1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-28 13:52:26 +01:00

Add Bookmark#folder getter.

This commit is contained in:
Kris Maglione
2011-12-31 19:17:57 -05:00
parent a6f7fc4b5e
commit 10ae8da855

View File

@@ -43,6 +43,18 @@ update(Bookmark.prototype, {
return encodeURIComponent(str);
let conv = services.CharsetConv(this.charset);
return escape(conv.ConvertFromUnicode(str) + conv.Finish());
},
get folder() {
let res = [];
res.toString = function () this.join("/");
let id = this.id, parent, title;
while ((id = services.bookmarks.getFolderIdForItem(id)) &&
(title = services.bookmarks.getItemTitle(id)))
res.push(title);
return res.reverse();
}
})
Bookmark.prototype.members.uri = Bookmark.prototype.members.url;