1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 14:27:59 +01:00

Miscellaneous semicolon, whitespace, and formatting fixes.

This commit is contained in:
Doug Kearns
2010-12-30 21:54:28 +11:00
parent 3c414d9ac9
commit 8e785245c1
22 changed files with 70 additions and 69 deletions

11
common/bootstrap.js vendored
View File

@@ -54,14 +54,14 @@ function startup(data, reason) {
dump("dactyl: bootstrap: init" + " " + data.id + "\n"); dump("dactyl: bootstrap: init" + " " + data.id + "\n");
addon = data; addon = data;
AddonManager.getAddonByID(addon.id, function (a) { addon = a }); AddonManager.getAddonByID(addon.id, function (a) { addon = a; });
if (basePath.isDirectory()) if (basePath.isDirectory())
getURI = function getURI(path) { getURI = function getURI(path) {
let file = basePath.clone().QueryInterface(Ci.nsILocalFile); let file = basePath.clone().QueryInterface(Ci.nsILocalFile);
file.appendRelativePath(path); file.appendRelativePath(path);
return (Services.io || services.io).newFileURI(file); return (Services.io || services.io).newFileURI(file);
} };
else else
getURI = function getURI(path) getURI = function getURI(path)
Services.io.newURI("jar:" + Services.io.newFileURI(basePath).spec + "!/" + path, null, null); Services.io.newURI("jar:" + Services.io.newFileURI(basePath).spec + "!/" + path, null, null);
@@ -100,7 +100,7 @@ FactoryProxy.prototype = {
}, },
createInstance: function (iids) { createInstance: function (iids) {
return let (factory = this.module.NSGetFactory(this.classID)) return let (factory = this.module.NSGetFactory(this.classID))
factory.createInstance.apply(factory, arguments) factory.createInstance.apply(factory, arguments);
} }
} }
@@ -196,6 +196,7 @@ function reasonToString(reason) {
return name; return name;
} }
function install(data, reason) { dump("dactyl: bootstrap: install " + reasonToString(reason) + "\n") } function install(data, reason) { dump("dactyl: bootstrap: install " + reasonToString(reason) + "\n"); }
function uninstall(data, reason) { dump("dactyl: bootstrap: uninstall " + reasonToString(reason) + "\n") } function uninstall(data, reason) { dump("dactyl: bootstrap: uninstall " + reasonToString(reason) + "\n"); }
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -145,7 +145,7 @@ var Buffer = Module("buffer", {
dactyl.commands["buffer.viewSource"] = function (event) { dactyl.commands["buffer.viewSource"] = function (event) {
let elem = event.originalTarget; let elem = event.originalTarget;
buffer.viewSource([elem.getAttribute("href"), Number(elem.getAttribute("line"))]) buffer.viewSource([elem.getAttribute("href"), Number(elem.getAttribute("line"))]);
}; };
this.cleanupProgressListener = util.overlayObject(window.XULBrowserWindow, this.cleanupProgressListener = util.overlayObject(window.XULBrowserWindow,
@@ -1006,9 +1006,9 @@ var Buffer = Module("buffer", {
this.callback = callable(callback) ? callback : this.callback = callable(callback) ? callback :
function (file) { function (file) {
editor.editFileExternally({ file: file.path, line: callback }, editor.editFileExternally({ file: file.path, line: callback },
function () { file.remove(false) }); function () { file.remove(false); });
return true; return true;
} };
let url = isString(doc) ? util.newURI(doc) : doc.documentURIObject; let url = isString(doc) ? util.newURI(doc) : doc.documentURIObject;
@@ -1478,9 +1478,9 @@ var Buffer = Module("buffer", {
util.map(array.iterValues(browsers), function ([i, browser]) { util.map(array.iterValues(browsers), function ([i, browser]) {
let indicator = " "; let indicator = " ";
if (i == tabs.index()) if (i == tabs.index())
indicator = "%" indicator = "%";
else if (i == tabs.index(tabs.alternate)) else if (i == tabs.index(tabs.alternate))
indicator = "#"; indicator = "#";
let tab = tabs.getTab(i); let tab = tabs.getTab(i);
let url = browser.contentDocument.location.href; let url = browser.contentDocument.location.href;
@@ -1750,7 +1750,7 @@ var Buffer = Module("buffer", {
// page info // page info
mappings.add(myModes, ["<C-g>"], mappings.add(myModes, ["<C-g>"],
"Print the current file name", "Print the current file name",
function () { buffer.showPageInfo(false); }) function () { buffer.showPageInfo(false); });
mappings.add(myModes, ["g<C-g>"], mappings.add(myModes, ["g<C-g>"],
"Print file information", "Print file information",

View File

@@ -81,7 +81,7 @@ var CommandWidgets = Class("CommandWidgets", {
onclick="dactyl.modules.commandline.onMultilineOutputEvent(event)"/> onclick="dactyl.modules.commandline.onMultilineOutputEvent(event)"/>
</vbox> </vbox>
</toolbar> </toolbar>
</e4x>.elements(), </e4x>.elements()
}); });
this.elements = {}; this.elements = {};
@@ -126,7 +126,7 @@ var CommandWidgets = Class("CommandWidgets", {
if (!elem.collapsed) if (!elem.collapsed)
dactyl.focus(elem); dactyl.focus(elem);
}, },
onVisibility: function (elem, visible) { visible && dactyl.focus(elem)} onVisibility: function (elem, visible) { visible && dactyl.focus(elem); }
}); });
this.addElement({ this.addElement({
name: "prompt", name: "prompt",
@@ -1607,7 +1607,7 @@ var CommandLine = Module("commandline", {
XML.ignoreWhitespace = false; XML.ignoreWhitespace = false;
commandline.commandOutput( commandline.commandOutput(
template.map(commandline._messageHistory.messages, function (message) template.map(commandline._messageHistory.messages, function (message)
<div highlight={message.highlight + " Message"}>{message.message}</div>));; <div highlight={message.highlight + " Message"}>{message.message}</div>));
} }
}, },
{ argCount: "0" }); { argCount: "0" });

View File

@@ -346,7 +346,7 @@ var Command = Class("Command", {
break; break;
case "-javascript": case "-javascript":
if (callable(params)) if (callable(params))
action = dactyl.userEval("(function action() { with (action.makeParams.apply(this, arguments)) {" + args.literalArg + "} })") action = dactyl.userEval("(function action() { with (action.makeParams.apply(this, arguments)) {" + args.literalArg + "} })");
else else
action = dactyl.userFunc.apply(dactyl, params.concat(args.literalArg).array); action = dactyl.userFunc.apply(dactyl, params.concat(args.literalArg).array);
process = function (param) isObject(param) && param.valueOf ? param.valueOf() : param; process = function (param) isObject(param) && param.valueOf ? param.valueOf() : param;

View File

@@ -895,12 +895,11 @@ var Completion = Module("completion", {
context.fork("about", 6, this, function (context) { context.fork("about", 6, this, function (context) {
context.generate = function () { context.generate = function () {
const PREFIX = "@mozilla.org/network/protocol/about;1?what="; const PREFIX = "@mozilla.org/network/protocol/about;1?what=";
return [[k.substr(PREFIX.length), ""] for (k in Cc) if (k.indexOf(PREFIX) == 0)] return [[k.substr(PREFIX.length), ""] for (k in Cc) if (k.indexOf(PREFIX) == 0)];
} };
}); });
} }
// Will, and should, throw an error if !(c in opts) // Will, and should, throw an error if !(c in opts)
Array.forEach(complete, function (c) { Array.forEach(complete, function (c) {
let completer = completion.urlCompleters[c]; let completer = completion.urlCompleters[c];

View File

@@ -119,7 +119,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
} }
let version = util.addon.version; let version = util.addon.version;
if ("@DATE" !== "@" + "DATE@") if ("@DATE" !== "@" + "DATE@")
version += " (created: @DATE@)" version += " (created: @DATE@)";
return version; return version;
}), }),
@@ -188,7 +188,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
.map(function (k) { .map(function (k) {
seen[k] = (seen[k] || 0) + 1; seen[k] = (seen[k] || 0) + 1;
return k; return k;
}).uniq() }).uniq();
}, },
options: params.options || [] options: params.options || []
}); });
@@ -430,7 +430,8 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
services.focus.focusedWindow = elem; services.focus.focusedWindow = elem;
else else
services.focus.setFocus(elem, flags); services.focus.setFocus(elem, flags);
} catch (e) { }
catch (e) {
util.dump(elem); util.dump(elem);
util.reportError(e); util.reportError(e);
} }
@@ -645,13 +646,13 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
this.helpInitialized = true; this.helpInitialized = true;
} }
}, },
stringifyXML: function (xml) { stringifyXML: function (xml) {
XML.prettyPrinting = false; XML.prettyPrinting = false;
XML.ignoreWhitespace = false; XML.ignoreWhitespace = false;
return UTF8(xml.toXMLString()); return UTF8(xml.toXMLString());
}, },
exportHelp: JavaScript.setCompleter(function (path) { exportHelp: JavaScript.setCompleter(function (path) {
const FILE = io.File(path); const FILE = io.File(path);
const PATH = FILE.leafName.replace(/\..*/, "") + "/"; const PATH = FILE.leafName.replace(/\..*/, "") + "/";
@@ -714,7 +715,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
value = value.replace(/(#|$)/, ".xhtml$1"); value = value.replace(/(#|$)/, ".xhtml$1");
} }
if (name == "src" && value.indexOf(":") > 0) { if (name == "src" && value.indexOf(":") > 0) {
chromeFiles[value] = value.replace(/.*\//, "");; chromeFiles[value] = value.replace(/.*\//, "");
value = value.replace(/.*\//, ""); value = value.replace(/.*\//, "");
} }
data.push(" "); data.push(" ");

View File

@@ -581,7 +581,7 @@ var Editor = Module("editor", {
mappings.add([modes.INSERT], mappings.add([modes.INSERT],
["<C-t>"], "Edit text field in Vi mode", ["<C-t>"], "Edit text field in Vi mode",
function () { function () {
dactyl.assert(!editor.isTextEdit) dactyl.assert(!editor.isTextEdit);
modes.push(modes.TEXT_EDIT); modes.push(modes.TEXT_EDIT);
}); });
@@ -774,7 +774,7 @@ var Editor = Module("editor", {
has: function (key) set.has(util.compileMacro(this.value).seen, key), has: function (key) set.has(util.compileMacro(this.value).seen, key),
validator: function (value) { validator: function (value) {
this.format({}, value); this.format({}, value);
return Object.keys(util.compileMacro(value).seen).every(function (k) ["column", "file", "line"].indexOf(k) >= 0) return Object.keys(util.compileMacro(value).seen).every(function (k) ["column", "file", "line"].indexOf(k) >= 0);
} }
}); });

View File

@@ -401,7 +401,7 @@ var Events = Module("events", {
// This causes a crash on Gecko<2.0, it seems. // This causes a crash on Gecko<2.0, it seems.
(target.ownerDocument || target.document || target).defaultView (target.ownerDocument || target.document || target).defaultView
.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils) .QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils)
.dispatchDOMEventViaPresShell(target, event, true) .dispatchDOMEventViaPresShell(target, event, true);
else else
target.dispatchEvent(event); target.dispatchEvent(event);
} }
@@ -771,7 +771,8 @@ var Events = Module("events", {
else else
elem.blur(); elem.blur();
} }
} catch (e) { }
catch (e) {
util.dump(win, String(elem.ownerDocument), String(elem.ownerDocument && elem.ownerDocument.defaultView)); util.dump(win, String(elem.ownerDocument), String(elem.ownerDocument && elem.ownerDocument.defaultView));
util.reportError(e); util.reportError(e);
} }
@@ -948,7 +949,7 @@ var Events = Module("events", {
event.dactylString = "<BS>"; event.dactylString = "<BS>";
return mode.params.onEvent(event) === false; return mode.params.onEvent(event) === false;
} };
} }
if (!input.process(event)) if (!input.process(event))
@@ -1157,7 +1158,7 @@ var Events = Module("events", {
if (modes.replaying && !this.waitForPageLoad()) if (modes.replaying && !this.waitForPageLoad())
return true; return true;
return !execute(map, null, this.count, null, command) || !map.route return !execute(map, null, this.count, null, command) || !map.route;
} }
} }
else if (mappings.getCandidates(this.main, command).length > 0 && !event.skipmap) { else if (mappings.getCandidates(this.main, command).length > 0 && !event.skipmap) {

View File

@@ -544,7 +544,7 @@ var RangeFind = Class("RangeFind", {
let start = RangeFind.sameDocument(this.lastRange, this.range.range) && this.range.intersects(this.lastRange) ? let start = RangeFind.sameDocument(this.lastRange, this.range.range) && this.range.intersects(this.lastRange) ?
RangeFind.endpoint(this.lastRange, !(again ^ this.backward)) : RangeFind.endpoint(this.lastRange, !(again ^ this.backward)) :
RangeFind.endpoint(this.range.range, !this.backward);; RangeFind.endpoint(this.range.range, !this.backward);
if (this.backward && !again) if (this.backward && !again)
start = RangeFind.endpoint(this.startRange, false); start = RangeFind.endpoint(this.startRange, false);

View File

@@ -1073,7 +1073,7 @@ var Hints = Module("hints", {
mappings.add(modes.HINTS, ["<Return>"], mappings.add(modes.HINTS, ["<Return>"],
"Follow the selected hint", "Follow the selected hint",
function () { update(true) }); function () { update(true); });
function tab(previous) { function tab(previous) {
hints.clearTimeout(); hints.clearTimeout();
@@ -1097,11 +1097,11 @@ var Hints = Module("hints", {
mappings.add(modes.HINTS, ["<Tab>"], mappings.add(modes.HINTS, ["<Tab>"],
"Focus the next matching hint", "Focus the next matching hint",
function () { tab.call(hints, false) }); function () { tab.call(hints, false); });
mappings.add(modes.HINTS, ["<S-Tab>"], mappings.add(modes.HINTS, ["<S-Tab>"],
"Focus the previous matching hint", "Focus the previous matching hint",
function () { tab.call(hints, true) }); function () { tab.call(hints, true); });
mappings.add(modes.HINTS, ["<BS>", "<C-h>"], mappings.add(modes.HINTS, ["<BS>", "<C-h>"],
"Delete the previous character", "Delete the previous character",

View File

@@ -232,7 +232,7 @@ var History = Module("history", {
].map(function (order) [ ].map(function (order) [
["+" + order.replace(" ", ""), "Sort by " + order + " ascending"], ["+" + order.replace(" ", ""), "Sort by " + order + " ascending"],
["-" + order.replace(" ", ""), "Sort by " + order + " descending"], ["-" + order.replace(" ", ""), "Sort by " + order + " descending"],
])) ]));
} }
} }
], ],

View File

@@ -178,7 +178,7 @@ var Mappings = Module("mappings", {
modes = modes.slice(); modes = modes.slice();
return (map for ([i, map] in Iterator(stack[modes.shift()].sort(function (m1, m2) String.localeCompare(m1.name, m2.name)))) return (map for ([i, map] in Iterator(stack[modes.shift()].sort(function (m1, m2) String.localeCompare(m1.name, m2.name))))
if (map.rhs && modes.every(function (mode) stack[mode]. if (map.rhs && modes.every(function (mode) stack[mode].
some(function (m) m.rhs && m.rhs === map.rhs && m.name === map.name)))) some(function (m) m.rhs && m.rhs === map.rhs && m.name === map.name))));
}, },
iterate: function (mode) { iterate: function (mode) {
@@ -475,8 +475,8 @@ var Mappings = Module("mappings", {
names: ["-modes", "-mode", "-m"], names: ["-modes", "-mode", "-m"],
type: CommandOption.LIST, type: CommandOption.LIST,
description: "Remove all mappings from the given modes", description: "Remove all mappings from the given modes",
default: mapmodes || ["n", "v"], default: mapmodes || ["n", "v"]
}), })
] ]
}); });
@@ -502,8 +502,8 @@ var Mappings = Module("mappings", {
names: ["-modes", "-mode", "-m"], names: ["-modes", "-mode", "-m"],
type: CommandOption.LIST, type: CommandOption.LIST,
description: "Remove mapping from the given modes", description: "Remove mapping from the given modes",
default: mapmodes || ["n", "v"], default: mapmodes || ["n", "v"]
}), })
] ]
}); });
} }

