-
Notifications
You must be signed in to change notification settings - Fork 0
/
jira.js
107 lines (88 loc) · 3.51 KB
/
jira.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// ==UserScript==
// @name Jira
// @namespace http://tampermonkey.net/
// @version 1.0.0
// @description Makes your JIRA world even better!
// @author Daniel Jílek, Jiří Černík
// @match https://jira.unicorn.eu/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
/* ----------------- Help and Feedback hider ----------------- */
var feedback = document.getElementById("jira-header-feedback-link");
feedback.style.display = 'none';
var help = document.getElementById("system-help-menu");
help.style.display = 'none';
/* ----------------- Larger edit dialog ----------------- */
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if (!mutation.addedNodes) return
var editComment = document.getElementById("edit-comment");
editComment.style.width = '80%';
editComment.style.left = '10%';
editComment.style.top = '10%';
editComment.style.margin = '0';
editComment.style.position = 'fixed';
editComment.style.zIndex = '3000';
editComment.style.border = '1px solid #FAFAFA';
editComment.style.borderRadius = '4px 4px 4px 4px';
editComment.style.overflow = 'hidden';
editComment.style.boxShadow = '0 16px 30px -14px rgba(9,30,66,0.25), 0 0 1px rgba(9,30,66,0.31)';
})
});
observer.observe(document.body, {
childList: true
, subtree: true
, attributes: true
, characterData: true
});
/* ----------------- Larger Search input ----------------- */
var searchInput = document.getElementById("quickSearchInput");
searchInput.style.width = '800px';
var observer2 = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if (!mutation.addedNodes) return
var dropdownMenu = document.getElementsByClassName("quicksearch-dropdown");
dropdownMenu[0].style.width = '800px';;
})
});
var quicksearchMenu = document.getElementById("quicksearch");
observer2.observe(quicksearchMenu, {
childList: true
, subtree: true
, attributes: true
, characterData: true
});
/* ----------------- Maintenance banner hider ----------------- */
var banner = document.getElementById("announcement-banner");
banner.style.display = 'none';
/* ----------------- Sidebar hider ----------------- */
var rightSide = document.getElementById("viewissuesidebar");
if(rightSide) rightSide.style.width = "20%";
setTimeout(function ()
{var sidebar = document.getElementsByClassName("aui-sidebar");
sidebar[0].remove();
}, 800);
/* ----------------- Drag disable on issue filter ----------------- */
let dragDisableTimeout = 500;
let cursorChange = function () {
//change cursor style
let rows = document.getElementsByClassName("issue-table-draggable");
for (let i = 0; i < rows.length; i++) {
rows[i].style.cursor = "default";
}
};
let dragDisable = function (timeout) {
setTimeout(function () {
// clean mousedown events from website
function handler(e) {
cursorChange();
e.stopPropagation();
}
document.addEventListener("mousedown", handler, true);
cursorChange();
}, timeout);
};
dragDisable(dragDisableTimeout);
})();