From 5583e0f6921c8bc01fe701bf3c74ef34c4244f4a Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Tue, 16 Dec 2014 16:12:54 +0000 Subject: Do not use Math.sign(). --- content_scripts/scroller.coffee | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/content_scripts/scroller.coffee b/content_scripts/scroller.coffee index a2617289..09470158 100644 --- a/content_scripts/scroller.coffee +++ b/content_scripts/scroller.coffee @@ -4,6 +4,13 @@ # activatedElement = null +# Return 0, -1 or 1: the sign of the argument. +getSign = (val) -> + if not val + 0 + else + if val < 0 then -1 else 1 + scrollProperties = x: { axisName: 'scrollLeft' @@ -63,7 +70,7 @@ doesScroll = (element, direction, amount, factor) -> # we're definitely scrolling forwards, so any positive value will do for delta. In the latter, we're # definitely scrolling backwards, so a delta of -1 will do. For absolute scrolls, factor is always 1. delta = factor * getDimension(element, direction, amount) || -1 - delta = Math.sign delta # 1 or -1 + delta = getSign delta # 1 or -1 performScroll(element, direction, delta) and performScroll(element, direction, -delta) # From element and its parents, find the first which we should scroll and which does scroll. @@ -136,7 +143,7 @@ CoreScroller = myKeyIsStillDown = => @time == activationTime and @keyIsDown # Store amount's sign and make amount positive; the arithmetic is clearer when amount is positive. - sign = Math.sign amount + sign = getSign amount amount = Math.abs amount # Initial intended scroll duration (in ms). We allow a bit longer for longer scrolls. -- cgit v1.2.3 From 46a5bad5d7d3532431dca3c567ad4f148f565e08 Mon Sep 17 00:00:00 2001 From: Phil Crosby Date: Tue, 16 Dec 2014 10:49:55 -0800 Subject: Add a little more context to a comment --- content_scripts/vimium_frontend.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 491f5750..fa20cd9e 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -227,8 +227,8 @@ setScrollPosition = (scrollX, scrollY) -> window.focusThisFrame = (shouldHighlight) -> if window.innerWidth < 3 or window.innerHeight < 3 # This frame is too small to focus. Cancel and tell the background frame to focus the next one instead. - # NOTE(smblott) We assume that there is at least one frame large enough to focus. - # See #1317. + # This affects sites like Google Inbox, which have many tiny iframes. See #1317. + # Here we're assuming that there is at least one frame large enough to focus. chrome.runtime.sendMessage({ handler: "nextFrame", frameId: frameId }) return window.focus() -- cgit v1.2.3 From bde170aa74aa9909efaaf95b056dbbd09811570f Mon Sep 17 00:00:00 2001 From: Phil Crosby Date: Tue, 16 Dec 2014 10:51:19 -0800 Subject: Revert "Hide the smooth scroll option from the settings UI" This reverts commit 5ec7f490b5e9e68bddb415b66b6cae86841a3d52. --- pages/options.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pages/options.html b/pages/options.html index bc4454cd..8e685304 100644 --- a/pages/options.html +++ b/pages/options.html @@ -351,6 +351,15 @@ unmapAll Miscellaneous
options + + + + + +
@@ -363,15 +372,6 @@ unmapAll - - - - - - -- cgit v1.2.3 From 243a77854c505b8bbdae7e4822c6239afb904d35 Mon Sep 17 00:00:00 2001 From: Phil Crosby Date: Tue, 16 Dec 2014 11:00:33 -0800 Subject: Increment version to v1.49 --- README.md | 5 +++++ manifest.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8256f9f7..b39bf0c3 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,11 @@ Please see [CONTRIBUTING.md](https://github.com/philc/vimium/blob/master/CONTRIB Release Notes ------------- +1.49 (2014-12-16) + +- An option to toggle smooth scrolling. +- Make Vimium work on older versions of Chrome. + 1.46, 1.47, 1.48 (2014-12-15) - Site-specific excluded keys: you can disable some Vimium key bindings on sites like gmail.com, so you can use the key bindings provided by the site itself. diff --git a/manifest.json b/manifest.json index 452132ec..3cd88d1e 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Vimium", - "version": "1.48", + "version": "1.49", "description": "The Hacker's Browser. Vimium provides keyboard shortcuts for navigation and control in the spirit of Vim.", "icons": { "16": "icons/icon16.png", "48": "icons/icon48.png", -- cgit v1.2.3 From 09f8527915eae8067072277e2b161493ede359cd Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Tue, 16 Dec 2014 22:04:28 +0000 Subject: Ensure we click elements --- lib/dom_utils.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dom_utils.coffee b/lib/dom_utils.coffee index dfaa5d5f..a0ac0bd3 100644 --- a/lib/dom_utils.coffee +++ b/lib/dom_utils.coffee @@ -95,11 +95,11 @@ DomUtils = # # The html5 input types that should use simulateSelect are: # ["date", "datetime", "datetime-local", "email", "month", "number", "password", "range", "search", - # "submit", "tel", "text", "time", "url", "week"] + # "tel", "text", "time", "url", "week"] # An unknown type will be treated the same as "text", in the same way that the browser does. # isSelectable: (element) -> - unselectableTypes = ["button", "checkbox", "color", "file", "hidden", "image", "radio", "reset"] + unselectableTypes = ["button", "checkbox", "color", "file", "hidden", "image", "radio", "reset", "submit"] (element.nodeName.toLowerCase() == "input" && unselectableTypes.indexOf(element.type) == -1) || element.nodeName.toLowerCase() == "textarea" -- cgit v1.2.3