X-Git-Url: https://git.donarmstrong.com/dactyl.git?a=blobdiff_plain;f=common%2Fmodules%2Fbookmarkcache.jsm;h=2647848d2f97209cd9c27bf2c5d8fa255a2883b4;hb=5ebd29f56d17f62011cdd596b1d351947ee534ff;hp=55328a1fe3aa8dfe4c8db978fd437aac7bfcad08;hpb=9044153cb63835e39b9de8ec4ade237c03e3888a;p=dactyl.git diff --git a/common/modules/bookmarkcache.jsm b/common/modules/bookmarkcache.jsm index 55328a1..2647848 100644 --- a/common/modules/bookmarkcache.jsm +++ b/common/modules/bookmarkcache.jsm @@ -42,7 +42,19 @@ update(Bookmark.prototype, { if (!this.charset || this.charset === "UTF-8") return encodeURIComponent(str); let conv = services.CharsetConv(this.charset); - return escape(conv.ConvertFromUnicode(str) + conv.Finish()); + return escape(conv.ConvertFromUnicode(str) + conv.Finish()).replace(/\+/g, encodeURIComponent); + }, + + 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; @@ -94,8 +106,8 @@ var BookmarkCache = Module("BookmarkCache", XPCOM(Ci.nsINavBookmarkObserver), { let uri = newURI(node.uri); let keyword = services.bookmarks.getKeywordForBookmark(node.itemId); - let tags = tags in node ? (node.tags ? node.tags.split(/, /g) : []) - : services.tagging.getTagsForURI(uri, {}) || []; + let tags = "tags" in node ? (node.tags ? node.tags.split(/, /g) : []) + : services.tagging.getTagsForURI(uri, {}) || []; let post = BookmarkCache.getAnnotation(node.itemId, this.POST); let charset = BookmarkCache.getAnnotation(node.itemId, this.CHARSET); @@ -172,7 +184,11 @@ var BookmarkCache = Module("BookmarkCache", XPCOM(Ci.nsINavBookmarkObserver), { let query = services.history.getNewQuery(); let options = services.history.getNewQueryOptions(); options.queryType = options.QUERY_TYPE_BOOKMARKS; - options.excludeItemIfParentHasAnnotation = "livemark/feedURI"; + try { + // https://bugzil.la/702639 + options.excludeItemIfParentHasAnnotation = "livemark/feedURI"; + } + catch (e) {} let { root } = services.history.executeQuery(query, options); root.containerOpen = true;