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:
@@ -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> 
|
||||
{
|
||||
!(extra.length) ? "" :
|
||||
<span class="extra-info">
|
||||
({
|
||||
template.map(extra, function (e)
|
||||
<>{e[0]}: <span class={e[2]}>{e[1]}</span></>,
|
||||
<> </>/* 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> 
|
||||
{
|
||||
!(item.extra && item.extra.length) ? "" :
|
||||
<span class="extra-info">
|
||||
({
|
||||
template.map(item.extra, function (e)
|
||||
<>{e[0]}: <span class={e[2]}>{e[1]}</span></>,
|
||||
<> </>/* Non-breaking space */)
|
||||
})
|
||||
</span>
|
||||
}
|
||||
</li>
|
||||
</ul>
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user