diff --git a/common/content/buffer.js b/common/content/buffer.js index e203c58d..282472c9 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -712,8 +712,7 @@ function Buffer() //{{{ ////////////////////// PAGE INFO /////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ - addPageInfoSection("f", "Feeds", function (verbose) - { + addPageInfoSection("f", "Feeds", function (verbose) { let doc = window.content.document; const feedTypes = { @@ -789,8 +788,7 @@ function Buffer() //{{{ yield nFeed + " feed" + (nFeed > 1 ? "s" : ""); }); - addPageInfoSection("g", "General Info", function (verbose) - { + addPageInfoSection("g", "General Info", function (verbose) { let doc = window.content.document; // get file size @@ -850,8 +848,7 @@ function Buffer() //{{{ yield ["Last Modified", lastModVerbose]; }); - addPageInfoSection("m", "Meta Tags", function (verbose) - { + addPageInfoSection("m", "Meta Tags", function (verbose) { // get meta tag data, sort and put into pageMeta[] let metaNodes = window.content.document.getElementsByTagName("meta"); diff --git a/common/content/commands.js b/common/content/commands.js index 8c7a1f92..f2505d4b 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -392,8 +392,7 @@ function Commands() //{{{ ////////////////////// PUBLIC SECTION ////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ - liberator.registerObserver("load_completion", function () - { + liberator.registerObserver("load_completion", function () { completion.setFunctionCompleter(commands.get, [function () ([c.name, c.description] for (c in commands))]); }); @@ -945,8 +944,7 @@ function Commands() //{{{ */ replaceTokens: function replaceTokens(str, tokens) { - return str.replace(/<((?:q-)?)([a-zA-Z]+)?>/g, function (match, quote, token) - { + return str.replace(/<((?:q-)?)([a-zA-Z]+)?>/g, function (match, quote, token) { if (token == "lt") // Don't quote, as in Vim (but, why so in Vim? You'd think people wouldn't say if they didn't want it) return "<"; let res = tokens[token]; @@ -963,8 +961,7 @@ function Commands() //{{{ ////////////////////// MAPPINGS //////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ - liberator.registerObserver("load_mappings", function () - { + liberator.registerObserver("load_mappings", function () { mappings.add(config.browserModes, ["@:"], "Repeat the last Ex command", function (count) diff --git a/common/content/events.js b/common/content/events.js index ff201923..72605830 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -164,8 +164,7 @@ function AutoCommands() //{{{ ////////////////////// PUBLIC SECTION ////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ - liberator.registerObserver("load_completion", function () - { + liberator.registerObserver("load_completion", function () { completion.setFunctionCompleter(autocommands.get, [function () config.autocommands]); }); @@ -343,20 +342,16 @@ function Events() //{{{ let tabcontainer = getBrowser().mTabContainer; if (tabcontainer) // not every VIM-like extension has a tab container { - tabcontainer.addEventListener("TabMove", function (event) - { + tabcontainer.addEventListener("TabMove", function (event) { statusline.updateTabCount(); }, false); - tabcontainer.addEventListener("TabOpen", function (event) - { + tabcontainer.addEventListener("TabOpen", function (event) { statusline.updateTabCount(); }, false); - tabcontainer.addEventListener("TabClose", function (event) - { + tabcontainer.addEventListener("TabClose", function (event) { statusline.updateTabCount(); }, false); - tabcontainer.addEventListener("TabSelect", function (event) - { + tabcontainer.addEventListener("TabSelect", function (event) { // TODO: is all of that necessary? modes.reset(); statusline.updateTabCount(); @@ -374,16 +369,14 @@ function Events() //{{{ getBrowser().addEventListener("load", onPageLoad, true); // called when the active document is scrolled - getBrowser().addEventListener("scroll", function (event) - { + getBrowser().addEventListener("scroll", function (event) { statusline.updateBufferPosition(); modes.show(); }, null); } catch (e) {} -// getBrowser().addEventListener("submit", function (event) -// { +// getBrowser().addEventListener("submit", function (event) { // // reset buffer loading state as early as possible, important for macros // buffer.loaded = 0; // }, null); @@ -420,8 +413,7 @@ function Events() //{{{ window.addEventListener("DOMMenuBarInactive", exitMenuMode, true); window.addEventListener("resize", onResize, true); - // window.document.addEventListener("DOMTitleChanged", function (event) - // { + // window.document.addEventListener("DOMTitleChanged", function (event) { // liberator.log("titlechanged"); // }, null); @@ -564,8 +556,7 @@ function Events() //{{{ function wrapListener(method) { - return function (event) - { + return function (event) { try { self[method](event); diff --git a/common/content/hints.js b/common/content/hints.js index 8922a97e..1a0a4c5d 100644 --- a/common/content/hints.js +++ b/common/content/hints.js @@ -612,8 +612,7 @@ function Hints() //{{{ function containsMatcher(hintString) //{{{ { let tokens = tokenize(/\s+/, hintString); - return function (linkText) - { + return function (linkText) { linkText = linkText.toLowerCase(); return tokens.every(function (token) linkText.indexOf(token) >= 0); }; @@ -737,8 +736,7 @@ function Hints() //{{{ return true; } - return function (linkText) - { + return function (linkText) { if (hintStrings.length == 1 && hintStrings[0].length == 0) return true; diff --git a/common/content/io.js b/common/content/io.js index 5101a886..7101ed20 100644 --- a/common/content/io.js +++ b/common/content/io.js @@ -389,8 +389,7 @@ function IO() //{{{ ////////////////////// PUBLIC SECTION ////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ - liberator.registerObserver("load_completion", function () - { + liberator.registerObserver("load_completion", function () { completion.setFunctionCompleter([self.getFile, self.expandPath], [function (context, obj, args) { context.quote[2] = ""; diff --git a/common/content/liberator.js b/common/content/liberator.js index 21eeff96..1efbd785 100644 --- a/common/content/liberator.js +++ b/common/content/liberator.js @@ -88,8 +88,8 @@ const liberator = (function () //{{{ } // Only general options are added here, which are valid for all Vimperator like extensions - registerObserver("load_options", function () - { + registerObserver("load_options", function () { + options.add(["errorbells", "eb"], "Ring the bell when an error message is displayed", "boolean", false); @@ -191,8 +191,8 @@ const liberator = (function () //{{{ }); }); - registerObserver("load_mappings", function () - { + registerObserver("load_mappings", function () { + mappings.add(modes.all, [""], "Open help window", function () { liberator.help(); }); @@ -237,8 +237,8 @@ const liberator = (function () //{{{ return items; } - registerObserver("load_commands", function () - { + registerObserver("load_commands", function () { + commands.add(["addo[ns]"], "Manage available Extensions and Themes", function () diff --git a/common/content/mappings.js b/common/content/mappings.js index 016bc5c8..4ca30275 100644 --- a/common/content/mappings.js +++ b/common/content/mappings.js @@ -301,8 +301,7 @@ function Mappings() //{{{ ////////////////////// PUBLIC SECTION ////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ - liberator.registerObserver("load_completion", function () - { + liberator.registerObserver("load_completion", function () { completion.setFunctionCompleter(mappings.get, [ null, diff --git a/common/content/options.js b/common/content/options.js index 3c93c34b..35b9ad36 100644 --- a/common/content/options.js +++ b/common/content/options.js @@ -724,10 +724,8 @@ function Options() //{{{ if (!/keypress/.test(popupAllowedEvents)) { storePreference("dom.popup_allowed_events", popupAllowedEvents + " keypress"); - liberator.registerObserver("shutdown", function () - { - if (loadPreference("dom.popup_allowed_events", "") - == popupAllowedEvents + " keypress") + liberator.registerObserver("shutdown", function () { + if (loadPreference("dom.popup_allowed_events", "") == popupAllowedEvents + " keypress") storePreference("dom.popup_allowed_events", popupAllowedEvents); }); } @@ -919,8 +917,7 @@ function Options() //{{{ /////////////////////////////////////////////////////////////////////////////{{{ // TODO: Does this belong elsewhere? - liberator.registerObserver("load_completion", function () - { + liberator.registerObserver("load_completion", function () { completion.setFunctionCompleter(options.get, [function () ([o.name, o.description] for (o in options))]); completion.setFunctionCompleter([options.getPref, options.safeSetPref, options.setPref, options.resetPref, options.invertPref], [function () services.get("pref") diff --git a/common/content/style.js b/common/content/style.js index 832556f1..9be43eeb 100644 --- a/common/content/style.js +++ b/common/content/style.js @@ -534,8 +534,7 @@ if (highlight.CSS != Highlights.prototype.CSS) liberator.triggerObserver("load_styles", "styles"); liberator.triggerObserver("load_highlight", "highlight"); -liberator.registerObserver("load_completion", function () -{ +liberator.registerObserver("load_completion", function () { completion.setFunctionCompleter(["get", "addSheet", "removeSheet", "findSheets"].map(function (m) styles[m]), [ // Prototype: (system, name, filter, css, index) null, @@ -546,8 +545,8 @@ liberator.registerObserver("load_completion", function () ]); }); -liberator.registerObserver("load_commands", function () -{ +liberator.registerObserver("load_commands", function () { + commands.add(["colo[rscheme]"], "Load a color scheme", function (args) diff --git a/common/content/tabs.js b/common/content/tabs.js index 1e4b985d..fe61165a 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -43,8 +43,7 @@ function Tabs() //{{{ var getBrowser = (function () { if (config.hostApplication == "Thunderbird") { - return function () - { + return function () { if (!tabmail) { tabmail = document.getElementById("tabmail"); diff --git a/common/content/util.js b/common/content/util.js index 466afb35..fc3e2b22 100644 --- a/common/content/util.js +++ b/common/content/util.js @@ -200,8 +200,7 @@ const util = { //{{{ while (cont) { cont = false; - str = str.replace(resep, function (match, before) - { + str = str.replace(resep, function (match, before) { results.push(before); cont = true; return ""; diff --git a/muttator/content/config.js b/muttator/content/config.js index 278c5eb4..bb466aad 100644 --- a/muttator/content/config.js +++ b/muttator/content/config.js @@ -225,8 +225,7 @@ const config = { //{{{ }; // XXX: Hack! - window.document.addEventListener("load", function () - { + window.document.addEventListener("load", function () { if (window.messageWasEditedExternally === undefined) { window.messageWasEditedExternally = false; @@ -234,8 +233,7 @@ const config = { //{{{ } }, true); - window.addEventListener("compose-window-close", function () - { + window.addEventListener("compose-window-close", function () { window.messageWasEditedExternally = false; }, true);