From 54b48868ce5842ab1ed27ce31670e5413ff9fd37 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Wed, 27 May 2009 21:20:41 +0100 Subject: [PATCH] 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) --- common/content/hints.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common/content/hints.js b/common/content/hints.js index e3768e87..8922a97e 100644 --- a/common/content/hints.js +++ b/common/content/hints.js @@ -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) }; /**