From afce27422a221c718958a06a1e7f804f0a59003d Mon Sep 17 00:00:00 2001 From: Sylvester Johansson Date: Thu, 28 May 2009 22:13:24 +0200 Subject: OH GOD I DON'T KNOW WHAT I AM DOING --- examples/configs/sampleconfig-dev | 5 +++-- examples/data/style.css | 4 ++++ examples/scripts/linkfollow.js | 22 +++++++++++++--------- 3 files changed, 20 insertions(+), 11 deletions(-) (limited to 'examples') diff --git a/examples/configs/sampleconfig-dev b/examples/configs/sampleconfig-dev index 3deeac1..0dcc0d2 100644 --- a/examples/configs/sampleconfig-dev +++ b/examples/configs/sampleconfig-dev @@ -60,7 +60,7 @@ set shell_cmd = sh -c set show_status = 1 # you can optionally use this setting to override the background color of the statusbar from your GTK theme. set status_background = #303030 -set status_format = MODE [KEYCMD] LOAD_PROGRESSBAR URI NAME MSGSELECTED_URI +set status_format = [MODE] [KEYCMD] LOAD_PROGRESSBAR URI NAME MSGSELECTED_URI set status_top = 0 # define how your titlebar should look like. (short = statusbar is also shown, long = show everything you must see if statusbar is off) set title_format_short = TITLE - Uzbl browser @@ -69,7 +69,8 @@ set title_format_long = KEYCMD MODE TITLE - Uzbl browser > SELECTED_URI set status_pbar_done = * set status_pbar_pending = - set status_pbar_width = 12 - +set insert_indicator = I +set command_indicator = C set modkey = Mod1 # reset to command mode when new page is loaded set reset_command_mode = 1 diff --git a/examples/data/style.css b/examples/data/style.css index 9789e6f..de0a38b 100644 --- a/examples/data/style.css +++ b/examples/data/style.css @@ -1,6 +1,10 @@ .uzbl_highlight { background-color: yellow;} .uzbl_h_first { background-color: lightgreen;} +.uzbl_follow { border-style: dotted; + border-width: thin; +} + #uzbl_hint > div { display: inline; border: 2px solid #4a6600; diff --git a/examples/scripts/linkfollow.js b/examples/scripts/linkfollow.js index e77219c..aad7353 100644 --- a/examples/scripts/linkfollow.js +++ b/examples/scripts/linkfollow.js @@ -10,7 +10,7 @@ // bind f_ = js hints.follow("%s",hints.open) // // At the moment, it may be useful to have way of forcing uzbl to load the script -// bind :lf = script /usr/share/examples/scripts/linkfollow.js +// bind :lf = script /usr/share/uzbl/examples/scripts/linkfollow.js // // The default style for the hints are pretty ugly, so it is recommended to add the following // to config file @@ -25,11 +25,20 @@ function Hints(){ + // Settings + //////////////////////////////////////////////////////////////////////////// // if set to true, you must explicitly call hints.follow(), otherwise it will // follow the link if there is only one matching result var requireReturn = true; + // Case sensitivity flag + var matchCase = "i"; + + // For case sensitive matching, uncomment: + // var matchCase = ""; + + var uzblid = 'uzbl_hint'; var uzblclass = 'uzbl_highlight'; var uzblclassfirst = 'uzbl_h_first'; @@ -81,7 +90,7 @@ function Hints(){ function Matcher(str){ var numbers = str.replace(/[^\d]/g,""); - var words = str.replace(/\d/g,"").split(/\s+/).map(function (n) { return new RegExp(n,"i")}); + var words = str.replace(/\d/g,"").split(/\s+/).map(function (n) { return new RegExp(n,matchCase)}); this.test = test; this.toString = toString; this.numbers = numbers; @@ -195,10 +204,12 @@ function Hints(){ this.openNewWindow = function(item){ // TODO: this doesn't work yet + item.className += " uzbl_follow"; window.open(item.href,"uzblnew",""); } this.open = function(item){ simulateMouseOver(item); + item.className += " uzbl_follow"; window.location = item.href; } @@ -222,13 +233,6 @@ function Hints(){ var item = items[0].node; } if (item) { - // This causes some elements to move around. Guess it should only be applied to - // links - item.style.margin -= 3; - item.style.padding -= 3; - item.style.borderStyle = "dotted"; - item.style.borderWidth = "thin"; - var name = item.tagName; if (name == 'A') { if(item.click) {item.click()}; -- cgit v1.2.3