diff --git a/content/bookmarks.js b/content/bookmarks.js index 1c6e4991..7c2daf51 100644 --- a/content/bookmarks.js +++ b/content/bookmarks.js @@ -222,7 +222,7 @@ function Bookmarks() //{{{ { // Forces a load, if not already loaded but wait 10sec // so most tabs should be restored and the CPU should be idle again usually - setTimeout(function() { liberator.callFunctionInThread(null, function () cache.load()); }, 10000); + setTimeout(function () { liberator.callFunctionInThread(null, function () cache.load()); }, 10000); } }); diff --git a/content/commands.js b/content/commands.js index d61a8d52..f2619b24 100644 --- a/content/commands.js +++ b/content/commands.js @@ -850,7 +850,7 @@ function Commands() //{{{ // Yeah, this is a bit scary. Perhaps I'll fix it when I'm // awake. options: util.Array.assocToObj( - util.map({argCount: "-nargs", bang: "-bang", count: "-count"}, + util.map({ argCount: "-nargs", bang: "-bang", count: "-count" }, function ([k, v]) k in cmd && cmd[k] != "0" && [v, typeof cmd[k] == "boolean" ? null : cmd[k]]) .filter(util.identity)), arguments: [cmd.name], diff --git a/content/completion.js b/content/completion.js index bda63896..684edbce 100644 --- a/content/completion.js +++ b/content/completion.js @@ -183,7 +183,7 @@ CompletionContext.prototype = { set filterFunc(val) this._filterFunc = val, get filter() this._filter != null ? this._filter : this.value.substr(this.offset, this.caret), - set filter(val) + set filter(val) { delete this._ignoreCase; return this._filter = val @@ -270,7 +270,7 @@ CompletionContext.prototype = { let self = this; delete this._substrings; - let filtered = this.filterFunc(items.map(function (item) ({ text: self.getKey({item: item}, "text"), item: item }))); + let filtered = this.filterFunc(items.map(function (item) ({ text: self.getKey({ item: item }, "text"), item: item }))); let quote = this.quote; if (quote) @@ -846,7 +846,7 @@ function Completion() //{{{ context.process = [null, function highlight(item, v) template.highlight(v, true)]; if (!context.anchored) context.filters.push(function (item) util.compareIgnoreCase(item.text.substr(0, key.length), key)); - context.compare = function ({item: {key: a}}, {item: {key: b}}) + context.compare = function ({ item: { key: a } }, { item: { key: b } }) { if (!isNaN(a) && !isNaN(b)) return a - b; @@ -857,10 +857,12 @@ function Completion() //{{{ let filter = key + (string || ""); for (let [,obj] in Iterator(objects)) { - try { - this.context.fork(obj[1], top[OFFSET], this, fill, - obj[0], obj[1], compl, compl != orig, filter, last, key.length); - } catch(e) { liberator.reportError(e) } + try + { + this.context.fork(obj[1], top[OFFSET], this, fill, + obj[0], obj[1], compl, compl != orig, filter, last, key.length); + } + catch (e) { liberator.reportError(e) } } if (orig) return; @@ -1031,7 +1033,7 @@ function Completion() //{{{ }, // discard all entries in the 'urls' array, which don't match 'filter - // urls must be of type [{url: "..", title: "..", tags: [...], keyword: ".."}, ...] + // urls must be of type [{ url: "..", title: "..", tags: [...], keyword: ".." }, ...] filterURLArray: function filterURLArray(urls, filter, filterTags) { var filtered = []; @@ -1141,7 +1143,7 @@ function Completion() //{{{ context.completions = bookmarks.get(context.filter) context.filters = []; if (tags) - context.filters.push(function ({item: item}) tags.every(function (tag) item.tags.indexOf(tag) > -1)); + context.filters.push(function ({ item: item }) tags.every(function (tag) item.tags.indexOf(tag) > -1)); }, buffer: function buffer(context) @@ -1379,7 +1381,7 @@ function Completion() //{{{ context.keys = { text: "names", description: "description" }; context.completions = options; if (scope) - context.filters.push(function ({item: opt}) opt.scope & scope); + context.filters.push(function ({ item: opt }) opt.scope & scope); }, optionValue: function (context, name, op, curValue) @@ -1494,7 +1496,7 @@ function Completion() //{{{ let engine = ss.getEngineByAlias(name); if (!engine) return; - let [, word] = /^\s*(\S+)/.exec(context.filter) || []; + let [,word] = /^\s*(\S+)/.exec(context.filter) || []; if (!kludge && word == name) // FIXME: Check for matching keywords return; let ctxt = context.fork(name, 0); diff --git a/content/hints.js b/content/hints.js index 99896d03..9af0aef8 100644 --- a/content/hints.js +++ b/content/hints.js @@ -333,7 +333,7 @@ function Hints() //{{{ if ((options["followhints"] == 2) && validHints.length > 1 && !hintNumber) return liberator.beep(); } - + if (!followFirst) { var firstHref = validHints[0].getAttribute("href") || null; diff --git a/content/mail.js b/content/mail.js index 44ae50a9..7ea0fcc0 100644 --- a/content/mail.js +++ b/content/mail.js @@ -92,7 +92,7 @@ function Mail() //{{{ function getFolderCompletions(filter) { let folders = mail.getFolders(filter); - context.completions = folders.map(function (folder) + context.completions = folders.map(function (folder) [folder.server.prettyName + ": " + folder.name, "Unread: " + folder.getNumUnread(false)]); } diff --git a/content/mappings.js b/content/mappings.js index 5f9aeaaf..145902ef 100644 --- a/content/mappings.js +++ b/content/mappings.js @@ -195,7 +195,7 @@ function Mappings() //{{{ return [ { command: this.name, - options: map.silent ? {"": null} : {}, + options: map.silent ? { "": null } : {}, arguments: [map.names[0]], literalArg: map.rhs } diff --git a/content/modes.js b/content/modes.js index 96b3a2a8..535f1cfa 100644 --- a/content/modes.js +++ b/content/modes.js @@ -123,7 +123,7 @@ const modes = (function () //{{{ let focus = document.commandDispatcher.focusedElement; if (focus != document.getElementById("urlbar").inputField) liberator.focusContent(false); - }, 100); + }, 100); } } diff --git a/content/options.js b/content/options.js index eb335e3f..6b672ab0 100644 --- a/content/options.js +++ b/content/options.js @@ -83,7 +83,7 @@ Option.prototype = { return Array.slice(value); return value; }, - + joinValues: function (values) { if (this.type == "stringlist") @@ -689,7 +689,7 @@ function Options() //{{{ if (context.filter.indexOf("=") == -1) { if (prefix) - context.filters.push(function ({item: opt}) opt.type == "boolean" || prefix == "inv" && opt.values instanceof Array); + context.filters.push(function ({ item: opt }) opt.type == "boolean" || prefix == "inv" && opt.values instanceof Array); return completion.option(context, opt.scope); } else if (prefix == "no") diff --git a/content/style.js b/content/style.js index 6f87a974..47772f43 100644 --- a/content/style.js +++ b/content/style.js @@ -395,9 +395,11 @@ let (array = util.Array) } const styles = storage.newObject("styles", Styles, false); -try { -const highlight = storage.newObject("highlight", Highlights, false); -} catch(e) { liberator.reportError(e) } +try +{ + const highlight = storage.newObject("highlight", Highlights, false); +} +catch (e) { liberator.reportError(e) } liberator.registerObserver("load_commands", function () { @@ -481,7 +483,7 @@ liberator.registerObserver("load_commands", function () { command: this.name, bang: true, - options: sty.name ? {"-name": sty.name} : {}, + options: sty.name ? { "-name": sty.name } : {}, arguments: [sty.sites.join(",")], literalArg: sty.css } for ([k, sty] in styles.userSheets) diff --git a/content/util.js b/content/util.js index 18273661..4ca214d2 100644 --- a/content/util.js +++ b/content/util.js @@ -33,7 +33,7 @@ default xml namespace = XHTML; const util = { //{{{ Array: { - // [["a", "b"], ["c", "d"]] -> {a: "b", c: "d"} + // [["a", "b"], ["c", "d"]] -> { a: "b", c: "d" } // From Common Lisp, more or less assocToObj: function assocToObj(assoc) { @@ -64,7 +64,7 @@ const util = { //{{{ let ret = []; if (unsorted) { - for (let [, item] in Iterator(ary)) + for (let [,item] in Iterator(ary)) if (ret.indexOf(item) == -1) ret.push(item); } @@ -352,7 +352,7 @@ const util = { //{{{ catch (e) {} if (!hasValue) { - if(i instanceof Array && i.length == 2) + if (i instanceof Array && i.length == 2) [i, value] = i; else var noVal = true;