From ff3ee8ca4f8ea9f30655c714d2fe91b3c43cd0a8 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Sun, 8 Aug 2010 23:18:28 -0400 Subject: Make scripts compatible with bugzilla.gnome.org Fixes #38 - Eliminate automatic "all" packages for bugzillas undefined in enabledPackages object, - Config_data.json: do have enabledPackages with RH BZ "all" comments - Fix spread of buttons in Gnome BZ --- lib/bzpage.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/bzpage.js') diff --git a/lib/bzpage.js b/lib/bzpage.js index 8b96c9c..878ce87 100644 --- a/lib/bzpage.js +++ b/lib/bzpage.js @@ -157,8 +157,9 @@ BZPage.prototype.getInstalledPackages = function getInstalledPackages(cfg) { if ("any" in epObject) { enabledPackages = enabledPackages.concat(epObject.any.split(/[, ]/)); } - } else { - // Default to collecting all comment packages available + } + + if ((enabledPackages.length === 1) && (enabledPackages[0] === "all")) { enabledPackages = []; for (var key in cfg.gJSONData.commentPackages) { enabledPackages.push(key); @@ -694,7 +695,7 @@ BZPage.prototype.getOptionTableCell = function getOptionTableCell(tableId, label var rows = this.doc.getElementById(tableId).getElementsByTagName("tr"); var ourLine = Array.filter(rows, function(row) { var curLabel = row.getElementsByTagName("td")[0].textContent.toLowerCase(); - curLabel = curLabel.replace(cleanLabelRE,"$1"); + curLabel = curLabel.replace(cleanLabelRE,"$1"); return (curLabel === label); }); if (ourLine.length > 0) { -- cgit