mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-04-10 21:33:35 +02: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:
@@ -63,6 +63,8 @@ function Hints() //{{{
|
|||||||
const Mode = new Struct("prompt", "action", "tags");
|
const Mode = new Struct("prompt", "action", "tags");
|
||||||
Mode.defaultValue("tags", function () function () options.hinttags);
|
Mode.defaultValue("tags", function () function () options.hinttags);
|
||||||
function extended() options.extendedhinttags;
|
function extended() options.extendedhinttags;
|
||||||
|
function images() "//img";
|
||||||
|
|
||||||
const hintModes = {
|
const hintModes = {
|
||||||
";": Mode("Focus hint", function (elem) buffer.focusElement(elem), extended),
|
";": Mode("Focus hint", function (elem) buffer.focusElement(elem), extended),
|
||||||
"?": Mode("Show information for hint", function (elem) buffer.showElementInfo(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),
|
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)
|
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)
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user