forked from moderntribe/tampermonkey-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qa-headers.user.js
50 lines (45 loc) · 1.2 KB
/
qa-headers.user.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
// ==UserScript==
// @name Central QA Headers
// @namespace https://central.tri.be/
// @version 1.0
// @description Applies color background to QA template headers for better visibility
// @author Nicole Ramsey
// @include /https?:\/\/central(dev)?.tri.be\/(projects\/)*[^\/]*\/?issues\/?/
// @grant none
// ==/UserScript==
(function( $ ) {
'use strict';
var $el;
var $heading;
var headings = [
{
'selector': 'a[name^="QA-PASSED-"]',
'icon': 'check',
'background': 'green',
'color': '#fff',
'stroke': '#0f690f'
},
{
'selector': 'a[name^="RETURNED-"]',
'icon': 'undo',
'background': '#f4af49',
'color': '#fff',
'stroke': '#db8e15'
},
];
for ( var i in headings ) {
$el = $( headings[ i ].selector );
// Find the closest h2
$heading = $el.next( 'h2' );
// Add the icon
$heading.prepend( '<i class="fa fa-' + headings[ i ].icon + '" aria-hidden="true"></i>' );
// Style the heading
$heading.css( {
'background-color': headings[ i ].background,
'color': headings[ i ].color,
'font-weight': 'bold',
'-webkit-text-fill-color': headings[ i ].color,
'-webkit-text-stroke': '1px ' + headings[ i ].stroke
} );
}
})( jQuery );