From 6e959935f94355bfe55dee808abd7ecc9fd42c66 Mon Sep 17 00:00:00 2001 From: Ilya Sukhar Date: Fri, 24 Sep 2010 00:53:04 -0700 Subject: Code cleanup & README changes for the multiple link hints patch. --- README.markdown | 3 ++- commands.js | 10 +++++----- linkHints.js | 8 +++----- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/README.markdown b/README.markdown index 668f0c2b..36e267bf 100644 --- a/README.markdown +++ b/README.markdown @@ -36,7 +36,7 @@ Navigating the current page: scroll up a full page f activate link hints mode to open in current tab F activate link hints mode to open in new tab - q activate link hints mode to open multiple links in a new tab + activate link hints mode to open multiple links in a new tab r reload gs view source zi zoom in @@ -86,6 +86,7 @@ Release Notes - In link hints mode, holding down the shift key will now toggle between opening in the current tab and opening in a new tab. - Two new commands (`zH` and `zL`) to scroll to the left and right edges of the page. - A new command (`gi`) to focus the first (or n-th) text input box on the page. +- A new command (``) to open up multiple links at a time in new tabs. - Frame support. - Bug fixes. diff --git a/commands.js b/commands.js index a952ae91..46a52632 100644 --- a/commands.js +++ b/commands.js @@ -110,9 +110,9 @@ function clearKeyMappingsAndSetDefaults() { mapKeyToCommand('gi', 'focusInput'); - mapKeyToCommand('f', 'activateLinkHintsMode'); - mapKeyToCommand('F', 'activateLinkHintsModeToOpenInNewTab'); - mapKeyToCommand('q', 'activeteLinkHintsModeWithQueue'); + mapKeyToCommand('f', 'activateLinkHintsMode'); + mapKeyToCommand('F', 'activateLinkHintsModeToOpenInNewTab'); + mapKeyToCommand('', 'activateLinkHintsModeWithQueue'); mapKeyToCommand('/', 'enterFindMode'); mapKeyToCommand('n', 'performFind'); @@ -159,7 +159,7 @@ addCommand('focusInput', 'Focus the first (or n-th) text box on the pag addCommand('activateLinkHintsMode', 'Enter link hints mode to open links in current tab'); addCommand('activateLinkHintsModeToOpenInNewTab', 'Enter link hints mode to open links in new tab'); -addCommand('activeteLinkHintsModeWithQueue', 'Enter link hints mode to open multiple links in a new tab'); +addCommand('activateLinkHintsModeWithQueue', 'Enter link hints mode to open multiple links in a new tab'); addCommand('enterFindMode', 'Enter find mode'); addCommand('performFind', 'Cycle forward to the next find match'); @@ -191,7 +191,7 @@ var commandGroups = { "scrollPageUp", "scrollFullPageDown", "reload", "toggleViewSource", "zoomIn", "zoomOut", "copyCurrentUrl", "goUp", "enterInsertMode", "focusInput", - "activateLinkHintsMode", "activateLinkHintsModeToOpenInNewTab", "activeteLinkHintsModeWithQueue", + "activateLinkHintsMode", "activateLinkHintsModeToOpenInNewTab", "activateLinkHintsModeWithQueue", "enterFindMode", "performFind", "performBackwardsFind", "nextFrame"], historyNavigation: ["goBack", "goForward"], diff --git a/linkHints.js b/linkHints.js index c470dfe0..c62468fb 100644 --- a/linkHints.js +++ b/linkHints.js @@ -35,7 +35,7 @@ var clickableElementsXPath = (function() { // We need this as a top-level function because our command system doesn't yet support arguments. function activateLinkHintsModeToOpenInNewTab() { activateLinkHintsMode(true, false); } -function activeteLinkHintsModeWithQueue() { activateLinkHintsMode(true, true); } +function activateMultipleLinkHintsMode() { activateLinkHintsMode(true, true); } function activateLinkHintsMode(openInNewTab, withQueue) { if (!linkHintsCssAdded) @@ -48,9 +48,7 @@ function activateLinkHintsMode(openInNewTab, withQueue) { document.addEventListener("keyup", onKeyUpInLinkHintsMode, true); } -function setOpenLinkMode(openInNewTab, withQueue) { - shouldOpenLinkHintInNewTab = openInNewTab; - shouldOpenLinkHintWithQueue = withQueue +function setOpenLinkMode(shouldOpenLinkHintInNewTab, shouldOpenLinkHintWithQueue) { if (shouldOpenLinkHintWithQueue) { HUD.show("Open multiple links in a new tab"); } else { @@ -306,7 +304,7 @@ function deactivateLinkHintsMode() { function resetLinkHintsMode() { deactivateLinkHintsMode(); - activeteLinkHintsModeWithQueue(); + activateMultipleLinkHintsMode(); } /* -- cgit v1.2.3