Created
February 6, 2013 09:03
-
-
Save netsi1964/4721303 to your computer and use it in GitHub Desktop.
Greasemonkey: FogBugz util
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name FogBugz utils by Sten Hougaard (netsi1964@gmail.com) | |
// @namespace http://www.netsi.dk | |
// @author Sten Hougaard (netsi1964@gmail.com) | |
// @description Extends the fogbugz interface | |
// @include https://*.fogbugz.com* | |
// ==/UserScript== | |
<!--FogBugz.user.js --> | |
// a function that loads jQuery and calls a callback function when jQuery has finished loading | |
function addJQuery(callback) { | |
var script = document.createElement("script"); | |
script.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"); | |
script.addEventListener('load', function() { | |
var script = document.createElement("script"); | |
script.textContent = "jQuery.noConflict(true);(" + callback.toString() + ")();"; | |
document.body.appendChild(script); | |
}, false); | |
document.body.appendChild(script); | |
} | |
// the guts of this userscript | |
function main() { | |
jQuery('td:contains("Closed"), td:contains("New")').css('background', 'rgba(255,0,0,.7)'); | |
jQuery('td:contains("Active"), td:contains("In progress")').css('background', 'rgba(0,255,0,.7)'); | |
jQuery('td:contains("Fixing")').css('background', 'rgba(255,255,0,.7)'); | |
} | |
// load jQuery and execute the main function | |
addJQuery(main); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment