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
commite4ac20345d80f69eba5a3cd606cdf70d93af6c23 (patch)
treedd77bb0cba7eb9ca44f3a1352ab2a84a745283fb
parent54426f47a1149e5b833653660db3b208c78e67f1 (diff)
downloadbugzilla-triage-e4ac20345d80f69eba5a3cd606cdf70d93af6c23.tar.gz
Even more brutal
-rw-r--r--lib/main.js44
-rw-r--r--lib/mozillabzpage.js14
-rw-r--r--lib/puvodni/logger.js (renamed from lib/logger.js)0
3 files changed, 12 insertions, 46 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);
}
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