From ec6f7e47e23fab3eb7261014607db3c6345aa5bb Mon Sep 17 00:00:00 2001 From: Tener Date: Wed, 17 Jan 2018 14:22:21 -0600 Subject: [PATCH 01/35] // wip --- src/content.js | 8 ++++++++ src/options.html | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/content.js b/src/content.js index 576d1dd..961e2bb 100644 --- a/src/content.js +++ b/src/content.js @@ -175,6 +175,14 @@ ScrollbarAnywhere = (function() { } } + /* + ██████ ██ ██ ████████ ████████ ██████ ███ ██ + ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ + ██████ ██ ██ ██ ██ ██ ██ ██ ██ ██ + ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ + ██████ ██████ ██ ██ ██████ ██ ████ + */ + // Don't drag when left-clicking on these elements const LBUTTON_OVERRIDE_TAGS = ['A','INPUT','SELECT','TEXTAREA','BUTTON','LABEL','OBJECT','EMBED'] const MBUTTON_OVERRIDE_TAGS = ['A'] diff --git a/src/options.html b/src/options.html index 16c122c..9db605f 100644 --- a/src/options.html +++ b/src/options.html @@ -105,6 +105,28 @@

Keys

+ + + + + +
+ + + + + + +
+ + + From e326262040ccb8ce2a1f4eda51906de8632e2b71 Mon Sep 17 00:00:00 2001 From: Tener Date: Wed, 17 Jan 2018 15:00:02 -0600 Subject: [PATCH 02/35] // wip: changed layout of options --- src/options.html | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/src/options.html b/src/options.html index 9db605f..31721ed 100644 --- a/src/options.html +++ b/src/options.html @@ -99,31 +99,22 @@

Keys

- - -
- - - - - - - - -
+ +

Disabled Elements

+ Which elements will you disable dragging on? - - - - -
+ + + + + + + + + +
+
From 81b8a2bc67653c119427957d291ae1bdf8974927 Mon Sep 17 00:00:00 2001 From: Tener Date: Wed, 17 Jan 2018 15:02:45 -0600 Subject: [PATCH 03/35] //wip: minimap title --- src/content.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/content.js b/src/content.js index 961e2bb..35a894c 100644 --- a/src/content.js +++ b/src/content.js @@ -576,6 +576,13 @@ ScrollbarAnywhere = (function() { activity = STOP } } + /* + ██████ ███ ██ ███ ███ ██████ ██ ██ ███████ ███████ ██████ ██████ ██ ██ ███ ██ + ██ ██ ████ ██ ████ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ + ██ ██ ██ ██ ██ ██ ████ ██ ██ ██ ██ ██ ███████ █████ ██ ██ ██ ██ ██ █ ██ ██ ██ ██ + ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███ ██ ██ ██ ██ + ██████ ██ ████ ██ ██ ██████ ██████ ███████ ███████ ██████ ██████ ███ ███ ██ ████ + */ function onMouseDown(ev) { blockContextMenu = false From a3571c492bad024d7fb966e32e6312f2d6c9813f Mon Sep 17 00:00:00 2001 From: Tener Date: Wed, 17 Jan 2018 15:23:41 -0600 Subject: [PATCH 04/35] // wip: added space to line up with other table --- src/options.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/options.html b/src/options.html index 31721ed..3591144 100644 --- a/src/options.html +++ b/src/options.html @@ -108,11 +108,11 @@

Disabled Elements

- + - - + + From f98e5d9413caa42b8a269f4a3922d43cd35d4c90 Mon Sep 17 00:00:00 2001 From: Tener Date: Wed, 17 Jan 2018 15:24:03 -0600 Subject: [PATCH 05/35] // wip: another minimap title --- src/content.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/content.js b/src/content.js index 35a894c..1eb566d 100644 --- a/src/content.js +++ b/src/content.js @@ -81,6 +81,14 @@ ScrollbarAnywhere = (function() { function vmag(v) { return Math.sqrt(v[0]*v[0] + v[1]*v[1]) } function vunit(v) { return vdiv(vmag(v),v) } + /* + ██ ███████ ██████ ██ ██ ███████ ██████ ████████ ███████ ██ ██ ████████ + ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ + ██ ███████ ██ ██ ██ ██ █████ ██████ ██ █████ ███ ██ + ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ + ██ ███████ ██████ ████ ███████ ██ ██ ██ ███████ ██ ██ ██ + */ + // Test if the given point is directly over text var isOverText = (function() { From bb8949921de9febb0754d1240b742d8583b8acd8 Mon Sep 17 00:00:00 2001 From: Tener Date: Wed, 17 Jan 2018 15:29:59 -0600 Subject: [PATCH 06/35] // wip: add buttons & labels to options.html --- src/options.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/options.html b/src/options.html index 3591144..3bdefef 100644 --- a/src/options.html +++ b/src/options.html @@ -114,6 +114,10 @@

