From: Dieter Plaetinck Date: Tue, 5 May 2009 21:13:07 +0000 (+0200) Subject: link following from Jan Kolkmeier (jouz) X-Git-Url: http://git.maemo.org/git/?p=uzbl-mobile;a=commitdiff_plain;h=ffe28435ff741bce2856132d2d3168e659e1a44c link following from Jan Kolkmeier (jouz) --- diff --git a/AUTHORS b/AUTHORS index fd0ec3e..ff39641 100644 --- a/AUTHORS +++ b/AUTHORS @@ -9,7 +9,7 @@ Contributors: Robert Manea - Various improvements Zane Ashby (HashBox) - Rewrote FIFO interface. Fixed various bugs. (sentientswitch) - Cleaned up code. Added some commands. - Jan Kolkmeier (jouz) - scrolling + Jan Kolkmeier (jouz) - scrolling, link following Evgeny Grablyk - libsoup settings Originaly based on http://trac.webkit.org/browser/trunk/WebKitTools/GtkLauncher/main.c diff --git a/CHECKLIST b/CHECKLIST index 292f9ab..2ea1a74 100644 --- a/CHECKLIST +++ b/CHECKLIST @@ -35,4 +35,5 @@ Also testers and interested people can use this list to see what uzbl is about, /_ = search %s <-- hilight all ; = search <-- jump over all hits * run javascript on curent page through "script" command. -* variable replacement in user agent. \ No newline at end of file +* variable replacement in user agent. +* basic keyboard link hilighting (numbering) and following. will be improved more diff --git a/examples/configs/sampleconfig b/examples/configs/sampleconfig index 0606fd7..f1c36e5 100644 --- a/examples/configs/sampleconfig +++ b/examples/configs/sampleconfig @@ -32,9 +32,6 @@ m = forward s = stop r = reload R = reload_ign_cache -f = follow_link_here -F = follow_link_new_tab -w = follow_link_new_window + = zoom_in - = zoom_out t = toggle_status @@ -53,6 +50,12 @@ U = spawn /usr/share/uzbl/examples/scripts/load_url_from_bookmarks.sh ZZ = exit S = script alert("hi"); +# Keyboard based link following: work in progress! No C DOM bindings yet, no click() event for hyperlinks so no referrer set..Quite basic but does the job for now... +#hit f followed by linknumber and ENTER to follow that link +f_ = script window.location = document.links[%s].href; +#hit F to show the link numbers +F = script for (var i=0; i < document.links.length; i++) {var uzblid = 'uzbl_link_hint_';var li = document.links[i];var pre = document.getElementById(uzblid+i);if (pre) {li.removeChild(pre);} else {var hint = document.createElement('div');hint.setAttribute('id',uzblid+i);hint.innerHTML = i;hint.style.display='inline';hint.style.lineHeight='90%';hint.style.backgroundColor='red';hint.style.color='white';hint.style.fontSize='small-xx';hint.style.fontWeight='light';hint.style.margin='0px';hint.style.padding='2px';hint.style.position='absolute';hint.style.textDecoration='none';hint.style.left=li.style.left;hint.style.top=li.style.top;li.insertAdjacentElement('afterBegin',hint);}} + [network] proxy_server = #values 0-3 diff --git a/examples/configs/sampleconfig-dev b/examples/configs/sampleconfig-dev index 0cb0699..e77ab7f 100644 --- a/examples/configs/sampleconfig-dev +++ b/examples/configs/sampleconfig-dev @@ -32,9 +32,6 @@ m = forward s = stop r = reload R = reload_ign_cache -f = follow_link_here -F = follow_link_new_tab -w = follow_link_new_window + = zoom_in - = zoom_out t = toggle_status @@ -53,6 +50,11 @@ U = spawn ./examples/scripts/load_url_from_bookmarks.sh ZZ = exit S = script alert("hi"); +# Keyboard based link following: work in progress! No C DOM bindings yet, no click() event for hyperlinks so no referrer set..Quite basic but does the job for now... +#hit f followed by linknumber and ENTER to follow that link +f_ = script window.location = document.links[%s].href; +#hit F to show the link numbers +F = script for (var i=0; i < document.links.length; i++) {var uzblid = 'uzbl_link_hint_';var li = document.links[i];var pre = document.getElementById(uzblid+i);if (pre) {li.removeChild(pre);} else {var hint = document.createElement('div');hint.setAttribute('id',uzblid+i);hint.innerHTML = i;hint.style.display='inline';hint.style.lineHeight='90%';hint.style.backgroundColor='red';hint.style.color='white';hint.style.fontSize='small-xx';hint.style.fontWeight='light';hint.style.margin='0px';hint.style.padding='2px';hint.style.position='absolute';hint.style.textDecoration='none';hint.style.left=li.style.left;hint.style.top=li.style.top;li.insertAdjacentElement('afterBegin',hint);}} [network] # to start a local socks server, do : ssh -fND localhost:8118 localhost #proxy_server = http://127.0.0.1:8118