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

Commit c30cdfb

Browse files
committed
Making buttons compatible with 4.0.0 to 4.3.x #131
* The HTML structure of how buttons are presented in Bitbucket Server was changed in 4.4.0.
1 parent d6a4dfb commit c30cdfb

File tree

4 files changed

+36
-4
lines changed

4 files changed

+36
-4
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,27 @@
22

33
Changelog of Pull Request Notifier for Bitbucket.
44

5+
## Unreleased
6+
### GitHub [#131](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/issues/131) Buttons do not appear [4.3.1]
7+
Making buttons compatible with 4.0.0 to 4.3.x
8+
9+
* The HTML structure of how buttons are presented in Bitbucket Server was changed in 4.4.0.
10+
11+
[b792c431985d106](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/b792c431985d106) Tomas Bjerre *2016-07-09 06:48:42*
12+
13+
### No issue
14+
Adding script that exports resources and starts server
15+
16+
* So that web resources, like javascript, can be edited while server is running.
17+
18+
[d6a4dfbc24e8967](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/d6a4dfbc24e8967) Tomas Bjerre *2016-07-09 06:08:13*
19+
20+
## 2.30
21+
### GitHub [#128](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/issues/128) Trigger button not showing up.
22+
Removing falty code left from
23+
24+
[10becd4a18bd77b](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/10becd4a18bd77b) Tomas Bjerre *2016-07-07 15:36:26*
25+
526
## 2.29
627
### GitHub [#129](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/issues/129) Unable to use wildcard for 'Repository'
728
Avoiding crash when administring global admin page as admin

export_and_run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export MAVEN_OPTS=-Dplugin.resource.directories=`pwd`/src/main/resources
2-
atlas-run
2+
atlas-run || mvn bitbucket:run

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,4 +262,4 @@ Changelog of Pull Request Notifier for Bitbucket.
262262
<bitbucket.data.version>${bitbucket.version}</bitbucket.data.version>
263263
<amps.version>6.1.0</amps.version>
264264
</properties>
265-
</project>
265+
</project>

src/main/resources/pr-triggerbutton.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,24 @@ define('plugin/prnfb/pr-triggerbutton', [
99
var waiting = '<span class="aui-icon aui-icon-wait aui-icon-small">Wait</span>';
1010

1111
var $buttonArea = $(".triggerManualNotification").closest('ul');
12+
var buttonTemplate = function(name) {
13+
return $('<li><button class="aui-button aui-button-link" role="menuitem">' + name + '</button></li>');
14+
}
15+
if ($buttonArea.length === 0) {
16+
//Before 4.4.0
17+
$buttonArea = $(".triggerManualNotification").parent();
18+
buttonTemplate = function(name) {
19+
return $('<button class="aui-button">' + name + '</button>');
20+
}
21+
}
22+
1223
$(".triggerManualNotification").remove();
1324

1425
function loadSettingsAndShowButtons() {
1526
$.get(buttonsAdminUrl + '/repository/' + pageState.getRepository().id + '/pullrequest/' + pageState.getPullRequest().id, function(settings) {
1627
settings.forEach(function(item) {
17-
var $buttonDropdownItem = $('<li><button class="aui-button aui-button-link" role="menuitem">' + item.name + '</button></li>');
18-
$buttonDropdownItem.find("button").click(function() {
28+
var $buttonDropdownItem = buttonTemplate(item.name);
29+
$buttonDropdownItem.click(function() {
1930
var $this = $(this);
2031
$this.attr("disabled", "disabled");
2132
$this.attr("aria-disabled", "true");

0 commit comments

Comments
 (0)