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

Fixed browser.followLink so that NEW_TAB semantics are invariant of prefs.

This commit is contained in:
Ted Pavlic
2009-01-08 12:01:31 -05:00
parent 3a98dfc589
commit bfe47dff89
3 changed files with 9 additions and 14 deletions

View File

@@ -1123,8 +1123,10 @@ function Buffer() //{{{
{ {
case liberator.NEW_TAB: case liberator.NEW_TAB:
case liberator.NEW_BACKGROUND_TAB: case liberator.NEW_BACKGROUND_TAB:
let invertLogic = !options.getPref("browser.tabs.loadInBackground");
let backgroundDesired = (where == liberator.NEW_BACKGROUND_TAB);
ctrlKey = true; ctrlKey = true;
shiftKey = (where != liberator.NEW_BACKGROUND_TAB); shiftKey = invertLogic ? backgroundDesired : !backgroundDesired;
break; break;
case liberator.NEW_WINDOW: case liberator.NEW_WINDOW:
shiftKey = true; shiftKey = true;

View File

@@ -86,13 +86,7 @@ function Hints() //{{{
// Used to open multiple hints // Used to open multiple hints
function hintSequenceElement(elem) 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); buffer.followLink(elem, liberator.NEW_BACKGROUND_TAB);
else
buffer.followLink(elem, liberator.NEW_TAB);
// Move to next element in sequence // Move to next element in sequence
// TODO: Maybe we find a *simple* way to keep the hints displayed rather than // TODO: Maybe we find a *simple* way to keep the hints displayed rather than
@@ -601,7 +595,7 @@ function Hints() //{{{
mappings.add(myModes, ["F"], mappings.add(myModes, ["F"],
"Start QuickHint mode, but open link in a new tab", "Start QuickHint mode, but open link in a new tab",
function () { hints.show("t"); }); function () { options.getPref("browser.tabs.loadInBackground") ? hints.show("b") : hints.show("t"); });
mappings.add(myModes, [";"], mappings.add(myModes, [";"],
"Start an extended hint mode", "Start an extended hint mode",

View File

@@ -22,8 +22,10 @@ ________________________________________________________________________________
|F| + |F| +
||#F#{hint}|| ||#F#{hint}||
________________________________________________________________________________ ________________________________________________________________________________
Start QuickHint mode, but open link in a new tab. Like normal QuickHint mode Start QuickHint mode, but open link in a new tab. Like normal QuickHint
(activated with [m]f[m]) but opens the link in a new tab. mode (activated with [m]f[m]) but opens the link in a new tab. The new
tab will be loaded in background according to the
\'browser.tabs.loadInBackground' Firefox preference.
________________________________________________________________________________ ________________________________________________________________________________
@@ -59,9 +61,6 @@ this hint mode. Then press [a]24[a] to copy the hint location.
Hintable elements for all extended hint modes can be set in the Hintable elements for all extended hint modes can be set in the
'extendedhinttags' XPath string. 'extendedhinttags' XPath string.
Note: The behavior of [m];t[m] and [m];b[m] is inverted if the
\'browser.tabs.loadInBackground' Firefox preference is set to false.
________________________________________________________________________________ ________________________________________________________________________________
// vim: set syntax=asciidoc: // vim: set syntax=asciidoc: