summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/vimb.13
-rw-r--r--src/hints.c4
-rw-r--r--src/scripts/hints.js2
3 files changed, 7 insertions, 2 deletions
diff --git a/doc/vimb.1 b/doc/vimb.1
index 2bca209..3c2f494 100644
--- a/doc/vimb.1
+++ b/doc/vimb.1
@@ -313,6 +313,9 @@ Open hinted image in the current window.
.B ;I
Open hinted image in a new window.
.TP
+.B ;k
+Kill (remove) hinted element from the page.
+.TP
.B ;p
Push the hint's URI to the end of the Read It Later queue like the `:qpush'
command.
diff --git a/src/hints.c b/src/hints.c
index b886e57..0cb6a5b 100644
--- a/src/hints.c
+++ b/src/hints.c
@@ -234,10 +234,10 @@ gboolean hints_parse_prompt(const char *prompt, char *mode, gboolean *is_gmode)
gboolean res;
char pmode = '\0';
#ifdef FEATURE_QUEUE
- static char *modes = "eiIoOpPstTxyY";
+ static char *modes = "eiIkoOpPstTxyY";
static char *g_modes = "IopPstyY";
#else
- static char *modes = "eiIoOstTxyY";
+ static char *modes = "eiIkoOstTxyY";
static char *g_modes = "IostyY";
#endif
diff --git a/src/scripts/hints.js b/src/scripts/hints.js
index 8917632..6ee86ad 100644
--- a/src/scripts/hints.js
+++ b/src/scripts/hints.js
@@ -528,12 +528,14 @@ var hints = Object.freeze((function(){
/* holds the xpaths for the different modes */
xpathmap = {
otY: "//*[@href] | //*[@onclick or @tabindex or @class='lk' or @role='link' or @role='button'] | //input[not(@type='hidden' or @disabled or @readonly)] | //textarea[not(@disabled or @readonly)] | //button | //select",
+ k: "//div",
e: "//input[not(@type) or @type='text'] | //textarea",
iI: "//img[@src]",
OpPsTxy: "//*[@href] | //img[@src and not(ancestor::a)] | //iframe[@src]"
},
/* holds the actions to perform on hint fire */
actionmap = {
+ k: function(e) {e.remove(); return "DONE:";},
ot: function(e) {open(e); return "DONE:";},
eiIOpPsTxy: function(e) {return "DATA:" + getSrc(e);},
Y: function(e) {return "DATA:" + (e.textContent || "");}