diff options
Diffstat (limited to 'common/content/dactyl.js')
-rw-r--r-- | common/content/dactyl.js | 56 |
1 files changed, 33 insertions, 23 deletions
diff --git a/common/content/dactyl.js b/common/content/dactyl.js index b4938ad9..0238e8fc 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -252,8 +252,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { commandline.commandOutput( template.usage(results, params.format)); - }, - { + }, { argCount: "*", completer: function (context, args) { context.keys.text = identity; @@ -1332,8 +1331,8 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { options.add(["fullscreen", "fs"], "Show the current window fullscreen", "boolean", false, { - setter: function (value) window.fullScreen = value, - getter: function () window.fullScreen + setter: function (value) { return window.fullScreen = value; }, + getter: function () { return window.fullScreen; } }); const groups = [ @@ -1382,8 +1381,10 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { prefs.safeSet("layout.scrollbar.side", opts.indexOf("l") >= 0 ? 3 : 2, _("option.guioptions.safeSet")); }, - validator: function (opts) Option.validIf(!(opts.indexOf("l") >= 0 && opts.indexOf("r") >= 0), - UTF8("Only one of ‘l’ or ‘r’ allowed")) + validator: function (opts) { + return Option.validIf(!(opts.indexOf("l") >= 0 && opts.indexOf("r") >= 0), + UTF8("Only one of ‘l’ or ‘r’ allowed")); + } }, { feature: "tabs", @@ -1421,8 +1422,10 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { events.checkFocus(); return value; }, - validator: function (val) Option.validateCompleter.call(this, val) - && groups.every(g => !g.validator || g.validator(val)) + validator: function (val) { + return Option.validateCompleter.call(this, val) && + groups.every(g => !g.validator || g.validator(val)); + } }); options.add(["loadplugins", "lpl"], @@ -1466,13 +1469,17 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { options.add(["urlseparator", "urlsep", "us"], "The regular expression used to separate multiple URLs in :open and friends", "string", " \\| ", - { validator: function (value) RegExp(value) }); + { validator: function (value) { return RegExp(value); } }); options.add(["verbose", "vbs"], "Define which info messages are displayed", "number", 1, - { validator: function (value) Option.validIf(value >= 0 && value <= 15, - "Value must be between 0 and 15") }); + { + validator: function (value) { + return Option.validIf(value >= 0 && value <= 15, + "Value must be between 0 and 15"); + } + }); options.add(["visualbell", "vb"], "Use visual bell instead of beeping on errors", @@ -1538,7 +1545,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { } }, { argCount: "1", - completer: function (context) completion.menuItem(context), + completer: function (context) { + completion.menuItem(context); + }, literal: 0 }); @@ -1553,7 +1562,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { dactyl.echoerr(e); } }, { - completer: function (context) completion.javascript(context), + completer: function (context) { + completion.javascript(context); + }, literal: 0 }); @@ -1561,18 +1572,17 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { "Load all or matching plugins", function (args) { dactyl.loadPlugins(args.length ? args : null, args.bang); - }, - { + }, { argCount: "*", bang: true, keepQuotes: true, serialGroup: 10, - serialize: function () [ - { + serialize: function () { + return [{ command: this.name, literalArg: options["loadplugins"].join(" ") - } - ] + }]; + } }); commands.add(["norm[al]"], @@ -1593,7 +1603,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { }); }, { argCount: "1", - completer: function (context) completion.ex(context), + completer: function (context) { completion.ex(context); }, literal: 0, privateData: "never-save", subCommand: 0 @@ -1799,9 +1809,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { bang: true, completer: function (context) { if (/^:/.test(context.filter)) - return completion.ex(context); + completion.ex(context); else - return completion.javascript(context); + completion.javascript(context); }, count: true, hereDoc: true, @@ -1827,7 +1837,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { } }, { argCount: "1", - completer: function (context) completion.ex(context), + completer: function (context) { completion.ex(context); }, count: true, literal: 0, subCommand: 0 |