Disabled Elements

+ + + + From f24ecbbc79e71ea0624bd878d2cc8ce7a83dd9d7 Mon Sep 17 00:00:00 2001 From: Tener Date: Wed, 17 Jan 2018 17:31:53 -0600 Subject: [PATCH 07/35] // wip: remove IsOverText() minimap title --- src/content.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/content.js b/src/content.js index 1eb566d..62ae38a 100644 --- a/src/content.js +++ b/src/content.js @@ -81,15 +81,6 @@ ScrollbarAnywhere = (function() { function vmag(v) { return Math.sqrt(v[0]*v[0] + v[1]*v[1]) } function vunit(v) { return vdiv(vmag(v),v) } - /* - ██ ███████ ██████ ██ ██ ███████ ██████ ████████ ███████ ██ ██ ████████ - ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ - ██ ███████ ██ ██ ██ ██ █████ ██████ ██ █████ ███ ██ - ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ - ██ ███████ ██████ ████ ███████ ██ ██ ██ ███████ ██ ██ ██ - */ - - // Test if the given point is directly over text var isOverText = (function() { var bonet = document.createElement("SPAN") From cc3395f98a866872f9c8458dd292d94ffcca02b5 Mon Sep 17 00:00:00 2001 From: Tener Date: Wed, 17 Jan 2018 17:59:29 -0600 Subject: [PATCH 08/35] //wip: small refactor in onMouseDown() --- src/content.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/content.js b/src/content.js index 62ae38a..95452eb 100644 --- a/src/content.js +++ b/src/content.js @@ -618,6 +618,11 @@ ScrollbarAnywhere = (function() { break } + if (options.notext && isOverText(ev)) { + debug("detected text node, ignoring") + break + } + if (isOverScrollbar(ev)) { debug("detected scrollbar click, ignoring",ev) break @@ -629,11 +634,6 @@ ScrollbarAnywhere = (function() { break } - if (options.notext && isOverText(ev)) { - debug("detected text node, ignoring") - break - } - debug("click MouseEvent=",ev," dragElement=",dragElement) activity = CLICK mouseOrigin = [ev.clientX,ev.clientY] From cd7685d3829a8abad6e4a9daa4d110f0518872e5 Mon Sep 17 00:00:00 2001 From: Tener Date: Wed, 17 Jan 2018 18:50:58 -0600 Subject: [PATCH 09/35] //wip: renames in onMouseDown() --- src/content.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/content.js b/src/content.js index 95452eb..e37c4b9 100644 --- a/src/content.js +++ b/src/content.js @@ -613,11 +613,16 @@ ScrollbarAnywhere = (function() { break } - if (hasOverrideAncestor(ev.target)) { + if (hasMandatoryOverrideAncestor(ev.target)) { debug("forbidden target element, ignoring",ev) break } + if (hasOptionalOverrideAncestor(ev.target)) { + debug("optional element disabled, ignoring",ev) + break + } + if (options.notext && isOverText(ev)) { debug("detected text node, ignoring") break From 500f764642fc8008997b69eafc378eb08af9cb7a Mon Sep 17 00:00:00 2001 From: Tener Date: Wed, 17 Jan 2018 19:32:31 -0600 Subject: [PATCH 10/35] add: added left-side to the cursor appearance options page seemed kind of lop-sided with this element --- src/options.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/options.html b/src/options.html index 3bdefef..0e127d0 100644 --- a/src/options.html +++ b/src/options.html @@ -123,7 +123,10 @@

Disabled Elements

- + +

Cursor

+ Cursor appearance while dragging. +
Try unchecking this if you notice any delays
From 94d2f3b2d2a2ed5049a44c605aee1b9d4cc8ee57 Mon Sep 17 00:00:00 2001 From: Tener Date: Wed, 17 Jan 2018 19:33:15 -0600 Subject: [PATCH 11/35] // wip: options minimap title --- src/content.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/content.js b/src/content.js index e37c4b9..f5da554 100644 --- a/src/content.js +++ b/src/content.js @@ -2,6 +2,13 @@ ScrollbarAnywhere = (function() { // === Options === + /* + ██████ ██████ ████████ ██ ██████ ███ ██ ███████ + ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ ██ + ██ ██ ██████ ██ ██ ██ ██ ██ ██ ██ ███████ + ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ + ██████ ██ ██ ██ ██████ ██ ████ ███████ + */ var options = {debug:true, enabled:false} From b87dedad767bd2a95bfd5a9f9640a6362873f3cb Mon Sep 17 00:00:00 2001 From: Tener Date: Wed, 17 Jan 2018 19:38:38 -0600 Subject: [PATCH 12/35] change: removed spaces from checkbox labels in options add margin-left to labels if they need more spacing --- src/options.html | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/options.html b/src/options.html index 0e127d0..d994794 100644 --- a/src/options.html +++ b/src/options.html @@ -86,12 +86,12 @@

