1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 05:58:03 +01:00

Run stylebot -- semicolons.

This commit is contained in:
Doug Kearns
2011-02-01 01:06:49 +11:00
parent cf79af7148
commit 37d62cdeba
17 changed files with 44 additions and 48 deletions

View File

@@ -1535,7 +1535,7 @@ var Buffer = Module("buffer", {
commands.add(["st[op]"],
"Stop loading the current web page",
function () { buffer.stop() },
function () { buffer.stop(); },
{ argCount: "0" });
commands.add(["vie[wsource]"],

View File

@@ -265,7 +265,7 @@ var CommandWidgets = Class("CommandWidgets", {
}
});
let res, self = this;
return Class.replaceProperty(this, name, this[name])
return Class.replaceProperty(this, name, this[name]);
},
get completionList() this._whenReady("completionList", "dactyl-completions"),
@@ -300,7 +300,6 @@ var CommandWidgets = Class("CommandWidgets", {
}
});
var CommandMode = Class("CommandMode", {
init: function init() {
this.keepCommand = userContext.hidden_option_command_afterimage;
@@ -600,7 +599,7 @@ var CommandLine = Module("commandline", {
},
get lastCommand() this._lastCommand || this.command,
set lastCommand(val) { this._lastCommand = val },
set lastCommand(val) { this._lastCommand = val; },
clear: function clear() {
if (this.widgets.message && this.widgets.message[1] === this._lastClearable)

View File

@@ -324,7 +324,7 @@ var Command = Class("Command", {
if (callable(params))
var makeParams = function makeParams(self, args)
iter.toObject([k, process(v)]
for ([k, v] in iter(params.apply(self, args))))
for ([k, v] in iter(params.apply(self, args))));
else if (params)
makeParams = function makeParams(self, args)
iter.toObject([name, process(args[i])]
@@ -800,7 +800,7 @@ var Commands = Module("commands", {
// Push possible option matches into completions
if (complete && !onlyArgumentsRemaining)
completeOpts = options.filter(function (opt) opt.multiple || !set.has(args, opt.names[0]));
}
};
let resetCompletions = function resetCompletions() {
completeOpts = null;
args.completeArg = null;
@@ -808,7 +808,7 @@ var Commands = Module("commands", {
args.completeFilter = null;
args.completeStart = i;
args.quote = Commands.complQuote[""];
}
};
if (complete) {
resetCompletions();
matchOpts("");
@@ -820,7 +820,7 @@ var Commands = Module("commands", {
complete.message = error;
else
dactyl.assert(false, error);
}
};
outer:
while (i < str.length || complete) {

View File

@@ -165,7 +165,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
}
catch (e if e.message == "can't wrap XML objects") {
// Horrible kludge.
callback.get().apply(null, [String(args[0])].concat(args.slice(1)))
callback.get().apply(null, [String(args[0])].concat(args.slice(1)));
}
}
catch (e) {
@@ -213,7 +213,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
for (let obj in values(results))
if (obj.helpTag in services["dactyl:"].HELP_TAGS)
yield dactyl.generateHelp(obj, null, null, true);
}
};
},
/**
@@ -227,7 +227,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
let elems = {
bell: document.getElementById("dactyl-bell"),
strut: document.getElementById("dactyl-bell-strut")
}
};
XML.ignoreWhitespace = true;
if (!elems.bell)
util.overlayWindow(window, {
@@ -609,13 +609,13 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
}
}
return result;
}
};
// Find the tags in the document.
let addTags = function addTags(file, doc) {
for (let elem in util.evaluateXPath("//@tag|//dactyl:tags/text()|//dactyl:tag/text()", doc))
for (let tag in values((elem.value || elem.textContent).split(/\s+/)))
tagMap[tag] = file;
}
};
let namespaces = ["locale-local", "locale"];
services["dactyl:"].init({});
@@ -759,7 +759,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
{rec(NEWS, 0)}
</document>.toXMLString()))
]
];
}
addTags("versions", util.httpGet("dactyl://help/versions").responseXML);
@@ -925,8 +925,8 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
k.@name = name;
if (mode)
k.@mode = mode;
return k
}
return k;
};
}
else if (obj instanceof Option) {
link = function (opt, name) <o>{name}</o>;

View File

@@ -149,7 +149,7 @@ var ProcessorStack = Class("ProcessorStack", {
this.processors = processors;
return this.execute(result, options["timeout"] && options["timeoutlen"] === 0)
return this.execute(result, options["timeout"] && options["timeoutlen"] === 0);
}
});
@@ -191,7 +191,7 @@ var KeyProcessor = Class("KeyProcessor", {
if (self.preExecute)
self.preExecute.apply(self, args);
let res = map.execute.call(map, update({ self: self.main.params.mappingSelf || self.main.mappingSelf || map },
args))
args));
if (self.postExecute)
self.postExecute.apply(self, args);
return res;
@@ -596,7 +596,7 @@ var Events = Module("events", {
var t = TYPES[type];
var evt = doc.createEvent((t || "HTML") + "Events");
let defaults = DEFAULTS[t || "HTML"]
let defaults = DEFAULTS[t || "HTML"];
evt["init" + t + "Event"].apply(evt, Object.keys(defaults)
.map(function (k) k in opts ? opts[k]
: defaults[k]));

View File

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

View File

@@ -103,7 +103,7 @@ var Map = Class("Map", {
if (!isObject(args)) // Backwards compatibility :(
args = iter(["motion", "count", "arg", "command"])
.map(function ([i, prop]) [prop, this[i]], arguments)
.toObject()
.toObject();
let self = this;
function repeat() self.action(args)
@@ -284,7 +284,7 @@ var MapHive = Class("MapHive", {
for (let key in events.iterKeys(name)) {
state += key;
if (state !== name)
states.candidates[state] = (states.candidates[state] || 0) + 1
states.candidates[state] = (states.candidates[state] || 0) + 1;
}
}
return states;
@@ -330,7 +330,6 @@ var Mappings = Module("mappings", {
remove: deprecated("mappings.user.remove", function remove(mode, cmd) this.user.remove(mode, cmd)),
removeAll: deprecated("mappings.user.clear", function removeAll(mode) this.user.clear(mode)),
/**
* Adds a new default key mapping.
*
@@ -534,7 +533,7 @@ var Mappings = Module("mappings", {
names: ["-modes", "-mode", "-m"],
type: CommandOption.LIST,
description: "Create this mapping in the given modes",
default: mapmodes || ["n", "v"],
default: mapmodes || ["n", "v"]
}),
{
names: ["-nopersist", "-n"],
@@ -693,7 +692,7 @@ var Mappings = Module("mappings", {
Option.splitList(context.filter);
context.advance(Option._splitAt);
context.compare = CompletionContext.Sort.unsorted
context.compare = CompletionContext.Sort.unsorted;
context.completions = [
[buffer.uri.host, "Current Host"],
[buffer.uri.spec, "Current Page"]
@@ -788,7 +787,7 @@ var Mappings = Module("mappings", {
name: name,
columns: [
mode == mainMode ? "" : <span highlight="Object" style="padding-right: 1em;">{mode.name}</span>,
hive.name == "builtin" ? "" : <span highlight="Object" style="padding-right: 1em;">{hive.name}</span>,
hive.name == "builtin" ? "" : <span highlight="Object" style="padding-right: 1em;">{hive.name}</span>
],
__proto__: map
};

View File

@@ -140,8 +140,8 @@ var Modes = Module("modes", {
: "PASS THROUGH (next)"
}, {
// Fix me.
preExecute: function (map) { if (modes.main == modes.QUOTE && map.name !== "<C-v>") modes.pop() },
postExecute: function (map) { if (modes.main == modes.QUOTE && map.name === "<C-v>") modes.pop() },
preExecute: function (map) { if (modes.main == modes.QUOTE && map.name !== "<C-v>") modes.pop(); },
postExecute: function (map) { if (modes.main == modes.QUOTE && map.name === "<C-v>") modes.pop(); },
onKeyPress: function () { if (modes.main == modes.QUOTE) modes.pop() }
});
this.addMode("IGNORE", { hidden: true }, {
@@ -484,7 +484,7 @@ var Modes = Module("modes", {
mappings.add([modes.MENU], ["<C-[>"],
"Close the current popup",
function () { events.feedkeys("<Esc>") });
function () { events.feedkeys("<Esc>"); });
},
prefs: function () {
prefs.watch("accessibility.browsewithcaret", modes.closure.onCaretChange);

View File

@@ -144,7 +144,7 @@ var MOW = Module("mow", {
const openLink = function openLink(where) {
event.preventDefault();
dactyl.open(event.target.href, where);
}
};
if (event.target instanceof HTMLAnchorElement)
switch (events.toString(event)) {
@@ -297,7 +297,7 @@ var MOW = Module("mow", {
else if (res === PASS)
events.feedkeys(command);
});
}
};
bind(["j", "<C-e>", "<Down>"], "Scroll down one line",
function () { mow.scrollVertical("lines", 1); },
@@ -333,10 +333,10 @@ var MOW = Module("mow", {
function () mow.isScrollable(-1), BEEP);
bind(["gg"], "Scroll to the beginning of output",
function () { mow.scrollToPercent(null, 0); })
function () { mow.scrollToPercent(null, 0); });
bind(["G"], "Scroll to the end of output",
function () { mow.body.scrollTop = mow.body.scrollHeight; })
function () { mow.body.scrollTop = mow.body.scrollHeight; });
// copy text to clipboard
bind(["<C-y>"], "Yank selection to clipboard",

View File

@@ -849,7 +849,7 @@ var Options = Module("options", {
{template.linkifyHelp(map.description)}
</>)
}
}
};
dactyl.addUsageCommand({
name: ["listo[ptions]", "lo"],

View File

@@ -135,7 +135,6 @@ var actions = {
}
};
var Addon = Class("Addon", {
init: function init(addon, list) {
this.addon = addon;
@@ -249,7 +248,6 @@ var Addon = Class("Addon", {
});
});
var AddonList = Class("AddonList", {
init: function init(modules, types, filter) {
this.modules = modules;

View File

@@ -9,7 +9,7 @@ try {
Components.utils.import("resource://dactyl/bootstrap.jsm");
defineModule("javascript", {
exports: ["JavaScript", "javascript"],
use: ["services", "template", "util"],
use: ["services", "template", "util"]
}, this);
// TODO: Clean this up.
@@ -18,7 +18,7 @@ var JavaScript = Module("javascript", {
Local: function (dactyl, modules, window) ({
init: function () {
this.modules = modules;
this.window = window
this.window = window;
this._stack = [];
this._functions = [];

View File

@@ -267,7 +267,7 @@ var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
*/
restore: function (branch) {
this.getNames(this.RESTORE + (branch || "")).forEach(function (pref) {
this.safeSet(pref.substr(this.RESTORE.length), this.get(pref), null, true)
this.safeSet(pref.substr(this.RESTORE.length), this.get(pref), null, true);
this.reset(pref);
}, this);
},

View File

@@ -605,7 +605,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
["1h", "Past hour"],
["1d", "Past day"],
["1w", "Past week"]
]
];
},
validator: function (value) /^(a(ll)?|s(ession)|\d+[mhdw])$/.test(value)
});

View File

@@ -199,7 +199,7 @@ var Template = Module("Template", {
XML.ignoreWhitespace = false; XML.prettyPrinting = false;
type = type || (/^'.*'$/.test(topic) ? "HelpOpt" :
/^:\w/.test(topic) ? "HelpEx" : "HelpKey");
return <a highlight={type} tag={topic} href={"dactyl://help-tag/" + topic} dactyl:command="dactyl.help" xmlns:dactyl={NS}>{text || topic}</a>
return <a highlight={type} tag={topic} href={"dactyl://help-tag/" + topic} dactyl:command="dactyl.help" xmlns:dactyl={NS}>{text || topic}</a>;
},
HelpLink: function (topic) {
if (!services["dactyl:"].initialized)
@@ -212,7 +212,7 @@ var Template = Module("Template", {
let tag = (/^'.*'$/.test(topic) ? "o" :
/^:\w/.test(topic) ? "ex" : "k");
topic = topic.replace(/^'(.*)'$/, "$1");
return <{tag} xmlns={NS}>{topic}</{tag}>
return <{tag} xmlns={NS}>{topic}</{tag}>;
},
// if "processStrings" is true, any passed strings will be surrounded by " and
@@ -382,7 +382,7 @@ var Template = Module("Template", {
href={url} path={path} line={frame.lineNumber}
highlight="URL">{
path + ":" + frame.lineNumber
}</a>
}</a>;
},
table: function table(title, data, indent) {