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
commite4ac20345d80f69eba5a3cd606cdf70d93af6c23 (patch)
treedd77bb0cba7eb9ca44f3a1352ab2a84a745283fb /lib/main.js
parent54426f47a1149e5b833653660db3b208c78e67f1 (diff)
downloadbugzilla-triage-e4ac20345d80f69eba5a3cd606cdf70d93af6c23.tar.gz
Even more brutal
Diffstat (limited to 'lib/main.js')
-rw-r--r--lib/main.js44
1 files changed, 12 insertions, 32 deletions
diff --git a/lib/main.js b/lib/main.js
index 3364971..ae7eece 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -13,38 +13,24 @@
//
"use strict";
var util = require("util");
-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 +56,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);
}