aboutsummaryrefslogtreecommitdiffstats
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
parent54426f47a1149e5b833653660db3b208c78e67f1 (diff)
downloadbugzilla-triage-d5f5588729a9d40d193651436560899336341c1a.tar.gz
Even more brutal
-rw-r--r--lib/main.js43
-rw-r--r--lib/mozillabzpage.js14
-rw-r--r--lib/puvodni/logger.js (renamed from lib/logger.js)0
3 files changed, 12 insertions, 45 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);
}
diff --git a/lib/mozillabzpage.js b/lib/mozillabzpage.js
deleted file mode 100644
index 7efaf16..0000000
--- a/lib/mozillabzpage.js
+++ /dev/null
@@ -1,14 +0,0 @@
-// Released under the MIT/X11 license
-// http://www.opensource.org/licenses/mit-license.php
-"use strict";
-var utilMod = require("util");
-
-// ============================================================================
-// MozillaBugzilla object
-
-exports.MozillaBugzilla = function MozillaBugzilla (doc, config) {
- BZPage.call(this, doc, config)
-};
-
-MozillaBugzilla.prototype = utilMod.heir(BZPage);
-MozillaBugzilla.prototype.constructor = MozillaBugzilla;
diff --git a/lib/logger.js b/lib/puvodni/logger.js
index cc3f213..cc3f213 100644
--- a/lib/logger.js
+++ b/lib/puvodni/logger.js