aboutsummaryrefslogtreecommitdiffstats
path: root/data/lib/bzpage.js
diff options
context:
space:
mode:
Diffstat (limited to 'data/lib/bzpage.js')
-rw-r--r--data/lib/bzpage.js88
1 files changed, 45 insertions, 43 deletions
diff --git a/data/lib/bzpage.js b/data/lib/bzpage.js
index 4bba873..8d7606f 100644
--- a/data/lib/bzpage.js
+++ b/data/lib/bzpage.js
@@ -22,7 +22,7 @@ var equivalentComponents = null;
* central handler processing messages from the main script.
*/
self.on('message', function onMessage(msg) {
- console.myDebug("onMessage - incoming : msg.cmd = " + msg.cmd);
+ myDebug("onMessage - incoming : msg.cmd = " + msg.cmd);
switch (msg.cmd) {
case "ReloadThePage":
document.location.reload(true);
@@ -84,7 +84,7 @@ function executeCommand(cmdObj) {
* Object with the appropriate parameters for the command
*/
function centralCommandDispatch (cmdLabel, cmdParams) {
- console.myDebug("centralCommandDispatch : cmdLabel = " + cmdLabel);
+ myDebug("centralCommandDispatch : cmdLabel = " + cmdLabel);
switch (cmdLabel) {
case "name":
case "position":
@@ -362,53 +362,55 @@ function startup() {
var logoutLink = Array.some(document.links, function (x) {
return x.search === "?logout=1" ;
});
- if (document.getElementById("brElementPlace_location")) {
- console.error("Hit multiple firing protection!")
- return null; // This should just finish whole content script without
- // doing any harm to anybody.
- }
- else {
- console.myDebug("Didn't hit multiple firing protection!");
- }
+ if (logoutLink) {
+ if (document.getElementById("brElementPlace_location")) {
+ console.error("Hit multiple firing protection!")
+ return null; // This should just finish whole content script without
+ // doing any harm to anybody.
+ }
+ else {
+ myDebug("Didn't hit multiple firing protection!");
+ }
- // Prepare for query buttons
- // element ID brElementPlace_location is later used in JSON files
- // Stay with this add_comment element even if RH BZ upgrades, this seems
- // to be generally much more stable (even with other bugzillas, e.g.
- // b.gnome.org)
- // then some getElementById.
- var commentArea = document.getElementsByClassName("bz_section_additional_comments")[0];
- if (commentArea) {
- var brElementPlacer = commentArea.getElementsByTagName("br");
- brElementPlacer = brElementPlacer[0];
- if (brElementPlacer) {
- brElementPlacer.setAttribute("id","brElementPlacer_location");
- brElementPlacer.parentNode.insertBefore(document.createElement("br"),
- brElementPlacer);
+ // Prepare for query buttons
+ // element ID brElementPlace_location is later used in JSON files
+ // Stay with this add_comment element even if RH BZ upgrades, this seems
+ // to be generally much more stable (even with other bugzillas, e.g.
+ // b.gnome.org)
+ // then some getElementById.
+ var commentArea = document.getElementsByClassName("bz_section_additional_comments")[0];
+ if (commentArea) {
+ var brElementPlacer = commentArea.getElementsByTagName("br");
+ brElementPlacer = brElementPlacer[0];
+ if (brElementPlacer) {
+ brElementPlacer.setAttribute("id","brElementPlacer_location");
+ brElementPlacer.parentNode.insertBefore(document.createElement("br"),
+ brElementPlacer);
+ }
}
- }
- // Prepare for adding external bugs
- var a0Elements = document.getElementsByName("a0");
- if (a0Elements.length > 0) {
- var extBugsHeadline = a0Elements[a0Elements.length - 1];
- extBugsHeadline.setAttribute("id", "external_bugs_headline");
- }
+ // Prepare for adding external bugs
+ var a0Elements = document.getElementsByName("a0");
+ if (a0Elements.length > 0) {
+ var extBugsHeadline = a0Elements[a0Elements.length - 1];
+ extBugsHeadline.setAttribute("id", "external_bugs_headline");
+ }
- // TODO Probably could be ignored ... used only once on line 973 of
- // rhbzpage.js
- // if (parseAbrtBacktraces && this.RE.Abrt.test(getSummary())) {
- // title = document.getElementById("short_desc_nonedit_display").textContent;
+ // TODO Probably could be ignored ... used only once on line 973 of
+ // rhbzpage.js
+ // if (parseAbrtBacktraces && this.RE.Abrt.test(getSummary())) {
+ // title = document.getElementById("short_desc_nonedit_display").textContent;
- // So, now we know we are logged in, so we can get to
- // the real work.
- setConfigurationButton();
- submitHandlerInstalled = false;
+ // So, now we know we are logged in, so we can get to
+ // the real work.
+ setConfigurationButton();
+ submitHandlerInstalled = false;
- self.postMessage(new Message("GetInstalledPackages", {
- location: window.location.href,
- login: getLogin()
- }));
+ self.postMessage(new Message("GetInstalledPackages", {
+ location: window.location.href,
+ login: getLogin()
+ }));
+ }
}
startup();