From d8741b51406ce3ac5fd0af80b994f4fc94cbab82 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Thu, 18 Sep 2008 14:10:02 +0000 Subject: [PATCH] *** empty log message *** --- content/liberator.js | 4 +++- content/ui.js | 17 +++-------------- content/util.js | 14 +++++++++----- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/content/liberator.js b/content/liberator.js index 2f0718ea..290d4cd1 100644 --- a/content/liberator.js +++ b/content/liberator.js @@ -1080,7 +1080,9 @@ const liberator = (function () //{{{ { var files = liberator.io.readDirectory(pluginDir.path); liberator.log("Sourcing plugin directory...", 3); - files.sort(function (a, b) String(a.path).localeCompare(b.path)).forEach(function (file) { + files.sort(function (a, b) String.localeCompare(a.path, b.path)) + .forEach(function (file) + { if (!file.isDirectory() && /\.(js|vimp)$/i.test(file.path)) liberator.io.source(file.path, false); }); diff --git a/content/ui.js b/content/ui.js index e84be4a1..c5fd74b4 100644 --- a/content/ui.js +++ b/content/ui.js @@ -707,16 +707,7 @@ liberator.CommandLine = function () //{{{ // sort the completion list if (/\bsort\b/.test(liberator.options["wildoptions"])) - { - completions.sort(function (a, b) { - if (a[0] < b[0]) - return -1; - else if (a[0] > b[0]) - return 1; - else - return 0; - }); - } + completions.sort(function (a, b) String.localeCompare(a[0], b[0])); if (hasList) completionList.setItems(completions, -1); @@ -1312,7 +1303,7 @@ liberator.ItemList = function (id) //{{{ clear: function () { this.setItems([]); doc.body.innerHTML = ""; }, hide: function () { container.collapsed = true; }, - show: function () { container.collapsed = false; }, + show: function () { container.collapsed = false; this.selectItem(0); /* fixme? */ }, visible: function () { return !container.collapsed; }, setItems: function (items, selectedItem) @@ -1478,9 +1469,7 @@ liberator.StatusLine = function () //{{{ } else { - var matches = url.match(/^chrome:\/\/vimperator\/locale\/(\S+)$/); - if (matches && matches[1]) - url = matches[1] + " [Help]"; + url = url.replace(new RegExp("^chrome://" + liberator.config.name.toLowerCase() + "/locale/(\\S+)\\.html$"), "$1 [Help]"); } // when session information is available, add [+] when we can go backwards diff --git a/content/util.js b/content/util.js index 96b1649a..42fcf195 100644 --- a/content/util.js +++ b/content/util.js @@ -287,14 +287,18 @@ liberator.util = { //{{{ { var urls = str.split(new RegExp("\s*" + liberator.options["urlseparator"] + "\s*")); - begin: for (let url = 0; url < urls.length; url++) + for (let url = 0; url < urls.length; url++) { - var file = liberator.io.getFile(urls[url]); - if (file.exists() && file.isReadable()) + try { - urls[url] = file.path; - continue; + var file = liberator.io.getFile(urls[url]); + if (file.exists() && file.isReadable()) + { + urls[url] = file.path; + continue; + } } + catch (e) {} // strip each 'URL' - makes things simpler later on urls[url] = urls[url].replace(/^\s+/, "").replace(/\s+$/, "");