1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 20:07:59 +01:00

cleaned up html code for :help to make it more xhtml compatible

:help now opens in the current tab even when current tab is a xhtml document
This commit is contained in:
Martin Stubenschrott
2007-05-09 00:31:25 +00:00
parent fd39e7fb7a
commit f873389e5f
5 changed files with 135 additions and 116 deletions

View File

@@ -1,6 +1,7 @@
<pre> <pre>
2007-05-02: 2007-05-02:
* version ??? * 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 * hints work on xhtml pages now (you need to reset the 'hinttags' and
'extendedhinttags' settings with :set hinttags& and :set extendedhinttags& 'extendedhinttags' settings with :set hinttags& and :set extendedhinttags&
* :set option& resets the option to the default value * :set option& resets the option to the default value

View File

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

View File

@@ -33,10 +33,10 @@ function help(section, easter)
echoerr("E478: Don't panic!"); echoerr("E478: Don't panic!");
return; return;
} }
if ((arguments[3] && arguments[3].inTab) || !window.content.document.open) if ((arguments[3] && arguments[3].inTab))// || !window.content.document.open)
openURLsInNewTab("", true); openURLsInNewTab("", true);
else
var doc = window.content.document; openURLs("about:blank");
// xxx: for firebug: :js Firebug.toggleBar(true) // xxx: for firebug: :js Firebug.toggleBar(true)
@@ -52,7 +52,7 @@ function help(section, easter)
for (var i=0; i < commands.length; i++) for (var i=0; i < commands.length; i++)
{ {
// the usage information for the command // the usage information for the command
ret += '</td></tr><tr class="description"><td class="usage" valign="top">'; ret += '<tr class="description"><td class="usage" valign="top">';
for (var j=0; j < commands[i][USAGE].length; j++) for (var j=0; j < commands[i][USAGE].length; j++)
{ {
var usage = commands[i][USAGE][j]; var usage = commands[i][USAGE][j];
@@ -64,9 +64,9 @@ function help(section, easter)
usage = usage.replace(/>/g, "&gt;"); usage = usage.replace(/>/g, "&gt;");
usage = usage.replace(/\\n/g, "<br/>"); usage = usage.replace(/\\n/g, "<br/>");
// color {count} and [url] arguments in the usage, not nice and error prone but the regexp work (for now) // color {count} and [url] arguments in the usage, not nice and error prone but the regexp work (for now)
usage = usage.replace(/(^|;|\n|\s|\]|\}|=|<br\/?>)({.*?}|\[.*?\])/gm, "$1<span class=argument>$2</span>"); usage = usage.replace(/(^|;|\n|\s|\]|\}|=|<br\/?>)({.*?}|\[.*?\])/gm, "$1<span class=\"argument\">$2</span>");
// and the 'setting' in a different color // and the 'setting' in a different color
usage = usage.replace(/^'(\w+)'/gm, "'<span class=setting>$1</span>'"); usage = usage.replace(/^'(\w+)'/gm, "'<span class=\"setting\">$1</span>'");
ret += "<code>" +beg+ usage +end+ '</code><br/>'; ret += "<code>" +beg+ usage +end+ '</code><br/>';
} }
ret += '</td><td valign="top">'; ret += '</td><td valign="top">';
@@ -92,19 +92,22 @@ function help(section, easter)
ret += "Sorry, no help available"; ret += "Sorry, no help available";
// the tags which are printed on the top right // the tags which are printed on the top right
//ret += '<tr class="tag"><td colspan="1">===================================='; //ret += '<tr class="tag"><td colspan="1">====================================';
ret += '<td class="tag" valign="top">'; ret += '</td><td class="tag" valign="top">';
for (var j=0; j < commands[i][COMMANDS].length; j++) for (var j=0; j < commands[i][COMMANDS].length; j++)
{ {
var cmd_name = commands[i][COMMANDS][j]; var cmd_name = commands[i][COMMANDS][j];
cmd_name = cmd_name.replace(/</g, "&lt;"); cmd_name = cmd_name.replace(/</g, "&lt;");
cmd_name = cmd_name.replace(/>/g, "&gt;"); cmd_name = cmd_name.replace(/>/g, "&gt;");
ret += '<code id="' +beg+ commands[i][COMMANDS][j] +end+ '">' +beg+ cmd_name +end+ '</code><br/>'; // cmd_name = cmd_name.replace(/"/g, "&quot;");
// cmd_name = cmd_name.replace(/'/g, "&apos;");
// cmd_name = cmd_name.replace(/&/g, "&amp;");
ret += '<code id="' +beg+ /*commands[i][COMMANDS][j]*/ cmd_name +end+ '">' +beg+ cmd_name +end+ '</code><br/>';
} }
ret += '</td></tr>'; ret += '</td></tr>';
// add more space between entries // add more space between entries
if (i < commands.length-1) if (i < commands.length-1)
ret += '<tr class="separator"><td colspan=3><hr></td></tr>\n'; ret += '<tr class="separator"><td colspan="3"><hr/></td></tr>\n';
} }
return ret; return ret;
} }
@@ -131,18 +134,18 @@ function help(section, easter)
return ret; return ret;
} }
var header = '<h1 align=center>Vimperator</h1>\n' + var header = '<h1 align=\"center\">Vimperator</h1>\n' +
'<p align=center><b>First there was a Navigator, then there was an Explorer.<br/>\n'+ '<p align=\"center\"><b>First there was a Navigator, then there was an Explorer.<br/>\n'+
'Later it was time for a Konqueror. Now it\'s time for an Imperator, the VIMperator :)</b></p>\n'; 'Later it was time for a Konqueror. Now it\'s time for an Imperator, the VIMperator :)</b></p>\n';
var introduction = '<h2>Introduction</h2>' + var introduction = '<h2>Introduction</h2>' +
'<p><a href="http://vimperator.mozdev.org">Vimperator</a> is a free browser add-on for Firefox, which makes it look and behave like the <a href="http://www.vim.org">Vim</a> text editor.<br/>' + '<p><a href="http://vimperator.mozdev.org">Vimperator</a> is a free browser add-on for Firefox, which makes it look and behave like the <a href="http://www.vim.org">Vim</a> text editor.<br/>' +
'It has similar key bindings, and you could call it a modal webbrowser, as key bindings differ according to which mode you are in.</p>\n' + 'It has similar key bindings, and you could call it a modal webbrowser, as key bindings differ according to which mode you are in.</p>\n' +
'<p><font color=red><b>Warning:</b></font> To provide the most authentic Vim experience, the Firefox menubar and toolbar were hidden.<br/>'+ '<p><font color="red"><b>Warning:</b></font> To provide the most authentic Vim experience, the Firefox menubar and toolbar were hidden.<br/>'+
'If you really need them, type: <code class=command>:set guioptions=mT</code> to get it back.<br>\n' + 'If you really need them, type: <code class="command">:set guioptions=mT</code> to get it back.<br/>\n' +
'If you don\'t like Vimperator at all, you can uninstall it by typing <code class=command>:addons</code> and remove/disable it.<br/>' + 'If you don\'t like Vimperator at all, you can uninstall it by typing <code class=\"command\">:addons</code> and remove/disable it.<br/>' +
'If you like it, but can\'t remember the shortcuts, press <code class=mapping>F1</code> or <code class=command>:help</code> to get this help window back.</p>\n' + 'If you like it, but can\'t remember the shortcuts, press <code class=\"mapping\">F1</code> or <code class=\"command\">:help</code> to get this help window back.</p>\n' +
'<p>Since Vimperator\'s GUI is embedded into a toolbar, it may look too 3D-like with the default theme.<br/>'+ '<p>Since Vimperator\'s GUI is embedded into a toolbar, it may look too 3D-like with the default theme.<br/>'+
'For best experience, I therefore recommend the <a href=\"https://addons.mozilla.org/firefox/364/\">Whitehart</a> theme.</p>\n' + 'For best experience, I therefore recommend the <a href=\"https://addons.mozilla.org/firefox/364/\">Whitehart</a> theme.</p>\n' +
@@ -151,11 +154,11 @@ function help(section, easter)
'send me greetings, patches or make a donation: \n' + 'send me greetings, patches or make a donation: \n' +
'<form action="https://www.paypal.com/cgi-bin/webscr" method="post">' + '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">' +
'<input type="hidden" name="cmd" value="_s-xclick">' + '<input type="hidden" name="cmd" value="_s-xclick"/>' +
'<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it\'s fast, free and secure!">' + '<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it\'s fast, free and secure!"/>' +
'<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">' + '<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"/>' +
'<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHPwYJKoZIhvcNAQcEoIIHMDCCBywCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBDDJfc+lXLBSAM9XSWv/ebzG/L7PTqYiIXaWVg8pfinDsfYaAcifcgCTuApg4v/VaZIQ/hLODzQu2EvmjGXP0twErA/Q8G5gx0l197PJSyVXb1sLwd1mgOdLF4t0HmDCdEI9z3H6CMhsb3xVwlfpzllSfCIqzlSpx4QtdzEZGzLDELMAkGBSsOAwIaBQAwgbwGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQI8ZOwn5QkHgaAgZjjtPQxB7Vw2rS7Voap9y+xdVLoczUQ97hw+bOdZLcGykBtfoVjdn76MS51QKjGp1fEmxkqTuQ+Fxv8+OVtHu0QF/qlrhmC3fJBRJ0IFWxKdXS+Wod4615BDaG2X1hzvCL443ffka8XlLSiFTuW43BumQs/O+6Jqsk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u+0NYxXRJhB+zMJubnMMMjzNrGlqI4F2HAB/bCA1eOJ5B83Of3dA4rk/T/8GoSQ=-----END PKCS7-----"/>' +
'</form>\n' + '</form>\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 :)</p>\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 :)</p>\n'
@@ -193,20 +196,21 @@ function help(section, easter)
settings + settings +
'\n</td></tr></table>\n</pre></body>\n</html>'; '\n</td></tr></table>\n</pre></body>\n</html>';
var doc = window.content.document;
try try
{ {
doc.open(); doc.open();
} }
catch(e) catch(e)
{ {
// when the url is "about:" the doc is not open // when the url is "about:" or any other xhtml page the doc is not open
// then open a new tab for it // then retry again in 250ms but just once
//if (!arguments[3] || !arguments[3].inTab) if (arguments[3] && arguments[3].recursive)
// help(section, false, {inTab: true}); return false;
openURLsInNewTab("", true);
doc = window.content.document; openURLs("about:blank");
doc.open(); setTimeout(function () { help(section, false, null, {recursive: true}); }, 250);
return;
} }
doc.write(fulldoc); doc.write(fulldoc);
doc.close(); doc.close();

