aboutsummaryrefslogtreecommitdiffstats
path: root/lib/main.js
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-06-24 12:57:09 +0200
committerMatěj Cepl <mcepl@redhat.com>2010-06-24 12:57:09 +0200
commit47b3d9ba7039221becf2c5abc47d3f1f8ad26952 (patch)
tree089f51f01e1e590668156580ed46fb692fc14696 /lib/main.js
parent14c737fe6fab5198fa6998685ba81c0754b2355c (diff)
downloadbugzilla-triage-47b3d9ba7039221becf2c5abc47d3f1f8ad26952.tar.gz
Make URL for JSON file configurable (fixes #9)0.4
Diffstat (limited to 'lib/main.js')
-rw-r--r--lib/main.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/main.js b/lib/main.js
index 7cd9a9c..f40dcd1 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -16,7 +16,10 @@ var logger = require("logger");
var myStorage = require("simple-storage").storage;
var browser = require("tab-browser");
var urlMod = require("url");
-var JSONURL = "http://matej.ceplovi.cz/progs/data/RH_Data-packages.json";
+var preferences = require("preferences-service");
+var BSTPrefNS = require("bzpage").BSTPrefNS;
+// Use my JSON for now before it is fixed for general public
+var JSONURLDefault = "http://matej.ceplovi.cz/progs/data/RH_Data-packages.json";
var TriagedDistro = 13;
var NumberOfFrames = 7;
@@ -91,7 +94,17 @@ function skipThisPage(doc) {
}
function initialize(callback) {
- util.loadJSON(JSONURL, function(parsedData) {
+ var prefName = BSTPrefNS+"JSONURL";
+ var url = "";
+
+ if (preferences.isSet(prefName)) {
+ url = preferences.get(prefName);
+ } else {
+ url = JSONURLDefault;
+ preferences.set(prefName, JSONURLDefault);
+ }
+
+ util.loadJSON(url, function(parsedData) {
config.gJSONData = parsedData;
var keys = "", key = "";