1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-03 22:14:14 +01:00

fixed :qmarks/:hs/:bmarks display, add a new template.genericTable() method

This commit is contained in:
Martin Stubenschrott
2008-11-21 12:44:54 +00:00
parent 52038db7ae
commit 5c8b17cc58
5 changed files with 60 additions and 63 deletions

View File

@@ -809,34 +809,6 @@ 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 <ul class="hl-CompItem">
<li class="hl-CompIcon"><img src={item.icon || ""}/></li>
<li class="hl-CompResult">{util.clip(item.title || "", 50)}</li>
<li style="width: 100%">
<a href="#" class="hl-URL">{item.url}</a>&#160;
{
!(extra.length) ? "" :
<span class="extra-info">
({
template.map(extra, function (e)
<>{e[0]}: <span class={e[2]}>{e[1]}</span></>,
<>&#xa0;</>/* Non-breaking space */)
})
</span>
}
</li>
</ul>
}
return {
start: 0,
get items() {
@@ -846,28 +818,9 @@ function Completion() //{{{
bmark[1] = bmark.title;
bmark.text = bmark.url;
bmark.__defineGetter__("html", function () createHtml(bmark));
return bmark;
});
},
createRow: function (item)
<ul class="hl-CompItem">
<li class="hl-CompIcon"><img src={item.icon || ""}/></li>
<li class="hl-CompResult">{util.clip(item.title || "", 50)}</li>
<li style="width: 100%">
<a href="#" class="hl-URL">{item.url}</a>&#160;
{
!(item.extra && item.extra.length) ? "" :
<span class="extra-info">
({
template.map(item.extra, function (e)
<>{e[0]}: <span class={e[2]}>{e[1]}</span></>,
<>&#xa0;</>/* Non-breaking space */)
})
</span>
}
</li>
</ul>
};
},