summaryrefslogtreecommitdiff
path: root/common/modules/config.jsm
diff options
context:
space:
mode:
authorDoug Kearns <dougkearns@gmail.com>2015-07-23 01:55:32 +1000
committerDoug Kearns <dougkearns@gmail.com>2015-07-23 01:55:32 +1000
commit77d59cdfd1a1a317cd93cd6220aa01489a2866ab (patch)
treed24ba6a591669787e51be448d7e135c71379181e /common/modules/config.jsm
parentc035aa936b1865892a8f00fbd5f395eaba4fb63b (diff)
downloadpentadactyl-77d59cdfd1a1a317cd93cd6220aa01489a2866ab.tar.gz
Replace expression closures (methods).
Expression closures are to be axed. See https://bugzil.la/1083458.
Diffstat (limited to 'common/modules/config.jsm')
-rw-r--r--common/modules/config.jsm104
1 files changed, 56 insertions, 48 deletions
diff --git a/common/modules/config.jsm b/common/modules/config.jsm
index 223830c0..1f2551c0 100644
--- a/common/modules/config.jsm
+++ b/common/modules/config.jsm
@@ -40,7 +40,7 @@ AboutHandler.prototype = {
return channel;
},
- getURIFlags: function (uri) Ci.nsIAboutModule.ALLOW_SCRIPT
+ getURIFlags: function (uri) { return Ci.nsIAboutModule.ALLOW_SCRIPT; }
};
var ConfigBase = Class("ConfigBase", {
/**
@@ -74,14 +74,20 @@ var ConfigBase = Class("ConfigBase", {
services["dactyl:"].pages["dtd"] = () => [null, cache.get("config.dtd")];
update(services["dactyl:"].providers, {
- "locale": function (uri, path) LocaleChannel("dactyl-locale", config.locale, path, uri),
- "locale-local": function (uri, path) LocaleChannel("dactyl-local-locale", config.locale, path, uri)
+ "locale": function (uri, path) {
+ return LocaleChannel("dactyl-locale", config.locale, path, uri);
+ },
+ "locale-local": function (uri, path) {
+ return LocaleChannel("dactyl-local-locale", config.locale, path, uri);
+ }
});
},
get prefs() { return localPrefs; },
- has: function (feature) this.features.has(feature),
+ has: function (feature) {
+ return this.features.has(feature);
+ },
configFiles: [
"resource://dactyl-common/config.json",
@@ -478,59 +484,61 @@ var ConfigBase = Class("ConfigBase", {
this.helpStyled = true;
},
- Local: function Local(dactyl, modules, { document, window }) ({
- init: function init() {
- this.loadConfig(document.documentURI);
-
- let append = [
- ["menupopup", { id: "viewSidebarMenu", xmlns: "xul" }],
- ["broadcasterset", { id: "mainBroadcasterSet", xmlns: "xul" }]];
-
- for (let [id, [name, key, uri]] of iter(this.sidebars)) {
- append[0].push(
- ["menuitem", { observes: "pentadactyl-" + id + "Sidebar", label: name,
- accesskey: key }]);
- append[1].push(
- ["broadcaster", { id: "pentadactyl-" + id + "Sidebar", autoCheck: "false",
- type: "checkbox", group: "sidebar", sidebartitle: name,
- sidebarurl: uri,
- oncommand: "toggleSidebar(this.id || this.observes);" }]);
- }
+ Local: function Local(dactyl, modules, { document, window }) {
+ return {
+ init: function init() {
+ this.loadConfig(document.documentURI);
+
+ let append = [
+ ["menupopup", { id: "viewSidebarMenu", xmlns: "xul" }],
+ ["broadcasterset", { id: "mainBroadcasterSet", xmlns: "xul" }]];
+
+ for (let [id, [name, key, uri]] of iter(this.sidebars)) {
+ append[0].push(
+ ["menuitem", { observes: "pentadactyl-" + id + "Sidebar", label: name,
+ accesskey: key }]);
+ append[1].push(
+ ["broadcaster", { id: "pentadactyl-" + id + "Sidebar", autoCheck: "false",
+ type: "checkbox", group: "sidebar", sidebartitle: name,
+ sidebarurl: uri,
+ oncommand: "toggleSidebar(this.id || this.observes);" }]);
+ }
- util.overlayWindow(window, { append: append });
- },
+ util.overlayWindow(window, { append: append });
+ },
- get window() { return window; },
+ get window() { return window; },
- get document() { return document; },
+ get document() { return document; },
- ids: Class.Update({
- get commandContainer() { return document.documentElement.id; }
- }),
+ ids: Class.Update({
+ get commandContainer() { return document.documentElement.id; }
+ }),
- browser: Class.Memoize(() => window.gBrowser),
- tabbrowser: Class.Memoize(() => window.gBrowser),
+ browser: Class.Memoize(() => window.gBrowser),
+ tabbrowser: Class.Memoize(() => window.gBrowser),
- get browserModes() { return [modules.modes.NORMAL]; },
+ get browserModes() { return [modules.modes.NORMAL]; },
- /**
- * @property {string} The ID of the application's main XUL window.
- */
- mainWindowId: document.documentElement.id,
+ /**
+ * @property {string} The ID of the application's main XUL window.
+ */
+ mainWindowId: document.documentElement.id,
- /**
- * @property {number} The height (px) that is available to the output
- * window.
- */
- get outputHeight() {
- return this.browser.mPanelContainer.boxObject.height;
- },
+ /**
+ * @property {number} The height (px) that is available to the output
+ * window.
+ */
+ get outputHeight() {
+ return this.browser.mPanelContainer.boxObject.height;
+ },
- tabStrip: Class.Memoize(function () {
- return document.getElementById("TabsToolbar") ||
- this.tabbrowser.mTabContainer;
- })
- }),
+ tabStrip: Class.Memoize(function () {
+ return document.getElementById("TabsToolbar") ||
+ this.tabbrowser.mTabContainer;
+ })
+ };
+ },
/**
* @property {Object} A mapping of names and descriptions