aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-07-16 19:01:46 +0200
committerMatěj Cepl <mcepl@redhat.com>2010-07-16 19:01:46 +0200
commitf77aee9c533e72cfbc141755894946f09a256c9e (patch)
treef93eb6fce81e485cdff249c61c8af543e1f987ac /lib
parent255e556c63171704c28c00dfeffc71d79bc9d78a (diff)
downloadbugzilla-triage-f77aee9c533e72cfbc141755894946f09a256c9e.tar.gz
Make "Query upstream" button working again.
Fix #22
Diffstat (limited to 'lib')
-rw-r--r--lib/bzpage.js9
-rw-r--r--lib/main.js4
-rw-r--r--lib/rhbzpage.js4
3 files changed, 7 insertions, 10 deletions
diff --git a/lib/bzpage.js b/lib/bzpage.js
index f8c46c8..a088259 100644
--- a/lib/bzpage.js
+++ b/lib/bzpage.js
@@ -5,6 +5,7 @@
var util = require("util");
var passUtils = require("passwords");
var apiUtils = require("api-utils");
+var selfMod = require("self");
var simpleStorage = require("simple-storage");
var preferences = require("preferences-service");
var prompts = require("prompts");
@@ -65,6 +66,8 @@ var BZPage = function BZPage(win, config) {
if ("constantData" in config.gJSONData) {
this.constantData = config.gJSONData.constantData;
+ this.constantData.queryUpstreamBug = JSON.parse(
+ selfMod.data.load("queryUpstreamBug.json"));
}
if ("CCmaintainer" in config.gJSONData.constantData) {
@@ -374,6 +377,7 @@ BZPage.prototype.createNewButton = function createNewButton (location, after, pk
// creation of button might be conditional on existence of data in constantData
if ("ifExist" in cmdObj) {
+ console.log("checking ifExist:\n" + this.constantData.toSource());
if (!(cmdObj.ifExist in this.constantData)) {
return ;
}
@@ -388,9 +392,6 @@ BZPage.prototype.createNewButton = function createNewButton (location, after, pk
}, false);
var originalLocation = this.doc.getElementById(location);
- if (!originalLocation) {
- console.log("location = " + location);
- }
if (after) {
originalLocation.parentNode.insertBefore(newButton,
@@ -538,7 +539,7 @@ BZPage.prototype.collectComments = function collectComments () {
*
*/
BZPage.prototype.selectOption = function selectOption (id, label, fireEvent) {
- if (fireEvent === null) {
+ if (!fireEvent) {
fireEvent = true;
}
var sel = this.doc.getElementById(id);
diff --git a/lib/main.js b/lib/main.js
index 20c5699..07ef3c6 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -85,15 +85,11 @@ function initialize(callback) {
for (key in config.gJSONData) {
keys += key + " ";
}
- console.log("loaded JSON object keys: " + keys);
// Get additional tables
if ("downloadJSON" in config.gJSONData.configData) {
var URLsList = config.gJSONData.configData.downloadJSON;
for (var dwnldObj in URLsList) {
- console.log("Downloading " +
- dwnldObj + " from URL " +
- URLsList[dwnldObj] + ".");
Request({
url: URLsList[dwnldObj],
onComplete: function() {
diff --git a/lib/rhbzpage.js b/lib/rhbzpage.js
index bc12cb9..44b3265 100644
--- a/lib/rhbzpage.js
+++ b/lib/rhbzpage.js
@@ -162,7 +162,7 @@ RHBugzillaPage.prototype.setDefaultAssignee = function() {
};
/**
- * Auxiliary function to computer more complicated resolution
+ * Auxiliary function to compute more complicated resolution
*/
RHBugzillaPage.prototype.closeSomeRelease = function() {
// for RAWHIDE close as RAWHIDE,
@@ -619,7 +619,7 @@ RHBugzillaPage.prototype.queryUpstream = function() {
var text = this.getSelectionOrClipboard();
if (text) {
text = encodeURIComponent(text.trim());
- var queryUpstreamBugsURLArray = self.data.load("queryUpstreamBug.json");
+ var queryUpstreamBugsURLArray = this.constantData.queryUpstreamBug;
var urlBase = util.filterByRegexp(queryUpstreamBugsURLArray, this.component);
tabs.open({
url: urlBase + text,