mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-06 14:04:12 +01:00
Add Bookmark#folder getter.
This commit is contained in:
@@ -43,6 +43,18 @@ update(Bookmark.prototype, {
|
|||||||
return encodeURIComponent(str);
|
return encodeURIComponent(str);
|
||||||
let conv = services.CharsetConv(this.charset);
|
let conv = services.CharsetConv(this.charset);
|
||||||
return escape(conv.ConvertFromUnicode(str) + conv.Finish());
|
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;
|
Bookmark.prototype.members.uri = Bookmark.prototype.members.url;
|
||||||
|
|||||||
Reference in New Issue
Block a user