1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-24 03:22:26 +01:00

Fix #268 (Hints for opening images)

Hmm, these extended hints are just awful, instead of just one ; we
should have four (this tab, new tab, background tab, window) so that we
don't need so much repitition (and the background tab mode can trigger
the multiple hint modes for all relevant hints too)
This commit is contained in:
Conrad Irwin
2009-05-27 21:20:41 +01:00
parent 6055c8a77b
commit 54b48868ce

View File

@@ -63,6 +63,8 @@ function Hints() //{{{
const Mode = new Struct("prompt", "action", "tags");
Mode.defaultValue("tags", function () function () options.hinttags);
function extended() options.extendedhinttags;
function images() "//img";
const hintModes = {
";": Mode("Focus hint", function (elem) buffer.focusElement(elem), extended),
"?": Mode("Show information for hint", function (elem) buffer.showElementInfo(elem), extended),
@@ -81,8 +83,9 @@ function Hints() //{{{
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 description", function (elem) util.copyToClipboard(elem.textContent || "", true), extended),
c: Mode("Open context menu", function (elem) buffer.openContextMenu(elem), extended)
c: Mode("Open context menu", function (elem) buffer.openContextMenu(elem), extended),
i: Mode("Show image", function (elem) liberator.open(elem.src), images),
I: Mode("Show image in a new tab", function (elem) liberator.open(elem.src, liberator.NEW_TAB), images)
};
/**