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

Implement http://vimperator.org/trac/ticket/92 (restore ;F) (revert if want)

The implementation provides the same functionality as ;F while still
maintaining the Vimp2.0 style hints. There is definitely room for
refactoring here.
This commit is contained in:
Ted Pavlic
2009-01-02 15:24:05 -05:00
parent f70344be50
commit 7ec7bb15dd
2 changed files with 17 additions and 0 deletions

View File

@@ -73,6 +73,7 @@ function Hints() //{{{
t: Mode("Follow hint in a new tab", function (elem) buffer.followLink(elem, liberator.NEW_TAB)),
b: Mode("Follow hint in a background tab", function (elem) buffer.followLink(elem, liberator.NEW_BACKGROUND_TAB)),
w: Mode("Follow hint in a new window", function (elem) buffer.followLink(elem, liberator.NEW_WINDOW), extended),
F: Mode("Follow hint sequence in tabs", hintSequenceElement),
O: Mode("Preselect hint in an :open query", function (elem, loc) commandline.open(":", "open " + loc, modes.EX)),
T: Mode("Preselect hint in a :tabopen query", function (elem, loc) commandline.open(":", "tabopen " + loc, modes.EX)),
W: Mode("Preselect hint in a :winopen query", function (elem, loc) commandline.open(":", "winopen " + loc, modes.EX)),
@@ -82,6 +83,21 @@ function Hints() //{{{
Y: Mode("Yank hint description", function (elem) util.copyToClipboard(elem.textContent || "", true), extended)
};
// Implement ';F' hint sequences. This function handles on element of the hint sequence.
function hintSequenceElement(elem)
{
// Want to always open sequence hints in background
// (remember: NEW_BACKGROUND_TAB and NEW_TAB semantics assume
// that loadInBackground=true)
if( options.getPref("browser.tabs.loadInBackground") )
buffer.followLink(elem, liberator.NEW_BACKGROUND_TAB);
else
buffer.followLink(elem, liberator.NEW_TAB);
// Move to next element in sequence
hints.show("F");
}
// reset all important variables
function reset()
{