diff options
author | Matěj Cepl <mcepl@redhat.com> | 2011-03-23 20:18:23 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2011-03-23 20:18:23 +0100 |
commit | 2e5993bc9bd0d468f4e9d12dd39e0548ba9adda1 (patch) | |
tree | f31a0d612efbfa5beb78e4718768c55c650f14d8 /data/lib/logging-front.js | |
parent | c662ccddab2cbcc6d13f49a21c04a6aea808f457 (diff) | |
download | bugzilla-triage-2e5993bc9bd0d468f4e9d12dd39e0548ba9adda1.tar.gz |
Fix indentation and else for Mozilla coding guidelines.
Diffstat (limited to 'data/lib/logging-front.js')
-rw-r--r-- | data/lib/logging-front.js | 123 |
1 files changed, 62 insertions, 61 deletions
diff --git a/data/lib/logging-front.js b/data/lib/logging-front.js index f6b3546..d186d7f 100644 --- a/data/lib/logging-front.js +++ b/data/lib/logging-front.js @@ -8,80 +8,81 @@ var FullLogsColor = new Color(0, 40, 103); var submitHandlerInstalled = false; // for setUpLogging function addLogRecord() { - var rec = {}; - rec.date = new Date(); - rec.url = document.location.toString(); - rec.title = document.title; - var comment = window.prompt( - "Enter comments for this comment"); - if (comment !== null) { - comment = comment.trim(); - if (comment.length > 0) { - comment = comment.trim(); - rec.comment = comment; - var dateStr = getISODate(rec.date); - var urlStr = window.location.hostname; - var bugNo = getBugNoFromURL(window.location.href); - rec.key = dateStr + "+" + - urlStr + "+" + bugNo; - postMessage(new Message("AddLogRecord", rec)); - } - return rec; + var rec = {}; + rec.date = new Date(); + rec.url = document.location.toString(); + rec.title = document.title; + var comment = window.prompt( + "Enter comments for this comment"); + if (comment !== null) { + comment = comment.trim(); + if (comment.length > 0) { + comment = comment.trim(); + rec.comment = comment; + var dateStr = getISODate(rec.date); + var urlStr = window.location.hostname; + var bugNo = getBugNoFromURL(window.location.href); + rec.key = dateStr + "+" + + urlStr + "+" + bugNo; + postMessage(new Message("AddLogRecord", rec)); } - return null; + return rec; + } + return null; } /** */ function setUpLogging () { - // Protection against double-call - if (document.getElementById("generateTSButton")) { - return ; - } + // Protection against double-call + if (document.getElementById("generateTSButton")) { + return ; + } - // For adding additional buttons to the top toolbar - var additionalButtons = document.querySelector("#bugzilla-body *.related_actions"); - var that = this; + // For adding additional buttons to the top toolbar + var additionalButtons = document.querySelector("#bugzilla-body *.related_actions"); + var that = this; - // logging all submits for timesheet - if (!submitHandlerInstalled) { - document.forms.namedItem("changeform").addEventListener("submit",function (evt) { - if (addLogRecord() === null) { - evt.stopPropagation(); - evt.preventDefault(); - } - }, false); - submitHandlerInstalled = true; - } + // logging all submits for timesheet + if (!submitHandlerInstalled) { + document.forms.namedItem("changeform").addEventListener("submit",function (evt) { + if (addLogRecord() === null) { + evt.stopPropagation(); + evt.preventDefault(); + } + }, false); + submitHandlerInstalled = true; + } - // (id, text, parent, callback, params, before, covered, accesskey) - createDeadLink("generateTSButton", "Generate TS", additionalButtons, - function(evt) { - postMessage(new Message("GenerateTS")); - }, [], "dash", "li"); + // (id, text, parent, callback, params, before, covered, accesskey) + createDeadLink("generateTSButton", "Generate TS", additionalButtons, + function(evt) { + postMessage(new Message("GenerateTS")); + }, [], "dash", "li"); - createDeadLink("clearLogs", "Clear TS", additionalButtons, - function(evt) { - postMessage(new Message("ClearTS")); - }, [], "dash", "li"); + createDeadLink("clearLogs", "Clear TS", additionalButtons, + function(evt) { + postMessage(new Message("ClearTS")); + }, [], "dash", "li"); - createDeadLink("importTSButton", "Import TS", additionalButtons, - function(evt) { - postMessage(new Message("ImportTS")); - }, [], "dash", "li"); + createDeadLink("importTSButton", "Import TS", additionalButtons, + function(evt) { + postMessage(new Message("ImportTS")); + }, [], "dash", "li"); - /* TODO - var clearLogAElem = document.getElementById("clearLogs"); - if (this.log.isEmpty()) { - clearLogAElem.style.color = this.log.EmptyLogsColor; - clearLogAElem.style.fontWeight = "normal"; - } else { - clearLogAElem.style.color = this.log.FullLogsColor; - clearLogAElem.style.fontWeight = "bolder"; - } - */ + /* TODO + var clearLogAElem = document.getElementById("clearLogs"); + if (this.log.isEmpty()) { + clearLogAElem.style.color = this.log.EmptyLogsColor; + clearLogAElem.style.fontWeight = "normal"; + } + else { + clearLogAElem.style.color = this.log.FullLogsColor; + clearLogAElem.style.fontWeight = "bolder"; + } + */ } if (window.location.hostname == "bugzilla.redhat.com") { - setUpLogging(); + setUpLogging(); } |