mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-06 18:54:12 +01:00
Add missing semicolons.
This commit is contained in:
@@ -63,7 +63,7 @@ var AutoCmdHive = Class("AutoCmdHive", Contexts.Hive, {
|
|||||||
remove: function (event, filter) {
|
remove: function (event, filter) {
|
||||||
filter = filter && String(Group.compileFilter(filter));
|
filter = filter && String(Group.compileFilter(filter));
|
||||||
this._store = this._store.filter(cmd => !cmd.match(event, filter));
|
this._store = this._store.filter(cmd => !cmd.match(event, filter));
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -646,7 +646,7 @@ var Bookmarks = Module("bookmarks", {
|
|||||||
options.add(["suggestengines"],
|
options.add(["suggestengines"],
|
||||||
"Search engines used for search suggestions",
|
"Search engines used for search suggestions",
|
||||||
"stringlist", "google",
|
"stringlist", "google",
|
||||||
{ completer: function completer(context) completion.searchEngine(context, true), });
|
{ completer: function completer(context) completion.searchEngine(context, true) });
|
||||||
},
|
},
|
||||||
|
|
||||||
completion: function initCompletion() {
|
completion: function initCompletion() {
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ var Browser = Module("browser", XPCOM(Ci.nsISupportsWeakReference, ModuleBase),
|
|||||||
|
|
||||||
onLocationChange: util.wrapCallback(function onLocationChange(browser) {
|
onLocationChange: util.wrapCallback(function onLocationChange(browser) {
|
||||||
Buffer(browser.contentWindow).locationChanged();
|
Buffer(browser.contentWindow).locationChanged();
|
||||||
}),
|
})
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
}, {
|
}, {
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ var CommandWidgets = Class("CommandWidgets", {
|
|||||||
["hbox", { id: s + "commandline", hidden: "false", class: "dactyl-container", highlight: "Normal StatusNormal", collapsed: "true" },
|
["hbox", { id: s + "commandline", hidden: "false", class: "dactyl-container", highlight: "Normal StatusNormal", collapsed: "true" },
|
||||||
["label", { id: s + "commandline-prompt", class: "dactyl-commandline-prompt plain", flex: "0", crop: "end", value: "", collapsed: "true" }],
|
["label", { id: s + "commandline-prompt", class: "dactyl-commandline-prompt plain", flex: "0", crop: "end", value: "", collapsed: "true" }],
|
||||||
["textbox", { id: s + "commandline-command", class: "dactyl-commandline-command plain", flex: "1", type: "text", timeout: "100",
|
["textbox", { id: s + "commandline-command", class: "dactyl-commandline-command plain", flex: "1", type: "text", timeout: "100",
|
||||||
highlight: "Events", }]]]],
|
highlight: "Events" }]]]],
|
||||||
|
|
||||||
before: [
|
before: [
|
||||||
["toolbar", { id: statusline.statusBar.id, xmlns: "xul" },
|
["toolbar", { id: statusline.statusBar.id, xmlns: "xul" },
|
||||||
@@ -446,7 +446,7 @@ var CommandMode = Class("CommandMode", {
|
|||||||
this.completions.clear();
|
this.completions.clear();
|
||||||
if (this.history)
|
if (this.history)
|
||||||
this.history.reset();
|
this.history.reset();
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var CommandExMode = Class("CommandExMode", CommandMode, {
|
var CommandExMode = Class("CommandExMode", CommandMode, {
|
||||||
@@ -783,7 +783,7 @@ var CommandLine = Module("commandline", {
|
|||||||
message.message;
|
message.message;
|
||||||
this._messageHistory.add(update({ highlight: highlightGroup }, message));
|
this._messageHistory.add(update({ highlight: highlightGroup }, message));
|
||||||
return message.message;
|
return message.message;
|
||||||
}
|
};
|
||||||
|
|
||||||
if (flags & this.APPEND_TO_MESSAGES)
|
if (flags & this.APPEND_TO_MESSAGES)
|
||||||
data = appendToMessages(data);
|
data = appendToMessages(data);
|
||||||
|
|||||||
@@ -1647,7 +1647,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
if (args["+purgecaches"])
|
if (args["+purgecaches"])
|
||||||
cache.flush();
|
cache.flush();
|
||||||
|
|
||||||
util.delay(() => { util.rehash(args) });
|
util.delay(() => { util.rehash(args); });
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
argCount: "0", // FIXME
|
argCount: "0", // FIXME
|
||||||
|
|||||||
@@ -804,7 +804,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
|
|||||||
this.editor.endTransaction();
|
this.editor.endTransaction();
|
||||||
this.editor = null;
|
this.editor = null;
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
Map.types["operator"] = {
|
Map.types["operator"] = {
|
||||||
preExecute: function preExecute(args) {
|
preExecute: function preExecute(args) {
|
||||||
|
|||||||
@@ -741,7 +741,7 @@ var HintSession = Class("HintSession", CommandMode, {
|
|||||||
updateStatusline: function _updateStatusline() {
|
updateStatusline: function _updateStatusline() {
|
||||||
statusline.inputBuffer = (this.escapeNumbers ? "\\" : "") +
|
statusline.inputBuffer = (this.escapeNumbers ? "\\" : "") +
|
||||||
(this.hintNumber ? this.getHintString(this.hintNumber) : "");
|
(this.hintNumber ? this.getHintString(this.hintNumber) : "");
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var Hints = Module("hints", {
|
var Hints = Module("hints", {
|
||||||
|
|||||||
@@ -286,7 +286,7 @@ var Marks = Module("marks", {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
}, {
|
}, {
|
||||||
markToString: function markToString(name, mark) {
|
markToString: function markToString(name, mark) {
|
||||||
let tab = mark.tab && mark.tab.get();
|
let tab = mark.tab && mark.tab.get();
|
||||||
|
|||||||
@@ -350,7 +350,7 @@ var Modes = Module("modes", {
|
|||||||
if (stack && stack.pop)
|
if (stack && stack.pop)
|
||||||
for (let { obj, prop, value, test } of values(this.topOfStack.saved))
|
for (let { obj, prop, value, test } of values(this.topOfStack.saved))
|
||||||
if (!test || !test(stack, prev))
|
if (!test || !test(stack, prev))
|
||||||
dactyl.trapErrors(function () { obj[prop] = value });
|
dactyl.trapErrors(function () { obj[prop] = value; });
|
||||||
|
|
||||||
this.show();
|
this.show();
|
||||||
|
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ var QuickMarks = Module("quickmarks", {
|
|||||||
quickmarks.list(args[0] || "");
|
quickmarks.list(args[0] || "");
|
||||||
}, {
|
}, {
|
||||||
argCount: "?",
|
argCount: "?",
|
||||||
completer: function (context) completion.quickmark(context),
|
completer: function (context) completion.quickmark(context)
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
completion: function initCompletion() {
|
completion: function initCompletion() {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ lazyRequire("template", ["template"]);
|
|||||||
|
|
||||||
var callResult = function callResult(method, ...args) {
|
var callResult = function callResult(method, ...args) {
|
||||||
return function (result) { result[method].apply(result, args); };
|
return function (result) { result[method].apply(result, args); };
|
||||||
}
|
};
|
||||||
|
|
||||||
var listener = function listener(action, event)
|
var listener = function listener(action, event)
|
||||||
function addonListener(install) {
|
function addonListener(install) {
|
||||||
@@ -218,7 +218,7 @@ var Addon = Class("Addon", {
|
|||||||
node.removeChild(node.firstChild);
|
node.removeChild(node.firstChild);
|
||||||
|
|
||||||
DOM(node).append(isArray(xml) ? xml : DOM.DOMString(xml));
|
DOM(node).append(isArray(xml) ? xml : DOM.DOMString(xml));
|
||||||
}
|
};
|
||||||
|
|
||||||
update("name", template.icon({ icon: this.iconURL }, this.name));
|
update("name", template.icon({ icon: this.iconURL }, this.name));
|
||||||
this.nodes.version.textContent = this.version;
|
this.nodes.version.textContent = this.version;
|
||||||
@@ -431,7 +431,7 @@ var Addons = Module("addons", {
|
|||||||
if (command.actions)
|
if (command.actions)
|
||||||
command.actions(list, this.modules);
|
command.actions(list, this.modules);
|
||||||
else
|
else
|
||||||
list.forEach(addon => { command.action.call(this.modules, addon, args.bang) });
|
list.forEach(addon => { command.action.call(this.modules, addon, args.bang); });
|
||||||
}));
|
}));
|
||||||
}, {
|
}, {
|
||||||
argCount: "?", // FIXME: should be "1"
|
argCount: "?", // FIXME: should be "1"
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ defineModule.dump = function dump_(...args) {
|
|||||||
dump(String.replace(msg, /\n?$/, "\n")
|
dump(String.replace(msg, /\n?$/, "\n")
|
||||||
.replace(/^./gm, JSMLoader.name + ": $&"));
|
.replace(/^./gm, JSMLoader.name + ": $&"));
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
defineModule.modules = [];
|
defineModule.modules = [];
|
||||||
defineModule.time = function time(major, minor, func, self, ...args) {
|
defineModule.time = function time(major, minor, func, self, ...args) {
|
||||||
let time = Date.now();
|
let time = Date.now();
|
||||||
@@ -123,7 +123,7 @@ defineModule.time = function time(major, minor, func, self, ...args) {
|
|||||||
|
|
||||||
JSMLoader.times.add(major, minor, Date.now() - time);
|
JSMLoader.times.add(major, minor, Date.now() - time);
|
||||||
return res;
|
return res;
|
||||||
}
|
};
|
||||||
|
|
||||||
function endModule() {
|
function endModule() {
|
||||||
defineModule.prefix = defineModule.prefix.slice(0, -2);
|
defineModule.prefix = defineModule.prefix.slice(0, -2);
|
||||||
@@ -230,7 +230,7 @@ this.lazyRequire("util", ["FailedAssertion", "util"]);
|
|||||||
|
|
||||||
if (typeof Symbol == "undefined")
|
if (typeof Symbol == "undefined")
|
||||||
this.Symbol = {
|
this.Symbol = {
|
||||||
iterator: "@@iterator",
|
iterator: "@@iterator"
|
||||||
};
|
};
|
||||||
|
|
||||||
literal.files = {};
|
literal.files = {};
|
||||||
@@ -382,7 +382,7 @@ deprecated.warn = function warn(func, name, alternative, frame) {
|
|||||||
if (!func.seenCaller.add(filename))
|
if (!func.seenCaller.add(filename))
|
||||||
util.dactyl(func).warn([util.urlPath(filename), frame.lineNumber, " "].join(":")
|
util.dactyl(func).warn([util.urlPath(filename), frame.lineNumber, " "].join(":")
|
||||||
+ _("warn.deprecated", name, alternative));
|
+ _("warn.deprecated", name, alternative));
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Iterates over all of the top-level, iterable property names of an
|
* Iterates over all of the top-level, iterable property names of an
|
||||||
@@ -430,7 +430,7 @@ Object.defineProperty(RealSet.prototype, "add", {
|
|||||||
let res = this.has(val);
|
let res = this.has(val);
|
||||||
Set_add.apply(this, arguments);
|
Set_add.apply(this, arguments);
|
||||||
return res;
|
return res;
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Object.defineProperty(RealSet.prototype, "difference", {
|
Object.defineProperty(RealSet.prototype, "difference", {
|
||||||
@@ -438,7 +438,7 @@ Object.defineProperty(RealSet.prototype, "difference", {
|
|||||||
writable: true,
|
writable: true,
|
||||||
value: function RealSet_difference(set) {
|
value: function RealSet_difference(set) {
|
||||||
return new RealSet(i for (i of this) if (!set.has(i)));
|
return new RealSet(i for (i of this) if (!set.has(i)));
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Object.defineProperty(RealSet.prototype, "intersection", {
|
Object.defineProperty(RealSet.prototype, "intersection", {
|
||||||
@@ -446,7 +446,7 @@ Object.defineProperty(RealSet.prototype, "intersection", {
|
|||||||
writable: true,
|
writable: true,
|
||||||
value: function RealSet_intersection(set) {
|
value: function RealSet_intersection(set) {
|
||||||
return new RealSet(i for (i of this) if (set.has(i)));
|
return new RealSet(i for (i of this) if (set.has(i)));
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Object.defineProperty(RealSet.prototype, "union", {
|
Object.defineProperty(RealSet.prototype, "union", {
|
||||||
@@ -457,7 +457,7 @@ Object.defineProperty(RealSet.prototype, "union", {
|
|||||||
for (let item of set)
|
for (let item of set)
|
||||||
res.add(item);
|
res.add(item);
|
||||||
return res;
|
return res;
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -598,7 +598,7 @@ function curry(fn, length, self, acc) {
|
|||||||
return fn.apply(self || this, args);
|
return fn.apply(self || this, args);
|
||||||
|
|
||||||
return curry(fn, length, self || this, args);
|
return curry(fn, length, self || this, args);
|
||||||
};
|
}
|
||||||
curried.realName = fn.realName || fn.name;
|
curried.realName = fn.realName || fn.name;
|
||||||
return curried;
|
return curried;
|
||||||
}
|
}
|
||||||
@@ -607,7 +607,7 @@ var bind = function bind(meth, self, ...args) {
|
|||||||
let func = callable(meth) ? meth : self[meth];
|
let func = callable(meth) ? meth : self[meth];
|
||||||
|
|
||||||
return apply(func, "bind", [self].concat(args));
|
return apply(func, "bind", [self].concat(args));
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if both arguments are functions and
|
* Returns true if both arguments are functions and
|
||||||
@@ -787,11 +787,11 @@ function update(target) {
|
|||||||
func.superapply = function superapply(self, args) {
|
func.superapply = function superapply(self, args) {
|
||||||
let meth = Object.getPrototypeOf(target)[k];
|
let meth = Object.getPrototypeOf(target)[k];
|
||||||
return meth && meth.apply(self, args);
|
return meth && meth.apply(self, args);
|
||||||
}
|
};
|
||||||
|
|
||||||
func.supercall = function supercall(self, ...args) {
|
func.supercall = function supercall(self, ...args) {
|
||||||
return func.superapply(self, args);
|
return func.superapply(self, args);
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -927,7 +927,7 @@ Class.extend = function extend(subclass, superclass, overrides) {
|
|||||||
|
|
||||||
if (superclass.prototype.constructor === objproto.constructor)
|
if (superclass.prototype.constructor === objproto.constructor)
|
||||||
superclass.prototype.constructor = superclass;
|
superclass.prototype.constructor = superclass;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Memoizes the value of a class property to the value returned by
|
* Memoizes the value of a class property to the value returned by
|
||||||
@@ -1101,7 +1101,7 @@ Class.prototype = {
|
|||||||
|
|
||||||
func.supercall = function supercall(self, ...args) {
|
func.supercall = function supercall(self, ...args) {
|
||||||
return func.superapply(self, args);
|
return func.superapply(self, args);
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1143,7 +1143,7 @@ var closureHooks = {
|
|||||||
if (hasOwnProperty(target._closureCache, prop))
|
if (hasOwnProperty(target._closureCache, prop))
|
||||||
return target._closureCache[prop];
|
return target._closureCache[prop];
|
||||||
|
|
||||||
let p = target[prop]
|
let p = target[prop];
|
||||||
if (callable(p))
|
if (callable(p))
|
||||||
return target._closureCache[prop] = p.bind(target);
|
return target._closureCache[prop] = p.bind(target);
|
||||||
return p;
|
return p;
|
||||||
@@ -1213,7 +1213,7 @@ function XPCOMShim(interfaces) {
|
|||||||
});
|
});
|
||||||
return (interfaces || []).reduce((shim, iface) => shim.QueryInterface(Ci[iface]),
|
return (interfaces || []).reduce((shim, iface) => shim.QueryInterface(Ci[iface]),
|
||||||
ip.data);
|
ip.data);
|
||||||
};
|
}
|
||||||
let stub = Class.Property({
|
let stub = Class.Property({
|
||||||
configurable: true,
|
configurable: true,
|
||||||
enumerable: false,
|
enumerable: false,
|
||||||
@@ -1313,7 +1313,7 @@ Module.INIT = {
|
|||||||
modules.dactyl.registerObservers(module);
|
modules.dactyl.registerObservers(module);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class Struct
|
* @class Struct
|
||||||
@@ -1336,7 +1336,7 @@ function Struct(...args) {
|
|||||||
|
|
||||||
const Struct = Class(className || "Struct", StructBase, {
|
const Struct = Class(className || "Struct", StructBase, {
|
||||||
length: args.length,
|
length: args.length,
|
||||||
members: Ary(args).map((v, k) => [v, k]).toObject(),
|
members: Ary(args).map((v, k) => [v, k]).toObject()
|
||||||
});
|
});
|
||||||
args.forEach(function (name, i) {
|
args.forEach(function (name, i) {
|
||||||
Struct.prototype.__defineGetter__(name, function () this[i]);
|
Struct.prototype.__defineGetter__(name, function () this[i]);
|
||||||
@@ -1606,6 +1606,7 @@ update(iter, {
|
|||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
some: function every(iter, pred, self) {
|
some: function every(iter, pred, self) {
|
||||||
pred = pred || util.identity;
|
pred = pred || util.identity;
|
||||||
for (let elem of iter)
|
for (let elem of iter)
|
||||||
@@ -1733,7 +1734,7 @@ const Iter = Class("Iter", {
|
|||||||
"Here you go:\n\n" + Error().stack);
|
"Here you go:\n\n" + Error().stack);
|
||||||
|
|
||||||
throw Error("Iter object used as a pre-ES6 iterator");
|
throw Error("Iter object used as a pre-ES6 iterator");
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
iter.Iter = Iter;
|
iter.Iter = Iter;
|
||||||
|
|
||||||
@@ -1956,7 +1957,7 @@ Object.defineProperty(Class.prototype, "closure",
|
|||||||
|
|
||||||
if (false)
|
if (false)
|
||||||
var array = Class("array", Ary, {
|
var array = Class("array", Ary, {
|
||||||
init: deprecated("Ary", function init() { init.superapply(arguments) })
|
init: deprecated("Ary", function init() { init.superapply(arguments); })
|
||||||
});
|
});
|
||||||
else
|
else
|
||||||
array = Ary;
|
array = Ary;
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ update(Bookmark.prototype, {
|
|||||||
|
|
||||||
return res.reverse();
|
return res.reverse();
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
Bookmark.prototype.members.uri = Bookmark.prototype.members.url;
|
Bookmark.prototype.members.uri = Bookmark.prototype.members.url;
|
||||||
Bookmark.setter = function (key, func) this.prototype.__defineSetter__(key, func);
|
Bookmark.setter = function (key, func) this.prototype.__defineSetter__(key, func);
|
||||||
Bookmark.setter("url", function (val) { this.uri = isString(val) ? newURI(val) : val; });
|
Bookmark.setter("url", function (val) { this.uri = isString(val) ? newURI(val) : val; });
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ this["import"] = function import_(obj) {
|
|||||||
for (let key of Object.getOwnPropertyNames(obj))
|
for (let key of Object.getOwnPropertyNames(obj))
|
||||||
Object.defineProperty(res, key, Object.getOwnPropertyDescriptor(obj, key));
|
Object.defineProperty(res, key, Object.getOwnPropertyDescriptor(obj, key));
|
||||||
return res;
|
return res;
|
||||||
}
|
};
|
||||||
|
|
||||||
if (typeof TextEncoder == "undefined")
|
if (typeof TextEncoder == "undefined")
|
||||||
Components.utils.importGlobalProperties(["TextEncoder", "TextDecoder"]);
|
Components.utils.importGlobalProperties(["TextEncoder", "TextDecoder"]);
|
||||||
|
|||||||
@@ -728,7 +728,7 @@ var Buffer = Module("Buffer", {
|
|||||||
return !b
|
return !b
|
||||||
|| a[0] == b[0] && a[1] == b[1]
|
|| a[0] == b[0] && a[1] == b[1]
|
||||||
|| a[0] != b[0] && a[1] != b[1];
|
|| a[0] != b[0] && a[1] != b[1];
|
||||||
}
|
};
|
||||||
|
|
||||||
let link = DOM("link[href][rev=canonical], \
|
let link = DOM("link[href][rev=canonical], \
|
||||||
link[href][rel=shortlink]", doc)
|
link[href][rel=shortlink]", doc)
|
||||||
@@ -749,7 +749,7 @@ var Buffer = Module("Buffer", {
|
|||||||
link[href][rel=shortlink]", this.doc)
|
link[href][rel=shortlink]", this.doc)
|
||||||
.each(elem => {
|
.each(elem => {
|
||||||
overlay.getData(elem, "link-check",
|
overlay.getData(elem, "link-check",
|
||||||
() => [elem.href, this.pageURI.spec])
|
() => [elem.href, this.pageURI.spec]);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1264,7 +1264,7 @@ var Buffer = Module("Buffer", {
|
|||||||
encoder.init(doc, "text/unicode", encoder.OutputRaw|encoder.OutputPreformatted);
|
encoder.init(doc, "text/unicode", encoder.OutputRaw|encoder.OutputPreformatted);
|
||||||
|
|
||||||
OS.File.writeAtomic(file.path, encoder.encodeToString())
|
OS.File.writeAtomic(file.path, encoder.encodeToString())
|
||||||
.then(() => { resolve([file, true]) })
|
.then(() => { resolve([file, true]); })
|
||||||
.catch(reject);
|
.catch(reject);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -1356,7 +1356,7 @@ var Commands = Module("commands", {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (complete)
|
if (complete)
|
||||||
var context = complete.fork(command.name).fork("opts", len);;
|
var context = complete.fork(command.name).fork("opts", len);
|
||||||
|
|
||||||
if (!complete || /(\w|^)[!\s]/.test(str))
|
if (!complete || /(\w|^)[!\s]/.test(str))
|
||||||
args = command.parseArgs(args, context, { count: count, bang: bang });
|
args = command.parseArgs(args, context, { count: count, bang: bang });
|
||||||
@@ -1641,7 +1641,7 @@ var Commands = Module("commands", {
|
|||||||
description: "The argument completion function",
|
description: "The argument completion function",
|
||||||
completer: function (context) [[k, ""] for ([k, v] of iter(config.completers))],
|
completer: function (context) [[k, ""] for ([k, v] of iter(config.completers))],
|
||||||
type: CommandOption.STRING,
|
type: CommandOption.STRING,
|
||||||
validator: function (arg) arg in config.completers || /^custom,/.test(arg),
|
validator: function (arg) arg in config.completers || /^custom,/.test(arg)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
names: ["-description", "-desc", "-d"],
|
names: ["-description", "-desc", "-d"],
|
||||||
|
|||||||
@@ -1189,7 +1189,7 @@ var Completion = Module("completion", {
|
|||||||
let builtin = Object.keys(Cc)
|
let builtin = Object.keys(Cc)
|
||||||
.filter(k => k.startsWith(services.AUTOCOMPLETE))
|
.filter(k => k.startsWith(services.AUTOCOMPLETE))
|
||||||
.map(key => {
|
.map(key => {
|
||||||
let name = key.substr(services.AUTOCOMPLETE.length)
|
let name = key.substr(services.AUTOCOMPLETE.length);
|
||||||
return ["native:" + name, _("autocomplete.description", name)];
|
return ["native:" + name, _("autocomplete.description", name)];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -62,8 +62,7 @@ var Group = Class("Group", {
|
|||||||
|
|
||||||
get toStringParams() [this.name],
|
get toStringParams() [this.name],
|
||||||
|
|
||||||
get builtin() this.modules.contexts.builtinGroups.indexOf(this) >= 0,
|
get builtin() this.modules.contexts.builtinGroups.indexOf(this) >= 0
|
||||||
|
|
||||||
}, {
|
}, {
|
||||||
compileFilter: function (patterns, default_=false) {
|
compileFilter: function (patterns, default_=false) {
|
||||||
function siteFilter(uri) {
|
function siteFilter(uri) {
|
||||||
|
|||||||
@@ -329,7 +329,7 @@ var DOM = Class("DOM", {
|
|||||||
let v = callable(val) ? val.call(thisObj || this, elem, i) : val;
|
let v = callable(val) ? val.call(thisObj || this, elem, i) : val;
|
||||||
|
|
||||||
highlight[(v == null ? highlight.has(hl) : !v) ? "remove" : "add"](hl);
|
highlight[(v == null ? highlight.has(hl) : !v) ? "remove" : "add"](hl);
|
||||||
}),
|
})
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -952,7 +952,7 @@ var DOM = Class("DOM", {
|
|||||||
|
|
||||||
fix(DOM(this.document.defaultView));
|
fix(DOM(this.document.defaultView));
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
}, {
|
}, {
|
||||||
/**
|
/**
|
||||||
* Creates an actual event from a pseudo-event object.
|
* Creates an actual event from a pseudo-event object.
|
||||||
@@ -1841,8 +1841,8 @@ var DOM = Class("DOM", {
|
|||||||
iterateNext: function () result.iterateNext(),
|
iterateNext: function () result.iterateNext(),
|
||||||
get resultType() result.resultType,
|
get resultType() result.resultType,
|
||||||
get snapshotLength() result.snapshotLength,
|
get snapshotLength() result.snapshotLength,
|
||||||
snapshotItem: function (i) result.snapshotItem(i),
|
snapshotItem: function (i) result.snapshotItem(i)
|
||||||
}
|
};
|
||||||
if (asIterator)
|
if (asIterator)
|
||||||
res[Symbol.iterator] = function* () {
|
res[Symbol.iterator] = function* () {
|
||||||
let elem;
|
let elem;
|
||||||
@@ -1889,7 +1889,7 @@ var DOM = Class("DOM", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
namespaceNames: Class.Memoize(function ()
|
namespaceNames: Class.Memoize(function ()
|
||||||
iter(this.namespaces).map(([k, v]) => ([v, k])).toObject()),
|
iter(this.namespaces).map(([k, v]) => ([v, k])).toObject())
|
||||||
});
|
});
|
||||||
|
|
||||||
Object.keys(DOM.Event.types).forEach(function (event) {
|
Object.keys(DOM.Event.types).forEach(function (event) {
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ var Download = Class("Download", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_compare: {
|
_compare: {
|
||||||
active: (a, b) => a.active - b.active,
|
active: (a, b) => a.active - b.active,
|
||||||
complete: (a, b) => a.percentComplete - b.percentComplete,
|
complete: (a, b) => a.percentComplete - b.percentComplete,
|
||||||
date: (a, b) => a.startTime - b.startTime,
|
date: (a, b) => a.startTime - b.startTime,
|
||||||
filename: (a, b) => String.localeCompare(a.targetFile.leafName, b.targetFile.leafName),
|
filename: (a, b) => String.localeCompare(a.targetFile.leafName, b.targetFile.leafName),
|
||||||
@@ -388,7 +388,7 @@ var DownloadList = Class("DownloadList",
|
|||||||
|
|
||||||
onDownloadChanged: function onDownloadChanged(download) {
|
onDownloadChanged: function onDownloadChanged(download) {
|
||||||
if (this.downloads.has(download)) {
|
if (this.downloads.has(download)) {
|
||||||
download = this.downloads.get(download)
|
download = this.downloads.get(download);
|
||||||
|
|
||||||
download.updateStatus();
|
download.updateStatus();
|
||||||
download.updateProgress();
|
download.updateProgress();
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ Highlight.liveProperty = function (name, prop) {
|
|||||||
if (this.onChange)
|
if (this.onChange)
|
||||||
this.onChange();
|
this.onChange();
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
Highlight.liveProperty("agent");
|
Highlight.liveProperty("agent");
|
||||||
Highlight.liveProperty("extends", "css");
|
Highlight.liveProperty("extends", "css");
|
||||||
Highlight.liveProperty("value", "css");
|
Highlight.liveProperty("value", "css");
|
||||||
|
|||||||
@@ -976,7 +976,7 @@ unlet s:cpo_save
|
|||||||
context.anchored = false;
|
context.anchored = false;
|
||||||
context.keys = {
|
context.keys = {
|
||||||
text: util.identity,
|
text: util.identity,
|
||||||
description: charset => io.charsetTitle(charset),
|
description: charset => io.charsetTitle(charset)
|
||||||
};
|
};
|
||||||
context.completions = io.charsets;
|
context.completions = io.charsets;
|
||||||
};
|
};
|
||||||
@@ -1034,7 +1034,7 @@ unlet s:cpo_save
|
|||||||
isDirectory: function () s.substr(-1) == "/",
|
isDirectory: function () s.substr(-1) == "/",
|
||||||
leafName: /([^\/]*)\/?$/.exec(s)[1]
|
leafName: /([^\/]*)\/?$/.exec(s)[1]
|
||||||
}
|
}
|
||||||
for (s of io.listJar(uri.JARFile, getDir(uri.JAREntry)))]
|
for (s of io.listJar(uri.JARFile, getDir(uri.JAREntry)))];
|
||||||
};
|
};
|
||||||
else
|
else
|
||||||
context.generate = function generate_file() {
|
context.generate = function generate_file() {
|
||||||
|
|||||||
@@ -641,8 +641,7 @@ var JavaScript = Module("javascript", {
|
|||||||
.concat([k.substr(3) for (k of keys(Ci)) if (/^nsI/.test(k))])
|
.concat([k.substr(3) for (k of keys(Ci)) if (/^nsI/.test(k))])
|
||||||
.concat(this.magicalNames)
|
.concat(this.magicalNames)
|
||||||
.filter(k => k in this.window));
|
.filter(k => k in this.window));
|
||||||
}),
|
})
|
||||||
|
|
||||||
}, {
|
}, {
|
||||||
EVAL_TMP: "__dactyl_eval_tmp",
|
EVAL_TMP: "__dactyl_eval_tmp",
|
||||||
|
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ var Modules = function Modules(window) {
|
|||||||
modules.plugins = create(modules);
|
modules.plugins = create(modules);
|
||||||
modules.modules = modules;
|
modules.modules = modules;
|
||||||
return modules;
|
return modules;
|
||||||
}
|
};
|
||||||
|
|
||||||
config.loadStyles();
|
config.loadStyles();
|
||||||
|
|
||||||
|
|||||||
@@ -442,7 +442,7 @@ var Option = Class("Option", {
|
|||||||
SCOPE_BOTH: 3,
|
SCOPE_BOTH: 3,
|
||||||
|
|
||||||
has: {
|
has: {
|
||||||
toggleAll: function toggleAll() toggleAll.supercall(this, "all") ^ !!toggleAll.superapply(this, arguments),
|
toggleAll: function toggleAll() toggleAll.supercall(this, "all") ^ !!toggleAll.superapply(this, arguments)
|
||||||
},
|
},
|
||||||
|
|
||||||
parseRegexp: function parseRegexp(value, result, flags) {
|
parseRegexp: function parseRegexp(value, result, flags) {
|
||||||
@@ -480,7 +480,7 @@ var Option = Class("Option", {
|
|||||||
filter: filter,
|
filter: filter,
|
||||||
result: result !== undefined ? result : !bang,
|
result: result !== undefined ? result : !bang,
|
||||||
toString: function toString() this.bang + Option.quote(this.filter, /:/) +
|
toString: function toString() this.bang + Option.quote(this.filter, /:/) +
|
||||||
(typeof this.result === "boolean" ? "" : ":" + quote(this.result)),
|
(typeof this.result === "boolean" ? "" : ":" + quote(this.result))
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -575,7 +575,7 @@ var Option = Class("Option", {
|
|||||||
|
|
||||||
parseKey: {
|
parseKey: {
|
||||||
number: Number,
|
number: Number,
|
||||||
boolean: function boolean(value) value == "true" || value == true ? true : false,
|
boolean: function boolean(value) value == "true" || value == true ? true : false
|
||||||
},
|
},
|
||||||
|
|
||||||
testValues: {
|
testValues: {
|
||||||
|
|||||||
@@ -342,7 +342,7 @@ var Overlay = Module("Overlay", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReferen
|
|||||||
if (!event || !overlay.onWindowVisible || window != util.topWindow(window))
|
if (!event || !overlay.onWindowVisible || window != util.topWindow(window))
|
||||||
util.trapErrors("visible", obj, window);
|
util.trapErrors("visible", obj, window);
|
||||||
else
|
else
|
||||||
overlay.onWindowVisible.push(function () { obj.visible(window) });
|
overlay.onWindowVisible.push(function () { obj.visible(window); });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj.load)
|
if (obj.load)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
|
|||||||
__proto__: this,
|
__proto__: this,
|
||||||
get original() this.constructor(this.ORIGINAL + this.root),
|
get original() this.constructor(this.ORIGINAL + this.root),
|
||||||
get restore() this.constructor(this.RESTORE + this.root),
|
get restore() this.constructor(this.RESTORE + this.root),
|
||||||
get saved() this.constructor(this.SAVED + this.root),
|
get saved() this.constructor(this.SAVED + this.root)
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!defaults)
|
if (!defaults)
|
||||||
@@ -414,10 +414,10 @@ var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
|
|||||||
|
|
||||||
yield option;
|
yield option;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
return template.options(_("pref.hostPreferences", config.host), prefs.call(this));
|
return template.options(_("pref.hostPreferences", config.host), prefs.call(this));
|
||||||
},
|
}
|
||||||
}, {
|
}, {
|
||||||
}, {
|
}, {
|
||||||
completion: function init_completion(dactyl, modules) {
|
completion: function init_completion(dactyl, modules) {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ function withCallbacks(fn) {
|
|||||||
function reject(arg) { deferred.reject(arg); }
|
function reject(arg) { deferred.reject(arg); }
|
||||||
fn.apply(this, [[resolve, reject, deferred]].concat(args));
|
fn.apply(this, [[resolve, reject, deferred]].concat(args));
|
||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function CancelablePromise(executor, oncancel) {
|
function CancelablePromise(executor, oncancel) {
|
||||||
@@ -111,7 +111,7 @@ var Promises = Module("Promises", {
|
|||||||
task: function task(fn) {
|
task: function task(fn) {
|
||||||
return function task_(...args) {
|
return function task_(...args) {
|
||||||
return Task.spawn(fn.bind.apply(fn, [this].concat(args)));
|
return Task.spawn(fn.bind.apply(fn, [this].concat(args)));
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -155,7 +155,7 @@ var Promises = Module("Promises", {
|
|||||||
* @param {function} fn The function to wrap.
|
* @param {function} fn The function to wrap.
|
||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
withCallbacks: withCallbacks,
|
withCallbacks: withCallbacks
|
||||||
});
|
});
|
||||||
|
|
||||||
endModule();
|
endModule();
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
|
|||||||
"quit-application-granted": function (subject, data) {
|
"quit-application-granted": function (subject, data) {
|
||||||
if (this.runAtShutdown && !this.sanitizeItems(null, Range(), null, "shutdown"))
|
if (this.runAtShutdown && !this.sanitizeItems(null, Range(), null, "shutdown"))
|
||||||
this.ranAtShutdown = true;
|
this.ranAtShutdown = true;
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -582,7 +582,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
|
|||||||
context.completions = Sanitizer.COMMANDS;
|
context.completions = Sanitizer.COMMANDS;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
completion: function initCompletion(dactyl, modules, window) {
|
completion: function initCompletion(dactyl, modules, window) {
|
||||||
|
|||||||
@@ -376,7 +376,7 @@ var Storage = Module("Storage", {
|
|||||||
if (obj.privateData && obj.clone)
|
if (obj.privateData && obj.clone)
|
||||||
return obj.clone(this);
|
return obj.clone(this);
|
||||||
return obj;
|
return obj;
|
||||||
},
|
}
|
||||||
}, {
|
}, {
|
||||||
Replacer: {
|
Replacer: {
|
||||||
skipXpcom: function skipXpcom(key, val) val instanceof Ci.nsISupports ? null : val
|
skipXpcom: function skipXpcom(key, val) val instanceof Ci.nsISupports ? null : val
|
||||||
@@ -803,7 +803,7 @@ var File = Class("File", {
|
|||||||
return File.DoesNotExist(e);
|
return File.DoesNotExist(e);
|
||||||
}
|
}
|
||||||
return path;
|
return path;
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -891,7 +891,7 @@ var AsyncFile = Class("AsyncFile", File, {
|
|||||||
*/
|
*/
|
||||||
readDirectory: function readDirectory(callback) {
|
readDirectory: function readDirectory(callback) {
|
||||||
let iter = new OS.File.DirectoryIterator(dir);
|
let iter = new OS.File.DirectoryIterator(dir);
|
||||||
let close = () => { iter.close() };
|
let close = () => { iter.close(); };
|
||||||
|
|
||||||
return iter.forEach(callback)
|
return iter.forEach(callback)
|
||||||
.then(close, close);
|
.then(close, close);
|
||||||
@@ -911,7 +911,7 @@ var AsyncFile = Class("AsyncFile", File, {
|
|||||||
|
|
||||||
moveTo: function moveTo(path, options) {
|
moveTo: function moveTo(path, options) {
|
||||||
return OS.File.move(this.path, path, options);
|
return OS.File.move(this.path, path, options);
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
for (let m of ["makeDir",
|
for (let m of ["makeDir",
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ var Hive = Class("Hive", {
|
|||||||
}
|
}
|
||||||
this.sheets = this.sheets.filter(s => matches.indexOf(s) == -1);
|
this.sheets = this.sheets.filter(s => matches.indexOf(s) == -1);
|
||||||
return matches.length;
|
return matches.length;
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -374,7 +374,7 @@ var Styles = Module("Styles", {
|
|||||||
let type = services.stylesheet[agent ? "AGENT_SHEET" : "USER_SHEET"];
|
let type = services.stylesheet[agent ? "AGENT_SHEET" : "USER_SHEET"];
|
||||||
if (services.stylesheet.sheetRegistered(uri, type))
|
if (services.stylesheet.sheetRegistered(uri, type))
|
||||||
services.stylesheet.unregisterSheet(uri, type);
|
services.stylesheet.unregisterSheet(uri, type);
|
||||||
},
|
}
|
||||||
}, {
|
}, {
|
||||||
append: function (dest, src, sort) {
|
append: function (dest, src, sort) {
|
||||||
let props = {};
|
let props = {};
|
||||||
@@ -554,7 +554,7 @@ var Styles = Module("Styles", {
|
|||||||
*/
|
*/
|
||||||
quote: function quote(str) {
|
quote: function quote(str) {
|
||||||
return '"' + str.replace(/([\\"])/g, "\\$1").replace(/\n/g, "\\00000a") + '"';
|
return '"' + str.replace(/([\\"])/g, "\\$1").replace(/\n/g, "\\00000a") + '"';
|
||||||
},
|
}
|
||||||
}, {
|
}, {
|
||||||
commands: function initCommands(dactyl, modules, window) {
|
commands: function initCommands(dactyl, modules, window) {
|
||||||
const { commands, contexts, styles } = modules;
|
const { commands, contexts, styles } = modules;
|
||||||
@@ -670,7 +670,7 @@ var Styles = Module("Styles", {
|
|||||||
{
|
{
|
||||||
name: ["dels[tyle]"],
|
name: ["dels[tyle]"],
|
||||||
desc: "Remove a user style sheet",
|
desc: "Remove a user style sheet",
|
||||||
action: function (sheet) sheet.remove(),
|
action: function (sheet) sheet.remove()
|
||||||
}
|
}
|
||||||
].forEach(function (cmd) {
|
].forEach(function (cmd) {
|
||||||
commands.add(cmd.name, cmd.desc,
|
commands.add(cmd.name, cmd.desc,
|
||||||
|
|||||||
@@ -459,7 +459,7 @@ var Template = Module("Template", {
|
|||||||
let source = this.sourceLink(frame);
|
let source = this.sourceLink(frame);
|
||||||
source[1]["dactyl:hint"] = source[2];
|
source[1]["dactyl:hint"] = source[2];
|
||||||
return source;
|
return source;
|
||||||
}
|
};
|
||||||
return ["table", {},
|
return ["table", {},
|
||||||
format.headings ?
|
format.headings ?
|
||||||
["thead", { highlight: "UsageHead" },
|
["thead", { highlight: "UsageHead" },
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ var wrapCallback = function wrapCallback(fn, isEvent) {
|
|||||||
};
|
};
|
||||||
fn.wrapper.wrapped = fn;
|
fn.wrapper.wrapped = fn;
|
||||||
return fn.wrapper;
|
return fn.wrapper;
|
||||||
}
|
};
|
||||||
|
|
||||||
var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), {
|
var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), {
|
||||||
Magic: Magic,
|
Magic: Magic,
|
||||||
|
|||||||
@@ -52,12 +52,12 @@ function Controller(controller) {
|
|||||||
|
|
||||||
this._countBeep = () => {
|
this._countBeep = () => {
|
||||||
this.beepCount++;
|
this.beepCount++;
|
||||||
}
|
};
|
||||||
this.errors = [];
|
this.errors = [];
|
||||||
this._countError = (message, highlight) => {
|
this._countError = (message, highlight) => {
|
||||||
if (/\b(Error|Warning)Msg\b/.test(highlight))
|
if (/\b(Error|Warning)Msg\b/.test(highlight))
|
||||||
this.errors.push(String(message));
|
this.errors.push(String(message));
|
||||||
}
|
};
|
||||||
this.modules.dactyl.registerObserver("beep", this._countBeep);
|
this.modules.dactyl.registerObserver("beep", this._countBeep);
|
||||||
this.modules.dactyl.registerObserver("echoLine", this._countError);
|
this.modules.dactyl.registerObserver("echoLine", this._countError);
|
||||||
this.modules.dactyl.registerObserver("echoMultiline", this._countError);
|
this.modules.dactyl.registerObserver("echoMultiline", this._countError);
|
||||||
|
|||||||
@@ -78,8 +78,7 @@ var Config = Module("config", ConfigBase, {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
}
|
||||||
|
|
||||||
}, {
|
}, {
|
||||||
}, {
|
}, {
|
||||||
commands: function initCommands(dactyl, modules, window) {
|
commands: function initCommands(dactyl, modules, window) {
|
||||||
|
|||||||
Reference in New Issue
Block a user