Keys

- + + - - + +
-
Tip: any unchecked keys will disable dragging when held down
@@ -107,16 +107,16 @@

Disabled Elements

- + + - - + + - - + +
-
@@ -128,7 +128,7 @@

Cursor

Cursor appearance while dragging. -
+
Try unchecking this if you notice any delays
@@ -139,7 +139,7 @@

Grab and drag

Grab-and-drag style scrolling will be enabled instead of the scrollbar anywhere style. -
+
@@ -187,7 +187,7 @@

Blacklist

- + From 2600321b586acdd1f7a8a546b6d623d2a39ec012 Mon Sep 17 00:00:00 2001 From: Tener Date: Wed, 17 Jan 2018 19:46:38 -0600 Subject: [PATCH 13/35] add: more cleanup Changed "show debug noise", it's now a first-class citizen with a capitol 'S' just like the other checkboxes. Added "Tip:" to cursor changer option to match the other class="tip" div. --- src/options.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/options.html b/src/options.html index d994794..0020962 100644 --- a/src/options.html +++ b/src/options.html @@ -129,7 +129,7 @@

Cursor


-
Try unchecking this if you notice any delays
+
Tip: try unchecking this if you notice any delays
@@ -186,8 +186,13 @@

Blacklist

- - + +

Developer

+ Development options. + + + + From 0e4e30e5be4e0b2ee8347bd68e693f1a5f89e54a Mon Sep 17 00:00:00 2001 From: Tener Date: Wed, 17 Jan 2018 19:48:28 -0600 Subject: [PATCH 14/35] //wip: changed the debug message --- src/content.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content.js b/src/content.js index f5da554..d2a8dd6 100644 --- a/src/content.js +++ b/src/content.js @@ -626,7 +626,7 @@ ScrollbarAnywhere = (function() { } if (hasOptionalOverrideAncestor(ev.target)) { - debug("optional element disabled, ignoring",ev) + debug("optional target element disabled, ignoring",ev) break } From 9be3b189de8e04500e56d8724cf718cab390c99d Mon Sep 17 00:00:00 2001 From: Tener Date: Wed, 17 Jan 2018 20:29:40 -0600 Subject: [PATCH 15/35] //wip: made a couple tables in the table in the table --- src/options.html | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/options.html b/src/options.html index 0020962..92ff8ff 100644 --- a/src/options.html +++ b/src/options.html @@ -104,19 +104,24 @@

Disabled Elements

Which elements will you disable dragging on? - - - - - +
-
- - + - - +
+ + + + + +
+
+ + + +
+
From 461aa1cc3028f50a1b0e9ed6261794b838afeac4 Mon Sep 17 00:00:00 2001 From: Tener Date: Wed, 17 Jan 2018 20:30:52 -0600 Subject: [PATCH 16/35] fix: left my bugbox in there from last commit --- src/options.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/options.html b/src/options.html index 92ff8ff..c92438c 100644 --- a/src/options.html +++ b/src/options.html @@ -104,7 +104,7 @@

Disabled Elements

