1
0
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:
Martin Stubenschrott
2008-11-10 04:00:13 +00:00
parent b3418425bd
commit 25549a0081
3 changed files with 63 additions and 49 deletions

View File

@@ -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>&#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>)
this.map(items, function (item) createRow(item))
}
</table>);
},