diff --git a/ChangeLog b/ChangeLog index b5ab35b3..79244f7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@
 2007-05-02:
 	* version ???
+	* :help now opens in the current tab even for xhtml pages like "about:"
 	* hints work on xhtml pages now (you need to reset the 'hinttags' and
 	  'extendedhinttags' settings with :set hinttags& and :set extendedhinttags&
 	* :set option& resets the option to the default value
diff --git a/chrome/content/vimperator/commands.js b/chrome/content/vimperator/commands.js
index 77b6f6ef..7788d324 100644
--- a/chrome/content/vimperator/commands.js
+++ b/chrome/content/vimperator/commands.js
@@ -67,7 +67,7 @@ var g_commands = [/*{{{*/
         ["bdelete", "bd", "bwipeout", "bw", "bunload", "bun", "tabclose", "tabc"],
         ["{count}bd[elete][!]"],
         "Delete current buffer (=tab)",
-        "Count WILL be supported in future releases, then :2bd removes 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 :2bd removes 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 ], @@ -134,7 +134,7 @@ var g_commands = [/*{{{*/ ["downloads", "dl"], ["downloads"], "Show progress of current downloads", - "Open the original Firefox download dialog in a new tab.
"+ + "Open the original Firefox download dialog in a new tab.
"+ "Here, downloads can be paused, canceled and resumed.", function() { openURLsInNewTab("chrome://mozapps/content/downloads/downloads.xul", true); }, null @@ -184,14 +184,14 @@ var g_commands = [/*{{{*/ ["help", "h"], ["h[elp] {subject}"], "Open the help window", - "You can jump to the specified {subject} with :help {subject}.
"+ + "You can jump to the specified {subject} with :help {subject}.
"+ "Make sure you use the full vim notation when jumping to {subject}. This means:
"+ ""+ - "You can however use partial stings in the tab completion, so :help he will complete :help :help", + "You can however use partial stings in the tab completion, so :help he<Tab> will complete :help :help", help, function(filter) { return get_help_completions(filter); } ], @@ -206,7 +206,7 @@ var g_commands = [/*{{{*/ ], [ ["javascript", "js"], - ["javascript {cmd}", "javascript <<{endpattern}\\n{script}\\n{endpattern}"], // \\n is changed to
in the help.js code + ["javascript {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 to eval().
" + ":javascript alert('Hello world') would show a dialog box with the text \"Hello world\".
" + @@ -246,13 +246,21 @@ var g_commands = [/*{{{*/ "Open one ore more URLs in the current tab", "Multiple URLs can be separated with the | character.
" + "Each |-separated token is analayzed and in this order:
"+ - "
  1. Opened with the specified search engine if the token looks like a search string 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).
  2. "+ - "
  3. Transformed to a relative URL of the current location if it starts with . or .. or ...;
    ... is special and moves up the directory hierarchy as far as possible.
    "+ - "
  4. Opened with the default search engine or keyword (specified with the 'defsearch' setting) if the first word is no search engine (:open linus torvalds will open a google search for linux torvalds).
  5. "+ - ""+ - "
  6. Passed directly to Firefox in all other cases (:open www.osnews.com | www.slashdot.org will open OSNews in the current, and Slashdot in a new background tab).
"+ - "You WILL be able to use :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.
"+ + "
    "+ + "
  1. Transformed to a relative URL of the current location if it starts with . or .. or ...;
    "+ + "... is special and moves up the directory hierarchy as far as possible."+ + "
    • :open ... with current location \"http://www.example.com/dir1/dir2/file.html\" will open \"http://www.example.com\"
    • "+ + "
    • :open ./foo.html with current location \"http://www.example.com/dir1/dir2/file.html\" will open \"http://www.example.com/dir1/dir2/foo.html\"
  2. "+ + "
  3. Opened with the specified search engine if the token looks like a search string "+ + "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).
  4. "+ + "
  5. Opened with the default search engine or keyword (specified with the 'defsearch' setting) "+ + "if the first word is no search engine (:open linus torvalds will open a google search for linux torvalds).
  6. "+ + "
  7. Passed directly to Firefox in all other cases (:open www.osnews.com | www.slashdot.org will "+ + "open OSNews in the current, and Slashdot in a new background tab).
  8. "+ + "
"+ + "You WILL be able to use :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.
"+ "Without argument, reloads the current page.
"+ "Without argument but with !, reloads the current page skipping the cache.", @@ -284,7 +292,7 @@ var g_commands = [/*{{{*/ ["preferences"], "Show Browser Preferences", "You can change the browser preferences from this dialog.
Be aware that not all Firefox preferences work, because Vimperator overrides some keybindings and changes Firefox's GUI.
"+ - "Works like :set!, but opens the dialog in a new window instead of a new tab. Use this, if you experience problems/crashes when using :set!", + "Works like :set!, but opens the dialog in a new window instead of a new tab. Use this, if you experience problems/crashes when using :set!", openPreferences, null ], @@ -338,7 +346,7 @@ var g_commands = [/*{{{*/ ":set without an argument opens about:config in a new tab to change advanced Firefox options.
"+ ":set! opens the GUI preference panel from Firefox in a new tab.
"+ ":set option? or :set option shows the current value of the option.
"+ - ":set option& resets 'option' to the default value.
"+ + ":set option& resets 'option' to the default value.
"+ ":set option+=foo and :set option-=foo WILL add/remove foo from list options.
", set, function(filter) { return get_settings_completions(filter); } @@ -366,7 +374,7 @@ var g_commands = [/*{{{*/ ["tab {cmd}"], "Execute {cmd} and tell it to output in a new tab", "Works for only commands that support it.
" + - "Example: :tab help tab opens the help in a new tab.", + "Example: :tab help tab opens the help in a new tab.", tab, null ], @@ -382,7 +390,7 @@ var g_commands = [/*{{{*/ ["tabopen", "t", "to", "topen", "tabnew", "tabedit", "tabe"], ["tabopen [url] [| url]"], "Open one or more URLs in a new tab", - "Like :open but open URLs in a new tab.
"+ + "Like :open but open URLs in a new tab.
"+ "If used with !, the 'tabopen' value of the 'activate' setting is negated.", function (args, special) { if (args.length > 0) openURLsInNewTab(args, !special); else openURLsInNewTab("about:blank", true); }, function (filter) { return get_url_completions(filter); } @@ -478,7 +486,7 @@ var g_commands = [/*{{{*/ ["wqa[ll]", "xa[ll]"], "Save the session and quit", "Quit Vimperator, no matter how many tabs/windows are open. The session is stored.
"+ - ":wq is different as in vim, as it closes the window instead of just one tab by popular demand. Complain on the mailing list, if you want to change that.", + ":wq is different as in vim, as it closes the window instead of just one tab by popular demand. Complain on the mailing list, if you want to change that.", function (args) { quit(true); }, null ], @@ -529,21 +537,21 @@ var g_mappings = [/*{{{*/ ["d"], ["{count}d"], "Delete current buffer (=tab)", - "Count WILL be supported in future releases, then 2d removes two tabs and the one the right is selected.", + "Count WILL be supported in future releases, then 2d removes two tabs and the one the right is selected.", function(count) { tab_remove(count, false, 0); } ], [ ["D"], ["{count}D"], "Delete current buffer (=tab)", - "Count WILL be supported in future releases, then 2D removes two tabs and the one the left is selected.", + "Count WILL be supported in future releases, then 2D removes two tabs and the one the left is selected.", function(count) { tab_remove(count, true, 0); } ], [ ["ge"], ["ge {cmd}"], "Execute an Ex command", - "Go Execute works like :execute.
"+ + "Go Execute works like :execute.
"+ "This mapping is for debugging purposes, and may be removed in future.", function(count) { openVimperatorBar('execute '); } ], @@ -565,7 +573,7 @@ var g_mappings = [/*{{{*/ ["gP"], ["gP"], "Open (put) an URL based on the current clipboard contents in a new buffer", - "Works like P, but inverts the 'activate' setting.", + "Works like P, but inverts the 'activate' setting.", function(count) { openURLsInNewTab(readFromClipboard(), false); } ], [ @@ -573,7 +581,7 @@ var g_mappings = [/*{{{*/ ["{count}gt"], "Go to next tab", "Cycles to the first tab, when the last is selected.
"+ - "Count is supported, 3gt goes to the third tab.", + "Count is supported, 3gt goes to the third tab.", function(count) { tab_go(count > 0 ? count : 0); } ], [ @@ -581,36 +589,36 @@ var g_mappings = [/*{{{*/ ["{count}gT"], "Go to previous tab", "Cycles to the last tab, when the first is selected.
"+ - "Count is supported, 3gt goes to the third tab.", + "Count is supported, 3gt goes to the third tab.", function(count) { tab_go(count > 0 ? count :-1); } ], [ ["o"], ["o"], "Open one or more URLs in the current tab", - "See :open for more details", + "See :open for more details", function(count) { openVimperatorBar('open '); } ], [ ["O"], ["O"], "Open one ore more URLs in the current tab, based on current location", - "Works like o, but preselects current URL in the :open query.", + "Works like o, but preselects current URL in the :open query.", function(count) { openVimperatorBar('open ' + getCurrentLocation()); } ], [ ["p", ""], ["p", ""], "Open (put) an URL based on the current clipboard contents in the current buffer", - "You can also just select some non-URL text, and search for it with the default search engine or keyword (specified by the 'defsearch' setting) with p", + "You can also just select some non-URL text, and search for it with the default search engine or keyword (specified by the 'defsearch' setting) with p", function(count) { openURLs(readFromClipboard()); } ], [ ["P"], ["P"], "Open (put) an URL based on the current clipboard contents in a new buffer", - "Works like p, but opens a new tab.
"+ - "Whether the new buffer is activated, depends on the 'activate' setting.", + "Works like p, but opens a new tab.
"+ + "Whether the new buffer is activated, depends on the 'activate' setting.", function(count) { openURLsInNewTab(readFromClipboard(), true); } ], [ @@ -631,15 +639,15 @@ var g_mappings = [/*{{{*/ ["t"], ["t"], "Open one or more URLs in a new tab", - "Like o but open URLs in a new tab.
"+ - "See :tabopen for more details", + "Like o but open URLs in a new tab.
"+ + "See :tabopen for more details", function(count) { openVimperatorBar('tabopen '); } ], [ ["T"], ["T"], "Open one ore more URLs in a new tab, based on current location", - "Works like t, but preselects current URL in the :tabopen query.", + "Works like t, but preselects current URL in the :tabopen query.", function(count) { openVimperatorBar('tabopen ' + getCurrentLocation()); } ], [ @@ -695,7 +703,7 @@ var g_mappings = [/*{{{*/ ["ZQ"], ["ZQ"], "Quit and don't save the session", - "Works like :qall.", + "Works like :qall.", function(count) { quit(false); } ], [ @@ -703,7 +711,7 @@ var g_mappings = [/*{{{*/ ["ZZ"], "Quit and save the session", "Quit Vimperator, no matter how many tabs/windows are open. The session is stored.
" + - "Works like :xall.", + "Works like :xall.", function(count) { quit(true); } ], @@ -712,7 +720,7 @@ var g_mappings = [/*{{{*/ ["0", "^"], ["0", "^"], "Scroll to the absolute left of the document", - "Unlike in vim, 0 and ^ work exactly the same way.", + "Unlike in vim, 0 and ^ work exactly the same way.", function(count) { scrollBufferAbsolute(0, -1); } ], [ @@ -726,46 +734,46 @@ var g_mappings = [/*{{{*/ ["gg", ""], ["{count}gg", "{count}"], "Goto the top of the document", - "Count is supported, 35gg vertically goes to 35% of the document", + "Count is supported, 35gg vertically goes to 35% of the document", function(count) { scrollBufferAbsolute(-1, count > 0 ? count : 0); } ], [ ["G", ""], ["{count}G", "{count}"], "Goto the end of the document", - "Count is supported, 35G vertically goes to 35% of the document", + "Count is supported, 35G vertically goes to 35% of the document", function(count) { scrollBufferAbsolute(-1, count >= 0 ? count : 100); } ], [ ["h", ""], ["{count}h", "{count}"], "Scroll document to the left", - "Count is supported: 10h will move 10 times as much to the left.
"+ - "If the document cannot scroll more, a beep is emmited (unless 'beep' is turned off).", + "Count is supported: 10h will move 10 times as much to the left.
"+ + "If the document cannot scroll more, a beep is emmited (unless 'beep' is turned off).", function(count) { scrollBufferRelative(-1, 0); } ], [ ["j", "", ""], ["{count}j", "{count}", "{count}"], "Scroll document down", - "Count is supported: 10j will move 10 times as much down.
"+ - "If the document cannot scroll more, a beep is emmited (unless 'beep' is turned off).", + "Count is supported: 10j will move 10 times as much down.
"+ + "If the document cannot scroll more, a beep is emmited (unless 'beep' is turned off).", function(count) { scrollBufferRelative(0, 1); } ], [ ["k", "", ""], ["{count}k", "{count}", "{count}"], "Scroll document up", - "Count is supported: 10k will move 10 times as much up.
"+ - "If the document cannot scroll more, a beep is emmited (unless 'beep' is turned off).", + "Count is supported: 10k will move 10 times as much up.
"+ + "If the document cannot scroll more, a beep is emmited (unless 'beep' is turned off).", function(count) { scrollBufferRelative(0, -1); } ], [ ["l", ""], ["{count}l", "{count}"], "Scroll document to the right", - "Count is supported: 10l will move 10 times as much to the right.
"+ - "If the document cannot scroll more, a beep is emmited (unless 'beep' is turned off).", + "Count is supported: 10l will move 10 times as much to the right.
"+ + "If the document cannot scroll more, a beep is emmited (unless 'beep' is turned off).", function(count) { scrollBufferRelative(1, 0); } ], [ @@ -802,28 +810,28 @@ var g_mappings = [/*{{{*/ ["H", "", ""], ["{count}H", "{count}", "{count}"], "Go back in the browser history", - "Count is supported, 3H goes back 3 steps.", + "Count is supported, 3H goes back 3 steps.", function(count) { stepInHistory(count > 0 ? -1 * count : -1); } ], [ ["L", "", ""], ["{count}L", "{count}", "{count}"], "Go forward in the browser history", - "Count is supported, 3L goes forward 3 steps.", + "Count is supported, 3L goes forward 3 steps.", function(count) { stepInHistory(count > 0 ? count : 1); } ], [ ["gu", ""], ["{count}gu", "{count}"], "Go to parent directory", - "Count is supported, 2gu on http://www.example.com/dir1/dir2/file.htm would open http://www.example.com/dir1/", + "Count is supported, 2gu on http://www.example.com/dir1/dir2/file.htm would open http://www.example.com/dir1/", goUp ], [ ["gU", ""], ["gU", ""], "Go to the root of the website", - "gU on http://www.example.com/dir1/dir2/file.htm opens http://www.example.com/.
"+ + "gU on http://www.example.com/dir1/dir2/file.htm opens http://www.example.com/.
"+ "When browsing a local directory, it goes to the root document.", function(count) { openURLs("..."); } ], @@ -833,8 +841,8 @@ var g_mappings = [/*{{{*/ ["f"], ["f"], "Start QuickHint mode", - "In QuickHint mode, every hintable item (according to the 'hinttags' XPath query) is assigned a label.
"+ - "If you then press the keys for a label, it is followed as soon as it can be uniquely identified and this mode is stopped. Or press <Esc> to stop this mode.
"+ + "In QuickHint mode, every hintable item (according to the 'hinttags' XPath query) is assigned a label.
"+ + "If you then press the keys for a label, it is followed as soon as it can be uniquely identified and this mode is stopped. Or press <Esc> to stop this mode.
"+ "If you write the hint in ALLCAPS, the hint is followed in a background tab.", function(count) { hah.enableHahMode(HINT_MODE_QUICK); } ], @@ -842,10 +850,10 @@ var g_mappings = [/*{{{*/ ["F"], ["F"], "Start AlwaysHint mode", - "In AlwaysHint mode, every hintable item (according to the 'hinttags' XPath query) is assigned a label.
"+ - "If you then press the keys for a label, it is followed as soon as it can be uniquely identified. Labels stay active after following a hint in this mode, press <Esc> to stop this mode.
"+ + "In AlwaysHint mode, every hintable item (according to the 'hinttags' XPath query) is assigned a label.
"+ + "If you then press the keys for a label, it is followed as soon as it can be uniquely identified. Labels stay active after following a hint in this mode, press <Esc> to stop this mode.
"+ "This hint mode is especially useful for browsing large sites like Forums as hints are automatically regenerated when switching to a new document.
"+ - "Also, most Ctrl-prefixed shortcut keys are available in this mode for navigation.", + "Also, most Ctrl-prefixed shortcut keys are available in this mode for navigation.", function(count) { hah.enableHahMode(HINT_MODE_ALWAYS); } ], [ @@ -853,20 +861,20 @@ var g_mappings = [/*{{{*/ [";"], "Start ExtendedHint mode", "ExtendedHint mode is useful, since in this mode you can yank link locations, or open them in a new window.
"+ - "E.g., if you want to yank the location of hint AB, press ; to start this hint mode.
"+ - "Then press AB to select the hint. Now press y to yank its location.
"+ + "E.g., if you want to yank the location of hint AB, press ; to start this hint mode.
"+ + "Then press AB to select the hint. Now press y to yank its location.
"+ "Actions for selected hints in ExtendedHint mode are:
"+ - "
  • y to yank its location
  • "+ - "
  • Y to yank its text description
  • "+ - "
  • o to open its location in the current tab
  • "+ - "
  • t to open its location in a new tab
  • "+ - "
  • O to open its location in an :open query (not implemented yet)
  • "+ - "
  • T to open its location in an :tabopen query (not implemented yet)
  • "+ - "
  • s to save its destination (not implemented yet)
  • "+ - "
  • <C-w> to open its destination in a new window
  • "+ + "
    • y to yank its location
    • "+ + "
    • Y to yank its text description
    • "+ + "
    • o to open its location in the current tab
    • "+ + "
    • t to open its location in a new tab
    • "+ + "
    • O to open its location in an :open query (not implemented yet)
    • "+ + "
    • T to open its location in an :tabopen query (not implemented yet)
    • "+ + "
    • s to save its destination (not implemented yet)
    • "+ + "
    • <C-w> to open its destination in a new window
    • "+ "
    "+ - "Multiple hints can be seperated by commas where it makes sense. ;ab,ac,adt opens AB, AC and AD in a new tab.
    "+ - "Hintable elements for this mode can be set in the 'extendedhinttags' XPath string.", + "Multiple hints can be seperated by commas where it makes sense. ;ab,ac,adt opens AB, AC and AD in a new tab.
    "+ + "Hintable elements for this mode can be set in the 'extendedhinttags' XPath string.", function(count) { hah.enableHahMode(HINT_MODE_EXTENDED); } ], @@ -893,7 +901,7 @@ var g_mappings = [/*{{{*/ [""], [""], "Open help window", - "The default section is shown, if you need help for a specific topic, try :help <F1> (jumping to a specific section not implemented yet).", + "The default section is shown, if you need help for a specific topic, try :help <F1> (jumping to a specific section not implemented yet).", function(count) { help(null); } ], [ @@ -907,19 +915,19 @@ var g_mappings = [/*{{{*/ ["I"], ["I"], "Disable vimperator keys", - "Starts an 'ignorekeys' mode, where all keys except <Esc> are passed to the next event handler.
    "+ + "Starts an 'ignorekeys' mode, where all keys except <Esc> are passed to the next event handler.
    "+ "This is especially useful, if JavaScript controlled forms like the RichEdit form fields of GMail don't work anymore.
    " + - "To exit this mode, press <Esc>. If you also need to pass <Esc>"+ - "in this mode to the webpage, prepend it with <C-v>.", + "To exit this mode, press <Esc>. If you also need to pass <Esc>"+ + "in this mode to the webpage, prepend it with <C-v>.", function(count) { addMode(MODE_ESCAPE_ALL_KEYS);} ], [ [""], // if you ever add/remove keys here, also check them in the onVimperatorKeypress() function [""], "Escape next key", - "If you need to pass a certain key to a javascript form field or another extension prefix the key with <C-v>.
    "+ - "Also works to unshadow Firefox shortcuts like <C-o> which are otherwise hidden in Vimperator.
    "+ - "When in 'ignorekeys' mode (activated by <I>), <C-v> will pass the next key to Vimperator instead of the webpage.", + "If you need to pass a certain key to a javascript form field or another extension prefix the key with <C-v>.
    "+ + "Also works to unshadow Firefox shortcuts like <C-o> which are otherwise hidden in Vimperator.
    "+ + "When in 'ignorekeys' mode (activated by <I>), <C-v> will pass the next key to Vimperator instead of the webpage.", function(count) { addMode(MODE_ESCAPE_ONE_KEY); } ], [ diff --git a/chrome/content/vimperator/help.js b/chrome/content/vimperator/help.js index 51483f6f..a8defbcb 100644 --- a/chrome/content/vimperator/help.js +++ b/chrome/content/vimperator/help.js @@ -33,10 +33,10 @@ function help(section, easter) echoerr("E478: Don't panic!"); return; } - if ((arguments[3] && arguments[3].inTab) || !window.content.document.open) + if ((arguments[3] && arguments[3].inTab))// || !window.content.document.open) openURLsInNewTab("", true); - - var doc = window.content.document; + else + openURLs("about:blank"); // xxx: for firebug: :js Firebug.toggleBar(true) @@ -52,7 +52,7 @@ function help(section, easter) for (var i=0; i < commands.length; i++) { // the usage information for the command - ret += ''; + ret += ''; for (var j=0; j < commands[i][USAGE].length; j++) { var usage = commands[i][USAGE][j]; @@ -64,9 +64,9 @@ function help(section, easter) usage = usage.replace(/>/g, ">"); usage = usage.replace(/\\n/g, "
    "); // color {count} and [url] arguments in the usage, not nice and error prone but the regexp work (for now) - usage = usage.replace(/(^|;|\n|\s|\]|\}|=|)({.*?}|\[.*?\])/gm, "$1$2"); + usage = usage.replace(/(^|;|\n|\s|\]|\}|=|)({.*?}|\[.*?\])/gm, "$1$2"); // and the 'setting' in a different color - usage = usage.replace(/^'(\w+)'/gm, "'$1'"); + usage = usage.replace(/^'(\w+)'/gm, "'$1'"); ret += "" +beg+ usage +end+ '
    '; } ret += ''; @@ -92,19 +92,22 @@ function help(section, easter) ret += "Sorry, no help available"; // the tags which are printed on the top right //ret += '===================================='; - ret += ''; + ret += ''; for (var j=0; j < commands[i][COMMANDS].length; j++) { var cmd_name = commands[i][COMMANDS][j]; cmd_name = cmd_name.replace(//g, ">"); - ret += '' +beg+ cmd_name +end+ '
    '; + // cmd_name = cmd_name.replace(/"/g, """); + // cmd_name = cmd_name.replace(/'/g, "'"); + // cmd_name = cmd_name.replace(/&/g, "&"); + ret += '' +beg+ cmd_name +end+ '
    '; } ret += ''; // add more space between entries if (i < commands.length-1) - ret += '
    \n'; + ret += '
    \n'; } return ret; } @@ -131,18 +134,18 @@ function help(section, easter) return ret; } - var header = '

    Vimperator

    \n' + - '

    First there was a Navigator, then there was an Explorer.
    \n'+ + var header = '

    Vimperator

    \n' + + '

    First there was a Navigator, then there was an Explorer.
    \n'+ 'Later it was time for a Konqueror. Now it\'s time for an Imperator, the VIMperator :)

    \n'; var introduction = '

    Introduction

    ' + '

    Vimperator is a free browser add-on for Firefox, which makes it look and behave like the Vim text editor.
    ' + 'It has similar key bindings, and you could call it a modal webbrowser, as key bindings differ according to which mode you are in.

    \n' + - '

    Warning: To provide the most authentic Vim experience, the Firefox menubar and toolbar were hidden.
    '+ - 'If you really need them, type: :set guioptions=mT to get it back.
    \n' + - 'If you don\'t like Vimperator at all, you can uninstall it by typing :addons and remove/disable it.
    ' + - 'If you like it, but can\'t remember the shortcuts, press F1 or :help to get this help window back.

    \n' + + '

    Warning: To provide the most authentic Vim experience, the Firefox menubar and toolbar were hidden.
    '+ + 'If you really need them, type: :set guioptions=mT to get it back.
    \n' + + 'If you don\'t like Vimperator at all, you can uninstall it by typing :addons and remove/disable it.
    ' + + 'If you like it, but can\'t remember the shortcuts, press F1 or :help to get this help window back.

    \n' + '

    Since Vimperator\'s GUI is embedded into a toolbar, it may look too 3D-like with the default theme.
    '+ 'For best experience, I therefore recommend the Whitehart theme.

    \n' + @@ -151,11 +154,11 @@ function help(section, easter) 'send me greetings, patches or make a donation: \n' + '
    ' + - '' + - '' + + '' + + '' + - '' + - '' + + '' + + '' + '
    \n' + 'Of course as a believer in free open source software, only make a donation if you really like Vimperator, and the money doesn\'t hurt - otherwise just use it, recommend it and like it :)

    \n' @@ -193,20 +196,21 @@ function help(section, easter) settings + '\n\n
