1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-04 00:24:13 +01:00

Merge branch 'master' of kmaglione@git.vimperator.org:/git/vimperator/liberator

This commit is contained in:
Kris Maglione
2008-12-29 13:55:48 -05:00
28 changed files with 217 additions and 215 deletions

View File

@@ -65,16 +65,16 @@ function Bookmarks() //{{{
// Error: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIObserverService.addObserver]"
// nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)"
// location: "JS frame :: file://~firefox/components/nsTaggingService.js :: anonymous :: line 89"
// data: no]
// Source file: file://~firefox/components/nsTaggingService.js
// data: no]
// Source file: file://~firefox/components/nsTaggingService.js
taggingService.getTagsForURI(window.makeURI("http://mysterious.bug"), {});
const Bookmark = new Struct("url", "title", "icon", "keyword", "tags", "id");
const Keyword = new Struct("keyword", "title", "icon", "url");
Bookmark.defaultValue("icon", function () getFavicon(this.url));
Bookmark.prototype.__defineGetter__("extra", function () [
['keyword', this.keyword, "Keyword"],
['tags', this.tags.join(', '), "Tag"]
["keyword", this.keyword, "Keyword"],
["tags", this.tags.join(", "), "Tag"]
].filter(function (item) item[1]));
const storage = modules.storage;
@@ -700,7 +700,7 @@ function History() //{{{
"Go back in the browser history",
function (args)
{
args = args.string;
let url = args.literalArg;
if (args.bang)
{
@@ -708,12 +708,12 @@ function History() //{{{
}
else
{
if (args)
if (url)
{
let sh = window.getWebNavigation().sessionHistory;
for (let i = sh.index - 1; i >= 0; i--)
for (let i in util.range(sh.index, 0, true))
{
if (sh.getEntryAtIndex(i, false).URI.spec == args)
if (sh.getEntryAtIndex(i, false).URI.spec == url)
{
window.getWebNavigation().gotoIndex(i);
return;
@@ -723,7 +723,7 @@ function History() //{{{
}
else
{
history.stepTo(args.count > 0 ? -1 * args.count : -1);
history.stepTo(-Math.max(args.count, 1));
}
}
},
@@ -746,7 +746,7 @@ function History() //{{{
"Go forward in the browser history",
function (args)
{
args = args.string;
let url = args.literalArg;
if (args.bang)
{
@@ -754,12 +754,12 @@ function History() //{{{
}
else
{
if (args)
if (url)
{
let sh = window.getWebNavigation().sessionHistory;
for (let i in util.range(sh.index + 1, sh.count))
{
if (sh.getEntryAtIndex(i, false).URI.spec == args)
if (sh.getEntryAtIndex(i, false).URI.spec == url)
{
window.getWebNavigation().gotoIndex(i);
return;
@@ -769,7 +769,7 @@ function History() //{{{
}
else
{
history.stepTo(args.count > 0 ? args.count : 1);
history.stepTo(Math.max(args.count, 1));
}
}
},
@@ -845,31 +845,30 @@ function History() //{{{
if (index >= 0 && index < window.getWebNavigation().sessionHistory.count)
window.getWebNavigation().gotoIndex(index);
else
liberator.beep();
liberator.beep(); // XXX: really wanted?
},
goToStart: function goToStart()
{
let index = window.getWebNavigation().sessionHistory.index;
if (index == 0)
{
liberator.beep(); // XXX: really wanted?
return;
}
window.getWebNavigation().gotoIndex(0);
if (index > 0)
window.getWebNavigation().gotoIndex(0);
else
liberator.beep(); // XXX: really wanted?
},
goToEnd: function goToEnd()
{
let index = window.getWebNavigation().sessionHistory.index;
if (index == window.getWebNavigation().sessionHistory.count - 1)
{
liberator.beep();
return;
}
let sh = window.getWebNavigation().sessionHistory;
let max = sh.count - 1;
if (sh.index < max)
window.getWebNavigation().gotoIndex(max);
else
liberator.beep(); // XXX: really wanted?
window.getWebNavigation().gotoIndex(max);
},
// if openItems is true, open the matching history items in tabs rather than display