diff --git a/ChangeLog b/ChangeLog index 1df62004..26f5f82e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@
2007-05-02: * version ??? + * :hardcopy works now and shows the printing dialog * changed "R" to reload without cache instead of reload all due to popular request * changed secure sites -> green, broken sites -> red in the statusbar * Vimperator now sets the window title, so it's "vimperator.mozdev.org - diff --git a/TODO b/TODO index 142a88b8..379963d8 100644 --- a/TODO +++ b/TODO @@ -11,31 +11,35 @@ BUGS: - reload/stop buttons don't update enabled state - http://en.wikipedia.org/wiki/Portal:Current_events - 'f' shows more hints than 'F' (on left side of nav bar) - gu and gU don't work on local files properly +- dpb| 09:09:56 dpb :: when I save a page with vimperator, it addsnear the end of it.. kinda annoying + dpb| 09:11:50 dpb :: and this happens only when saving the complete + webpage, saving only the html works just fine.. + FEATURES: 9 marks of a Location, [m a-zA-Z] to set it, [` a-zA-Z] to go there [m 0-9] marks a buffer instead [' 0-9] goes there also mark bookmarks (with M[a-zA-Z] maybe and use only lowercase marks for inbuffer marks?) also support :mark and :marks -8 downloading of links to filesystem (:save ) -8 provide a buffer on the bottom where more than 1 line messages can be shown, preferrable - with color support (for things like :echo line1\nline2) +8 :map commands to keys +8 :command for new commands 8 middleclick in content == p, and if command line is open, paste there the clipboard buffer -8 [ctrl-o/i] to Go back to a Previous Position (done partly, however currenty does not use a per tab jumplist) 8 Use our own find-as-you-type mechanism (like conkeror does) +7 [ctrl-o/i] to Go back to a Previous Position (done partly, however currenty does not use a per tab jumplist) +7 provide a buffer on the bottom where more than 1 line messages can be shown, preferrable + with color support (for things like :echo line1\nline2) 7 make hints smarter, not only with characters from from hintchars, but use "NE" or "NP" for 'new posts' e.g. (might be too slow) 7 whereever possible: get rid of dialogs and ask console-like dialog questions or write error prompts directly on the webpage or with :echo() -7 :hardcopy -> printing 7 Ctrl-6/Ctrl-^ -> jump to the previously active tab 7 3d should delete 3 tabs -6 :map commands to keys +6 downloading of links to filesystem (:save ) 6 autocommands (BrowserStart, BrowserQuit, TabClose, TabOpen, TabChanged, PageLoaded, any more?) 6 vim like mappings for caret mode and textboxes (i to start caret mode?) http://nigel.mcnie.name/gnawt/ has a somewhat working implementation 6 pipe selected text/link/website to an external command 6 it would be nice to have :(undo|back|forward) w/ tab completion support 6 macros (qq) -6 support firefox search engines, or at least make our search enginges user configurable 6 gf = view source? 6 make a real one-tab-mode, divert _all_ other targets, possible by setting a firefox option (set popup=0-3) 6 Shift-Insert in textboxes pastes selection contents @@ -43,7 +47,7 @@ FEATURES: 5 Use arrow keys in preview window, and ctrl-w+j/k to switch to from preview window 5 Sort :open completion by date? (use 'wildsort') 5 make use of the ] and [ keys to e.g. jump to the next heading ]], next image ]i, previous textbox [t and so on -5 add tag support to adding/deleting bookmarks +5 add tag and keyword support to adding/deleting bookmarks 4 Support multiple top-level windows? 3 Splitting Windows with [:sp :vsp ctrl-w,s ctrl-w,v] and closing with [ctrl-w,q], moving with [ctrl-w,w or tab] have a look into the split browser extension diff --git a/chrome/content/vimperator/bookmarks.js b/chrome/content/vimperator/bookmarks.js index 1c6a33f7..716dcb8b 100644 --- a/chrome/content/vimperator/bookmarks.js +++ b/chrome/content/vimperator/bookmarks.js @@ -369,10 +369,7 @@ function QM() { //logObject(vimperator); logMessage(vimperator.getpr("complete")); -// var command_widget = document.getElementById('new-vim-commandbar'); -// logMessage(command_widget); - //setTimeout(function() {logObject(vimperator)}, 1000); - //Vimperator.echo("test"); + this.add = function() { alert('add');}; this.rem = function() { vimperator.echo("rem"); logObject(vimperator)}; this.zoom = function() { vimperator.zoom_to(200); logObject(vimperator)}; diff --git a/chrome/content/vimperator/commands.js b/chrome/content/vimperator/commands.js index 7e563380..7c7a5aae 100644 --- a/chrome/content/vimperator/commands.js +++ b/chrome/content/vimperator/commands.js @@ -59,8 +59,8 @@ var g_commands = [/*{{{*/ ["ba[ck]"], ["{count}ba[ck][!]"], "Go back in the browser history", - "Count is supported, :3backgoes back 3 pages in the browser history.
"+ - "The special version:back!goes to the beginning of the browser history.", + "Count is supported,:3backgoes back 3 pages in the browser history.
"+ + "The special version:back!goes to the beginning of the browser history.", function(args, special, count) { if(special) historyGoToBeginning(); else stepInHistory(count > 0 ? -1 * count : -1); }, null ], @@ -68,7 +68,7 @@ var g_commands = [/*{{{*/ ["bd[elete]", "bw[ipeout]", "bun[load]", "tabc[lose]"], ["{count}bd[elete][!]"], "Delete current buffer (=tab)", - "Count WILL be supported in future releases, then:2bdremoves two tabs and the one the right is selected.
Do:bdelete!to select the tab to the left after removing the current tab.", + "Count WILL be supported in future releases, then:2bdremoves two tabs and the one the right is selected.
Do:bdelete!to select the tab to the left after removing the current tab.", function (args, special, count) { tab_remove (count, special, 0); }, null ], @@ -86,7 +86,7 @@ var g_commands = [/*{{{*/ "Add a bookmark", "If you don't add a custom title, either the title of the webpage or the URL will be taken as the title.
" + "Tags WILL be some mechanism to classify bookmarks. Assume, you tag a url with the tags \"linux\" and \"computer\" you'll be able to search for bookmarks containing these tags.
" + - "You can omit the optional [url] field, so just do:bmaddto bookmark the currently loaded web page with a default title and without any tags.
" + + "You can omit the optional [url] field, so just do:bmaddto bookmark the currently loaded web page with a default title and without any tags.
" + " -t \"custom title\"
" + "The following options will be interpreted in the future:
" + " -T comma,separated,tag,list
"+ @@ -109,7 +109,7 @@ var g_commands = [/*{{{*/ ["bm[!] [-T] {regexp}"], "Show bookmarks", "Open the preview window at the bottom of the screen for all bookmarks which match the regexp either in the title or URL.
" + - "Close this window with:pcloseor open entries with double click in the current tab or middle click in a new tab.
" + + "Close this window with:pcloseor open entries with double click in the current tab or middle click in a new tab.
" + "The following options WILL be interpretted in the future:
" + " -T comma,separated,tag,list
", bmshow, @@ -160,7 +160,7 @@ var g_commands = [/*{{{*/ ["exe[cute]"], ["exe[cute] {expr1} [ ... ]"], "Execute the string that results from the evaluation of {expr1} as an Ex command.", - ":execute "echo test"would show a message with the text "test".
", + ":execute "echo test"would show a message with the text "test".
", execute, null ], @@ -168,8 +168,8 @@ var g_commands = [/*{{{*/ ["fo[rward]", "fw"], ["{count}fo[rward][!]"], "Go forward in the browser history", - "Count is supported,:3forwardgoes forward 3 pages in the browser history.
"+ - "The special version:forward!goes to the end of the browser history.", + "Count is supported,:3forwardgoes forward 3 pages in the browser history.
"+ + "The special version:forward!goes to the end of the browser history.", function(args, special, count) { if(special) historyGoToEnd(); else stepInHistory(count > 0 ? count : 1); }, null ], @@ -201,7 +201,7 @@ var g_commands = [/*{{{*/ ["hist[ory] {filter}"], "Show recently visited URLs", "Open the preview window at the bottom of the screen for all history items which match the filter string either in the title or URL."+ - "Close this window with:pcloseor open entries with double click in the current tab or middle click in a new tab.", + "Close this window with:pcloseor open entries with double click in the current tab or middle click in a new tab.", hsshow, function(filter) { return get_history_completions(filter); } ], @@ -210,9 +210,9 @@ var g_commands = [/*{{{*/ ["javas[cript] {cmd}", "javascript <<{endpattern}\\n{script}\\n{endpattern}"], // \\n is changed to
in the help.js code "Run any javascript command through eval()", "Acts as a javascript interpreter by passing the argument toeval().
" + - ":javascript alert('Hello world')would show a dialog box with the text \"Hello world\".
" + - ":javascript <<EOFwould read all the lines until a line starting with 'EOF' is found, and willeval()them.
" + - "The special version:javascript!will open the javascript console of Firefox.", + ":javascript alert('Hello world')would show a dialog box with the text \"Hello world\".
" + + ":javascript <<EOFwould read all the lines until a line starting with 'EOF' is found, and willeval()them.
" + + "The special version:javascript!will open the javascript console of Firefox.", function(args, special) { if (special) // open javascript console openURLsInNewTab("chrome://global/content/console.xul", true); @@ -256,13 +256,13 @@ var g_commands = [/*{{{*/ "and the first word of the token is the name of a search engine (:open wikipedia linus torvalds"+ "will open the wikipedia entry for linux torvalds)."+ "Opened with the default search engine or keyword (specified with the "+ + "if the first word is no search engine ('defsearch'setting) "+ - "if the first word is no search engine (:open linus torvaldswill open a google search for linux torvalds).:open linus torvaldswill open a google search for linux torvalds)."+ "Passed directly to Firefox in all other cases ( "+ ""+ "You WILL be able to use:open www.osnews.com | www.slashdot.orgwill "+ "open OSNews in the current, and Slashdot in a new background tab).:open [-T \"linux\"] torvalds<Tab>to complete bookmarks "+ "with tag \"linux\" and which contain \"torvalds\". Note that -T support is only available for tab completion, not for the actual command.
"+ - "The items which are completed on<Tab>are specified in the'complete'option.
"+ + "The items which are completed on<Tab>are specified in the'complete'option.
"+ "Without argument, reloads the current page.
"+ "Without argument but with !, reloads the current page skipping the cache.", function(args, special) @@ -343,12 +343,12 @@ var g_commands = [/*{{{*/ ["se[t][!]", "se[t] {option}[?]", "se[t] {option}[+-]={value}"], "Set an option", "Permanently change an option. In contrast to Vim options are stored throughout sessions.
"+ - "Boolean options must be set with:set optionand:set nooption.
"+ - ":setwithout an argument opensabout:configin a new tab to change advanced Firefox options.
"+ - ":set!opens the GUI preference panel from Firefox in a new tab.
"+ - ":set option?or:set optionshows the current value of the option.
"+ - ":set option&resets 'option' to the default value.
"+ - ":set option+=fooand:set option-=fooWILL add/remove foo from list options.
", + "Boolean options must be set with:set optionand:set nooption.
"+ + ":setwithout an argument opensabout:configin a new tab to change advanced Firefox options.
"+ + ":set!opens the GUI preference panel from Firefox in a new tab.
"+ + ":set option?or:set optionshows the current value of the option.
"+ + ":set option&resets 'option' to the default value.
"+ + ":set option+=fooand:set option-=fooWILL add/remove foo from list options.
", set, function(filter) { return get_settings_completions(filter); } ], @@ -455,7 +455,7 @@ var g_commands = [/*{{{*/ [ ["qmarkd[el]", "qmd[el]"], ["qmarkd[el] {a-zA-Z0-9}"], - "Remove a marked URL" + + "Remove a marked URL", "Not implemented yet.", function(args) { set_url_mark("mark", "url"); }, // FIXME function(filter) { return [["a", ""], ["b", ""]]; } @@ -1176,7 +1176,7 @@ function execute_command(count, cmd, special, args, modifiers) // {{{ if (command[FUNCTION] === null) { - echoerr("E666: Internal error: command[FUNCTION] === null"); + vimperator.echoerr("E666: Internal error: command[FUNCTION] === null"); return; } @@ -1240,37 +1240,6 @@ function execute(string) return execute_command.apply(this, tokens); } -//////////////////////////////////////////////////////////////////////// -// statusbar/commandbar handling ////////////////////////////////// {{{1 -//////////////////////////////////////////////////////////////////////// - function echo(msg) - { - /* In Mozilla, the XUL textbox is implemented as a wrapper around an HTML - * input element. The read only property '.inputField' holds a reference to this inner - * input element. */ - var bar = command_line.inputField; - var focused = document.commandDispatcher.focusedElement; - if (focused && focused == bar) - return; - - bar.setAttribute("style","font-family: monospace;"); - bar.value = msg; - } - - function echoerr(msg) - { - /* In Mozilla, the XUL textbox is implemented as a wrapper around an HTML - * input element. The read only property '.inputField' holds a reference to this inner - * input element. */ - var bar = command_line.inputField; - var focused = document.commandDispatcher.focusedElement; - if (focused && focused == bar) - return; - - bar.setAttribute("style", "font-family: monospace; color:white; background-color:red; font-weight: bold"); - bar.value = msg; - } - //////////////////////////////////////////////////////////////////////// // navigation functions /////////////////////////////////////////// {{{1 //////////////////////////////////////////////////////////////////////// @@ -1285,9 +1254,9 @@ function stepInHistory(steps) { beep(); if(index < 0) - echo("Cannot go past beginning of history"); + vimperator.echo("Cannot go past beginning of history"); else - echo("Cannot go past end of history"); + vimperator.echo("Cannot go past end of history"); } } function historyGoToBeginning() @@ -1295,7 +1264,7 @@ function historyGoToBeginning() var index = getWebNavigation().sessionHistory.index; if (index == 0) { - echo("Already at beginning of history"); + vimperator.echo("Already at beginning of history"); return; } getWebNavigation().gotoIndex(0); @@ -1306,7 +1275,7 @@ function historyGoToEnd() var max = getWebNavigation().sessionHistory.count -1; if (index == max) { - echo("Already at end of history"); + vimperator.echo("Already at end of history"); return; } getWebNavigation().gotoIndex(max); @@ -1457,7 +1426,7 @@ function focusNextFrame(count) var frames = window.content.frames; if (frames.length == 0) { - echo("No frames found"); + vimperator.echo("No frames found"); beep(); return; } @@ -1530,7 +1499,7 @@ function yankCurrentLocation() { var loc = getCurrentLocation(); copyToClipboard(loc); - echo("Yanked " + loc); + vimperator.echo("Yanked " + loc); } // return null, if no link with a href focused @@ -1816,12 +1785,12 @@ function zoom_in(factor) var zoomMgr = ZoomManager.prototype.getInstance(); if (zoomMgr.textZoom == 25 && factor < 0) { - echoerr("Minimum zoom level of 25% reached"); + vimperator.echoerr("Minimum zoom level of 25% reached"); beep(); } else if (zoomMgr.textZoom == 500 && factor > 0) { - echoerr("Maximum zoom level of 500% reached"); + vimperator.echoerr("Maximum zoom level of 500% reached"); beep(); } else @@ -1834,7 +1803,7 @@ function zoom_in(factor) hah.reshowHints(); - echo("Zoom value: " + value + "%"); + vimperator.echo("Zoom value: " + value + "%"); } } @@ -1853,14 +1822,14 @@ Vimperator.prototype.zoom_to = function(value) value = parseInt(oldval, 10); if (isNaN(value)) { - echoerr("Cannot convert " + oldval + " to a number"); + vimperator.echoerr("Cannot convert " + oldval + " to a number"); return; } } if (value < 25 || value > 500) { - echoerr("Zoom value must be between 25% and 500%"); + vimperator.echoerr("Zoom value must be between 25% and 500%"); beep(); return; } @@ -1869,7 +1838,7 @@ Vimperator.prototype.zoom_to = function(value) hah.reshowHints(); - echo("Zoom value: " + value + "%"); + vimperator.echo("Zoom value: " + value + "%"); } @@ -1895,7 +1864,7 @@ function beep() if (gBeepService) gBeepService.beep(); else - echoerr('no beep service found'); + vimperator.echoerr('no beep service found'); } // quit vimperator, no matter how many tabs/windows are open @@ -1969,7 +1938,7 @@ function set(args, special) var matches = args.match(/^\s*(no)?([a-z]+)(\?|&)?(([+-])?=(.*))?/); if (!matches) { - echoerr("E518: Unknown option: " + args); + vimperator.echoerr("E518: Unknown option: " + args); return; } @@ -1978,7 +1947,7 @@ function set(args, special) var setting = get_setting(opt); if (!setting) { - echoerr("E518: Unknown option: " + opt); + vimperator.echoerr("E518: Unknown option: " + opt); return; } @@ -1998,7 +1967,7 @@ function set(args, special) else if (get) { var cur_val = setting[GETFUNC].call(this); - echo(" " + setting[COMMANDS][0] + "=" + cur_val); + vimperator.echo(" " + setting[COMMANDS][0] + "=" + cur_val); } // write access else @@ -2012,14 +1981,14 @@ function set(args, special) { var num = parseInt(val, 10); if (isNaN(num)) - echoerr("Invalid argument type to option " + setting[COMMANDS][0] + ": Expects number"); + vimperator.echoerr("Invalid argument type to option " + setting[COMMANDS][0] + ": Expects number"); else { var cur_val = setting[GETFUNC].call(this); if (oper == '+') num = cur_val + num; if (oper == '-') num = cur_val - num; if (setting[CHECKFUNC] != null && setting[CHECKFUNC].call(this, num) == false) - echoerr("Invalid argument to option " + setting[COMMANDS][0] + ": Check help for more details"); + vimperator.echoerr("Invalid argument to option " + setting[COMMANDS][0] + ": Check help for more details"); else // all checks passed, execute option handler setting[SETFUNC].call(this, num); } @@ -2044,12 +2013,12 @@ function set(args, special) } } if (setting[CHECKFUNC] != null && setting[CHECKFUNC].call(this, val) == false) - echoerr("Invalid argument to option " + setting[COMMANDS][0] + ": Check help for more details"); + vimperator.echoerr("Invalid argument to option " + setting[COMMANDS][0] + ": Check help for more details"); else // all checks passed, execute option handler setting[SETFUNC].call(this, val); } else - echoerr("Internal error, option format `" + type + "' not supported"); + vimperator.echoerr("Internal error, option format `" + type + "' not supported"); } } } @@ -2078,7 +2047,7 @@ function source(filename, silent) catch(e) { if(!silent) - echoerr(e); + vimperator.echoerr(e); } } diff --git a/chrome/content/vimperator/ui.js b/chrome/content/vimperator/ui.js index 55d51272..a76ca535 100644 --- a/chrome/content/vimperator/ui.js +++ b/chrome/content/vimperator/ui.js @@ -56,7 +56,7 @@ function CommandLine () const UNINITIALIZED = -2; // notifies us, if we need to start history/tab-completion from the beginning const HISTORY_SIZE = 500; - var completionlist = new InformationList("vim-completion", { min_items: 2, max_items: 10 }); + var completionlist = new InformationList("vimperator-completion", { min_items: 2, max_items: 10 }); var completions = new Array(); var history = new Array(); @@ -72,9 +72,9 @@ function CommandLine () var completion_index = UNINITIALIZED; // The prompt for the current command, for example : or /. Can be blank - var prompt_widget = document.getElementById('new-vim-commandbar-prompt'); + var prompt_widget = document.getElementById('vimperator-commandline-prompt'); // The command bar which contains the current command - var command_widget = document.getElementById('new-vim-commandbar'); + var command_widget = document.getElementById('vimperator-commandline-command'); // load the history var hist = get_pref("commandline_history", ""); diff --git a/chrome/content/vimperator/vimperator.js b/chrome/content/vimperator/vimperator.js index bd9602c6..bee70383 100644 --- a/chrome/content/vimperator/vimperator.js +++ b/chrome/content/vimperator/vimperator.js @@ -179,8 +179,8 @@ function init() Vimperator.prototype.qm = new QM; // Vimperator.prototype.commandline = new CommandLine; Vimperator.prototype.search = new Search; - Vimperator.prototype.previewwindow = new InformationList("vimperator-preview-window", { incremental_fill: false, max_items: 10 }); - Vimperator.prototype.bufferwindow = new InformationList("vimperator-buffer-window", { incremental_fill: false, max_items: 10 }); + Vimperator.prototype.previewwindow = new InformationList("vimperator-previewwindow", { incremental_fill: false, max_items: 10 }); + Vimperator.prototype.bufferwindow = new InformationList("vimperator-bufferwindow", { incremental_fill: false, max_items: 10 }); Vimperator.prototype.statusline = new StatusLine(); Vimperator.prototype.tabs = new Tabs(); @@ -190,7 +190,7 @@ function init() //vimperator.registerCallback("complete", vimperator.modes.EX, function(str) { return moo();; } ); //status_line = document.getElementById("vim-statusbar"); - command_line = document.getElementById("vim-commandbar"); + command_line = document.getElementById("vimperator-commandline"); // Setup our main status handler - from browser.js // this function reacts to status bar and url changes which are sent from the mozilla core diff --git a/chrome/content/vimperator/vimperator.xul b/chrome/content/vimperator/vimperator.xul index ed4732f8..cb89100c 100644 --- a/chrome/content/vimperator/vimperator.xul +++ b/chrome/content/vimperator/vimperator.xul @@ -51,8 +51,8 @@ the terms of any one of the MPL, the GPL or the LGPL.- - + - - - @@ -90,16 +90,10 @@ the terms of any one of the MPL, the GPL or the LGPL. - -- - - + -