\n'; - + var doc = window.content.document; try { doc.open(); } catch(e) { - // when the url is "about:" the doc is not open - // then open a new tab for it - //if (!arguments[3] || !arguments[3].inTab) - // help(section, false, {inTab: true}); - openURLsInNewTab("", true); - doc = window.content.document; - doc.open(); + // when the url is "about:" or any other xhtml page the doc is not open + // then retry again in 250ms but just once + if (arguments[3] && arguments[3].recursive) + return false; + + openURLs("about:blank"); + setTimeout(function () { help(section, false, null, {recursive: true}); }, 250); + return; } doc.write(fulldoc); doc.close(); diff --git a/chrome/content/vimperator/settings.js b/chrome/content/vimperator/settings.js index 18332880..bfd893bd 100644 --- a/chrome/content/vimperator/settings.js +++ b/chrome/content/vimperator/settings.js @@ -62,13 +62,13 @@ var g_settings = [/*{{{*/ ["complete", "cpt"], ["complete", "cpt"], "Items which are completed at the :[tab]open prompt", - "Available items:
"+ + "Available items:
"+ ""+ - "The order is important, so :set complete=bs would list bookmarks first, and then any available quick searches.
"+ - "Add 'sort' to the 'wildoptions' setting if you want all entries sorted.", + "The order is important, so :set complete=bs would list bookmarks first, and then any available quick searches.
"+ + "Add 'sort' to the 'wildoptions' setting if you want all entries sorted.", "charlist", null, function(value) { set_pref("complete", value); }, @@ -80,7 +80,7 @@ var g_settings = [/*{{{*/ ["defsearch", "ds"], ["defsearch", "ds"], "Set the default search engine", - "The default search engine is used in the :[tab]open [arg] command "+ + "The default search engine is used in the :[tab]open [arg] command "+ "if [arg] neither looks like a URL or like a specified search engine/keyword.", "string", function() { return [["foo", "bar"], ["shit", "blub"]]; }, @@ -130,7 +130,12 @@ var g_settings = [/*{{{*/ ["guioptions", "go"], ["guioptions", "go"], "Shows or hides the menu, toolbar and scrollbars", - "Supported characters:
", + "Supported characters:
", "charlist", null, function(value) { set_pref("guioptions", value); set_guioptions(value); }, @@ -165,7 +170,7 @@ var g_settings = [/*{{{*/ [ ["hinttags"], ["hinttags"], - "XPath string of hintable elements activated by 'f' and 'F'", + "XPath string of hintable elements activated by 'f' and 'F'", null, "string", null, @@ -191,7 +196,7 @@ var g_settings = [/*{{{*/ ["preload", "nopreload"], ["preload"], "Speed up first time history/bookmark completion", - "History access can be quite slow for a large history. Vimperator maintains a cache to speed it up significantly on subsequent access.
"+ + "History access can be quite slow for a large history. Vimperator maintains a cache to speed it up significantly on subsequent access.
"+ "In order to also speed up first time access, it is cached at startup, if this option is set (recommended).", "boolean", null, @@ -204,7 +209,8 @@ var g_settings = [/*{{{*/ ["previewheight", "pvh"], ["previewheight", "pvh"], "Default height for preview window", - "Value must be between 1 and 50. If the value is too high, completions may cover the command-line. Close the preview window with :pclose.", + "Value must be between 1 and 50. If the value is too high, completions may cover the command-line. "+ + "Close the preview window with :pclose.", "number", null, function(value) { set_pref("previewheight", value); }, @@ -228,7 +234,7 @@ var g_settings = [/*{{{*/ ["showtabline", "stal"], ["showtabline", "stal"], "Control when to show the tab bar of opened web pages", - "Available items:
"+ + "Available items:
"+ ""+ @@ -244,7 +250,7 @@ var g_settings = [/*{{{*/ ["usermode", "um", "nousermode", "noum"], ["usermode", "um"], "Show current website with a minimal stylesheet to make it easily accessible", - "Note that this is a local setting for now, later it may be split into a global and :setlocal part", + "Note that this is a local setting for now, later it may be split into a global and :setlocal part", "boolean", null, function(value) { opt_usermode = value; setStyleDisabled(value); }, @@ -284,7 +290,7 @@ var g_settings = [/*{{{*/ "A list of words that change how command line completion is done.
"+ "Currently only one word is allowed:
"+ "
"+
-        "
" + + "" + "
sortAlways sorts completion list, overriding the 'complete' option.
sortAlways sorts completion list, overriding the 'complete' option.
", "stringlist", null, diff --git a/chrome/content/vimperator/vimperator.js b/chrome/content/vimperator/vimperator.js index 20ef8a79..34afa5ca 100644 --- a/chrome/content/vimperator/vimperator.js +++ b/chrome/content/vimperator/vimperator.js @@ -242,9 +242,9 @@ function init() if (get_pref("firsttime", true)) { setTimeout(function() { - var tab = openURLsInNewTab("about:blank", true); - BrowserStop(); - help(); + //var tab = openURLsInNewTab("about:blank", true); + //BrowserStop(); + help(null, null, null, {inTab: true}); set_pref("firsttime", false); }, 1000); }