diff --git a/content/completion.js b/content/completion.js index 51148d60..4b54ee83 100644 --- a/content/completion.js +++ b/content/completion.js @@ -813,9 +813,47 @@ function Completion() //{{{ bookmark: function (filter) { + // TODO: move to template.js? + function createHtml(item) + { + var extra = []; + if (item.keyword) + extra.push(['keyword', item.keyword, "hl-Keyword"]); + if (item.tags.length > 0) + extra.push(["tags", item.tags.join(","), "hl-Tag"]); // no space, otherwise it looks strange, since we just have spaces to seperate tags from keywords + + return + } + return { start: 0, - get items() { return bookmarks.get(filter) }, + get items() { + return bookmarks.get(filter).map(function (bmark) { + // temporary, until we have moved all completions to objects + bmark[0] = bmark.url; + bmark[1] = bmark.title; + + bmark.text = bmark.url; + bmark.__defineGetter__("html", function () createHtml(bmark)); + return bmark; + }); + }, createRow: function (item)