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:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 + "]";
|
||||
|
||||
Reference in New Issue
Block a user