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

Whitespace fixes.

--HG--
extra : rebase_source : 7bc98c4cf1a8ca89cfbfb1f96ffe9fa72565c663
This commit is contained in:
Doug Kearns
2010-11-05 00:52:40 +11:00
parent 4f5fd70ab2
commit 26e130bd0b
10 changed files with 18 additions and 19 deletions

View File

@@ -8,7 +8,6 @@
/** @scope modules */ /** @scope modules */
/** /**
* A structure representing the options available for a command. * A structure representing the options available for a command.
* *
@@ -149,7 +148,6 @@ const Command = Class("Command", {
if (args.bang && !this.bang) if (args.bang && !this.bang)
throw FailedAssertion("E477: No ! allowed"); throw FailedAssertion("E477: No ! allowed");
dactyl.trapErrors(function exec(command) { dactyl.trapErrors(function exec(command) {
if (this.always) if (this.always)
this.always(args, modifiers); this.always(args, modifiers);
@@ -709,9 +707,9 @@ const Commands = Module("commands", {
} }
let [count, arg, quote] = Commands.parseArg(str, null, keepQuotes); let [count, arg, quote] = Commands.parseArg(str, null, keepQuotes);
if (quote == "\\" && !complete) if (quote == "\\" && !complete)
return [,,,"Trailing \\"]; return [, , , "Trailing \\"];
if (quote && !complete) if (quote && !complete)
return [,,,"E114: Missing quote: " + quote]; return [, , , "E114: Missing quote: " + quote];
return [count, arg, quote]; return [count, arg, quote];
} }

View File

@@ -527,7 +527,7 @@ const Dactyl = Module("dactyl", {
let chrome = {}; let chrome = {};
let styles = {}; let styles = {};
for (let [file,] in Iterator(services.get("dactyl:").FILE_MAP)) { for (let [file, ] in Iterator(services.get("dactyl:").FILE_MAP)) {
dactyl.open("dactyl://help/" + file); dactyl.open("dactyl://help/" + file);
dactyl.modules.events.waitForPageLoad(); dactyl.modules.events.waitForPageLoad();
let data = [ let data = [
@@ -1420,8 +1420,8 @@ const Dactyl = Module("dactyl", {
}, },
getAddonsByTypes: function (types, callback) { getAddonsByTypes: function (types, callback) {
let res = []; let res = [];
for (let [,type] in Iterator(types)) for (let [, type] in Iterator(types))
for (let [,item] in Iterator(services.get("extensionManager") for (let [, item] in Iterator(services.get("extensionManager")
.getItemList(Ci.nsIUpdateItem["TYPE_" + type.toUpperCase()], {}))) .getItemList(Ci.nsIUpdateItem["TYPE_" + type.toUpperCase()], {})))
res.push(this.getAddonByID(item)); res.push(this.getAddonByID(item));
callback(res); callback(res);

View File

@@ -520,7 +520,7 @@ const Editor = Module("editor", {
addMovementMap(["gg", "<C-Home>"], false, "completeMove", false, "cmd_moveTop", "cmd_selectTop"); addMovementMap(["gg", "<C-Home>"], false, "completeMove", false, "cmd_moveTop", "cmd_selectTop");
addMovementMap(["G", "<C-End>"], false, "completeMove", true, "cmd_moveBottom", "cmd_selectBottom"); addMovementMap(["G", "<C-End>"], false, "completeMove", true, "cmd_moveBottom", "cmd_selectBottom");
addMovementMap(["0", "^", "<Home>"], false, "intraLineMove", false, "cmd_beginLine", "cmd_selectBeginLine"); addMovementMap(["0", "^", "<Home>"], false, "intraLineMove", false, "cmd_beginLine", "cmd_selectBeginLine");
addMovementMap(["$", "<End>"], false, "intraLineMove", true, "cmd_endLine" , "cmd_selectEndLine" ); addMovementMap(["$", "<End>"], false, "intraLineMove", true, "cmd_endLine" , "cmd_selectEndLine");
addBeginInsertModeMap(["i", "<Insert>"], []); addBeginInsertModeMap(["i", "<Insert>"], []);
addBeginInsertModeMap(["a"], ["cmd_charNext"]); addBeginInsertModeMap(["a"], ["cmd_charNext"]);

View File

@@ -592,7 +592,7 @@ const RangeFind = Class("RangeFind", {
this.index = index; this.index = index;
this.range = range; this.range = range;
this.document = range.startContainer.ownerDocument; this.document = range.startContainer.ownerDocument;
this.window = this.document.defaultView; this.window = this.document.defaultView;
this.docShell = this.window.QueryInterface(Ci.nsIInterfaceRequestor) this.docShell = this.window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation) .getInterface(Ci.nsIWebNavigation)
@@ -641,9 +641,9 @@ const RangeFind = Class("RangeFind", {
} }
} }
}), }),
contains: function (range, r) contains: function (range, r)
range.compareBoundaryPoints(range.START_TO_END, r) >= 0 && range.compareBoundaryPoints(range.START_TO_END, r) >= 0 &&
range.compareBoundaryPoints(range.END_TO_START, r) <= 0, range.compareBoundaryPoints(range.END_TO_START, r) <= 0,
endpoint: function (range, before) { endpoint: function (range, before) {
range = range.cloneRange(); range = range.cloneRange();
range.collapse(before); range.collapse(before);

View File

@@ -322,7 +322,7 @@ const Modes = Module("modes", {
modes.getMode(this.main).name + modes.getMode(this.main).name +
(!this.extended ? "" : (!this.extended ? "" :
"(" + "(" +
[modes.getMode(1<<i).name for (i in util.range(0, 32)) if (this.extended & (1<<i))].join("|") + [modes.getMode(1 << i).name for (i in util.range(0, 32)) if (this.extended & (1 << i))].join("|") +
")") + "]"; ")") + "]";
return struct; return struct;
})(), })(),

View File

@@ -134,7 +134,8 @@ defineModule.time = function time(major, minor, func, self) {
let time = Date.now(); let time = Date.now();
try { try {
var res = func.apply(self, Array.slice(arguments, 4)); var res = func.apply(self, Array.slice(arguments, 4));
} catch (e) { }
catch (e) {
loaded.util && util.reportError(e); loaded.util && util.reportError(e);
} }
let delta = Date.now() - time; let delta = Date.now() - time;

View File

@@ -504,7 +504,8 @@ const Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakR
(function rec(frame) { (function rec(frame) {
try { try {
res = res.concat(util.subdomains(frame.location.host)); res = res.concat(util.subdomains(frame.location.host));
} catch (e) {} }
catch (e) {}
Array.forEach(frame.frames, rec); Array.forEach(frame.frames, rec);
})(window.content); })(window.content);
if (context.filter && !res.some(function (host) host.indexOf(context.filter) >= 0)) if (context.filter && !res.some(function (host) host.indexOf(context.filter) >= 0))

View File

@@ -55,7 +55,6 @@ const Services = Module("Services", {
this.add("windowMediator", "@mozilla.org/appshell/window-mediator;1", Ci.nsIWindowMediator); this.add("windowMediator", "@mozilla.org/appshell/window-mediator;1", Ci.nsIWindowMediator);
this.add("windowWatcher", "@mozilla.org/embedcomp/window-watcher;1", Ci.nsIWindowWatcher); this.add("windowWatcher", "@mozilla.org/embedcomp/window-watcher;1", Ci.nsIWindowWatcher);
this.addClass("file", "@mozilla.org/file/local;1", Ci.nsILocalFile); this.addClass("file", "@mozilla.org/file/local;1", Ci.nsILocalFile);
this.addClass("file:", "@mozilla.org/network/protocol;1?name=file", Ci.nsIFileProtocolHandler); this.addClass("file:", "@mozilla.org/network/protocol;1?name=file", Ci.nsIFileProtocolHandler);
this.addClass("find", "@mozilla.org/embedcomp/rangefind;1", Ci.nsIFind); this.addClass("find", "@mozilla.org/embedcomp/rangefind;1", Ci.nsIFind);

View File

@@ -789,13 +789,13 @@ const Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
if (field instanceof Ci.nsIDOMHTMLInputElement && field.type == "submit") if (field instanceof Ci.nsIDOMHTMLInputElement && field.type == "submit")
elems.push(encode(field.name, field.value)); elems.push(encode(field.name, field.value));
for (let [,elem] in iter(form.elements)) { for (let [, elem] in iter(form.elements)) {
if (set.has(util.editableInputs, elem.type) if (set.has(util.editableInputs, elem.type)
|| /^(?:hidden|textarea)$/.test(elem.type) || /^(?:hidden|textarea)$/.test(elem.type)
|| elem.checked && /^(?:checkbox|radio)$/.test(elem.type)) || elem.checked && /^(?:checkbox|radio)$/.test(elem.type))
elems.push(encode(elem.name, elem.value, elem === field)); elems.push(encode(elem.name, elem.value, elem === field));
else if (elem instanceof Ci.nsIDOMHTMLSelectElement) { else if (elem instanceof Ci.nsIDOMHTMLSelectElement) {
for (let [,opt] in Iterator(elem.options)) for (let [, opt] in Iterator(elem.options))
if (opt.selected) if (opt.selected)
elems.push(encode(elem.name, opt.value)); elems.push(encode(elem.name, opt.value));
} }

View File

@@ -70,7 +70,7 @@ const Config = Module("config", ConfigBase, {
pagesource: ["View page source", pagesource: ["View page source",
function () { window.BrowserViewSourceOfDocument(content.document); }], function () { window.BrowserViewSourceOfDocument(content.document); }],
passwords: ["Passwords dialog", passwords: ["Passwords dialog",
function () { window.openDialog("chrome://passwordmgr/content/passwordManager.xul"); }], function () { window.openDialog("chrome://passwordmgr/content/passwordManager.xul"); }],
places: ["Places Organizer: Manage your bookmarks and history", places: ["Places Organizer: Manage your bookmarks and history",
function () { PlacesCommandHook.showPlacesOrganizer(ORGANIZER_ROOT_BOOKMARKS); }], function () { PlacesCommandHook.showPlacesOrganizer(ORGANIZER_ROOT_BOOKMARKS); }],
preferences: ["Show Firefox preferences dialog", preferences: ["Show Firefox preferences dialog",