sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit b64a533c1d5b9bf4d03b313b3742288085538fad
parent e3a0337ec8fbdb8e16c50fa1daa526610aea49a1
Author: Christoph Lohmann <20h@r-36.net>
Date:   Wed, 29 Aug 2012 09:11:49 +0200

Cleaning up the middle click user script page.
Diffstat:
Msurf.suckless.org/files/middle_click_link.md | 32+++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/surf.suckless.org/files/middle_click_link.md b/surf.suckless.org/files/middle_click_link.md @@ -7,26 +7,28 @@ Description This script must be deployed into the ~/.surf/user.js and one will be able to open link in a new window with middleclick or with control click. -(function() { - window.addEventListener("click", function(e) { - if ( - e.button == 1 // for middle click - //|| e.ctrlKey // for ctrl + click - ) { - var new_uri = e.srcElement.href; - if (new_uri) { - e.stopPropagation(); - e.preventDefault(); - window.open(new_uri); + (function() { + window.addEventListener("click", function(e) { + if ( + e.button == 1 // for middle click + //|| e.ctrlKey // for ctrl + click + ) { + var new_uri = e.srcElement.href; + if (new_uri) { + e.stopPropagation(); + e.preventDefault(); + window.open(new_uri); + } } - } - }, false); -})(); + }, false); + })(); Author ------ - Original author n30n , actual revision chm.duquesne. -The last version of this script is on http://www.uzbl.org/wiki/middle_click_links +The last version of this script is +[here](http://www.uzbl.org/wiki/middle_click_links) under a [CC Attribution-Noncommercial-Share Alike 3.0 Unported license](http://creativecommons.org/licenses/by-nc-sa/3.0/). +