aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Ben Boeckel <mathstuf@gmail.com>2012-03-26 21:10:15 -0400
committerGravatar Ben Boeckel <mathstuf@gmail.com>2012-03-26 21:10:15 -0400
commite14d88de39e8ac0e3502e5f24d85d78d33962218 (patch)
tree45a73b4650243c84a2fd86d1a14211f73a0f872a
parentcfbc480c78da072174b8df70d776f6c057a048c0 (diff)
Add code and bindings to follow the current search
-rw-r--r--examples/config/config6
-rw-r--r--examples/data/scripts/follow.js16
2 files changed, 22 insertions, 0 deletions
diff --git a/examples/config/config b/examples/config/config
index c22178b..11f1d82 100644
--- a/examples/config/config
+++ b/examples/config/config
@@ -325,6 +325,7 @@ set ebind = @mode_bind global,-insert
@cbind yu = sh 'echo -n "$UZBL_URI" | xclip'
@cbind yU = sh 'echo -n "$1" | xclip' '\@SELECTED_URI'
@cbind yy = sh 'echo -n "$UZBL_TITLE" | xclip'
+@cbind ys = spawn @scripts_dir/follow.sh \@< uzbl.follow.followSelection('returnuri') >\@ clipboard
# Clone current window
@cbind c = event REQ_NEW_WINDOW \@uri
@@ -362,6 +363,11 @@ set follow_hint_keys = 0123456789
@cbind FL* = spawn @scripts_dir/follow.sh \@< uzbl.follow("\@follow_hint_keys", "%s", 'returnuri') >\@ clipboard
@cbind fi = spawn @scripts_dir/go_input.sh
+@cbind fs = spawn @scripts_dir/follow.sh \@< uzbl.follow.followSelection('returnuri') >\@ set
+@cbind fS = spawn @scripts_dir/follow.sh \@< uzbl.follow.followSelection('click') >\@
+@cbind Fs = spawn @scripts_dir/follow.sh \@< uzbl.follow.followSelection('newwindow') >\@
+@cbind FS = spawn @scripts_dir/follow.sh \@< uzbl.follow.followSelection('returnuri') >\@ clipboard
+
@cbind ft* = spawn @scripts_dir/follow.sh \@< uzbl.follow.followTextContent("%s", 'returnuri') >\@ set
@cbind fT* = spawn @scripts_dir/follow.sh \@< uzbl.follow.followTextContent("%s", 'click') >\@
@cbind Ft* = spawn @scripts_dir/follow.sh \@< uzbl.follow.followTextContent("%s", 'newwindow') >\@
diff --git a/examples/data/scripts/follow.js b/examples/data/scripts/follow.js
index 88f80f2..83bbf55 100644
--- a/examples/data/scripts/follow.js
+++ b/examples/data/scripts/follow.js
@@ -326,3 +326,19 @@ uzbl.follow.followLinks = function(str) {
this.reDrawHints(leftover, len);
}
}
+
+uzbl.follow.followSelection = function(mode) {
+ var selection = window.getSelection()
+ if (!selection)
+ return
+
+ var node = selection.anchorNode
+ if (!node)
+ return
+
+ var el = node.parentElement
+ if (!el)
+ return
+
+ this.elementSelected(el)
+}