diff --git a/common/content/style.js b/common/content/style.js index 6bdcf232..6388aadd 100644 --- a/common/content/style.js +++ b/common/content/style.js @@ -135,9 +135,9 @@ Highlights.prototype.CSS = 0) { commandline.echo("Removed bookmark: " + url, commandline.HL_NORMAL, commandline.FORCE_SINGLELINE); } else { - var title = buffer.title || url; - var extra = ""; + let title = buffer.title || url; + let extra = ""; if (title != url) extra = " (" + title + ")"; this.add(true, title, url); @@ -486,7 +486,7 @@ function Bookmarks() //{{{ { try { - var uri = util.newURI(url); + let uri = util.newURI(url); return (bookmarksService.getBookmarkedURIFor(uri) != null); } catch (e) @@ -501,12 +501,12 @@ function Bookmarks() //{{{ if (!url) return 0; - var i = 0; + let i = 0; try { - var uri = util.newURI(url); + let uri = util.newURI(url); var count = {}; - var bmarks = bookmarksService.getBookmarkIdsForURI(uri, count); + let bmarks = bookmarksService.getBookmarkIdsForURI(uri, count); for (; i < bmarks.length; i++) bookmarksService.removeItem(bmarks[i]); @@ -529,18 +529,18 @@ function Bookmarks() //{{{ // also ensures that each search engine has a Vimperator-friendly alias getSearchEngines: function getSearchEngines() { - var searchEngines = []; - var firefoxEngines = searchService.getVisibleEngines({}); + let searchEngines = []; + let firefoxEngines = searchService.getVisibleEngines({}); for (let [,engine] in Iterator(firefoxEngines)) { - var alias = engine.alias; + let alias = engine.alias; if (!alias || !/^[a-z0-9_-]+$/.test(alias)) alias = engine.name.replace(/^\W*([a-zA-Z_-]+).*/, "$1").toLowerCase(); if (!alias) alias = "search"; // for search engines which we can't find a suitable alias // make sure we can use search engines which would have the same alias (add numbers at the end) - var newAlias = alias; + let newAlias = alias; for (let j = 1; j <= 10; j++) // <=10 is intentional { if (!searchEngines.some(function (item) item[0] == newAlias)) @@ -603,9 +603,9 @@ function Bookmarks() //{{{ // if the search also requires a postData, [url, postData] is returned getSearchURL: function getSearchURL(text, useDefsearch) { - var url = null; - var aPostDataRef = {}; - var searchString = (useDefsearch ? options["defsearch"] + " " : "") + text; + let url = null; + let aPostDataRef = {}; + let searchString = (useDefsearch ? options["defsearch"] + " " : "") + text; // we need to make sure our custom alias have been set, even if the user // did not :open once before @@ -702,7 +702,7 @@ function History() //{{{ { if (args) { - var sh = window.getWebNavigation().sessionHistory; + let sh = window.getWebNavigation().sessionHistory; for (let i = sh.index - 1; i >= 0; i--) { if (sh.getEntryAtIndex(i, false).URI.spec == args) @@ -748,7 +748,7 @@ function History() //{{{ { if (args) { - var sh = window.getWebNavigation().sessionHistory; + let sh = window.getWebNavigation().sessionHistory; for (let i in util.range(sh.index + 1, sh.count)) { if (sh.getEntryAtIndex(i, false).URI.spec == args) @@ -961,7 +961,7 @@ function QuickMarks() //{{{ "Mark a URL with a letter for quick access", function (args) { - var matches = args.string.match(/^([a-zA-Z0-9])(?:\s+(.+))?$/); + let matches = args.string.match(/^([a-zA-Z0-9])(?:\s+(.+))?$/); if (!matches) liberator.echoerr("E488: Trailing characters"); else if (!matches[2]) @@ -984,7 +984,7 @@ function QuickMarks() //{{{ return; } - var filter = args.replace(/[^a-zA-Z0-9]/g, ""); + let filter = args.replace(/[^a-zA-Z0-9]/g, ""); quickmarks.list(filter); }); @@ -1002,7 +1002,7 @@ function QuickMarks() //{{{ remove: function remove(filter) { - var pattern = RegExp("[" + filter.replace(/\s+/g, "") + "]"); + let pattern = RegExp("[" + filter.replace(/\s+/g, "") + "]"); for (let [qmark,] in qmarks) { @@ -1018,7 +1018,7 @@ function QuickMarks() //{{{ jumpTo: function jumpTo(qmark, where) { - var url = qmarks.get(qmark); + let url = qmarks.get(qmark); if (url) liberator.open(url, where); @@ -1028,11 +1028,11 @@ function QuickMarks() //{{{ list: function list(filter) { - var marks = [key for ([key, val] in qmarks)]; + let marks = [key for ([key, val] in qmarks)]; // This was a lot nicer without the lambda... - var lowercaseMarks = marks.filter(function (x) /[a-z]/.test(x)).sort(); - var uppercaseMarks = marks.filter(function (x) /[A-Z]/.test(x)).sort(); - var numberMarks = marks.filter(function (x) /[0-9]/.test(x)).sort(); + let lowercaseMarks = marks.filter(function (x) /[a-z]/.test(x)).sort(); + let uppercaseMarks = marks.filter(function (x) /[A-Z]/.test(x)).sort(); + let numberMarks = marks.filter(function (x) /[0-9]/.test(x)).sort(); marks = Array.concat(lowercaseMarks, uppercaseMarks, numberMarks);