aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Sand2013-02-16 22:39:39 +0000
committerTimo Sand2013-02-16 22:39:39 +0000
commitb466d26ee559bf97e1cbf0cfd77ec0aa1d40a104 (patch)
treec645250d504823a897115458dfafa449e26e058f
parentc781ce942e225c9bc9f172cea54e0e7de6e4bcd0 (diff)
downloadvimium-b466d26ee559bf97e1cbf0cfd77ec0aa1d40a104.tar.bz2
Added `gU` command to go to root of page including current port and protocol
-rw-r--r--CREDITS1
-rw-r--r--README.markdown1
-rw-r--r--background_scripts/commands.coffee6
-rw-r--r--content_scripts/vimium_frontend.coffee10
4 files changed, 16 insertions, 2 deletions
diff --git a/CREDITS b/CREDITS
index 9d4f8259..6f3e6cd6 100644
--- a/CREDITS
+++ b/CREDITS
@@ -38,5 +38,6 @@ Contributors:
R.T. Lechow <rtlechow@gmail.com> (github: rtlechow)
Wang Ning <daning106@gmail.com> (github:daning)
Werner Laurensse (github: ab3)
+ Timo Sand (github: deiga)
Feel free to add real names in addition to GitHub usernames.
diff --git a/README.markdown b/README.markdown
index d0cabeed..e8c22e1f 100644
--- a/README.markdown
+++ b/README.markdown
@@ -81,6 +81,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 d7c332f9..66e8ff4e 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", "goRoot",
"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", "goRoot", "focusInput", "LinkHints.activateModeWithQueue",
"goPrevious", "goNext", "Marks.activateCreateMode", "Marks.activateGotoMode"]
defaultKeyMappings =
@@ -133,6 +133,7 @@ defaultKeyMappings =
"H": "goBack"
"L": "goForward"
"gu": "goUp"
+ "gU": "goRoot"
"gi": "focusInput"
@@ -225,6 +226,7 @@ commandDescriptions =
# Navigating the URL hierarchy
goUp: ["Go up the URL hierarchy", { passCountToFunction: true }]
+ goRoot: ["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..34635323 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -246,6 +246,16 @@ extend window,
urlsplit = urlsplit.slice(0, Math.max(3, urlsplit.length - count))
window.location.href = urlsplit.join('/')
+ goRoot: (count) ->
+ host = window.location.hostname
+ port = window.location.port
+ protocol = window.location.protocol
+
+ url = protocol + "//" + host
+ if port
+ url += ":" + port
+ window.location.href = url
+
toggleViewSource: ->
chrome.extension.sendRequest { handler: "getCurrentTabUrl" }, (url) ->
if (url.substr(0, 12) == "view-source:")