3
// @namespace http://murraytwins.com/greasemonkey/
4
// @description (Launchpad) Identify workflow reports
5
// @include https://*.launchpad.net/*
6
// @include https://*.edge.launchpad.net/*
7
// @include https://launchpad.net/*
9
// @creator Brian Murray <brian@ubuntu.com>
15
// List of special teams whose bugs shouldn't be meddled with
16
var special_subscribers = {
17
'ubuntu-archive':'<br>This is a workflow report',
18
'ubuntu-release':'<br>This is a workflow report',
19
'ubuntu-universe-sponsors':'<br>This is a workflow report',
20
'ubuntu-main-sponsors':'<br>This is a workflow report',
21
'motu-release':'<br>This is a workflow report',
22
'ubuntu-mir':'<br>This is a workflow report'
24
// ------- End of User settable data -------
26
function xpath(query, context) {
27
// GM_log('xpath running');
28
context = context ? context : document;
29
return document.evaluate(query, context, null,
30
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
33
window.addEventListener("load", function(e) {
37
var bug_heading = xpath("//div[contains(@style,'float: left;')]").snapshotItem(0);
39
var current_subscribers = xpath("//div[contains(@id,'portlet-subscribers')]//ul[contains(@class,'person')]/li/a")
40
for ( var i = 0; i < current_subscribers.snapshotLength; i++ ) {
41
var node = current_subscribers.snapshotItem(i);
43
var person = link.substr(link.lastIndexOf("~")+1);
45
GM_log( "subscribers " + person );
48
if ( person in special_subscribers ) {
50
GM_log( "Special subscriber is " + person );
53
var special_K = document.createElement("h1");
54
special_K.sytle = "clear: left;";
55
special_K.innerHTML = special_subscribers[person];
56
bug_heading.parentNode.insertBefore(special_K, bug_heading.nextSibling);