// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
-// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
+// Copyright (c) 2008-2013 Kris Maglione <maglione.k@gmail.com>
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
}
},
-
observers: {
"dactyl-cleanup": function dactyl_cleanup(subject, reason) {
let modules = dactyl.modules;
});
},
- triggerObserver: function triggerObserver(type) {
- return this.applyTriggerObserver(type, Array.slice(arguments, 1));
+ triggerObserver: function triggerObserver(type, ...args) {
+ return this.applyTriggerObserver(type, args);
},
addUsageCommand: function (params) {
* Acts like the Function builtin, but the code executes in the
* userContext global.
*/
- userFunc: function userFunc() {
+ userFunc: function userFunc(...args) {
return this.userEval(
- "(function userFunction(" + Array.slice(arguments, 0, -1).join(", ") + ")" +
- " { " + arguments[arguments.length - 1] + " })");
+ "(function userFunction(" + args.slice(0, -1).join(", ") + ")" +
+ " { " + args.pop() + " })");
},
/**
if (win.frameElement)
win.frameElement.blur();
// Grr.
- if (content.document.activeElement instanceof HTMLIFrameElement)
+ if (content.document.activeElement instanceof Ci.nsIDOMHTMLIFrameElement)
content.document.activeElement.blur();
});
}
tag = function (map) [
let (c = obj.modes[0].char) c ? c + "_" : "",
map
- ]
+ ];
link = function (map) {
let [, mode, name, extra] = /^(?:(.)_)?(?:<([^>]+)>)?(.*)$/.exec(map);
let k = ["k", {}, extra];
let description = ["description", {},
obj.description ? ["p", {}, template.linkifyHelp(obj.description.replace(/\.?$/, "."), true)] : "",
extraHelp ? extraHelp : "",
- !(extraHelp || obj.description) ? ["p", {}, /*L*/ "Sorry, no help available."] : ""]
+ !(extraHelp || obj.description) ? ["p", {}, /*L*/ "Sorry, no help available."] : ""];
res.push(
["item", {},
* @param {function} func The function to call
* @param {object} self The 'this' object for the function.
*/
- trapErrors: function trapErrors(func, self) {
+ trapErrors: function trapErrors(func, self, ...args) {
try {
if (isString(func))
func = self[func];
- return func.apply(self || this, Array.slice(arguments, 2));
+ return func.apply(self || this, args);
}
catch (e) {
try {
dactyl.reportError(e, true);
}
});
- }
+ };
},
/**
groups.every(function (g) !g.validator || g.validator(val))
});
- options.add(["helpfile", "hf"],
- "Name of the main help file",
- "string", "intro");
-
options.add(["loadplugins", "lpl"],
"A regexp list that defines which plugins are loaded at startup and via :loadplugins",
"regexplist", "'\\.(js|" + config.fileExtension + ")$'");
commandline.commandOutput([
["div", {}, [config.appName, " ", config.version, date, " running on: "].join("")],
["div", {}, [window.navigator.userAgent].join("")]
- ])
+ ]);
}
}, {
argCount: "0",
}
});
-// vim: set fdm=marker sw=4 ts=4 et:
+// vim: set fdm=marker sw=4 sts=4 ts=8 et: