diff options
| author | Phil Crosby | 2009-11-11 00:21:17 -0800 |
|---|---|---|
| committer | Phil Crosby | 2009-11-11 00:24:58 -0800 |
| commit | d367e58a555606b7ad232fa880484cad8a2f7844 (patch) | |
| tree | e6b189ab235f2674847067794f4e2da7f85d3633 /vimiumFrontend.js | |
| parent | ab53553dcc4356ae0d76f28c62722907e71c762f (diff) | |
| download | vimium-d367e58a555606b7ad232fa880484cad8a2f7844.tar.bz2 | |
Implement zoom in and zoom out.
The hotkey for zoom currently doesn't work, because it's beeing eaten by insert mode.
Diffstat (limited to 'vimiumFrontend.js')
| -rw-r--r-- | vimiumFrontend.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/vimiumFrontend.js b/vimiumFrontend.js index 2166e5c7..d6223b32 100644 --- a/vimiumFrontend.js +++ b/vimiumFrontend.js @@ -17,6 +17,15 @@ 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); |
