aboutsummaryrefslogtreecommitdiffstats
path: root/lib/main.js
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-06-11 22:42:25 +0200
committerMatěj Cepl <mcepl@redhat.com>2010-06-11 22:42:25 +0200
commitd5f5588729a9d40d193651436560899336341c1a (patch)
treedb887a1f6be48305e1825bd4bc0b0438011f6d2e /lib/main.js
parent54426f47a1149e5b833653660db3b208c78e67f1 (diff)
downloadbugzilla-triage-d5f5588729a9d40d193651436560899336341c1a.tar.gz
Even more brutal
Diffstat (limited to 'lib/main.js')
-rw-r--r--lib/main.js43
1 files changed, 12 insertions, 31 deletions
diff --git a/lib/main.js b/lib/main.js
index 3364971..30c5b81 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -17,34 +17,21 @@ var logger = require("logger");
var file = require("file");
var myStorage = require("simple-storage").storage;
var browser = require("tab-browser");
-const JSONURL = "http://matej.ceplovi.cz/progs/data/RH_Data-packages.json";
-var myStorage = require("simple-storage");
+var JSONURL = "http://matej.ceplovi.cz/progs/data/RH_Data-packages.json";
var config = {};
-function initialize(callback) {
- util.loadJSON(JSONURL, function(parsedData) {
- config.gJSONData = parsedData;
+var matches = [
+ "https://bugzilla.redhat.com/show_bug.cgi.*",
+ "https://bugzilla.mozilla.org/show_bug.cgi.*"
+];
- var keys = "", key = "";
- for (key in config.gJSONData) {
- keys += key + " ";
- }
- console.log("loaded JSON object keys: " + keys);
-
- // Get card translation table
- if ("PCIIDsURL" in config.gJSONData.configData) {
- util.loadJSON(config.gJSONData.configData.PCIIDsURL, function(response) {
- config.PCI_ID_Array = response;
- });
- }
-
- config.logger = new logger.Logger(myStorage.logs,
- config.gJSONData.constantData.bugzillalabelAbbreviations);
-
- callback(config);
-}, this);
+function initialize(callback) {
+ util.loadJSON(JSONURL, function(parsedData) {
+ config = {};
+ callback(config);
+ }, this);
}
// TODO: sometime in the future we should include
@@ -70,14 +57,8 @@ exports.main = function main(options, callbacks) {
browser.whenContentLoaded(
function(window) {
var doc = window.document;
- if (isOurPage(window, config.gJSONData.configData.matches)) {
- console.log("dump config:\n" + config);
- var curPage = {};
- if (config.gJSONData.configData.objectStyle = "RH") {
- curPage = new require("rhbzpage").RHBugzillaPage(doc, config);
- } else if (config.gJSONData.configData.objectStyle = "MoFo") {
- curPage = new require("mozillabzpage").MozillaBugzilla(doc, config);
- }
+ if (isOurPage(window, matches)) {
+ var curPage = new require("rhbzpage").RHBugzillaPage(doc, config);
} else {
console.log("Not our page: " + window.location.href);
}