Which elements will you disable dragging on? - +
From b8030cf3310746879bcb85dcbb3bdd0cb017c392 Mon Sep 17 00:00:00 2001 From: Tener Date: Wed, 17 Jan 2018 21:02:44 -0600 Subject: [PATCH 18/35] add: new even listeners for new options --- src/options.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/options.js b/src/options.js index 8a156dc..f90195d 100644 --- a/src/options.js +++ b/src/options.js @@ -92,7 +92,16 @@ function onUpdate(ev) { document.addEventListener('DOMContentLoaded', function(ev) { load(); - ['button','cursor','notext','debug', 'grab_and_drag'].forEach(function(id) { + ['button', + 'cursor', + 'notext', + 'nolinks', + 'nobuttons', + 'nolabels', + 'noimages', + 'noembeds', + 'debug', + 'grab_and_drag'].forEach(function(id) { $(id).addEventListener('change',onUpdate,false) }) From 00ca4ad40dbfe4b967b4b340a175ca92de517bb0 Mon Sep 17 00:00:00 2001 From: Tener Date: Wed, 17 Jan 2018 21:07:26 -0600 Subject: [PATCH 19/35] // WIP: each place i'll need to append to later (aka: bedtime) --- src/content.js | 9 +++++++-- src/options.js | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/content.js b/src/content.js index d2a8dd6..f593b00 100644 --- a/src/content.js +++ b/src/content.js @@ -18,6 +18,8 @@ ScrollbarAnywhere = (function() { options = msg.saveOptions options.cursor = (options.cursor == "true") options.notext = (options.notext == "true") + options.nolinks = (options.nolinks == "true") + options.noimages = (options.noimages == "true") // WIP options.grab_and_drag = (options.grab_and_drag == "true") options.debug = (options.debug == "true") options.enabled = isEnabled(options.blacklist) @@ -201,8 +203,11 @@ ScrollbarAnywhere = (function() { return arguments.callee(e.parentNode) } - function shouldOverrideLeftButton(e) { - return LBUTTON_OVERRIDE_TAGS.some(function(tag) { return tag == e.tagName; }) || hasRoleButtonAttribute(e); + function hasOptionalOverrideAncestor(e) { + if (e == null) return false + if (options.nolinks && e.tagName == 'A') return true + if (options.noimages && e.tagName == 'IMG') return true // WIP + return arguments.callee(e.parentNode) } function hasRoleButtonAttribute(e) { diff --git a/src/options.js b/src/options.js index f90195d..03b6604 100644 --- a/src/options.js +++ b/src/options.js @@ -52,6 +52,8 @@ function save() { o.cursor = $('cursor').checked o.notext = $('notext').checked + o.nolinks = $('nolinks').checked + o.noimages = $('noimages').checked // WIP o.grab_and_drag = $('grab_and_drag').checked o.debug = $('debug').checked @@ -74,6 +76,8 @@ function load() { $('cursor').checked = (o.cursor == "true") $('notext').checked = (o.notext == "true") + $('nolinks').checked = (o.nolinks == "true") + $('noimages').checked = (o.noimages == "true") // WIP $('grab_and_drag').checked = (o.grab_and_drag == "true") $('debug').checked = (o.debug == "true") } From 3ebf785dfe3824322cb7513fcded6b22239df6cb Mon Sep 17 00:00:00 2001 From: Tener Date: Wed, 17 Jan 2018 21:08:37 -0600 Subject: [PATCH 20/35] change: simplied [LMR]BUTTON_OVERRIDE_TAGS i may take these out of the array later --- src/content.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/content.js b/src/content.js index f593b00..1f3b541 100644 --- a/src/content.js +++ b/src/content.js @@ -192,14 +192,10 @@ ScrollbarAnywhere = (function() { */ // Don't drag when left-clicking on these elements - const LBUTTON_OVERRIDE_TAGS = ['A','INPUT','SELECT','TEXTAREA','BUTTON','LABEL','OBJECT','EMBED'] - const MBUTTON_OVERRIDE_TAGS = ['A'] - const RBUTTON_OVERRIDE_TAGS = ['A','INPUT','TEXTAREA','OBJECT','EMBED'] - function hasOverrideAncestor(e) { + const MANDATORY_OVERRIDE_TAGS = ['INPUT', 'TEXTAREA'] + function hasMandatoryOverrideAncestor(e) { if (e == null) return false - if (options.button == LBUTTON && shouldOverrideLeftButton(e)) return true; - if (options.button == MBUTTON && MBUTTON_OVERRIDE_TAGS.some(function(tag) { return tag == e.tagName })) return true - if (options.button == RBUTTON && RBUTTON_OVERRIDE_TAGS.some(function(tag) { return tag == e.tagName })) return true + if (MANDATORY_OVERRIDE_TAGS.some(function(tag) { return tag == e.tagName })) return true return arguments.callee(e.parentNode) } From 028d285694e814ff2ff5d264950e762c940dd9e4 Mon Sep 17 00:00:00 2001 From: Tener Date: Thu, 18 Jan 2018 16:03:46 -0600 Subject: [PATCH 21/35] change: added
From 80004fda6c7ad27e10ea9d0ebb5b500db3350e5d Mon Sep 17 00:00:00 2001 From: Tener Date: Wed, 17 Jan 2018 20:59:39 -0600 Subject: [PATCH 17/35] fix: formatting --- src/options.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/options.html b/src/options.html index c92438c..b62760d 100644 --- a/src/options.html +++ b/src/options.html @@ -119,7 +119,7 @@

Disabled Elements

- +