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

move global help() command to a vimperator slot

This commit is contained in:
Doug Kearns
2007-07-04 10:11:36 +00:00
parent 8a38512346
commit 0e1eee7ae7
5 changed files with 54 additions and 51 deletions

View File

@@ -397,7 +397,7 @@ function Commands() //{{{
}
));
addDefaultCommand(new Command(["exu[sage]"],
function() { help("commands"); },
function(args, special, count, modifiers) { vimperator.help("commands", special, null, modifiers); },
{
usage: ["exu[sage]"],
short_help: "Show help for Ex commands"
@@ -427,7 +427,7 @@ function Commands() //{{{
}
));
addDefaultCommand(new Command(["h[elp]"],
help,
function(args, special, count, modifiers) { vimperator.help(args, special, null, modifiers); },
{
usage: ["h[elp] {subject}"],
short_help: "Open the help window",
@@ -620,7 +620,7 @@ function Commands() //{{{
}
));
addDefaultCommand(new Command(["se[t]"],
function(args, special)
function(args, special, count, modifiers)
{
if (args == "")
{
@@ -888,7 +888,7 @@ function Commands() //{{{
}
));
addDefaultCommand(new Command(["viu[sage]"],
function() { help("mappings"); },
function(args, special, count, modifiers) { vimperator.help("mappings", special, null, modifiers); },
{
usage: ["viu[sage]"],
short_help: "Show help for normal mode commands"

View File

@@ -26,7 +26,7 @@ the provisions above, a recipient may use your version of this file under
the terms of any one of the MPL, the GPL or the LGPL.
}}} ***** END LICENSE BLOCK *****/
function help(section, easter) //{{{
Vimperator.prototype.help = function(section, easter) //{{{
{
if (easter)
{
@@ -210,7 +210,7 @@ function help(section, easter) //{{{
return false;
openURLs("about:blank");
setTimeout(function () { help(section, false, null, {recursive: true}); }, 250);
setTimeout(function () { vimperator.help(section, false, null, {recursive: true}); }, 250);
return;
}
doc.write(fulldoc);

View File

@@ -207,14 +207,16 @@ function Mappings() //{{{
flags: Mappings.flags.ARGUMENT
}
));
addDefaultMap(new Map(vimperator.modes.NORMAL, ["]f"], function(count) { focusNextFrame(count > 1 ? count : 1, true); },
addDefaultMap(new Map(vimperator.modes.NORMAL, ["]f"],
function(count) { focusNextFrame(count > 1 ? count : 1, true); },
{
short_help: "Focus next frame",
help: "Transfers keyboard focus to the [count]th next frame in order. The newly focused frame is briefly colored red.",
flags: Mappings.flags.COUNT
}
));
addDefaultMap(new Map(vimperator.modes.NORMAL, ["[f"], function(count) { focusNextFrame(count > 1 ? count : 1, false); },
addDefaultMap(new Map(vimperator.modes.NORMAL, ["[f"],
function(count) { focusNextFrame(count > 1 ? count : 1, false); },
{
short_help: "Focus previous frame",
help: "Transfers keyboard focus to the [count]th previous frame in order. The newly focused frame is briefly colored red.",
@@ -308,7 +310,8 @@ function Mappings() //{{{
}
));
addDefaultMap(new Map(vimperator.modes.NORMAL, ['<C-^>', '<C-6>'],
function (args) {
function()
{
if (vimperator.tabs.getTab() == vimperator.tabs.alternate)
{
vimperator.echoerr("E23: No alternate page");
@@ -684,7 +687,7 @@ function Mappings() //{{{
/* vimperator managment */
addDefaultMap(new Map(vimperator.modes.NORMAL, ["<F1>"],
function(count) { help(null); },
function(count) { vimperator.help(null); },
{
short_help: "Open help window",
help: "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)."

View File

@@ -112,7 +112,7 @@ function init() //{{{
if (Options.getPref("firsttime", true))
{
setTimeout(function() {
help(null, null, null, { inTab: true });
vimperator.help(null, null, null, { inTab: true });
Options.setPref("firsttime", false);
}, 1000);
}

View File

@@ -38,8 +38,8 @@ the terms of any one of the MPL, the GPL or the LGPL.
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript;version=1.7" src="help.js"/>
<script type="application/x-javascript;version=1.7" src="vimperator.js"/>
<script type="application/x-javascript;version=1.7" src="help.js"/>
<script type="application/x-javascript;version=1.7" src="commands.js"/>
<script type="application/x-javascript;version=1.7" src="ui.js"/>
<script type="application/x-javascript;version=1.7" src="options.js"/>