From 4828c9b56585bbf0e090934187cc5397df4536cd Mon Sep 17 00:00:00 2001 From: Phil Crosby Date: Sun, 8 Nov 2009 00:22:59 -0800 Subject: Crank down the initial step size a bit; add commands for page up and page down. --- background_page.html | 2 ++ vimiumFrontend.js | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/background_page.html b/background_page.html index 91a5ed69..fc19fa4a 100644 --- a/background_page.html +++ b/background_page.html @@ -98,6 +98,8 @@ keyToCommandRegistry['l'] = 'scrollRight'; keyToCommandRegistry['gg'] = 'scrollToTop'; keyToCommandRegistry['G'] = 'scrollToBottom'; + keyToCommandRegistry[''] = "scrollPageDown"; + keyToCommandRegistry[''] = "scrollPageUp"; keyToCommandRegistry['r'] = 'reload'; keyToCommandRegistry['ba'] = 'goBack'; diff --git a/vimiumFrontend.js b/vimiumFrontend.js index 5c5c93ce..f9a42d75 100644 --- a/vimiumFrontend.js +++ b/vimiumFrontend.js @@ -1,4 +1,4 @@ -var SCROLL_STEP_SIZE = 100; // Pixels +var SCROLL_STEP_SIZE = 60; // Pixels document.addEventListener("keydown", onKeydown); document.addEventListener("focus", onFocusCapturePhase, true); @@ -13,6 +13,8 @@ function scrollToBottom() { window.scrollTo(0, document.body.scrollHeight); } function scrollToTop() { window.scrollTo(0, 0); } function scrollUp() { window.scrollBy(0, -1 * SCROLL_STEP_SIZE); } function scrollDown() { window.scrollBy(0, SCROLL_STEP_SIZE); } +function scrollPageUp() { window.scrollBy(0, -6 * SCROLL_STEP_SIZE); } +function scrollPageDown() { window.scrollBy(0, 6 * SCROLL_STEP_SIZE); } function scrollLeft() { window.scrollBy(-1 * SCROLL_STEP_SIZE, 0); } function scrollRight() { window.scrollBy(SCROLL_STEP_SIZE, 0); } -- cgit v1.2.3