1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 22:57:58 +01:00

Remove other uses of CompletionContextcompletion.jsgetKey

This commit is contained in:
Kris Maglione
2008-12-20 13:54:35 -05:00
parent 653893bbfc
commit e1d5236261
2 changed files with 17 additions and 21 deletions

View File

@@ -128,7 +128,7 @@ function CompletionContext(editor, name, offset) //{{{
* results. * results.
*/ */
this.filters = [function (item) { this.filters = [function (item) {
let text = Array.concat(this.getKey(item, "text")); let text = Array.concat(item.text);
for (let [i, str] in Iterator(text)) for (let [i, str] in Iterator(text))
{ {
if (this.match(String(str))) if (this.match(String(str)))

View File

@@ -49,8 +49,8 @@ const template = {
} }
else else
{ {
var text = this.process[0].call(this, item, item.text || this.getKey(item, "text")); var text = this.process[0].call(this, item, item.text);
var desc = this.process[1].call(this, item, this.getKey(item, "description")); var desc = this.process[1].call(this, item, item.description);
} }
// <e4x> // <e4x>
@@ -66,27 +66,23 @@ const template = {
}, },
bookmarkDescription: function (item, text) bookmarkDescription: function (item, text)
{ <>
let extra = this.getKey(item, "extra");
return <>
<a href={item.item.url} highlight="URL">{text}</a>&#160; <a href={item.item.url} highlight="URL">{text}</a>&#160;
{ {
!(extra && extra.length) ? "" : !(item.extra && item.extra.length) ? "" :
<span class="extra-info"> <span class="extra-info">
({ ({
template.map(extra, function (e) template.map(item.extra, function (e)
<>{e[0]}: <span highlight={e[2]}>{e[1]}</span></>, <>{e[0]}: <span highlight={e[2]}>{e[1]}</span></>,
<>&#xa0;</>/* Non-breaking space */) <>&#xa0;</>/* Non-breaking space */)
}) })
</span> </span>
} }
</> </> ,
},
icon: function (item, text) icon: function (item, text)
{ {
let icon = this.getKey(item, "icon"); return <><span highlight="CompIcon">{item.icon ? <img src={item.icon}/> : <></>}</span><span class="td-strut"/>{text}</>
return <><span highlight="CompIcon">{icon ? <img src={icon}/> : <></>}</span><span class="td-strut"/>{text}</>
}, },
filter: function (str) <span highlight="Filter">{str}</span>, filter: function (str) <span highlight="Filter">{str}</span>,