aboutsummaryrefslogtreecommitdiffstats
path: root/vimiumFrontend.js
diff options
context:
space:
mode:
authorint32010-04-17 10:29:02 +0800
committerint32010-06-12 23:34:54 +0800
commitc3649ada9fb51f09cf4d229a2589955ad96d7413 (patch)
tree09000bcc3c95f27bc76bb1523daa35c044e6f22c /vimiumFrontend.js
parent626d7be7d10884dd401996ef7b88049b420f42f9 (diff)
downloadvimium-c3649ada9fb51f09cf4d229a2589955ad96d7413.tar.bz2
Add 'goUp' function. However, it does not support command repetition.
Diffstat (limited to 'vimiumFrontend.js')
-rw-r--r--vimiumFrontend.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/vimiumFrontend.js b/vimiumFrontend.js
index 4346d18f..c33e87db 100644
--- a/vimiumFrontend.js
+++ b/vimiumFrontend.js
@@ -200,6 +200,19 @@ function reload() { window.location.reload(); }
function goBack() { history.back(); }
function goForward() { history.forward(); }
+function goUp() {
+ var url = window.location.href;
+ if (url[url.length-1] == '/')
+ url = url.substring(0, url.length - 1);
+
+ var urlsplit = url.split('/');
+ // make sure we haven't hit the base domain yet
+ if (urlsplit.length > 3) {
+ delete urlsplit[urlsplit.length-1];
+ window.location.href = urlsplit.join('/');
+ }
+}
+
function toggleViewSource() {
getCurrentUrlHandlers.push(toggleViewSourceCallback);