1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-13 07:05:46 +01:00

Move bookmark info before title in completions, and show for "Smart" completions.

This commit is contained in:
Kris Maglione
2010-11-18 17:53:37 -05:00
parent dba1b75edb
commit 3771166126
5 changed files with 20 additions and 11 deletions

View File

@@ -56,6 +56,14 @@ const BookmarkCache = Module("BookmarkCache", XPCOM(Ci.nsINavBookmarkObserver),
return Bookmark(node.uri, node.title, node.icon && node.icon.spec, post, keyword, tags, node.itemId);
},
get: function (url) {
let ids = bookmarks.getBookmarkIdsForURI(util.newURI(url));
for (let id in values(ids))
if (id in this.bookmarks)
return this.bookmarks[id];
return null;
},
readBookmark: function readBookmark(id) {
return {
itemId: id,

View File

@@ -50,18 +50,17 @@ const Template = Module("Template", {
bookmarkDescription: function (item, text)
<>
<a xmlns:dactyl={NS} identifier={item.id} dactyl:command={item.command}
href={item.item.url} highlight="URL">{text || ""}</a>&#xa0;
{
!(item.extra && item.extra.length) ? "" :
<span class="extra-info">
<span highlight="URLExtra">
({
template.map(item.extra, function (e)
<>{e[0]}: <span highlight={e[2]}>{e[1]}</span></>,
<>&#xa0;</>/* Non-breaking space */)
})
</span>
<>&#xa0;</>)
})&#xa0;</span>
}
<a xmlns:dactyl={NS} identifier={item.id} dactyl:command={item.command}
href={item.item.url} highlight="URL">{text || ""}</a>
</>,
filter: function (str) <span highlight="Filter">{str}</span>,