mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-24 09:02:27 +01:00
completions are now objects (containing an completions array), in order to allow things like having a common createRow function which is used for displaying :bmarks<cr> as well as for showing :bmarks foo<tab>
We still allow completion functions to return arrays, for now at least.
This commit is contained in:
@@ -140,30 +140,14 @@ const template = {
|
||||
|
||||
bookmarks: function (header, items)
|
||||
{
|
||||
let createRow = completion.bookmark("").createRow;
|
||||
return this.generic(
|
||||
<table>
|
||||
<tr align="left" class="hl-Title">
|
||||
<th/><th>{header}</th><th>URL</th>
|
||||
</tr>
|
||||
{
|
||||
this.map(items, 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>)
|
||||
this.map(items, function (item) createRow(item))
|
||||
}
|
||||
</table>);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user