diff options
-rw-r--r-- | bugzillaBugTriage.js | 63 |
1 files changed, 41 insertions, 22 deletions
diff --git a/bugzillaBugTriage.js b/bugzillaBugTriage.js index 61427c1..27d07ba 100644 --- a/bugzillaBugTriage.js +++ b/bugzillaBugTriage.js @@ -12,12 +12,15 @@ jetpack.future.import("clipboard"); // http://en.wikipedia.org/wiki/HSL_color_space // when only the value of S is changed // stupido!!! the string is value in hex for each color -var RHColor = new Color(158, 41, 43); // RGB 158, 41, 43; HSL 359, 1, 39 -var FedoraColor = new Color(0, 40, 103); // RGB 0, 40, 103; HSL 359, 1, 39 -var RawhideColor = new Color(0, 119, 0); // or "green", or RGB 0, 119, 0, or HSL 120, 0, 23 -var RHITColor = new Color(102, 0, 102); // RGB 102, 0, 102; HSL 300, 0, 20 -var SalmonPink = new Color(255, 224, 176); // RGB 255, 224, 176; HSL 36, 2, 85 -var ReporterColor = new Color(255, 255, 166); // RGB 255, 255, 166; HSL 60, 2, 83 +const RHColor = new Color(158, 41, 43); // RGB 158, 41, 43; HSL 359, 1, 39 +const FedoraColor = new Color(0, 40, 103); // RGB 0, 40, 103; HSL 359, 1, 39 +const RawhideColor = new Color(0, 119, 0); // or "green", or RGB 0, 119, 0, or HSL 120, 0, 23 +const RHITColor = new Color(102, 0, 102); // RGB 102, 0, 102; HSL 300, 0, 20 +const SalmonPink = new Color(255, 224, 176); // RGB 255, 224, 176; HSL 36, 2, 85 +const ReporterColor = new Color(255, 255, 166); // RGB 255, 255, 166; HSL 60, 2, 83 +const EmptyLogsColor = new Color(0, 255, 0); +const FullLogsColor = FedoraColor; + var Luminosity = 0.85; var Desaturated = 0.4; var TriagedDistro = 13; @@ -774,7 +777,11 @@ BzPage.prototype.isRHEL = function() { return (/Red Hat Enterprise Linux/).test(this.product); }; - +/** + * Find out whether the bug is needed an attention of bugZappers + * + * @return Boolean whether the bug has been triaged or not + */ BzPage.prototype.isTriaged = function() { // First excceptions if (this.version > 7 && this.version < 13) { @@ -1679,6 +1686,9 @@ BzPage.prototype.addLogRecord = function () { if (comment.length > 0) { rec.comment = comment; var recKey = getISODate(rec.date)+"+"+rec.bugId; + var clearLogAElem = this.dok.getElementById("clearLogs"); + clearLogAElem.style.color = FullLogsColor; + clearLogAElem.style.fontWeight = "bolder"; if (myStorage.logs[recKey]) { myStorage.logs[recKey].comment += "<br/>\n"+comment; } else { @@ -1717,21 +1727,6 @@ BzPage.prototype.timeSheetRecordsPrinter = function (body,records) { BzPage.prototype.generateTimeSheet = function (body) { var doc = body.ownerDocument; - var newButton = doc.createElement("input"); - var newP = doc.createElement("p"); - body.appendChild(newP); - newP.appendChild(newButton); - newButton.setAttribute("type","button"); - newButton.value = "Clear the store"; - newButton.setAttribute("id","clearThePage"); - newButton.addEventListener("click",function (evt) { - myStorage.logs = {}; - jetpack.storage.simple.sync(); - console.log("mystorage.logs wiped out!"); - body.innerHTML = ""; - }, false); - - var currentDay = ""; this.timeSheetRecordsPrinter(body,myStorage.logs); }; @@ -1919,10 +1914,34 @@ function BzPage(doc) { evt.stopPropagation(); evt.preventDefault(); }, false); + + var clearLogsUI = this.dok.createElement("li"); + clearLogsUI.innerHTML = + "\u00A0-\u00A0<a href='#' id='clearLogs'>" + + "Clear logs</a>"; + additionalButtons.appendChild(clearLogsUI); + var clearLogAElem = this.dok.getElementById("clearLogs"); + clearLogAElem.addEventListener("click", + function () { + myStorage.logs = {}; + jetpack.storage.simple.sync(); + this.style.color = EmptyLogsColor; + clearLogAElem.style.fontWeight = "normal"; + console.log("mystorage.logs wiped out!"); + }, false); if (!myStorage.logs) { + console.log("No myStorage.logs defined!"); myStorage.logs = {}; } + + if (myStorage.logs) { + clearLogAElem.style.color = FullLogsColor; + clearLogAElem.style.fontWeight = "bolder"; + } else { + clearLogAElem.style.color = EmptyLogsColor; + clearLogAElem.style.fontWeight = "normal"; + } } } |