1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 15:57:58 +01:00

convert help page to XHTML Strict (excepting the id values) and add initial

implementations for the :viusage and :exusage commands
This commit is contained in:
Doug Kearns
2007-06-06 13:52:18 +00:00
parent e47ad6187e
commit bc717bdc24
7 changed files with 146 additions and 99 deletions

View File

@@ -381,6 +381,13 @@ function Commands()//{{{
help: "<code class=\"command\">:execute &#34;echo test&#34;</code> would show a message with the text &#34;test&#34;.<br/>" help: "<code class=\"command\">:execute &#34;echo test&#34;</code> would show a message with the text &#34;test&#34;.<br/>"
} }
)); ));
addDefaultCommand(new Command(["exu[sage]"],
function () { help("commands"); },
{
usage: ["exu[sage]"],
short_help: "Show help for Ex commands"
}
));
addDefaultCommand(new Command(["fo[rward]", "fw"], addDefaultCommand(new Command(["fo[rward]", "fw"],
function(args, special, count) { if(special) historyGoToEnd(); else stepInHistory(count > 0 ? count : 1); }, function(args, special, count) { if(special) historyGoToEnd(); else stepInHistory(count > 0 ? count : 1); },
{ {
@@ -608,6 +615,22 @@ function Commands()//{{{
"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."
} }
)); ));
addDefaultCommand(new Command(["tabl[ast]"],
function(args, count) { vimperator.tabs.select("$", false); },
{
usage: ["tabl[ast]"],
short_help: "Switch to the last tab"
}
));
addDefaultCommand(new Command(["tabm[ove]"],
function(args, special) { vimperator.tabs.move(getBrowser().mCurrentTab, args, special); },
{
usage: ["tabm[ove] [N]", "tabm[ove][!] [+|-N]"],
short_help: "Move the current tab after tab N",
help: "When N is 0 the current tab is made the first one. Without N the current tab is made the last one. " +
"N can also be prefixed with '+' or '-' to indicate a relative movement. If ! is specified the movement wraps around the start or end of the tab list."
}
));
addDefaultCommand(new Command(["tabn[ext]", "tn[ext]"], addDefaultCommand(new Command(["tabn[ext]", "tn[ext]"],
function(args, special, count) { vimperator.tabs.select("+1", true); }, function(args, special, count) { vimperator.tabs.select("+1", true); },
{ {
@@ -616,6 +639,13 @@ function Commands()//{{{
help: "Cycles to the first tab, when the last is selected." help: "Cycles to the first tab, when the last is selected."
} }
)); ));
addDefaultCommand(new Command(["tabo[nly]"],
function() { vimperator.tabs.keepOnly(getBrowser().mCurrentTab); },
{
usage: ["tabo[nly]"],
short_help: "Close all other tabs"
}
));
addDefaultCommand(new Command(["tabopen", "t[open]", "tabnew", "tabe[dit]"], addDefaultCommand(new Command(["tabopen", "t[open]", "tabnew", "tabe[dit]"],
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); },
{ {
@@ -626,22 +656,6 @@ function Commands()//{{{
completer: function (filter) { return get_url_completions(filter); } completer: function (filter) { return get_url_completions(filter); }
} }
)); ));
addDefaultCommand(new Command(["tabo[nly]"],
function() { vimperator.tabs.keepOnly(getBrowser().mCurrentTab); },
{
usage: ["tabo[nly]"],
short_help: "Close all other tabs"
}
));
addDefaultCommand(new Command(["tabm[ove]"],
function(args, special) { vimperator.tabs.move(getBrowser().mCurrentTab, args, special); },
{
usage: ["tabm[ove] [N]", "tabm[ove][!] [+|-N]"],
short_help: "Move the current tab after tab N",
help: "When N is 0 the current tab is made the first one. Without N the current tab is made the last one. " +
"N can also be prefixed with '+' or '-' to indicate a relative movement. If ! is specified the movement wraps around the start or end of the tab list."
}
));
addDefaultCommand(new Command(["tabp[revious]", "tp[revious]", "tabN[ext]", "tN[ext]"], addDefaultCommand(new Command(["tabp[revious]", "tp[revious]", "tabN[ext]", "tN[ext]"],
function(args, count) { vimperator.tabs.select("-1", true); }, function(args, count) { vimperator.tabs.select("-1", true); },
{ {
@@ -657,13 +671,6 @@ function Commands()//{{{
short_help: "Switch to the first tab" short_help: "Switch to the first tab"
} }
)); ));
addDefaultCommand(new Command(["tabl[ast]"],
function(args, count) { vimperator.tabs.select("$", false); },
{
usage: ["tabl[ast]"],
short_help: "Switch to the last tab"
}
));
addDefaultCommand(new Command(["u[ndo]"], addDefaultCommand(new Command(["u[ndo]"],
function(args, special, count) { if(count < 1) count = 1; undoCloseTab(count-1); }, function(args, special, count) { if(count < 1) count = 1; undoCloseTab(count-1); },
{ {
@@ -706,6 +713,13 @@ function Commands()//{{{
help: "You can show the Firefox version page with <code class=\"command\">:version!</code>." help: "You can show the Firefox version page with <code class=\"command\">:version!</code>."
} }
)); ));
addDefaultCommand(new Command(["viu[sage]"],
function () { help("mappings"); },
{
usage: ["viu[sage]"],
short_help: "Show help for normal mode commands"
}
));
addDefaultCommand(new Command(["wino[pen]", "w[open]", "wine[dit]"], addDefaultCommand(new Command(["wino[pen]", "w[open]", "wine[dit]"],
function () { vimperator.echo("winopen not yet implemented"); }, function () { vimperator.echo("winopen not yet implemented"); },
{ {

View File

@@ -253,7 +253,9 @@ function get_file_completions(filter)/*{{{*/
function get_help_completions(filter)/*{{{*/ function get_help_completions(filter)/*{{{*/
{ {
var help_array = []; var help_array = [[["mappings"], "Normal mode commands"],
[["commands"], "Ex commands"],
[["settings"], "Configuration options"]]; // TODO: hardcoded until we have proper 'pages'
g_substrings = []; g_substrings = [];
for (var command in vimperator.commands) for (var command in vimperator.commands)
{ {

View File

@@ -1,15 +1,25 @@
div.main {
font-family: monospace;
font-size: 12px;
width: 800px;
margin-left: auto;
margin-right: auto;
}
h1 {
text-align: center;
}
p.tagline {
text-align: center;
font-weight: bold;
}
/* the text in the tables is too large without that */ /* the text in the tables is too large without that */
table { table {
font-size: 1.0em; font-size: 1.0em;
} }
table.main {
border-width: 0px;
border-style: none;
margin-left: auto; /* for centering the table */
margin-right: auto;
width: 800px !important;
}
table.vimperator { table.vimperator {
border-width: 1px 1px 1px 1px; border-width: 1px 1px 1px 1px;
border-style: dotted dotted dotted dotted; border-style: dotted dotted dotted dotted;
@@ -17,6 +27,7 @@ table.vimperator {
margin-left: auto; /* for centering the table */ margin-left: auto; /* for centering the table */
margin-right: auto; margin-right: auto;
width: 800px !important; width: 800px !important;
white-space: -moz-pre-wrap !important;
} }
table.vimperator td { table.vimperator td {
border-width: 0px 0px 0px 0px; border-width: 0px 0px 0px 0px;
@@ -39,7 +50,7 @@ hr { /* horizontal lines */
td.tag { td.tag {
text-align: right; text-align: right;
vertical-align: top; vertical-align: top;
white-space: -moz-pre-wrap !important; /* white-space: -moz-pre-wrap !important; // DJK */
border-spacing: 13px 10px; border-spacing: 13px 10px;
border-width: 0px 10px 0px 10px; border-width: 0px 10px 0px 10px;
border-color: blue !important; border-color: blue !important;
@@ -72,21 +83,37 @@ table.settings {
background-color: rgb(240, 250, 230); background-color: rgb(240, 250, 230);
} }
fieldset.paypal {
border: none;
}
.command { font-weight: bold; color: #632610; } .command { font-weight: bold; color: #632610; }
.mapping { font-weight: bold; color: #102663; } .mapping { font-weight: bold; color: #102663; }
.setting { font-weight: bold; color: #106326; } .setting { font-weight: bold; color: #106326; }
.argument { color: #6A97D4; } .argument { color: #6A97D4; }
.version { position:absolute; top:10px; right:2%; color:#C0C0C0; text-align:right; } .version {
position: absolute;
top: 10px;
right: 2%;
color: #C0C0C0;
text-align: right;
}
.warning {
font-weight: bold;
color: red;
}
.shorthelp { font-weight: bold; }
.status_insecure, .status_insecure * { .status_insecure, .status_insecure * {
background-color: transparent; background-color: transparent;
} }
.status_secure, .status_secure * { .status_secure, .status_secure * {
background-color: #B0FF00; /* light green */ background-color: yellow;
color: black; color: black;
} }
.status_broken, .status_broken * { .status_broken, .status_broken * {
background-color: #FF6060; /* light red */ background-color: #ff9900;
color: black; color: black;
} }
/* vim: set fdm=marker sw=4 ts=4 et: */

View File

@@ -41,12 +41,11 @@ function help(section, easter)
// xxx: for firebug: :js Firebug.toggleBar(true) // xxx: for firebug: :js Firebug.toggleBar(true)
/* commands = array where help information is located /* commands = array where help information is located
* color = used for background of the table
* beg = string which is printed before the commmand/setting/mapping name * beg = string which is printed before the commmand/setting/mapping name
* end = string which is printed after the commmand/setting/mapping name * end = string which is printed after the commmand/setting/mapping name
* func = called with 'command', result is a string is prepended to the help text * func = called with 'command', result is a string is prepended to the help text
*/ */
function makeHelpString(commands, color, beg, end, func) function makeHelpString(commands, beg, end, func)
{ {
var ret = ""; var ret = "";
for (var i=0; i < commands.length; i++) for (var i=0; i < commands.length; i++)
@@ -74,9 +73,9 @@ function help(section, easter)
// the actual help text with the first line in bold // the actual help text with the first line in bold
if (commands[i][SHORTHELP]) if (commands[i][SHORTHELP])
{ {
ret += "<b>"; ret += '<span class="shorthelp">';
ret += commands[i][SHORTHELP]; // the help description ret += commands[i][SHORTHELP]; // the help description
ret += "</b><br/>"; ret += "</span><br/>";
if(func) // for settings whe print default values here, e.g. if(func) // for settings whe print default values here, e.g.
{ {
ret += func.call(this, commands[i]); ret += func.call(this, commands[i]);
@@ -134,76 +133,80 @@ function help(section, easter)
return ret; return ret;
} }
var header = '<h1 align=\"center\">Vimperator</h1>\n' + var header = '<h1>Vimperator</h1>\n' +
'<p align=\"center\"><b>First there was a Navigator, then there was an Explorer.<br/>\n'+ '<p class="tagline">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 :)</p>\n';
var introduction = '<h2>Introduction</h2>' + var introduction = '<div><h2 id="introduction">Introduction</h2></div>' +
'<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><span class="warning">Warning:</span> 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' +
'<p>Vimperator was written by <a href="mailto:stubenschrott@gmx.net">Martin Stubenschrott</a>. If you appreciate my work on Vimperator, you can either<br/>'+ '<p>Vimperator was written by <a href="mailto:stubenschrott@gmx.net">Martin Stubenschrott</a>. If you appreciate my work on Vimperator, you can either send me greetings, patches or make a donation: </p>\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">\n<fieldset class="paypal">' +
'<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" 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="" 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+6Jqsk2hcReP3FIQOvtWMSgGTALnZx7x5c60u/3NSKW5qvyWKCCA4cwggODMIIC7KADAgECAgEAMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDV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91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAgV86VpqAWuXvX6Oro4qJ1tYVIT5DgWpE692Ag422H7yRIr/9j/iKG4Thia/Oflx4TdL+IFJBAyPK9v6zZNZtBgPBynXb048hsP16l2vi0k5Q2JKiPDsEfBhGI+HnxLXEaUWAcVfCsQFvd2A1sxRr67ip5y2wwBelUecP3AjJ+YcxggGaMIIBlgIBATCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTA3MDMyMTIyMzI1OFowIwYJKoZIhvcNAQkEMRYEFCirrvlwYVHQiNEEbM6ikfx9+Dm5MA0GCSqGSIb3DQEBAQUABIGAtbsR8GdCdURLziozXLSdtY+zJZUPPeQFXXy2V1S/3ldiN+pRvd4HI7xz8mOY1UaKJZpwZnOosy9MflL1/hbiEtEyQ2Dm/s4jnTcJng/NjLIZu+0NYxXRJhB+zMJubnMMMjzNrGlqI4F2HAB/bCA1eOJ5B83Of3dA4rk/T/8GoSQ=-----END PKCS7-----"/>' +
'</form>\n' + '</fieldset>\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' '<p>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'
var mappings = '<h2>Mappings</h2>\n'+ var mappings = '<div><h2 id="mappings">Mappings</h2></div>\n' +
'<p>The denotion of modifier keys is like in Vim, so C- means the Control key, M- the Meta key, A- the Alt key and S- the Shift key.</p>'+ '<p>The denotion of modifier keys is like in Vim, so C- means the Control key, M- the Meta key, A- the Alt key and S- the Shift key.</p>'+
'<p><table class="vimperator mappings">' '<table class="vimperator mappings">'
// FIXME: fix this when Command() is added and help patch is merged -- djk // FIXME: fix this when Command() is added and help patch is merged -- djk
var all_maps = []; var all_maps = [];
for (var map in vimperator.mappings) for (var map in vimperator.mappings)
all_maps.push([map.commands, [map.usage], map.short_help, map.help]) all_maps.push([map.commands, [map.usage], map.short_help, map.help])
mappings += makeHelpString(all_maps, "#102663", "", "", null); mappings += makeHelpString(all_maps, "", "", null);
mappings += '</table></p>'; mappings += '</table>';
if (section && section == 'holy-grail') if (section && section == 'holy-grail')
mappings += '<span id="holy-grail">You found it, Arthur!</span>\n'; mappings += '<span id="holy-grail">You found it, Arthur!</span>\n';
var commands = '<h2>Commands</h2><p><table class="vimperator commands">\n'; var commands = '<div><h2 id="commands">Commands</h2></div>\n' +
'<table class="vimperator commands">\n';
var all_commands = []; var all_commands = [];
for (var command in vimperator.commands) for (var command in vimperator.commands)
all_commands.push([command.names, command.usage, command.short_help, command.help]); all_commands.push([command.names, command.usage, command.short_help, command.help]);
commands += makeHelpString(all_commands, "#632610", ":", "", null); commands += makeHelpString(all_commands, ":", "", null);
commands += '</table></p>'; commands += '</table>';
if (section && section == '42') if (section && section == '42')
commands += '<p id="42">What is the meaning of life, the universe and everything?<br/>' + commands += '<p id="42">What is the meaning of life, the universe and everything?<br/>' +
'Douglas Adams, the only person who knew what this question really was about is<br/>' + 'Douglas Adams, the only person who knew what this question really was about is<br/>' +
'now dead, unfortunately. So now you might wonder what the meaning of death<br/>' + 'now dead, unfortunately. So now you might wonder what the meaning of death<br/>' +
'is...</p>\n'; 'is...</p>\n';
var settings = '<h2>Settings</h2><p><table class="vimperator settings">\n'; var settings = '<div><h2 id="settings">Settings</h2></div>\n' +
settings += makeHelpString(g_settings, "#106326", "'", "'", makeSettingsHelpString); '<table class="vimperator settings">\n';
settings += '</table></p>'; settings += makeHelpString(g_settings, "'", "'", makeSettingsHelpString);
settings += '</table>';
var fulldoc = '<html>\n<head>\n<title>Vimperator help</title>\n' + var fulldoc = '<?xml version="1.0"?>\n' +
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\n "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n' +
'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n<head>\n<title>Vimperator help</title>\n' +
// XXX: stylesheet broken here? Have to add it in the vimperator.xul file // XXX: stylesheet broken here? Have to add it in the vimperator.xul file
'<link rel="stylesheet" href="chrome://vimperator/content/default.css" type="text/css">\n'+ '<link rel="stylesheet" href="chrome://vimperator/content/default.css" type="text/css"/>\n' +
'</head>\n<body><pre style="white-space: -moz-pre-wrap !important;">\n<table class="main"><tr><td>\n' + // should change that to: white-space: pre-wrap; once CSS3 hits firefox '</head>\n<body>\n<div class="main">\n' +
'<span class="version">version ' + vimperator.ver + '</span>\n'+ '<span class="version">version ' + vimperator.ver + '</span>\n' +
header + header +
introduction + introduction +
mappings + mappings +
commands + commands +
settings + settings +
'\n</td></tr></table>\n</pre></body>\n</html>'; '\n</div>\n</body>\n</html>';
var doc = window.content.document; var doc = window.content.document;
try try
{ {
doc.open(); doc.open();
@@ -258,8 +261,9 @@ function help(section, easter)
vimperator.echoerr("E149: Sorry, no help for " + section); vimperator.echoerr("E149: Sorry, no help for " + section);
return; return;
} }
// FIXME: H2 elements are currently wrapped in DIVs so this works
var pos = cumulativeOffset(element.parentNode); var pos = cumulativeOffset(element.parentNode);
// horizontal offset is annyoing, set it to 0 (use pos[0] if you want horizontal offset) // horizontal offset is annoying, set it to 0 (use pos[0] if you want horizontal offset)
window.content.scrollTo(0, pos[1]); window.content.scrollTo(0, pos[1]);
} }
} }

View File

@@ -516,14 +516,15 @@ function Mappings()//{{{
"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 text description</li>" + "<li><code class=\"mapping\">y</code> to yank its location</li>" +
" <li><code class=\"mapping\">o</code> to open its location in the current tab</li>" + "<li><code class=\"mapping\">Y</code> to yank its text description</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 the current 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\">t</code> to open its location in a new tab</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\">O</code> to open its location in an <code class=\"command\">:open</code> query (not implemented yet)</li>" +
" <li><code class=\"mapping\">s</code> to save its destination (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\">&lt;C-w&gt;</code> to open its destination in a new window</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>" +
"</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."

View File

@@ -62,11 +62,11 @@ 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>" +
"<ul><li><b>s</b>: Search machines and keyword URLs</li><li>"+ "<li><b>s</b>: Search machines and keyword URLs</li>" +
"<b>f</b>: Local files</li><li>"+ "<li><b>f</b>: Local files</li>" +
"<b>b</b>: Bookmarks</li><li>"+ "<li><b>b</b>: Bookmarks</li>" +
"<b>h</b>: History</li></ul>"+ "<li><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",
@@ -134,8 +134,7 @@ var g_settings = [/*{{{*/
"<li><b>m</b>: menubar</li>"+ "<li><b>m</b>: menubar</li>"+
"<li><b>T</b>: toolbar</li>"+ "<li><b>T</b>: toolbar</li>"+
"<li><b>b</b>: bookmark bar</li>"+ "<li><b>b</b>: bookmark bar</li>"+
"<li><b>s</b>: original Firefox statusbar</li>"+ "<li><b>s</b>: original Firefox statusbar</li></ul>",
"</ul>",
"charlist", "charlist",
null, null,
function(value) { set_pref("guioptions", value); set_guioptions(value); }, function(value) { set_pref("guioptions", value); set_guioptions(value); },
@@ -235,10 +234,10 @@ var g_settings = [/*{{{*/
["showstatuslinks", "ssli"], ["showstatuslinks", "ssli"],
"Show the destination of the link under the cursor in the status bar", "Show the destination of the link under the cursor in the status bar",
"Also links which are focused by keyboard commands like <code class=\"mapping\">&lt;Tab&gt;</code> are shown. "+ "Also links which are focused by keyboard commands like <code class=\"mapping\">&lt;Tab&gt;</code> are shown. "+
"Possible values:<br/>"+ "Possible values:<br/><ul>"+
"<ul><li><b>0</b>: Don't show link destination</li><li>" + "<li><b>0</b>: Don't show link destination</li>" +
" <b>1</b>: Show the link in the status line</li><li>" + "<li><b>1</b>: Show the link in the status line</li>" +
" <b>2</b>: Show the link in the command line</li></ul>", "<li><b>2</b>: Show the link in the command line</li></ul>",
"number", "number",
null, null,
function(value) { set_pref("showstatuslinks", value); }, function(value) { set_pref("showstatuslinks", value); },
@@ -250,10 +249,10 @@ 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",
"Possible values:<br/>"+ "Possible values:<br/><ul>"+
"<ul><li><b>0</b>: Never show tab bar</li><li>"+ "<li><b>0</b>: Never show tab bar</li>"+
" <b>1</b>: Show tab bar only if more than one tab is open</li><li>"+ "<li><b>1</b>: Show tab bar only if more than one tab is open</li>"+
" <b>2</b>: Always show tab bar</li></ul>"+ "<li><b>2</b>: Always show tab bar</li></ul>"+
"Not implemented yet.", "Not implemented yet.",
"number", "number",
null, null,
@@ -297,14 +296,14 @@ var g_settings = [/*{{{*/
"specifies the behavior for the first use of the completion key, the second part " + "specifies the behavior for the first use of the completion key, the second part " +
"for the second use, etc.<br/>" + "for the second use, etc.<br/>" +
"These are the possible values for each part:<br/>" + "These are the possible values for each part:<br/>" +
"<table><pre>"+ "<table>"+
"<tr><td><b>''</b></td><td>Complete only the first match</td></tr>" + "<tr><td><b>''</b></td><td>Complete only the first match</td></tr>" +
"<tr><td><b>'full'</b></td><td>Complete the next full match. After the last, the original string is used.</td></tr>" + "<tr><td><b>'full'</b></td><td>Complete the next full match. After the last, the original string is used.</td></tr>" +
"<tr><td><b>'longest'</b></td><td>Complete till the longest common string.</td></tr>" + "<tr><td><b>'longest'</b></td><td>Complete till the longest common string.</td></tr>" +
"<tr><td><b>'list'</b></td><td>When more than one match, list all matches.</td></tr>" + "<tr><td><b>'list'</b></td><td>When more than one match, list all matches.</td></tr>" +
"<tr><td><b>'list:full'</b></td><td>When more than one match, list all matches and complete first match.</td></tr>" + "<tr><td><b>'list:full'</b></td><td>When more than one match, list all matches and complete first match.</td></tr>" +
"<tr><td><b>'list:longest'</b></td><td>When more than one match, list all matches and complete till the longest common string.</td></tr>" + "<tr><td><b>'list:longest'</b></td><td>When more than one match, list all matches and complete till the longest common string.</td></tr>" +
"</pre></table>" + "</table>" +
"When there is only a single match, it is fully completed regardless of the case.", "When there is only a single match, it is fully completed regardless of the case.",
"stringlist", "stringlist",
null, null,
@@ -319,9 +318,9 @@ var g_settings = [/*{{{*/
"Change how command line completion is done", "Change how command line completion is done",
"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>"+
"<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>", "</table>",
"stringlist", "stringlist",
null, null,
function(value) { set_pref("wildoptions", value); }, function(value) { set_pref("wildoptions", value); },

View File

@@ -30,7 +30,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?> <?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
<!-- The stylesheet which is used for the :help command --> <!-- The stylesheet which is used for the :help command -->
<?xml-stylesheet href="chrome://vimperator/content/default.css" type="text/css"?> <?xml-stylesheet href="chrome://vimperator/content/default.css" type="text/css"?>
<overlay id="vimperator" <overlay id="vimperator"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"