From bb30dd437895473966a2dddd16db2eaf7aca6f31 Mon Sep 17 00:00:00 2001 From: Martin Stubenschrott Date: Wed, 9 Jul 2008 17:57:58 +0000 Subject: [PATCH] new :jumps command (thanks a lot, Konstantin) --- NEWS | 1 + TODO | 2 ++ content/bookmarks.js | 27 +++++++++++++++++++++++++++ locale/en-US/browsing.txt | 12 ++++++++++++ 4 files changed, 42 insertions(+) diff --git a/NEWS b/NEWS index 8916a3e2..5e2c5c41 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,7 @@ * don't pass certain keys like ctrl-o or ctrl-n to firefox in insert mode * keywords in :open have higher priority than local files now * add :set online to control the "work offline" menu item + * add :jumps command to list current tab's history * many small bug fixes 2008-06-03: diff --git a/TODO b/TODO index c68af0a8..af5c93a9 100644 --- a/TODO +++ b/TODO @@ -15,6 +15,8 @@ BUGS: - ;f seems broken after a page load - ;s saves the page rather than the image - :set! browser.urlbar.clickSelectsAll=true -> clicking in the location bar unfocuses it immediately +- http://apcmag.com/why_os_x_106_snow_leopard_should_leave_powerpc_in_the_cold.htm - scrolls the wrong + window with j/k (the green slashdot thing for me). FEATURES: 8 middleclick in content == p, and if command line is open, paste there the clipboard buffer diff --git a/content/bookmarks.js b/content/bookmarks.js index 83ed5ef3..7d814f8b 100644 --- a/content/bookmarks.js +++ b/content/bookmarks.js @@ -129,6 +129,33 @@ liberator.Bookmarks = function () //{{{ ////////////////////// COMMANDS //////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ + liberator.commands.add(["ju[mps]"], + "Show jumplist", + function () + { + var sh = getWebNavigation().sessionHistory; + var list = ":" + (liberator.util.escapeHTML(liberator.commandline.getCommand()) || "jumps") + "
" + ""; + list += ""; + var num = -sh.index; + + for (var i = 0; i < sh.count; i++) + { + var entry = sh.getEntryAtIndex(i, false); + var uri = entry.URI.spec; + var title = entry.title; + var indicator = i == sh.index? ">": " "; + list += ""; + num++; + } + + list += "
jumptitleURI
" + indicator + "" + Math.abs(num) + "" + title + + "" + uri + "
"; + + liberator.commandline.echo(list, liberator.commandline.HL_NORMAL, liberator.commandline.FORCE_MULTILINE); + }, + {} + ); + liberator.commands.add(["bma[rk]"], "Add a bookmark", function (args) diff --git a/locale/en-US/browsing.txt b/locale/en-US/browsing.txt index 974aed07..ae946799 100644 --- a/locale/en-US/browsing.txt +++ b/locale/en-US/browsing.txt @@ -90,6 +90,7 @@ Go [count] pages back in the browser history. The special version [c]:back![c] goes to the beginning of the browser history. ________________________________________________________________________________ + |L| || |CTRL-i| |:fo| |:fw| |:forward| ||:[count]fo[rward][!] [url]|| + ||CTRL-i|| @@ -99,6 +100,17 @@ The special version [c]:forward![c] goes to the end of the browser history. ________________________________________________________________________________ +|:ju| |:jumps| +||:ju[mps]|| +________________________________________________________________________________ +List all jumps aka current tab's history aka session history. + +Current history position is marked with >, jump numbers are counters +to be used with [c]:back[c] (above zero record) or [c]:forward[c] +(below zero record). +________________________________________________________________________________ + + |gu| ||[count]gu|| ________________________________________________________________________________