diff --git a/common/content/configbase.js b/common/content/configbase.js index 78ec15c3..0d19a171 100644 --- a/common/content/configbase.js +++ b/common/content/configbase.js @@ -251,6 +251,7 @@ const ConfigBase = Class(ModuleBase, { Title color: magenta; background: white; font-weight: bold; URL text-decoration: none; color: green; background: inherit; URL:hover text-decoration: underline; cursor: pointer; + URLExtra color: gray; FrameIndicator;;* { /* This gets released into the wild, so everything is important */ diff --git a/common/modules/bookmarkcache.jsm b/common/modules/bookmarkcache.jsm index a376eb05..8e4d3b2b 100644 --- a/common/modules/bookmarkcache.jsm +++ b/common/modules/bookmarkcache.jsm @@ -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, diff --git a/common/modules/template.jsm b/common/modules/template.jsm index dfa87abc..e6368b43 100644 --- a/common/modules/template.jsm +++ b/common/modules/template.jsm @@ -50,18 +50,17 @@ const Template = Module("Template", { bookmarkDescription: function (item, text) <> - {text || ""}  { !(item.extra && item.extra.length) ? "" : - + ({ template.map(item.extra, function (e) <>{e[0]}: {e[1]}, - <> /* Non-breaking space */) - }) - + <> ) + })  } + {text || ""} , filter: function (str) {str}, diff --git a/common/skin/dactyl.css b/common/skin/dactyl.css index f689ab26..44ec214d 100644 --- a/common/skin/dactyl.css +++ b/common/skin/dactyl.css @@ -58,8 +58,6 @@ width: 0px; } -.extra-info { color: gray; } - .times-executed, .time-average { color: green; } .time-total { color: red; } diff --git a/pentadactyl/content/config.js b/pentadactyl/content/config.js index c3f53da4..a05af89c 100644 --- a/pentadactyl/content/config.js +++ b/pentadactyl/content/config.js @@ -254,8 +254,11 @@ const Config = Module("config", ConfigBase, { context.filterFunc = null; context.hasItems = context.completions.length > 0; // XXX context.incomplete = true; - context.keys.icon = 2; + + context.format = bookmarks.format; + context.keys.extra = function (item) (bookmarkcache.get(item.url) || {}).extra; context.title = ["Smart Completions"]; + context.cancel = function () { if (searchRunning) { services.get("autoCompleteSearch").stopSearch(); @@ -267,8 +270,8 @@ const Config = Module("config", ConfigBase, { let timer = new Timer(50, 100, function (result) { context.incomplete = result.searchResult >= result.RESULT_NOMATCH_ONGOING; context.completions = [ - [result.getValueAt(i), result.getCommentAt(i), result.getImageAt(i)] - for (i in util.range(0, result.matchCount)) + { url: result.getValueAt(i), title: result.getCommentAt(i), icon: result.getImageAt(i) } + for (i in util.range(0, result.matchCount)) ]; }); services.get("autoCompleteSearch").startSearch(context.filter, "", context.result, {