mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-16 07:15:46 +01:00
Add "c" extended hint mode to open the context menu.
This commit is contained in:
@@ -1255,6 +1255,18 @@ function Buffer() //{{{
|
|||||||
.getInterface(Ci.nsISelectionDisplay)
|
.getInterface(Ci.nsISelectionDisplay)
|
||||||
.QueryInterface(Ci.nsISelectionController),
|
.QueryInterface(Ci.nsISelectionController),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Opens the appropriate context menu for <b>elem</b>.
|
||||||
|
*
|
||||||
|
* @param {Node} elem The context element.
|
||||||
|
*/
|
||||||
|
openContextMenu: function (elem)
|
||||||
|
{
|
||||||
|
document.popupNode = elem;
|
||||||
|
let menu = document.getElementById("contentAreaContextMenu");
|
||||||
|
menu.showPopup(elem, -1, -1, "context", "bottomleft", "topleft");
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves a page link to disk.
|
* Saves a page link to disk.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -73,22 +73,25 @@ function Hints() //{{{
|
|||||||
t: Mode("Follow hint in a new tab", function (elem) buffer.followLink(elem, liberator.NEW_TAB)),
|
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)),
|
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),
|
w: Mode("Follow hint in a new window", function (elem) buffer.followLink(elem, liberator.NEW_WINDOW), extended),
|
||||||
F: Mode("Open multiple hints in tabs", hintAction_F),
|
F: Mode("Open multiple hints in tabs", followAndReshow),
|
||||||
O: Mode("Generate an ':open URL' using hint", function (elem, loc) commandline.open(":", "open " + loc, modes.EX)),
|
O: Mode("Generate an ':open URL' using hint", function (elem, loc) commandline.open(":", "open " + loc, modes.EX)),
|
||||||
T: Mode("Generate a ':tabopen URL' using hint",function (elem, loc) commandline.open(":", "tabopen " + loc, modes.EX)),
|
T: Mode("Generate a ':tabopen URL' using hint",function (elem, loc) commandline.open(":", "tabopen " + loc, modes.EX)),
|
||||||
W: Mode("Generate a ':winopen URL' using hint",function (elem, loc) commandline.open(":", "winopen " + loc, modes.EX)),
|
W: Mode("Generate a ':winopen URL' using hint",function (elem, loc) commandline.open(":", "winopen " + loc, modes.EX)),
|
||||||
v: Mode("View hint source", function (elem, loc) buffer.viewSource(loc, false), extended),
|
v: Mode("View hint source", function (elem, loc) buffer.viewSource(loc, false), extended),
|
||||||
V: Mode("View hint source in external editor", function (elem, loc) buffer.viewSource(loc, true), extended),
|
V: Mode("View hint source in external editor", function (elem, loc) buffer.viewSource(loc, true), extended),
|
||||||
y: Mode("Yank hint location", function (elem, loc) util.copyToClipboard(loc, true)),
|
y: Mode("Yank hint location", function (elem, loc) util.copyToClipboard(loc, true)),
|
||||||
Y: Mode("Yank hint description", function (elem) util.copyToClipboard(elem.textContent || "", true), extended)
|
Y: Mode("Yank hint description", function (elem) util.copyToClipboard(elem.textContent || "", true), extended),
|
||||||
|
c: Mode("Open context menu", function (elem) buffer.openContextMenu(elem), extended)
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to open multiple hints.
|
* Follows the specified hint and then reshows all hints. Used to open
|
||||||
|
* multiple hints in succession.
|
||||||
*
|
*
|
||||||
* @param {node} elem The previously selected hint.
|
* @param {Node} elem The selected hint.
|
||||||
*/
|
*/
|
||||||
function hintAction_F(elem)
|
function followAndReshow(elem)
|
||||||
{
|
{
|
||||||
buffer.followLink(elem, liberator.NEW_BACKGROUND_TAB);
|
buffer.followLink(elem, liberator.NEW_BACKGROUND_TAB);
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
* version 2.2a1pre
|
* version 2.2a1pre
|
||||||
* add @: mapping - repeat the last Ex command
|
* add @: mapping - repeat the last Ex command
|
||||||
* add \ mapping - toggle between rendered and source view
|
* add \ mapping - toggle between rendered and source view
|
||||||
|
* add ;c extended hint mode - open the context menu
|
||||||
|
|
||||||
2009-05-21:
|
2009-05-21:
|
||||||
* version 2.1
|
* version 2.1
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ hint mode. Then press [a]24[a] to copy the hint location.
|
|||||||
* |;V| [m]V[m] to view its destination source in the external editor
|
* |;V| [m]V[m] to view its destination source in the external editor
|
||||||
* |;y| [m]y[m] to yank its destination location
|
* |;y| [m]y[m] to yank its destination location
|
||||||
* |;Y| [m]Y[m] to yank its text description
|
* |;Y| [m]Y[m] to yank its text description
|
||||||
|
* |;c| [m]c[m] to open its context menu
|
||||||
|
|
||||||
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.
|
||||||
|
|||||||
Reference in New Issue
Block a user