diff options
| author | Phil Crosby | 2013-02-19 10:47:14 -0800 |
|---|---|---|
| committer | Phil Crosby | 2013-02-19 10:47:14 -0800 |
| commit | 550afd365d947c0a18ff235f6f2fc5655fd4bf9f (patch) | |
| tree | d29b3c17e47d0b88d989c4d837f1dfe0c30c2f78 | |
| parent | 3e3ccbb5fc89af559dc67fd973abfe2cf1a2e5b8 (diff) | |
| parent | e71731aed50e8ec81b333b386f22f3e901132508 (diff) | |
| download | vimium-550afd365d947c0a18ff235f6f2fc5655fd4bf9f.tar.bz2 | |
Merge pull request #783 from deiga/patch-2
Added `gU` command to go to root of page including current port and protocol
| -rw-r--r-- | README.markdown | 1 | ||||
| -rw-r--r-- | background_scripts/commands.coffee | 6 | ||||
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 3 |
3 files changed, 8 insertions, 2 deletions
diff --git a/README.markdown b/README.markdown index 94274ebf..fb68bfd4 100644 --- a/README.markdown +++ b/README.markdown @@ -82,6 +82,7 @@ Additional advanced browsing commands: <a-f> open multiple links in a new tab gi focus the first (or n-th) text input box on the page gu go up one level in the URL hierarchy + gU go up to root of the URL hierarchy zH scroll all the way left zL scroll all the way right diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee index c6a3a770..1db7d980 100644 --- a/background_scripts/commands.coffee +++ b/background_scripts/commands.coffee @@ -88,7 +88,7 @@ Commands = "scrollToTop", "scrollToBottom", "scrollToLeft", "scrollToRight", "scrollPageDown", "scrollPageUp", "scrollFullPageUp", "scrollFullPageDown", "reload", "toggleViewSource", "copyCurrentUrl", "LinkHints.activateModeToCopyLinkUrl", - "openCopiedUrlInCurrentTab", "openCopiedUrlInNewTab", "goUp", + "openCopiedUrlInCurrentTab", "openCopiedUrlInNewTab", "goUp", "goToRoot", "enterInsertMode", "focusInput", "LinkHints.activateMode", "LinkHints.activateModeToOpenInNewTab", "LinkHints.activateModeWithQueue", "Vomnibar.activate", "Vomnibar.activateInNewTab", "Vomnibar.activateTabSelection", @@ -107,7 +107,7 @@ Commands = # from Vimium will uncover these gems. advancedCommands: [ "scrollToLeft", "scrollToRight", - "goUp", "focusInput", "LinkHints.activateModeWithQueue", + "goUp", "goToRoot", "focusInput", "LinkHints.activateModeWithQueue", "goPrevious", "goNext", "Marks.activateCreateMode", "Marks.activateGotoMode"] defaultKeyMappings = @@ -133,6 +133,7 @@ defaultKeyMappings = "H": "goBack" "L": "goForward" "gu": "goUp" + "gU": "goToRoot" "gi": "focusInput" @@ -226,6 +227,7 @@ commandDescriptions = # Navigating the URL hierarchy goUp: ["Go up the URL hierarchy", { passCountToFunction: true }] + goToRoot: ["Go to root of current URL hierarchy", { passCountToFunction: true }] # Manipulating tabs nextTab: ["Go one tab right", { background: true }] diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index ca7af5ae..1b97c30a 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -246,6 +246,9 @@ extend window, urlsplit = urlsplit.slice(0, Math.max(3, urlsplit.length - count)) window.location.href = urlsplit.join('/') + goToRoot: () -> + window.location.href = window.location.origin + toggleViewSource: -> chrome.extension.sendRequest { handler: "getCurrentTabUrl" }, (url) -> if (url.substr(0, 12) == "view-source:") |
