Skip to content

Instantly share code, notes, and snippets.

@pejobo
Created March 31, 2017 06:49
Show Gist options
  • Save pejobo/3b3d3fae1e4d66065090d47d95831fd6 to your computer and use it in GitHub Desktop.
Save pejobo/3b3d3fae1e4d66065090d47d95831fd6 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Jira Color Checkbox
// @namespace http://<domain>
// @version 0.1
// @description Ensures the color checkbox to be checked.
// @author DRe
// @match https://<sub-domain>/secure/RapidBoard.jspa?rapidView=175&*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var timeout = 10000;
var started = Date.now();
function clickColorCheckbox() {
var checkbox = document.getElementById("ghx-colorcontrol-range");
if (checkbox) {
if (!checkbox.checked) {
checkbox.click();
}
/*
var controls = document.getElementById("ghx-color-controls");
if (controls) {
controls.parentNode.removeChild(controls);
}
*/
} else if (Date.now() - started < timeout) {
setTimeout(clickColorCheckbox, 10);
}
}
clickColorCheckbox();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment