From 930e69732ebb35bd862d33065befaa918229ffb9 Mon Sep 17 00:00:00 2001 From: Mason Larobina Date: Fri, 5 Mar 2010 14:21:15 +0800 Subject: Strip whitespace. --- examples/data/scripts/follower.js | 26 +++++++++++++------------- examples/data/scripts/instance-select-wmii.sh | 2 +- examples/data/scripts/uzblcat | 1 - 3 files changed, 14 insertions(+), 15 deletions(-) (limited to 'examples') diff --git a/examples/data/scripts/follower.js b/examples/data/scripts/follower.js index 604b779..dc37b46 100644 --- a/examples/data/scripts/follower.js +++ b/examples/data/scripts/follower.js @@ -16,7 +16,7 @@ // be done with: // // @on_event LOAD_COMMIT script /path/to/follower.js -// +// // Then you can bind it to a key: // // @bind f* = js follower.follow('%s', matchSpec, handler, hintStyler) @@ -26,7 +26,7 @@ // set these to follower.genericMatchSpec, follower.genericHandler and // follower.genericHintStyler respectively. // -// For example, +// For example, // // @bind f* = js follower.follow('%s', follower.genericMatchSpec, follower.genericHandler, follower.genericHintStyler) // @bind F* = js follower.follow('%s', follower.onlyLinksMatchSpec, follower.newPageHandler, follower.newPageHintStyler) @@ -53,7 +53,7 @@ // * What elements are hinted. // * The style of the hints displayed. // * How the hints are handled. -// +// // In order to customize behavior, write an alternative, and pass that in to // follower.follow invocation. You _will_ have to modify this script, but only // locally, it beats having to copy the entire script under a new name and @@ -75,11 +75,11 @@ String.prototype.lpad = function(padding, length) { return padded; } -function Follower() { +function Follower() { // Globals - var uzblID = 'uzbl-follow'; // ID to apply to each hint. - var uzblContainerID = 'uzbl-follow-container'; // ID to apply to the div containing hints. + var uzblID = 'uzbl-follow'; // ID to apply to each hint. + var uzblContainerID = 'uzbl-follow-container'; // ID to apply to the div containing hints. // Translation table, used to display something other than numbers as hint // labels. Typically set to the ten keys of the home row. @@ -147,7 +147,7 @@ function Follower() { } Uzbl.run("event SET_KEYCMD"); } - + // Handler to open links in a new page. The rest is the same as before. this.newPageHandler = function(node) { if (node) { @@ -387,24 +387,24 @@ function Follower() { // The main hinting function. I don't know how to do default values to // functions, so all arguments must be specified. Use generics if you must. this.follow = function(target, matchSpec, handler, hintStyler) { - var container = generateHintContainer(); // Get a container to hold all hints. + var container = generateHintContainer(); // Get a container to hold all hints. var allHintables = generateHintables(matchSpec); // Get all items that can be hinted. - hintables = filterHintables(allHintables, target); // Filter them based on current input. - + hintables = filterHintables(allHintables, target); // Filter them based on current input. + clearHints(); // Clear existing hints, if any. if (hintables[0].length == 0) { // Nothing was hinted, user pressed an unknown key, maybe? // Do nothing. } else if (hintables[0].length == 1) { - handler(hintables[0][0]); // Only one hint remains, handle it. + handler(hintables[0][0]); // Only one hint remains, handle it. } else { - drawHints(container, hintables, hintStyler); // Draw whatever hints remain. + drawHints(container, hintables, hintStyler); // Draw whatever hints remain. } return; }; -} +} // Make on-click links clickable. try { diff --git a/examples/data/scripts/instance-select-wmii.sh b/examples/data/scripts/instance-select-wmii.sh index 2bf13ba..fdd27e6 100755 --- a/examples/data/scripts/instance-select-wmii.sh +++ b/examples/data/scripts/instance-select-wmii.sh @@ -6,7 +6,7 @@ # you can select one from a list, or go to the next/previous one # It does not change the layout (stacked/tiled/floating) nor does it # changes the size or viewing mode of a uzbl window -# When your current uzbl window is maximized, the one you change to +# When your current uzbl window is maximized, the one you change to # will be maximized as well. # See http://www.uzbl.org/wiki/wmii for more info # $1 must be one of 'list', 'next', 'prev' diff --git a/examples/data/scripts/uzblcat b/examples/data/scripts/uzblcat index e955608..4aa4b9e 100755 --- a/examples/data/scripts/uzblcat +++ b/examples/data/scripts/uzblcat @@ -9,4 +9,3 @@ for line in stdin: stdout.write(line[0:-1]) # vim: set noet ff=unix - -- cgit v1.2.3