-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui-improvement.js
44 lines (32 loc) · 1.4 KB
/
ui-improvement.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// ==UserScript==
// @name Bamboo UI Improvement
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Atlassian Bamboo UI improvement
// @author Alessandro Cingolani (@gr3yc4t)
// @match http*://*/browse/*
// @grant none
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js
// ==/UserScript==
(function() {
'use strict';
$(document).ready(function(){
//Check if the page is Bamboo due to the too permissive @match
var app_name = $('meta[name=application-name]').attr('content');
if(app_name != "Bamboo"){
return;
}else{
var $buttonVariables = $('<a class=""><span class="aui-icon aui-icon-small aui-iconfont-settings"></span></a>');
console.log("DOCUMENT READY");
$(this).find(".project").each( function (index) {
var plan_nickname = $(this).find(".build").find("a").attr('id').replace("viewBuild:", "");
console.log(plan_nickname);
$buttonVariables.attr("href", window.location.origin + "/chain/admin/config/configureChainVariables.action?buildKey=" + plan_nickname);
$(this).find(".dashboard-operations").each(function (index) {
console.log("FOUND");
$(this).append($buttonVariables);
});
});
}
});
})();