aboutsummaryrefslogtreecommitdiffstats
path: root/vimiumFrontend.js
diff options
context:
space:
mode:
authorPhil Crosby2009-11-11 00:28:50 -0800
committerPhil Crosby2009-11-11 00:28:50 -0800
commit1f1b5aeaa1d5540c05bf94300fab0b18a87cbdbf (patch)
tree5d527cb7a6409a36621e968888630f5b1daf1d35 /vimiumFrontend.js
parent300fa151c6f59955f9deb7ef2e195f11d79a95ec (diff)
downloadvimium-1f1b5aeaa1d5540c05bf94300fab0b18a87cbdbf.tar.bz2
Shuffle some methods around.
Diffstat (limited to 'vimiumFrontend.js')
-rw-r--r--vimiumFrontend.js38
1 files changed, 19 insertions, 19 deletions
diff --git a/vimiumFrontend.js b/vimiumFrontend.js
index 39ce6036..3b6bcc5d 100644
--- a/vimiumFrontend.js
+++ b/vimiumFrontend.js
@@ -5,28 +5,9 @@ var keyCodes = { ESC: 27 };
var insertMode = false;
var keyPort;
-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); }
-
-function reload() { window.location.reload(); }
-function goBack() { history.back(); }
-function goForward() { history.forward(); }
-
// TODO(philc): This should be pulled from the extension's storage when the page loads.
var currentZoomLevel = 100;
-/*
- * Zoom in increments of 20%; this matches chrome's CMD+ and CMD- keystrokes.
- */
-function zoomIn() { document.body.style.zoom = (currentZoomLevel += 20) + "%"; }
-function zoomOut() { document.body.style.zoom = (currentZoomLevel -= 20) + "%"; }
-
function initializeFrontend() {
document.addEventListener("keydown", onKeydown);
document.addEventListener("focus", onFocusCapturePhase, true);
@@ -65,6 +46,25 @@ function initializeFrontend() {
});
};
+/*
+ * Zoom in increments of 20%; this matches chrome's CMD+ and CMD- keystrokes.
+ */
+function zoomIn() { document.body.style.zoom = (currentZoomLevel += 20) + "%"; }
+function zoomOut() { document.body.style.zoom = (currentZoomLevel -= 20) + "%"; }
+
+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); }
+
+function reload() { window.location.reload(); }
+function goBack() { history.back(); }
+function goForward() { history.forward(); }
+
function toggleViewSource() {
getCurrentUrlHandlers.push(toggleViewSourceCallback);