diff --git a/common/content/autocommands.js b/common/content/autocommands.js old mode 100644 new mode 100755 index a273b16b..e8eb47f7 --- a/common/content/autocommands.js +++ b/common/content/autocommands.js @@ -196,7 +196,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]] }); diff --git a/common/content/completion.js b/common/content/completion.js old mode 100644 new mode 100755 index e838734f..d86d6a18 --- a/common/content/completion.js +++ b/common/content/completion.js @@ -696,8 +696,11 @@ const Completion = Module("completion", { if (skip) context.advance(skip[0].length); + if (complete == null) + 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)); }); diff --git a/common/content/io.js b/common/content/io.js old mode 100644 new mode 100755 index 4ca6174f..7c85d331 --- a/common/content/io.js +++ b/common/content/io.js @@ -924,7 +924,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); }, @@ -954,16 +954,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); diff --git a/common/content/statusline.js b/common/content/statusline.js old mode 100644 new mode 100755 index 7b619beb..e82c9550 --- a/common/content/statusline.js +++ b/common/content/statusline.js @@ -63,7 +63,15 @@ const StatusLine = Module("statusline", { function losslessDecodeURI(url) { // 1. decodeURI decodes %25 to %, which creates unintended // encoding sequences. - url = url.split("%25").map(decodeURI).join("%25"); + url = url.split("%25").map(function (url) { + // Non-UTF-8 complient URLs cause "malformed URI sequence" errors. + try { + return decodeURI(url); + } + catch (e) { + return url; + } + }).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); diff --git a/common/content/util.js b/common/content/util.js index 97e3e888..7dfe3c3b 100644 --- a/common/content/util.js +++ b/common/content/util.js @@ -18,14 +18,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. * @@ -454,7 +446,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, 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 = []; } } } 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) diff --git a/vimperator/NEWS b/vimperator/NEWS old mode 100644 new mode 100755 index dc078e95..34c932f6 --- a/vimperator/NEWS +++ b/vimperator/NEWS @@ -10,6 +10,7 @@ * Asciidoc is no longer for building * 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/vimperator/install.rdf b/vimperator/install.rdf index 5e0bc867..cf814ed9 100644 --- a/vimperator/install.rdf +++ b/vimperator/install.rdf @@ -19,7 +19,7 @@ {ec8030f7-c20a-464f-9b0e-13a3a9e97384} 3.5 - 3.6b3pre + 4.0 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 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