diff --git a/Donators b/Donators index 43572616..e72f0c91 100644 --- a/Donators +++ b/Donators @@ -3,6 +3,7 @@ 2008: * Kurtis Rader +* Andrew Pantyukhin 2007: * Richard Terrell diff --git a/NEWS b/NEWS index df0278dd..445c2fa9 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,8 @@ removed the following hint options: 'hintchars' 'maxhints' added the following hint options: 'hinttimeout' * IMPORTANT: changed 'I' key to Ctrl-Q to also work in textboxes + * IMPORTANT: :bmarks! and :history! open the matching items now in a tab, instead + of bringing up the bookmarks/history window * new :command to add user defined commands * new setCustomMode for plugin writers * :au[tocmd] executes commands on events (only 'PageLoad' actually) on websites diff --git a/content/bookmarks.js b/content/bookmarks.js index a8f353b4..e78c95e5 100644 --- a/content/bookmarks.js +++ b/content/bookmarks.js @@ -319,59 +319,64 @@ vimperator.Bookmarks = function () //{{{ return url; // can be null }, - list: function (filter, tags, fullmode) + // if openItems is true, open the matching bookmarks items in tabs rather than display + list: function (filter, tags, openItems) { - if (fullmode) + var items = this.get(filter, tags, false); + if (items.length == 0) { - vimperator.open("chrome://browser/content/bookmarks/bookmarksPanel.xul", vimperator.NEW_TAB); + if (filter.length > 0 || tags.length > 0) + vimperator.echoerr("E283: No bookmarks matching \"" + filter + "\""); + else + vimperator.echoerr("No bookmarks set"); + + return; } - else + + if (openItems) { - var items = this.get(filter, tags, false); + // FIXME: use yes/no question + if (items.length > 50) + return vimperator.echoerr("For now, you can only open a hard limit of 50 items at once"); - if (items.length == 0) - { - if (filter.length > 0 || tags.length > 0) - vimperator.echoerr("E283: No bookmarks matching \"" + filter + "\""); - else - vimperator.echoerr("No bookmarks set"); - - return; - } - - var title, url, tags, keyword, extra; - var list = ":" + vimperator.util.escapeHTML(vimperator.commandline.getCommand()) + "
" + - ""; for (var i = 0; i < items.length; i++) - { - title = vimperator.util.escapeHTML(items[i][1]); - if (title.length > 50) - title = title.substr(0, 47) + "..."; - url = vimperator.util.escapeHTML(items[i][0]); - keyword = items[i][2]; - tags = items[i][3].join(", "); + vimperator.open(items[i][0], vimperator.NEW_TAB); - extra = ""; - if (keyword) - { - extra = " (keyword: " + vimperator.util.escapeHTML(keyword) + ""; - if (tags) - extra += " tags: " + vimperator.util.escapeHTML(tags) + ")"; - else - extra += ")"; - } - else if (tags) - { - extra = " (tags: " + vimperator.util.escapeHTML(tags) + ")"; - } - - - list += ""; - } - list += "
titleURL
" + title + "" + url + "" + extra + "
"; - - vimperator.commandline.echo(list, vimperator.commandline.HL_NORMAL, vimperator.commandline.FORCE_MULTILINE); + return; } + + var title, url, tags, keyword, extra; + var list = ":" + vimperator.util.escapeHTML(vimperator.commandline.getCommand()) + "
" + + ""; + for (var i = 0; i < items.length; i++) + { + title = vimperator.util.escapeHTML(items[i][1]); + if (title.length > 50) + title = title.substr(0, 47) + "..."; + url = vimperator.util.escapeHTML(items[i][0]); + keyword = items[i][2]; + tags = items[i][3].join(", "); + + extra = ""; + if (keyword) + { + extra = " (keyword: " + vimperator.util.escapeHTML(keyword) + ""; + if (tags) + extra += " tags: " + vimperator.util.escapeHTML(tags) + ")"; + else + extra += ")"; + } + else if (tags) + { + extra = " (tags: " + vimperator.util.escapeHTML(tags) + ")"; + } + + + list += ""; + } + list += "
titleURL
" + title + "" + url + "" + extra + "
"; + + vimperator.commandline.echo(list, vimperator.commandline.HL_NORMAL, vimperator.commandline.FORCE_MULTILINE); } }; @@ -493,25 +498,33 @@ vimperator.History = function () //{{{ getWebNavigation().gotoIndex(max); }, - list: function (filter, fullmode) + // if openItems is true, open the matching history items in tabs rather than display + list: function (filter, openItems) { - if (fullmode) + var items = this.get(filter); + if (items.length == 0) { - vimperator.open("chrome://browser/content/history/history-panel.xul", vimperator.NEW_TAB); + if (filter.length > 0) + vimperator.echoerr("E283: No history matching \"" + filter + "\""); + else + vimperator.echoerr("No history set"); + + return; + } + + if (openItems) + { + // FIXME: use yes/no question + if (items.length > 50) + return vimperator.echoerr("For now, you can only open a hard limit of 50 items at once"); + + for (var i = 0; i < items.length; i++) + vimperator.open(items[i][0], vimperator.NEW_TAB); + + return; } else { - var items = this.get(filter); - - if (items.length == 0) - { - if (filter.length > 0) - vimperator.echoerr("E283: No history matching \"" + filter + "\""); - else - vimperator.echoerr("No history set"); - - return; - } var list = ":" + vimperator.util.escapeHTML(vimperator.commandline.getCommand()) + "
" + ""; diff --git a/content/commands.js b/content/commands.js index 68a30e88..89985686 100644 --- a/content/commands.js +++ b/content/commands.js @@ -675,10 +675,10 @@ vimperator.Commands = function () //{{{ vimperator.bookmarks.list(res.args.join(" "), tags, special); }, { - usage: ["bmarks [filter]", "bmarks!"], - shortHelp: "Show bookmarks", + usage: ["bmarks[!] [filter]"], + shortHelp: "List or open multiple bookmarks", help: "Open the message window at the bottom of the screen with all bookmarks which match [filter] either in the title or URL.
" + - "The special version :bmarks! opens the default Firefox bookmarks window.
" + + "The special version :bmarks! works the same as :bmarks except it opens all the found bookmarks in new tabs.
" + "Filter can also contain the following options:
" + "-tags=comma,separated,tag,list
", completer: function (filter) { return [0, vimperator.bookmarks.get(filter)]; }, @@ -1106,10 +1106,10 @@ vimperator.Commands = function () //{{{ commandManager.add(new vimperator.Command(["hist[ory]", "hs"], function (args, special) { vimperator.history.list(args, special); }, { - usage: ["hist[ory] [filter]", "history!"], + usage: ["hist[ory][!] [filter]"], shortHelp: "Show recently visited URLs", help: "Open the message window at the bottom of the screen with all history items which match [filter] either in the title or URL.
" + - "The special version :history! opens the default Firefox history window.", + "The special version :history! works the same as :history except it opens all the found items in new tabs.
", completer: function (filter) { return [0, vimperator.history.get(filter)]; } } ));
titleURL