From 560f84a4bc65b7abd003951f191514761ba35e90 Mon Sep 17 00:00:00 2001 From: hogelog Date: Tue, 11 Jan 2011 10:00:19 +0900 Subject: disable zoom in/out when load iframe. https://github.com/philc/vimium/issuesearch?state=open&q=zoom#issue/271 --- vimiumFrontend.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vimiumFrontend.js b/vimiumFrontend.js index eb3de996..680578c9 100644 --- a/vimiumFrontend.js +++ b/vimiumFrontend.js @@ -61,7 +61,8 @@ function initializePreDomReady() { checkIfEnabledForUrl(); var getZoomLevelPort = chrome.extension.connect({ name: "getZoomLevel" }); - getZoomLevelPort.postMessage({ domain: window.location.host }); + if (window.self == window.parent) + getZoomLevelPort.postMessage({ domain: window.location.host }); chrome.extension.sendRequest({handler: "getLinkHintCss"}, function (response) { linkHintCss = response.linkHintCss; -- cgit v1.2.3 From 5f7c1506b774bfc7288bf66103e9f1eddd57115e Mon Sep 17 00:00:00 2001 From: Phil Crosby Date: Thu, 3 Feb 2011 16:20:14 -0800 Subject: Update the readme to reflect the new bindings for scrolling up/down a half page --- README.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.markdown b/README.markdown index 9b122f56..512fed22 100644 --- a/README.markdown +++ b/README.markdown @@ -30,10 +30,8 @@ Navigating the current page: l scroll right gg scroll to top of the page G scroll to bottom of the page - , scroll down a page - , scroll up a page - scroll down a full page - scroll up a full page + d, , scroll down half a page + u, , scroll up half a page f open a link in the current tab F open a link in a new tab r reload @@ -69,6 +67,8 @@ Additional advanced browsing commands: zH scroll all the way left zL scroll all the way right z0 reset zoom to default value + scroll down a full page + scroll up a full page Vimium supports command repetition so, for example, hitting '5t' will open 5 tabs in rapid succession. ESC (or -- cgit v1.2.3 From cbb0e6b78c5e8c59e5f027151ed16a20dedaffea Mon Sep 17 00:00:00 2001 From: ilya Date: Wed, 9 Feb 2011 00:31:46 -0800 Subject: added hogelog to credits --- CREDITS | 1 + 1 file changed, 1 insertion(+) diff --git a/CREDITS b/CREDITS index 3a01884a..fb4be384 100644 --- a/CREDITS +++ b/CREDITS @@ -10,6 +10,7 @@ Contributors: Christian Stefanescu (github: stchris) ConradIrwin drizzd + hogelog int3 Johannes Emerich (github: knuton) Julian Naydichev (github: naydichev) -- cgit v1.2.3 From 7d5f9b138f77db9a62f2d2847fd182372afdd9b3 Mon Sep 17 00:00:00 2001 From: ilya Date: Wed, 9 Feb 2011 01:23:52 -0800 Subject: fix a bug with zoomReset --- vimiumFrontend.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/vimiumFrontend.js b/vimiumFrontend.js index a5356f3f..6ddc15c3 100644 --- a/vimiumFrontend.js +++ b/vimiumFrontend.js @@ -221,18 +221,23 @@ function setPageZoomLevel(zoomLevel, showUINotification) { } function zoomIn() { - setPageZoomLevel(currentZoomLevel += 20, true); - saveZoomLevel(window.location.host, currentZoomLevel); + currentZoomLevel += 20; + setAndSaveZoom(); } function zoomOut() { - setPageZoomLevel(currentZoomLevel -= 20, true); - saveZoomLevel(window.location.host, currentZoomLevel); + currentZoomLevel -= 20; + setAndSaveZoom(); } function zoomReset() { - setPageZoomLevel(100, true); - saveZoomLevel(window.location.host, 100); + currentZoomLevel = 100; + setAndSaveZoom(); +} + +function setAndSaveZoom() { + setPageZoomLevel(currentZoomLevel, true); + saveZoomLevel(window.location.host, currentZoomLevel); } function scrollToBottom() { window.scrollTo(window.pageXOffset, document.body.scrollHeight); } -- cgit v1.2.3 From 1edb16a47eb8a35fc3ea7991bfdfc8434d1d3bff Mon Sep 17 00:00:00 2001 From: Phil Crosby Date: Wed, 9 Feb 2011 23:05:40 -0800 Subject: Style --- background_page.html | 8 +++++--- vimiumFrontend.js | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/background_page.html b/background_page.html index d98967b4..77150244 100644 --- a/background_page.html +++ b/background_page.html @@ -18,8 +18,9 @@ var focusedFrame = null; var framesForTab = {}; - // Keys are either literal characters, or "named" - for example (alt+b), (the left arrow) or - // This regular expression captures two groups, the first is a named key, the second is the remainder of the string. + // Keys are either literal characters, or "named" - for example (alt+b), (left arrow) or + // This regular expression captures two groups: the first is a named key, the second is the remainder of + // the string. var namedKeyRegex = /^(<(?:[amc]-.|(?:[amc]-)?[a-z0-9]{2,5})>)(.*)$/; var defaultSettings = { @@ -164,7 +165,8 @@ function showHelp(callback, frameId) { chrome.tabs.getSelected(null, function(tab) { - chrome.tabs.sendRequest(tab.id, { name: "showHelpDialog", dialogHtml: helpDialogHtml(), frameId:frameId }); + chrome.tabs.sendRequest(tab.id, + { name: "showHelpDialog", dialogHtml: helpDialogHtml(), frameId:frameId }); }); } diff --git a/vimiumFrontend.js b/vimiumFrontend.js index 6ddc15c3..b7f9308f 100644 --- a/vimiumFrontend.js +++ b/vimiumFrontend.js @@ -153,8 +153,8 @@ function initializeWhenEnabled() { /* * The backend needs to know which frame has focus. */ -window.addEventListener("focus", function(e){ - chrome.extension.sendRequest({handler: "frameFocused", frameId: frameId}); +window.addEventListener("focus", function(e) { + chrome.extension.sendRequest({ handler: "frameFocused", frameId: frameId }); }); /* @@ -185,7 +185,8 @@ function initializeOnDomReady() { // This is a little hacky but sometimes the size wasn't available on domReady? function registerFrameIfSizeAvailable (top) { if (innerWidth != undefined && innerWidth != 0 && innerHeight != undefined && innerHeight != 0) - chrome.extension.sendRequest({ handler: "registerFrame", frameId: frameId, area: innerWidth * innerHeight, top: top, total: frames.length + 1 }); + chrome.extension.sendRequest({ handler: "registerFrame", frameId: frameId, + area: innerWidth * innerHeight, top: top, total: frames.length + 1 }); else setTimeout(function () { registerFrameIfSizeAvailable(top); }, 100); } -- cgit v1.2.3 From a036d2dac281b2528c2087b08839e118e3f449ae Mon Sep 17 00:00:00 2001 From: Phil Crosby Date: Wed, 9 Feb 2011 23:06:41 -0800 Subject: Preserve the "show advanced commands" setting after you close the vimium help dialog. --- background_page.html | 9 ++++++++- helpDialog.html | 21 ++++++++++++++++----- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/background_page.html b/background_page.html index 77150244..ee12a77d 100644 --- a/background_page.html +++ b/background_page.html @@ -79,7 +79,8 @@ upgradeNotificationClosed: upgradeNotificationClosed, updateScrollPosition: handleUpdateScrollPosition, copyToClipboard: copyToClipboard, - isEnabledForUrl: isEnabledForUrl + isEnabledForUrl: isEnabledForUrl, + saveHelpDialogSettings: saveHelpDialogSettings }; // Event handlers @@ -151,6 +152,10 @@ return { isEnabledForUrl: isEnabled }; } + function saveHelpDialogSettings(request) { + localStorage["helpDialog_showAdvancedCommands"] = request.showAdvancedCommands; + } + /* * Returns the previously saved zoom level for the current tab, or the default zoom level */ @@ -186,6 +191,8 @@ showUnboundCommands, showCommandNames)); dialogHtml = dialogHtml.replace("{{version}}", currentVersion); dialogHtml = dialogHtml.replace("{{title}}", customTitle || "Help"); + dialogHtml = dialogHtml.replace("{{showAdvancedCommands}}", + localStorage["helpDialog_showAdvancedCommands"] == "true"); return dialogHtml; } diff --git a/helpDialog.html b/helpDialog.html index c21c8b7b..ae78d149 100644 --- a/helpDialog.html +++ b/helpDialog.html @@ -132,10 +132,14 @@ -- cgit v1.2.3 From dabef2b50b23df370a26031c25e62a410411d5a9 Mon Sep 17 00:00:00 2001 From: ilya Date: Fri, 11 Feb 2011 18:29:43 -0800 Subject: Change the font size on the help dialog to 11 temporarily because, without more refactoring, the command view in the options page with advanced enabled is way too large. --- helpDialog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpDialog.html b/helpDialog.html index 0f1cd6e9..51ff1692 100644 --- a/helpDialog.html +++ b/helpDialog.html @@ -5,7 +5,7 @@