View File

@@ -82,7 +82,7 @@ var Option = Class("Option", {
get isDefault() this.stringValue === this.stringDefaultValue, get isDefault() this.stringValue === this.stringDefaultValue,
/** @property {value} The option's global value. @see #scope */ /** @property {value} The option's global value. @see #scope */
get globalValue() { try { return options.store.get(this.name, {}).value } catch (e) { util.reportError(e); throw e; } }, get globalValue() { try { return options.store.get(this.name, {}).value; } catch (e) { util.reportError(e); throw e; } },
set globalValue(val) { options.store.set(this.name, { value: val, time: Date.now() }); }, set globalValue(val) { options.store.set(this.name, { value: val, time: Date.now() }); },
/** /**
@@ -499,7 +499,7 @@ var Option = Class("Option", {
number: function (operator, values, scope, invert) { number: function (operator, values, scope, invert) {
if (invert) if (invert)
values = values[(values.indexOf(String(this.value)) + 1) % values.length] values = values[(values.indexOf(String(this.value)) + 1) % values.length];
let value = parseInt(values); let value = parseInt(values);
dactyl.assert(Number(values) % 1 == 0, dactyl.assert(Number(values) % 1 == 0,
@@ -572,7 +572,7 @@ var Option = Class("Option", {
string: function (operator, values, scope, invert) { string: function (operator, values, scope, invert) {
if (invert) if (invert)
return values[(values.indexOf(this.value) + 1) % values.length] return values[(values.indexOf(this.value) + 1) % values.length];
switch (operator) { switch (operator) {
case "+": case "+":
return this.value + values; return this.value + values;
@@ -735,7 +735,7 @@ var Options = Module("options", {
isDefault: opt.isDefault, isDefault: opt.isDefault,
default: opt.stringDefaultValue, default: opt.stringDefaultValue,
pre: "\u00a0\u00a0", // Unicode nonbreaking space. pre: "\u00a0\u00a0", // Unicode nonbreaking space.
value: <></>, value: <></>
}; };
if (filter && !filter(opt)) if (filter && !filter(opt))

View File

@@ -65,7 +65,7 @@ if (!XPCNativeWrapper.unwrap)
if (hasOwnProperty.call(obj, "wrappedJSObject")) if (hasOwnProperty.call(obj, "wrappedJSObject"))
return obj.wrappedJSObject; return obj.wrappedJSObject;
return obj; return obj;
} };
if (!Object.create) if (!Object.create)
Object.create = function (proto, props) { Object.create = function (proto, props) {
let obj = { __proto__: proto }; let obj = { __proto__: proto };
@@ -527,7 +527,7 @@ var isinstance_types = {
string: String, string: String,
function: Function, function: Function,
number: Number number: Number
} };
function isinstance(targ, src) { function isinstance(targ, src) {
src = Array.concat(src); src = Array.concat(src);
for (var i = 0; i < src.length; i++) { for (var i = 0; i < src.length; i++) {
@@ -870,7 +870,7 @@ Class.prototype = {
return; return;
util.trapErrors(callback, self); util.trapErrors(callback, self);
} }
return services.Timer(notify, timeout || 0, services.Timer.TYPE_ONE_SHOT);; return services.Timer(notify, timeout || 0, services.Timer.TYPE_ONE_SHOT);
} }
}; };
memoize(Class.prototype, "closure", function () { memoize(Class.prototype, "closure", function () {

View File

@@ -507,4 +507,4 @@ endModule();
} catch(e){ if (isString(e)) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); } } catch(e){ if (isString(e)) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
// vim: set fdm=marker sw=4 ts=4 et: // vim: set fdm=marker sw=4 sts=4 et ft=javascript:

View File

@@ -405,4 +405,4 @@ var Highlights = Module("Highlight", {
endModule(); endModule();
// vim:se fdm=marker sw=4 ts=4 et ft=javascript: // vim: set fdm=marker sw=4 ts=4 et ft=javascript:

View File

@@ -263,4 +263,4 @@ var Overlay = Module("Overlay", {
} }
}); });
// vim: set fdm=marker sw=4 ts=4 et: // vim: set fdm=marker sw=4 ts=4 et ft=javascript:

View File

@@ -32,7 +32,6 @@ Range.prototype.__defineGetter__("isSession", function () this.max == null && th
Range.prototype.__defineGetter__("native", function () Range.prototype.__defineGetter__("native", function ()
this.isEternity ? null : [range.min || 0, range.max == null ? Number.MAX_VALUE : range.max]); this.isEternity ? null : [range.min || 0, range.max == null ? Number.MAX_VALUE : range.max]);
var Item = Class("Item", { var Item = Class("Item", {
init: function (name) { init: function (name) {
this.name = name; this.name = name;
@@ -311,7 +310,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
unset: 0, unset: 0,
allow: 1, allow: 1,
deny: 2, deny: 2,
session: 8, session: 8
}, },
UNPERMS: Class.memoize(function () array.toObject([[v, k] for ([k, v] in Iterator(this.PERMS))])), UNPERMS: Class.memoize(function () array.toObject([[v, k] for ([k, v] in Iterator(this.PERMS))])),
COMMANDS: { COMMANDS: {
@@ -322,12 +321,12 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
list: "List all cookies for domain", list: "List all cookies for domain",
clear: "Clear all cookies for domain", clear: "Clear all cookies for domain",
"clear-persistent": "Clear all persistent cookies for domain", "clear-persistent": "Clear all persistent cookies for domain",
"clear-session": "Clear all session cookies for domain", "clear-session": "Clear all session cookies for domain"
}, },
argPrefMap: { argPrefMap: {
offlineapps: "offlineApps", offlineapps: "offlineApps",
sitesettings: "siteSettings", sitesettings: "siteSettings"
}, },
argToPref: function (arg) Sanitizer.argPrefMap[arg] || arg, argToPref: function (arg) Sanitizer.argPrefMap[arg] || arg,
prefToArg: function (pref) pref.replace(/.*\./, "").toLowerCase(), prefToArg: function (pref) pref.replace(/.*\./, "").toLowerCase(),
@@ -500,7 +499,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
for (let c in Sanitizer.iterCookies(host)) for (let c in Sanitizer.iterCookies(host))
count[c.isSession + 0]++; count[c.isSession + 0]++;
return <>{Sanitizer.COMMANDS[getPerms(host)]} (session: {count[1]} persistent: {count[0]})</>; return <>{Sanitizer.COMMANDS[getPerms(host)]} (session: {count[1]} persistent: {count[0]})</>;
} };
break; break;
case 1: case 1:
context.completions = Sanitizer.COMMANDS; context.completions = Sanitizer.COMMANDS;
@@ -533,7 +532,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
getter: function () services.privateBrowsing.privateBrowsingEnabled, getter: function () services.privateBrowsing.privateBrowsingEnabled,
setter: function (value) { setter: function (value) {
if (services.privateBrowsing.privateBrowsingEnabled != value) if (services.privateBrowsing.privateBrowsingEnabled != value)
services.privateBrowsing.privateBrowsingEnabled = value services.privateBrowsing.privateBrowsingEnabled = value;
}, },
persist: false persist: false
}); });
@@ -584,7 +583,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
["10m", "Last ten minutes"], ["10m", "Last ten minutes"],
["1h", "Past hour"], ["1h", "Past hour"],
["1d", "Past day"], ["1d", "Past day"],
["1w", "Past week"], ["1w", "Past week"]
] ]
}, },
validator: function (value) /^(a(ll)?|s(ession)|\d+[mhdw])$/.test(value) validator: function (value) /^(a(ll)?|s(ession)|\d+[mhdw])$/.test(value)

View File

@@ -51,7 +51,7 @@ var StoreBase = Class("StoreBase", {
this.reload(); this.reload();
}, },
changed: function () { this.timer.tell() }, changed: function () { this.timer.tell(); },
reload: function reload() { reload: function reload() {
this._object = this._load() || this._constructor(); this._object = this._load() || this._constructor();

View File

@@ -36,7 +36,7 @@ update(Sheet.prototype, {
function (filter) <span highlight={uris.some(Styles.matchFilter(filter)) ? "Filter" : ""}>{filter}</span>, function (filter) <span highlight={uris.some(Styles.matchFilter(filter)) ? "Filter" : ""}>{filter}</span>,
<>,</>), <>,</>),
remove: function () { this.hive.remove(this) }, remove: function () { this.hive.remove(this); },
get uri() cssUri(this.fullCSS), get uri() cssUri(this.fullCSS),
@@ -491,7 +491,7 @@ var Styles = Module("Styles", {
context.generate = function () styles.user.sites; context.generate = function () styles.user.sites;
context.keys.text = util.identity; context.keys.text = util.identity;
context.keys.description = function (site) this.sheets.length + " sheet" + (this.sheets.length == 1 ? "" : "s") + ": " + context.keys.description = function (site) this.sheets.length + " sheet" + (this.sheets.length == 1 ? "" : "s") + ": " +
array.compact(this.sheets.map(function (s) s.name)).join(", ") array.compact(this.sheets.map(function (s) s.name)).join(", ");
context.keys.sheets = function (site) styles.user.sheets.filter(function (s) s.sites.indexOf(site) >= 0); context.keys.sheets = function (site) styles.user.sheets.filter(function (s) s.sites.indexOf(site) >= 0);
context.keys.active = function (site) uris.some(Styles.matchFilter(site)); context.keys.active = function (site) uris.some(Styles.matchFilter(site));
@@ -532,7 +532,7 @@ var Styles = Module("Styles", {
var lastMatch = match; var lastMatch = match;
if (lastMatch != null && !lastMatch.value && !lastMatch.postSpace) { if (lastMatch != null && !lastMatch.value && !lastMatch.postSpace) {
context.advance(lastMatch.index + lastMatch.preSpace.length) context.advance(lastMatch.index + lastMatch.preSpace.length);
context.completions = names; context.completions = names;
} }
}; };
@@ -552,4 +552,4 @@ endModule();
// catch(e){dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack);} // catch(e){dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack);}
// vim:se fdm=marker sw=4 ts=4 et ft=javascript: // vim: set fdm=marker sw=4 ts=4 et ft=javascript:

View File

@@ -83,7 +83,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
return prop.apply(dactyl, args); return prop.apply(dactyl, args);
return prop; return prop;
} }
} };
}, { }, {
__noSuchMethod__: function () this().__noSuchMethod__.apply(null, arguments) __noSuchMethod__: function () this().__noSuchMethod__.apply(null, arguments)
}), }),
@@ -966,7 +966,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
window.removeEventListener("DOMContentLoaded", listener.wrapper, true); window.removeEventListener("DOMContentLoaded", listener.wrapper, true);
util._loadOverlays(window); util._loadOverlays(window);
} }
}), true) }), true);
} }
}, },
@@ -1053,7 +1053,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
return function unwrap() { return function unwrap() {
for each (let k in Object.getOwnPropertyNames(original)) for each (let k in Object.getOwnPropertyNames(original))
Object.defineProperty(object, k, Object.getOwnPropertyDescriptor(original, k)); Object.defineProperty(object, k, Object.getOwnPropertyDescriptor(original, k));
} };
}, },
overlayWindow: function (url, fn) { overlayWindow: function (url, fn) {
@@ -1234,7 +1234,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
catch (e) { catch (e) {
try { try {
this.dump(String(error)); this.dump(String(error));
this.dump(util.stackLines(error.stack).join("\n")) this.dump(util.stackLines(error.stack).join("\n"));
} }
catch (e) { dump(e + "\n"); } catch (e) { dump(e + "\n"); }
} }
@@ -1392,7 +1392,8 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
(function next() { (function next() {
try { try {
util.timeout(next, gen.next()); util.timeout(next, gen.next());
} catch(e if e instanceof StopIteration) {}; }
catch (e if e instanceof StopIteration) {};
})(); })();
}, },
@@ -1491,7 +1492,6 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
Array: array Array: array
}); });
/** /**
* Math utility methods. * Math utility methods.
* @singleton * @singleton

View File

@@ -758,11 +758,11 @@ const Player = Module("player", {
mappings.add([modes.PLAYER], mappings.add([modes.PLAYER],
["n"], "Find the next track", ["n"], "Find the next track",
function () { player.searchViewAgain(false);}); function () { player.searchViewAgain(false); });
mappings.add([modes.PLAYER], mappings.add([modes.PLAYER],
["N"], "Find the previous track", ["N"], "Find the previous track",
function () { player.searchViewAgain(true);}); function () { player.searchViewAgain(true); });
for (let i in util.range(0, 6)) { for (let i in util.range(0, 6)) {
let (rating = i) { let (rating = i) {