From bb031a3589755cfb923449de1ed319a181f8f08b Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Thu, 1 Jul 2010 20:17:01 +0200 Subject: enabledPackages defaults to all; fixes #14 --- lib/bzpage.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/bzpage.js b/lib/bzpage.js index eac54af..14dde0e 100644 --- a/lib/bzpage.js +++ b/lib/bzpage.js @@ -105,7 +105,15 @@ BZPage.prototype.getInstalledPackages = function getInstalledPackages(cfg) { if (preferences.isSet(prefName)) { enabledPackages = preferences.get(prefName,"").split(/[, ]/); } else { - preferences.set(prefName,""); + console.log("Setting default preference " + prefName + " to 'all'."); + preferences.set(prefName,"all"); + } + + if ((enabledPackages.length === 1) && (enabledPackages[0] === "all")) { + enabledPackages = []; + for (var key in cfg.gJSONData.commentPackages) { + enabledPackages.push(key); + } } enabledPackages.forEach(function (pkg, idx, arr) { -- cgit