From b85b546696ad72823147a09a8ad17e2d9d0e15cc Mon Sep 17 00:00:00 2001 From: anekos Date: Thu, 19 Nov 2009 06:09:07 +0900 Subject: [PATCH 01/11] Add a NEWS entry about the new values of 'activate' option. --- vimperator/NEWS | 1 + xulmus/NEWS | 1 + 2 files changed, 2 insertions(+) mode change 100644 => 100755 vimperator/NEWS mode change 100644 => 100755 xulmus/NEWS diff --git a/vimperator/NEWS b/vimperator/NEWS old mode 100644 new mode 100755 index f55c9bf3..15e3732b --- a/vimperator/NEWS +++ b/vimperator/NEWS @@ -6,6 +6,7 @@ * the help system is newly modularized * remove [c]:edit[c], [c]:tabedit[c], and [c]:winedit[c] * add 'jsdebugger' option - switch on/off javascript debugger service + * add "addons", "downloads", "extoptions" and "help" to the 'activate' option. 2009-10-28: * version 2.2 diff --git a/xulmus/NEWS b/xulmus/NEWS old mode 100644 new mode 100755 index 9cf07cce..a50e9b8e --- a/xulmus/NEWS +++ b/xulmus/NEWS @@ -13,6 +13,7 @@ * rename [c]:filter[c] to [c]:queue[c] and [c]:Filter[c] to [c]:filter[c] * add 'repeat' and 'shuffle' * add 'jsdebugger' option - switch on/off javascript debugger service + * add "addons", "downloads", "extoptions" and "help" to the 'activate' option. 2009-03-28: * version 0.1 From 550f088bad20370841ef790f2b3759dec82d90a0 Mon Sep 17 00:00:00 2001 From: teramako Date: Thu, 19 Nov 2009 21:16:40 +0900 Subject: [PATCH 02/11] Update maxVersion to 3.6b3 --- vimperator/install.rdf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vimperator/install.rdf b/vimperator/install.rdf index 62c6cc5c..1f67bd6f 100644 --- a/vimperator/install.rdf +++ b/vimperator/install.rdf @@ -19,7 +19,7 @@ {ec8030f7-c20a-464f-9b0e-13a3a9e97384} 3.5 - 3.6b3pre + 3.6b3 From 346207ec91692b15f3e9307e777c3019c289e684 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 20 Nov 2009 01:38:19 +1100 Subject: [PATCH 03/11] Normalize access to the current media list view. --HG-- extra : rebase_source : 4c0e528eaa949be3443441b263011d79d1adc33b --- xulmus/content/player.js | 42 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 767eda41..a75fd39a 100644 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -9,7 +9,7 @@ const Player = Module("player", { init: function init() { this._lastSearchString = ""; this._lastSearchIndex = 0; - this._lastSearchView = _SBGetCurrentView(); + this._lastSearchView = this._currentView; //XXX // Get the focus to the visible playlist first //window._SBShowMainLibrary(); @@ -22,7 +22,7 @@ const Player = Module("player", { }, /** - * Adjusts the track position interval milliseconds forwards or + * Moves the track position interval milliseconds forwards or * backwards. * * @param {number} interval The time interval (ms) to move the track @@ -79,6 +79,9 @@ const Player = Module("player", { } }, + /** @property {sbIMediaListView} The current media list view. @private */ + get _currentView() SBGetBrowser().currentMediaListView, + /** * @property {number} The player volume in the range 0.0-1.0. */ @@ -88,16 +91,14 @@ const Player = Module("player", { }, /** - * Focuses the specified media item in the current media view. + * Focuses the specified media item in the current media list view. * * @param {sbIMediaItem} mediaItem The media item to focus. */ focusTrack: function focusTrack(mediaItem) { - SBGetBrowser().mediaTab.mediaPage.highlightItem(_SBGetCurrentView().getIndexForItem(mediaItem)); + SBGetBrowser().mediaTab.mediaPage.highlightItem(this._currentView.getIndexForItem(mediaItem)); }, - // FIXME: can't be called from non-media tabs since 840e78 (git) - // _SBGetCurrentView only returns the view in that tab - use SBGetBrowser().currentMediaListView /** * Plays the currently selected media item. If no item is selected the * first item in the current media view is played. @@ -105,9 +106,9 @@ const Player = Module("player", { play: function play() { // Check if there is any selection in place, else play first item of the visible view. // TODO: this approach, or similar, should be generalised for all commands, PT? --djk - if (_SBGetCurrentView().selection.count != 0) - gMM.sequencer.playView(_SBGetCurrentView(), - _SBGetCurrentView().getIndexForItem(_SBGetCurrentView().selection.currentMediaItem)); + if (this._currentView.selection.count != 0) + gMM.sequencer.playView(this._currentView, + this._currentView.getIndexForItem(this._currentView.selection.currentMediaItem)); else gMM.sequencer.playView(SBGetBrowser().currentMediaListView, 0); @@ -240,9 +241,7 @@ const Player = Module("player", { * @param {string} str The search string. */ searchView: function searchView(str) { - let currentView = _SBGetCurrentView(); - let mediaItemList = currentView.mediaList; - let search = _getSearchString(currentView); + let search = _getSearchString(this._currentView); let searchString = ""; if (search != "") // XXX @@ -252,12 +251,12 @@ const Player = Module("player", { this._lastSearchString = searchString; - let mySearchView = LibraryUtils.createStandardMediaListView(mediaItemList, searchString); + let searchView = LibraryUtils.createStandardMediaListView(this._currentView.mediaList, searchString); - if (mySearchView.length) { - this._lastSearchView = mySearchView; + if (searchView.length) { + this._lastSearchView = searchView; this._lastSearchIndex = 0; - this.focusTrack(mySearchView.getItemByIndex(this._lastSearchIndex)); + this.focusTrack(searchView.getItemByIndex(this._lastSearchIndex)); } else liberator.echoerr("E486 Pattern not found: " + searchString, commandline.FORCE_SINGLELINE); @@ -266,7 +265,8 @@ const Player = Module("player", { /** * Repeats the previous view search. * - * @param {boolean} reverse + * @param {boolean} reverse Search in the reverse direction to the previous + * search. */ searchViewAgain: function searchViewAgain(reverse) { function echo(str) { @@ -292,7 +292,7 @@ const Player = Module("player", { this._lastSearchIndex = this._lastSearchIndex + 1; } - // FIXME: Implement for "?" --ken + // TODO: Implement for "?" --ken commandline.echo("/" + this._lastSearchString, null, commandline.FORCE_SINGLELINE); this.focusTrack(this._lastSearchView.getItemByIndex(this._lastSearchIndex)); @@ -431,7 +431,7 @@ const Player = Module("player", { break; } - _SBGetCurrentView().setSort(properties); + this._currentView.setSort(properties); } }, { }, { @@ -474,7 +474,7 @@ const Player = Module("player", { for ([i, list] in Iterator(playlists)) { if (util.compareIgnoreCase(arg, list.name) == 0) { SBGetBrowser().loadMediaList(playlists[i]); - this.focusTrack(_SBGetCurrentView().getItemByIndex(0)); + this.focusTrack(this._currentView.getItemByIndex(0)); return; } } @@ -761,7 +761,7 @@ const Player = Module("player", { mappings.add([modes.PLAYER], [""], "Rate the current media item " + rating, function () { - let item = gMM.sequencer.currentItem || _SBGetCurrentView().selection.currentMediaItem; // XXX: a bit too magic + let item = gMM.sequencer.currentItem || this._currentView.selection.currentMediaItem; // XXX: a bit too magic if (item) player.rateMediaItem(item, rating); else From 4ed5f85eab37b073a4e320c10115e7a121abffcf Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 20 Nov 2009 01:53:29 +1100 Subject: [PATCH 04/11] Remove util.isArray which is made redundant by isarray. --HG-- extra : rebase_source : 59b8cb2d2e12ebd92b78e95ae16860f6e570841e --- common/content/util.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/common/content/util.js b/common/content/util.js index e313747d..4ae31928 100644 --- a/common/content/util.js +++ b/common/content/util.js @@ -15,14 +15,6 @@ const Util = Module("util", { this.Array = Util.Array; }, - /** - * Returns true if its argument is an Array object, regardless - * of which context it comes from. - * - * @param {object} obj - */ - isArray: function isArray(obj) Object.prototype.toString.call(obj) == "[object Array]", - /** * Returns a shallow copy of obj. * @@ -400,7 +392,7 @@ const Util = Module("util", { doc = window.content.document; if (!elem) elem = doc; - if (util.isArray(expression)) + if (isarray(expression)) expression = util.makeXPath(expression); let result = doc.evaluate(expression, elem, From a8f985081c5956af2d84f7d2f6687541ab75e673 Mon Sep 17 00:00:00 2001 From: anekos Date: Mon, 23 Nov 2009 11:41:11 +0900 Subject: [PATCH 05/11] Smart :autocmd completer --- common/content/autocommands.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) mode change 100644 => 100755 common/content/autocommands.js diff --git a/common/content/autocommands.js b/common/content/autocommands.js old mode 100644 new mode 100755 index 52ceecb6..c0ce9252 --- a/common/content/autocommands.js +++ b/common/content/autocommands.js @@ -194,7 +194,12 @@ const AutoCommands = Module("autocommands", { } }, { bang: true, - completer: function (context) completion.autocmdEvent(context), + completer: function (context, args) { + if (args.length == 1) + return completion.autocmdEvent(context); + if (args.length == 3) + return args["-javascript"] ? completion.javascript(context) : completion.ex(context); + }, literal: 2, options: [[["-javascript", "-js"], commands.OPTION_NOARG]] }); From 252070f1427ac85e0e83d9c495eb12ba3530ce1d Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 25 Nov 2009 04:07:43 +1100 Subject: [PATCH 06/11] Banish Konstantin, Tim and myself to the Former Developers wasteland. ...after consulting with all three. --HG-- extra : rebase_source : a487f5d9d930b4aae694ae128b9ee7ff1c663e85 --- vimperator/AUTHORS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vimperator/AUTHORS b/vimperator/AUTHORS index e829459c..1ab59ff5 100644 --- a/vimperator/AUTHORS +++ b/vimperator/AUTHORS @@ -2,9 +2,6 @@ Main developer/Project founder: * Martin Stubenschrott (stubenschrott@vimperator.org) Developers: - * Doug Kearns (dougkearns@gmail.com) - * Tim Hammerquist (penryu@gmail.com) - * Konstantin Stepanov (milezv@yandex.ru) * Kris Maglione * Ted Pavlic * anekos @@ -16,6 +13,9 @@ Inactive/former developers: * Viktor Kojouharov (Виктор Кожухаров) * Marco Candrian (mac@calmar.ws) * Daniel Bainton (dpb .AT. driftaway .DOT. org) + * Doug Kearns (dougkearns@gmail.com) + * Konstantin Stepanov (milezv@yandex.ru) + * Tim Hammerquist (penryu@gmail.com) Patches (in no special order): * Ruud Grosmann ('followhints' option) From 24b38ffdd425a028d67ad55a143270e2c75f6810 Mon Sep 17 00:00:00 2001 From: anekos Date: Wed, 25 Nov 2009 14:49:17 +0900 Subject: [PATCH 07/11] Countermeasure for "Error: malformed URI sequence". This error occurs in encodeURI when URL is encoded by not UTF-8 encoding. --- common/content/statusline.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) mode change 100644 => 100755 common/content/statusline.js diff --git a/common/content/statusline.js b/common/content/statusline.js old mode 100644 new mode 100755 index 9214b75d..c5f8a254 --- a/common/content/statusline.js +++ b/common/content/statusline.js @@ -61,9 +61,20 @@ const StatusLine = Module("statusline", { updateUrl: function updateUrl(url) { // ripped from Firefox; modified function losslessDecodeURI(url) { + // Countermeasure for "Error: malformed URI sequence". + // This error occurs when URL is encoded by not UTF-8 encoding. + function _decodeURI(url) { + try { + return decodeURI(url); + } + catch (e) { + return url; + } + }; + // 1. decodeURI decodes %25 to %, which creates unintended // encoding sequences. - url = url.split("%25").map(decodeURI).join("%25"); + url = url.split("%25").map(_decodeURI).join("%25"); // 2. Re-encode whitespace so that it doesn't get eaten away // by the location bar (bug 410726). url = url.replace(/[\r\n\t]/g, encodeURIComponent); From 9dbe5cc7b0088d05b48ad5e8a87804bdcef779d9 Mon Sep 17 00:00:00 2001 From: Martin Stubenschrott Date: Wed, 25 Nov 2009 23:44:35 +0100 Subject: [PATCH 08/11] [muttator] Fix this_selectedMessageKeys warnings --- muttator/content/mail.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/muttator/content/mail.js b/muttator/content/mail.js index c67cd433..f55eb33e 100644 --- a/muttator/content/mail.js +++ b/muttator/content/mail.js @@ -35,17 +35,17 @@ const Mail = Module("mail", { // Jump to a message when requested let indices = []; - if (this._selectMessageKeys.length > 0) { - for (let j = 0; j < this._selectMessageKeys.length; j++) - indices.push([gDBView.findIndexFromKey(this._selectMessageKeys[j], true), this._selectMessageKeys[j]]); + if (mail._selectMessageKeys.length > 0) { + for (let j = 0; j < mail._selectMessageKeys.length; j++) + indices.push([gDBView.findIndexFromKey(mail._selectMessageKeys[j], true), mail._selectMessageKeys[j]]); indices.sort(); - let index = this._selectMessageCount - 1; - if (this._selectMessageReverse) - index = this._selectMessageKeys.length - 1 - index; + let index = mail._selectMessageCount - 1; + if (mail._selectMessageReverse) + index = mail._selectMessageKeys.length - 1 - index; gDBView.selectMsgByKey(indices[index][1]); - this._selectMessageKeys = []; + mail._selectMessageKeys = []; } } } From 3256577767d5ace51dd744b116dc83e9e9c32cd4 Mon Sep 17 00:00:00 2001 From: anekos Date: Fri, 27 Nov 2009 23:32:54 +0900 Subject: [PATCH 09/11] Fix :scriptnames --- common/content/io.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 common/content/io.js diff --git a/common/content/io.js b/common/content/io.js old mode 100644 new mode 100755 index 3e5bd21a..bbb3286a --- a/common/content/io.js +++ b/common/content/io.js @@ -920,7 +920,7 @@ lookup: "List all sourced script names", function () { let list = template.tabular(["", "Filename"], ["text-align: right; padding-right: 1em;"], - ([i + 1, file] for ([i, file] in Iterator(this._scriptNames)))); // TODO: add colon and remove column titles for pedantic Vim compatibility? + ([i + 1, file] for ([i, file] in Iterator(io._scriptNames)))); // TODO: add colon and remove column titles for pedantic Vim compatibility? commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE); }, From 78308e24836cff6bf0194093fbe23f45f5a5628e Mon Sep 17 00:00:00 2001 From: anekos Date: Fri, 27 Nov 2009 23:55:20 +0900 Subject: [PATCH 10/11] Fix :run command --- common/content/io.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/content/io.js b/common/content/io.js index bbb3286a..07f15453 100755 --- a/common/content/io.js +++ b/common/content/io.js @@ -950,16 +950,16 @@ lookup: arg = "!" + arg; // replaceable bang and no previous command? - liberator.assert(!/((^|[^\\])(\\\\)*)!/.test(arg) || this._lastRunCommand, + liberator.assert(!/((^|[^\\])(\\\\)*)!/.test(arg) || io._lastRunCommand, "E34: No previous command"); // NOTE: Vim doesn't replace ! preceded by 2 or more backslashes and documents it - desirable? // pass through a raw bang when escaped or substitute the last command arg = arg.replace(/(\\)*!/g, - function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", this._lastRunCommand) + function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", io._lastRunCommand) ); - this._lastRunCommand = arg; + io._lastRunCommand = arg; let output = io.system(arg); From c3ec6fff4af9bff844d3ae84bc164bd4184fe811 Mon Sep 17 00:00:00 2001 From: anekos Date: Sat, 28 Nov 2009 08:45:23 +0900 Subject: [PATCH 11/11] Fix: completion.url completion.url(foo, "") misuse option["complete"]. --- common/content/completion.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) mode change 100644 => 100755 common/content/completion.js diff --git a/common/content/completion.js b/common/content/completion.js old mode 100644 new mode 100755 index 16aa7398..ed7e3cfd --- a/common/content/completion.js +++ b/common/content/completion.js @@ -682,8 +682,11 @@ const Completion = Module("completion", { if (skip) context.advance(skip[0].length); + if (typeof complete === "undefined") + complete = options["complete"]; + // Will, and should, throw an error if !(c in opts) - Array.forEach(complete || options["complete"], function (c) { + Array.forEach(complete, function (c) { let completer = completion.urlCompleters[c]; context.fork.apply(context, [c, 0, completion, completer.completer].concat(completer.args)); });