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

Strip leading counts and trailing bangs from help tag links.

This commit is contained in:
Doug Kearns
2009-03-07 00:50:28 +11:00
parent 9d3a5ec939
commit 5f190d3443
4 changed files with 15 additions and 11 deletions

View File

@@ -1421,20 +1421,24 @@ window.liberator = liberator;
// FIXME: Ugly, etc. // FIXME: Ugly, etc.
window.addEventListener("liberatorHelpLink", function (event) { window.addEventListener("liberatorHelpLink", function (event) {
let elem = event.target; let elem = event.target;
if (/^(option|mapping|command)$/.test(elem.className)) if (/^(option|mapping|command)$/.test(elem.className))
var tag = elem.textContent.replace(/\s.*/, ""); var tag = elem.textContent.replace(/\s.*/, "");
if (/^(mapping|command)$/.test(elem.className))
tag = tag.replace(/^\d+/, "");
if (elem.className == "command") if (elem.className == "command")
tag = tag.replace(/\[.*?\]/g, ""); tag = tag.replace(/\[.*?\]/g, "").replace(/!$/, "");
if (tag) if (tag)
var page = liberator.findHelp(tag); var page = liberator.findHelp(tag);
if (page) if (page)
{ {
elem.href = "chrome://liberator/locale/" + page; elem.href = "chrome://liberator/locale/" + page;
if (buffer.URL.replace(/#.*/, "") == elem.href.replace(/#.*/, "")) // XXX if (buffer.URL.replace(/#.*/, "") == elem.href.replace(/#.*/, "")) // XXX
setTimeout(function () { content.postMessage("fragmentChange", "*"); }, 0); setTimeout(function () { content.postMessage("fragmentChange", "*"); }, 0);
} }
}, }, true, true);
true, true);
// called when the chrome is fully loaded and before the main window is shown // called when the chrome is fully loaded and before the main window is shown
window.addEventListener("load", liberator.startup, false); window.addEventListener("load", liberator.startup, false);

View File

@@ -2,8 +2,8 @@ HEADER
|Command-line-mode| |Command-line| |mode-cmdline| + |Command-line-mode| |Command-line| |mode-cmdline| +
Command-line mode is used to enter Ex commands (":") and text search patterns Command-line mode is used to enter Ex commands ("[m]:[m]") and text search patterns
("/" and "?"). ("[m]/[m]" and "[m]?[m]").
|:| + |:| +
||:|| ||:||

View File

@@ -100,7 +100,7 @@ section:Features[features]
with support for Firefox keyword bookmarks and search engines with support for Firefox keyword bookmarks and search engines
* Count supported for many commands ([m]3<C-o>[m] will go back 3 pages) * Count supported for many commands ([m]3<C-o>[m] will go back 3 pages)
* Beep on errors * Beep on errors
* Marks support ([m]ma[m] to set mark a on a web page, [m]'a[m] to go there) * Marks support ([m]m[m][a]a[a] to set mark a on a web page, [m]'[m][a]a[a] to go there)
* QuickMarks support (quickly go to previously marked web pages with [m]go[m][a]\\{a-zA-Z0-9\\}[a]) * QuickMarks support (quickly go to previously marked web pages with [m]go[m][a]\\{a-zA-Z0-9\\}[a])
* [c]:map[c] and [c]:command[c] support (and feedkeys() for script writers) * [c]:map[c] and [c]:command[c] support (and feedkeys() for script writers)
* [c]:time[c] support for profiling * [c]:time[c] support for profiling

View File

@@ -22,8 +22,8 @@ If you're a veteran Vim user, this may look familiar. It should.
However, in this author's opinion, the best way to get familiar with However, in this author's opinion, the best way to get familiar with
Vimperator is to leave these disabled for now. (The above action can be Vimperator is to leave these disabled for now. (The above action can be
reversed with [c]:set go=<CR>[c]) You can look at the entry for reversed with [c]:set go=<CR>[c]) You can look at the entry for 'guioptions' in
[o]guioptions[o] in help:options[options.html] for more information on this. help:options[options.html] for more information on this.
section:Vimperator's{nbsp}modal{nbsp}interface[modal] section:Vimperator's{nbsp}modal{nbsp}interface[modal]
@@ -36,8 +36,8 @@ When Vimperator starts, it is in Normal mode by default. This is probably where
you will spend the majority of your time. you will spend the majority of your time.
The other core mode of Vimperator, Command-line mode, can be entered from The other core mode of Vimperator, Command-line mode, can be entered from
Normal mode by typing a \':' (colon). You will frequently see Vimperator Normal mode by typing a \'[m]:[m]' (colon). You will frequently see Vimperator
commands start with a \':', indicating that what follows is a command. commands start with a \'[m]:[m]', indicating that what follows is a command.
To return to Normal mode from Command-line mode, type [m]<Esc>[m]. Pressing To return to Normal mode from Command-line mode, type [m]<Esc>[m]. Pressing
[m]<Esc>[m] will also return you to Normal mode from most other modes in [m]<Esc>[m] will also return you to Normal mode from most other modes in
@@ -142,7 +142,7 @@ type uniquely identifies any given link, Vimperator will follow that link
immediately without any further user input. immediately without any further user input.
Whichever way you choose to indicate your target link, once Vimperator has Whichever way you choose to indicate your target link, once Vimperator has
highlighted the link you want, simply hit <Enter> to open it. highlighted the link you want, simply hit [m]<Enter>[m] to open it.
The most common hint mode is called help:QuickHint{nbsp}mode[various.html,f]. The most common hint mode is called help:QuickHint{nbsp}mode[various.html,f].
To activate QuickHint mode, press either [m]f[m] or [m]F[m]. The lower-case To activate QuickHint mode, press either [m]f[m] or [m]F[m]. The lower-case