Skip to content
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.

Commit

Permalink
Making buttons compatible with 4.0.0 to 4.3.x #131
Browse files Browse the repository at this point in the history
 * The HTML structure of how buttons are presented in Bitbucket Server was changed in 4.4.0.
  • Loading branch information
tomasbjerre committed Jul 9, 2016
1 parent d6a4dfb commit c30cdfb
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

Changelog of Pull Request Notifier for Bitbucket.

## Unreleased
### GitHub [#131](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/issues/131) Buttons do not appear [4.3.1]
Making buttons compatible with 4.0.0 to 4.3.x

* The HTML structure of how buttons are presented in Bitbucket Server was changed in 4.4.0.

[b792c431985d106](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/b792c431985d106) Tomas Bjerre *2016-07-09 06:48:42*

### No issue
Adding script that exports resources and starts server

* So that web resources, like javascript, can be edited while server is running.

[d6a4dfbc24e8967](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/d6a4dfbc24e8967) Tomas Bjerre *2016-07-09 06:08:13*

## 2.30
### GitHub [#128](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/issues/128) Trigger button not showing up.
Removing falty code left from

[10becd4a18bd77b](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/10becd4a18bd77b) Tomas Bjerre *2016-07-07 15:36:26*

## 2.29
### GitHub [#129](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/issues/129) Unable to use wildcard for 'Repository'
Avoiding crash when administring global admin page as admin
Expand Down
2 changes: 1 addition & 1 deletion export_and_run.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export MAVEN_OPTS=-Dplugin.resource.directories=`pwd`/src/main/resources
atlas-run
atlas-run || mvn bitbucket:run
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -262,4 +262,4 @@ Changelog of Pull Request Notifier for Bitbucket.
<bitbucket.data.version>${bitbucket.version}</bitbucket.data.version>
<amps.version>6.1.0</amps.version>
</properties>
</project>
</project>
15 changes: 13 additions & 2 deletions src/main/resources/pr-triggerbutton.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,24 @@ define('plugin/prnfb/pr-triggerbutton', [
var waiting = '<span class="aui-icon aui-icon-wait aui-icon-small">Wait</span>';

var $buttonArea = $(".triggerManualNotification").closest('ul');
var buttonTemplate = function(name) {
return $('<li><button class="aui-button aui-button-link" role="menuitem">' + name + '</button></li>');
}
if ($buttonArea.length === 0) {
//Before 4.4.0
$buttonArea = $(".triggerManualNotification").parent();
buttonTemplate = function(name) {
return $('<button class="aui-button">' + name + '</button>');
}
}

$(".triggerManualNotification").remove();

function loadSettingsAndShowButtons() {
$.get(buttonsAdminUrl + '/repository/' + pageState.getRepository().id + '/pullrequest/' + pageState.getPullRequest().id, function(settings) {
settings.forEach(function(item) {
var $buttonDropdownItem = $('<li><button class="aui-button aui-button-link" role="menuitem">' + item.name + '</button></li>');
$buttonDropdownItem.find("button").click(function() {
var $buttonDropdownItem = buttonTemplate(item.name);
$buttonDropdownItem.click(function() {
var $this = $(this);
$this.attr("disabled", "disabled");
$this.attr("aria-disabled", "true");
Expand Down

0 comments on commit c30cdfb

Please sign in to comment.