aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Sand2013-02-18 10:14:31 +0000
committerTimo Sand2013-02-18 10:14:31 +0000
commite71731aed50e8ec81b333b386f22f3e901132508 (patch)
treef24c735295b2df85efd2b51ba49143a39cbefcbd
parent5146b77465d259c9749d1af2da83a6950c620312 (diff)
downloadvimium-e71731aed50e8ec81b333b386f22f3e901132508.tar.bz2
Renamed to 'goToRoot', condensed function
-rw-r--r--background_scripts/commands.coffee8
-rw-r--r--content_scripts/vimium_frontend.coffee11
2 files changed, 6 insertions, 13 deletions
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee
index 66e8ff4e..a4937c4a 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", "goRoot",
+ "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", "goRoot", "focusInput", "LinkHints.activateModeWithQueue",
+ "goUp", "goToRoot", "focusInput", "LinkHints.activateModeWithQueue",
"goPrevious", "goNext", "Marks.activateCreateMode", "Marks.activateGotoMode"]
defaultKeyMappings =
@@ -133,7 +133,7 @@ defaultKeyMappings =
"H": "goBack"
"L": "goForward"
"gu": "goUp"
- "gU": "goRoot"
+ "gU": "goToRoot"
"gi": "focusInput"
@@ -226,7 +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 }]
+ 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 34635323..1b97c30a 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -246,15 +246,8 @@ 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
+ goToRoot: () ->
+ window.location.href = window.location.origin
toggleViewSource: ->
chrome.extension.sendRequest { handler: "getCurrentTabUrl" }, (url) ->