View File

@@ -62,13 +62,13 @@ var g_settings = [/*{{{*/
["complete", "cpt"], ["complete", "cpt"],
["complete", "cpt"], ["complete", "cpt"],
"Items which are completed at the :[tab]open prompt", "Items which are completed at the :[tab]open prompt",
"Available items:<br>"+ "Available items:<br/>"+
"<ul><li><b>s</b>: Search machines and keyword URLs</li><li>"+ "<ul><li><b>s</b>: Search machines and keyword URLs</li><li>"+
"<b>f</b>: Local files</li><li>"+ "<b>f</b>: Local files</li><li>"+
"<b>b</b>: Bookmarks</li><li>"+ "<b>b</b>: Bookmarks</li><li>"+
"<b>h</b>: History</li></ul>"+ "<b>h</b>: History</li></ul>"+
"The order is important, so <code class=command>:set complete=bs</code> would list bookmarks first, and then any available quick searches.<br/>"+ "The order is important, so <code class=\"command\">:set complete=bs</code> would list bookmarks first, and then any available quick searches.<br/>"+
"Add 'sort' to the <code class=setting>'wildoptions'</code> setting if you want all entries sorted.", "Add 'sort' to the <code class=\"setting\">'wildoptions'</code> setting if you want all entries sorted.",
"charlist", "charlist",
null, null,
function(value) { set_pref("complete", value); }, function(value) { set_pref("complete", value); },
@@ -80,7 +80,7 @@ var g_settings = [/*{{{*/
["defsearch", "ds"], ["defsearch", "ds"],
["defsearch", "ds"], ["defsearch", "ds"],
"Set the default search engine", "Set the default search engine",
"The default search engine is used in the <code class=command>:[tab]open [arg]</code> command "+ "The default search engine is used in the <code class=\"command\">:[tab]open [arg]</code> command "+
"if [arg] neither looks like a URL or like a specified search engine/keyword.", "if [arg] neither looks like a URL or like a specified search engine/keyword.",
"string", "string",
function() { return [["foo", "bar"], ["shit", "blub"]]; }, function() { return [["foo", "bar"], ["shit", "blub"]]; },
@@ -130,7 +130,12 @@ var g_settings = [/*{{{*/
["guioptions", "go"], ["guioptions", "go"],
["guioptions", "go"], ["guioptions", "go"],
"Shows or hides the menu, toolbar and scrollbars", "Shows or hides the menu, toolbar and scrollbars",
"Supported characters:<br><ul><li><b>m</b>: menubar</li><li><b>T</b>: toolbar<li><b>b</b>: bookmark bar</li><li><b>s</b>: original Firefox statusbar</ul>", "Supported characters:<br/><ul>"+
"<li><b>m</b>: menubar</li>"+
"<li><b>T</b>: toolbar</li>"+
"<li><b>b</b>: bookmark bar</li>"+
"<li><b>s</b>: original Firefox statusbar</li>"+
"</ul>",
"charlist", "charlist",
null, null,
function(value) { set_pref("guioptions", value); set_guioptions(value); }, function(value) { set_pref("guioptions", value); set_guioptions(value); },
@@ -165,7 +170,7 @@ var g_settings = [/*{{{*/
[ [
["hinttags"], ["hinttags"],
["hinttags"], ["hinttags"],
"XPath string of hintable elements activated by <code class=mapping>'f'</code> and <code class=mapping>'F'</code>", "XPath string of hintable elements activated by <code class=\"mapping\">'f'</code> and <code class=\"mapping\">'F'</code>",
null, null,
"string", "string",
null, null,
@@ -191,7 +196,7 @@ var g_settings = [/*{{{*/
["preload", "nopreload"], ["preload", "nopreload"],
["preload"], ["preload"],
"Speed up first time history/bookmark completion", "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.<br>"+ "History access can be quite slow for a large history. Vimperator maintains a cache to speed it up significantly on subsequent access.<br/>"+
"In order to also speed up first time access, it is cached at startup, if this option is set (recommended).", "In order to also speed up first time access, it is cached at startup, if this option is set (recommended).",
"boolean", "boolean",
null, null,
@@ -204,7 +209,8 @@ var g_settings = [/*{{{*/
["previewheight", "pvh"], ["previewheight", "pvh"],
["previewheight", "pvh"], ["previewheight", "pvh"],
"Default height for preview window", "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 <code class=command>:pclose</close>.", "Value must be between 1 and 50. If the value is too high, completions may cover the command-line. "+
"Close the preview window with <code class=\"command\">:pclose</code>.",
"number", "number",
null, null,
function(value) { set_pref("previewheight", value); }, function(value) { set_pref("previewheight", value); },
@@ -228,7 +234,7 @@ var g_settings = [/*{{{*/
["showtabline", "stal"], ["showtabline", "stal"],
["showtabline", "stal"], ["showtabline", "stal"],
"Control when to show the tab bar of opened web pages", "Control when to show the tab bar of opened web pages",
"Available items:<br>"+ "Available items:<br/>"+
"<ul><li><b>0</b>: Never show tab bar</li><li>"+ "<ul><li><b>0</b>: Never show tab bar</li><li>"+
" <b>1</b>: Show tab bar only if more than one tab is open</li><li>"+ " <b>1</b>: Show tab bar only if more than one tab is open</li><li>"+
" <b>2</b>: Always show tab bar</li></ul>"+ " <b>2</b>: Always show tab bar</li></ul>"+
@@ -244,7 +250,7 @@ var g_settings = [/*{{{*/
["usermode", "um", "nousermode", "noum"], ["usermode", "um", "nousermode", "noum"],
["usermode", "um"], ["usermode", "um"],
"Show current website with a minimal stylesheet to make it easily accessible", "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 <code style=command>:setlocal</code> part", "Note that this is a local setting for now, later it may be split into a global and <code class=\"command\">:setlocal</code> part",
"boolean", "boolean",
null, null,
function(value) { opt_usermode = value; setStyleDisabled(value); }, 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.<br/>"+ "A list of words that change how command line completion is done.<br/>"+
"Currently only one word is allowed:<br/>"+ "Currently only one word is allowed:<br/>"+
"<table><pre>"+ "<table><pre>"+
"<tr><td><b>sort</b></td><td>Always sorts completion list, overriding the <code class=setting>'complete'</code> option.</td></tr>" + "<tr><td><b>sort</b></td><td>Always sorts completion list, overriding the <code class=\"setting\">'complete'</code> option.</td></tr>" +
"</pre></table>", "</pre></table>",
"stringlist", "stringlist",
null, null,

View File

@@ -242,9 +242,9 @@ function init()
if (get_pref("firsttime", true)) if (get_pref("firsttime", true))
{ {
setTimeout(function() { setTimeout(function() {
var tab = openURLsInNewTab("about:blank", true); //var tab = openURLsInNewTab("about:blank", true);
BrowserStop(); //BrowserStop();
help(); help(null, null, null, {inTab: true});
set_pref("firsttime", false); set_pref("firsttime", false);
}, 1000); }, 1000);
} }