1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 00:27:57 +01:00

an experimental hearts symbol in the statusline for bookmarked pages. Needs a unicode font, so might be problematic

This commit is contained in:
Martin Stubenschrott
2007-11-20 02:24:59 +00:00
parent 1d9004c99c
commit 06c23ac254
3 changed files with 19 additions and 0 deletions

View File

@@ -167,6 +167,18 @@ vimperator.Bookmarks = function () //{{{
this.add(title, url);
vimperator.commandline.echo("Added bookmark: " + url + extra, vimperator.commandline.HL_NORMAL, vimperator.commandline.FORCE_SINGLELINE);
}
// update the display of our "bookmarked" symbol
vimperator.statusline.updateUrl();
},
isBookmarked: function(url)
{
var uri = ioService.newURI(url, null, null);
var count = {};
bookmarksService.getBookmarkIdsForURI(uri, count);
return count.value > 0;
},
// returns number of deleted bookmarks

View File

@@ -683,6 +683,10 @@ vimperator.Buffer = function () //{{{
if (countFeeds)
info.push(countFeeds);
if (vimperator.bookmarks.isBookmarked(this.URL))
info.push("bookmarked");
var pageInfoText = '"' + file + '" [' + info.join(", ") + "] " + title;
vimperator.echo(pageInfoText, vimperator.commandline.FORCE_SINGLELINE);
return;

View File

@@ -1134,6 +1134,9 @@ vimperator.StatusLine = function () //{{{
modified += "+";
if (sh.index < sh.count -1)
modified += "-";
if (vimperator.bookmarks.isBookmarked(url))
modified += "\u2764"; // a heart symbol: ❤
//modified += "\u2665"; // a heart symbol: ♥
if (modified)
url += " [" + modified + "]";