From 6dfc33035b3cf377fbaec1317355f3dbb46b84c0 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 2 Nov 2008 11:54:56 +0000 Subject: [PATCH] whitespace and semicolon fixes --- content/bookmarks.js | 4 ++-- content/buffer.js | 8 +++----- content/commands.js | 2 +- content/events.js | 7 ++++--- content/find.js | 6 +++--- content/hints.js | 8 +++++--- content/io.js | 6 +++--- content/liberator.js | 8 ++++---- content/options.js | 14 +++++++------- content/style.js | 8 ++++---- content/util.js | 8 ++++---- locale/en-US/map.txt | 2 +- 12 files changed, 41 insertions(+), 40 deletions(-) diff --git a/content/bookmarks.js b/content/bookmarks.js index d08ce869..cd49eb92 100644 --- a/content/bookmarks.js +++ b/content/bookmarks.js @@ -200,7 +200,7 @@ function Bookmarks() //{{{ if (event == "add") autocommands.trigger("BookmarkAdd", arg); statusline.updateUrl(); - } + }; var cache = storage.newObject("bookmark-cache", Cache, false); storage.addObserver("bookmark-cache", bookmarkObserver); @@ -835,7 +835,7 @@ function History() //{{{ { url: item[0], title: item[1], - icon: bookmarks.getFavicon(item[0]), + icon: bookmarks.getFavicon(item[0]) } for each ([i, item] in Iterator(items)) if (i < 1000))); commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE); } diff --git a/content/buffer.js b/content/buffer.js index c01d8c65..13171c7d 100644 --- a/content/buffer.js +++ b/content/buffer.js @@ -1083,12 +1083,11 @@ function Buffer() //{{{ elem.focus(); var evt = doc.createEvent("MouseEvents"); - ["mousedown", "mouseup", "click"].forEach(function (event) - { + ["mousedown", "mouseup", "click"].forEach(function (event) { evt.initMouseEvent(event, true, true, view, 1, offsetX, offsetY, 0, 0, ctrlKey, /*altKey*/0, shiftKey, /*metaKey*/ ctrlKey, 0, null); elem.dispatchEvent(evt); - }) + }); }, get selectionController() getBrowser().docShell @@ -1289,8 +1288,7 @@ function Buffer() //{{{ } let option = options["pageinfo"]; - let list = template.map(option, function (option) - { + let list = template.map(option, function (option) { let opt = pageInfo[option]; if (opt) return template.table(opt[1], opt[0](true)); diff --git a/content/commands.js b/content/commands.js index 24de812e..f57a1b6f 100644 --- a/content/commands.js +++ b/content/commands.js @@ -216,7 +216,7 @@ function Commands() //{{{ ["int", parseInt], ["float", parseFloat], ["list", function (arg) arg && arg.split(/\s*,\s*/)] - ].map(function (x) x && ArgType.apply(null, x));; + ].map(function (x) x && ArgType.apply(null, x)); /////////////////////////////////////////////////////////////////////////////}}} ////////////////////// PUBLIC SECTION ////////////////////////////////////////// diff --git a/content/events.js b/content/events.js index 8c8dc07a..9555c66b 100644 --- a/content/events.js +++ b/content/events.js @@ -465,7 +465,8 @@ function Events() //{{{ let args = { url: doc.location.href, title: doc.title - } + }; + if (liberator.has("tabs")) args.tab = tabs.getContentIndex(doc) + 1; @@ -559,7 +560,7 @@ function Events() //{{{ if (Components.utils.reportError) Components.utils.reportError(e); } - } + }; } // return true when load successful, or false otherwise @@ -1348,7 +1349,7 @@ function Events() //{{{ } // others are left to generate the 'input' event or handled by firefox - return ; + return; } } diff --git a/content/find.js b/content/find.js index b7acd8a7..f2264bb3 100644 --- a/content/find.js +++ b/content/find.js @@ -165,7 +165,7 @@ function Search() //{{{ return range; } return null; - } + }; var start = new Point(win.pageXOffset, win.pageYOffset); let selection = sel.getSelection(sel.SELECTION_NORMAL); @@ -226,14 +226,14 @@ function Search() //{{{ sel.scrollSelectionIntoView(sel.SELECTION_NORMAL, 0, false); lastRange = range.cloneRange(); return range; - } + }; this.cancel = function () { selection.removeAllRanges(); selection.addRange(startRange); win.scrollTo(start.x, start.y); - } + }; } /* Stolen from toolkit.jar in Firefox, for the time being. The private diff --git a/content/hints.js b/content/hints.js index 1adf5f10..90674075 100644 --- a/content/hints.js +++ b/content/hints.js @@ -336,7 +336,9 @@ function Hints() //{{{ return false; } else if (validHints.length > 1) + { return false; + } } var timeout = followFirst || events.feedingKeys ? 0 : 500; @@ -598,15 +600,15 @@ function Hints() //{{{ mappings.add(myModes, ["f"], "Start QuickHint mode", - function () { hints.show("o") }); + function () { hints.show("o"); }); mappings.add(myModes, ["F"], "Start QuickHint mode, but open link in a new tab", - function () { hints.show("t") }); + function () { hints.show("t"); }); mappings.add(myModes, [";"], "Start an extended hint mode", - function (arg) { hints.show(arg) }, + function (arg) { hints.show(arg); }, { flags: Mappings.flags.ARGUMENT }); /////////////////////////////////////////////////////////////////////////////}}} diff --git a/content/io.js b/content/io.js index a5d7a0df..2a710382 100644 --- a/content/io.js +++ b/content/io.js @@ -323,7 +323,7 @@ function IO() //{{{ function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", lastRunCommand) ); - lastRunCommand = args + lastRunCommand = args; let output = io.system(args); let command = ":" + util.escapeHTML(commandline.getCommand()) + "
"; @@ -743,7 +743,7 @@ lookup: if (!found) liberator.echomsg("not found in 'runtimepath': \"" + paths.join(" ") + "\"", 1); // FIXME: should use original arg string - + return found; }, @@ -787,7 +787,7 @@ lookup: .getService(Components.interfaces.mozIJSSubScriptLoader); try { - loader.loadSubScript(uri.spec, modules) + loader.loadSubScript(uri.spec, modules); } catch (e) { diff --git a/content/liberator.js b/content/liberator.js index 035673fe..bd39828b 100644 --- a/content/liberator.js +++ b/content/liberator.js @@ -74,7 +74,7 @@ const liberator = (function () //{{{ const tabopts = [ ["n", "Tab number", null, ".hl-TabNumber"], - ["N", "Tab number over icon", null, ".hl-TabIconNumber"], + ["N", "Tab number over icon", null, ".hl-TabIconNumber"] ]; options.add(["guioptions", "go"], "Show or hide certain GUI elements like the menu or toolbar", @@ -141,7 +141,7 @@ const liberator = (function () //{{{ return value; } }); - }) + }); registerObserver("load_mappings", function () { @@ -159,7 +159,7 @@ const liberator = (function () //{{{ mappings.add([modes.NORMAL], ["ZZ"], "Quit and save the session", function () { liberator.quit(true); }); - }) + }); registerObserver("load_commands", function () { @@ -530,7 +530,7 @@ const liberator = (function () //{{{ argCount: "0", bang: true }); - }) + }); // initially hide all GUI, it is later restored unless the user has :set go= or something // similar in his config diff --git a/content/options.js b/content/options.js index a32779e0..dadc6b85 100644 --- a/content/options.js +++ b/content/options.js @@ -171,13 +171,13 @@ function Options() //{{{ // Trigger any setters. let opt = options.get(option); if (event == "change" && opt) - opt.set(opt.value, options.OPTION_SCOPE_GLOBAL) + opt.set(opt.value, options.OPTION_SCOPE_GLOBAL); } storage.newMap("options", false); storage.addObserver("options", optionObserver); liberator.registerObserver("shutdown", function () { - storage.removeObserver("options", optionObserver) + storage.removeObserver("options", optionObserver); }); function storePreference(name, value) @@ -440,8 +440,8 @@ function Options() //{{{ ret.prefix = prefix; ret.postfix = postfix; - ret.all = (ret.name == "all") - ret.get = (ret.all || postfix == "?" || (ret.option && ret.option.type != "boolean" && !valueGiven)) + ret.all = (ret.name == "all"); + ret.get = (ret.all || postfix == "?" || (ret.option && ret.option.type != "boolean" && !valueGiven)); ret.invert = (prefix == "inv" || postfix == "!"); ret.reset = (postfix == "&"); ret.unsetBoolean = (prefix == "no"); @@ -761,7 +761,7 @@ function Options() //{{{ switch (option.type) { case "boolean": - completer = function () [["true", ""], ["false", ""]] + completer = function () [["true", ""], ["false", ""]]; break; case "stringlist": len = opt.valueHas.pop().length; @@ -930,7 +930,7 @@ function Options() //{{{ } yield option; } - } + }; let list = template.options("Options", opts()); commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE); @@ -964,7 +964,7 @@ function Options() //{{{ yield option; } - } + }; let list = template.options(config.hostApplication + " Options", prefs()); commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE); diff --git a/content/style.js b/content/style.js index 39be9a40..743162d8 100644 --- a/content/style.js +++ b/content/style.js @@ -31,11 +31,11 @@ function Highlights(name, store, serial) CompItem[selected] background: yellow; CompItem>* padding: 0 .5ex; CompIcon width: 16px; min-width: 16px; - CompIcon>img max-width: 16px; max-height: 16px; vertical-align: middle; - CompResult width: 45%; overflow: hidden; - CompDesc color: gray; + CompIcon>img max-width: 16px; max-height: 16px; vertical-align: middle; + CompResult width: 45%; overflow: hidden; + CompDesc color: gray; - Indicator color: blue; + Indicator color: blue; Filter font-weight: bold; Keyword color: red; diff --git a/content/util.js b/content/util.js index e040c42c..89548b32 100644 --- a/content/util.js +++ b/content/util.js @@ -96,7 +96,7 @@ const util = { //{{{ { this.doneAt = Date.now() + minInterval; } - } + }; this.tell = function (arg) { if (arg !== undefined) @@ -115,17 +115,17 @@ const util = { //{{{ this.latest = now + maxInterval; timer.initWithCallback(this, Math.max(timeout, 0), timer.TYPE_ONE_SHOT); this.doneAt = -1; - } + }; this.reset = function () { timer.cancel(); this.doneAt = 0; - } + }; this.flush = function () { if (this.latest) this.notify(); - } + }; }, ciCompare: function (a, b) diff --git a/locale/en-US/map.txt b/locale/en-US/map.txt index e010c32f..1c80fa2e 100644 --- a/locale/en-US/map.txt +++ b/locale/en-US/map.txt @@ -316,7 +316,7 @@ The valid escape sequences are: -------------------------------------------------------------------------------- "q-" can be prefixed to the escape sequence so that the value is quoted, making -it suitable for expression evaluation. Example: +it suitable for expression evaluation. Example: ________________________________________________________________________________