mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 23:07:59 +01:00
Remove other uses of CompletionContextcompletion.jsgetKey
This commit is contained in:
@@ -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)))
|
||||||
|
|||||||
@@ -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");
|
<a href={item.item.url} highlight="URL">{text}</a> 
|
||||||
return <>
|
{
|
||||||
<a href={item.item.url} highlight="URL">{text}</a> 
|
!(item.extra && item.extra.length) ? "" :
|
||||||
{
|
<span class="extra-info">
|
||||||
!(extra && extra.length) ? "" :
|
({
|
||||||
<span class="extra-info">
|
template.map(item.extra, function (e)
|
||||||
({
|
<>{e[0]}: <span highlight={e[2]}>{e[1]}</span></>,
|
||||||
template.map(extra, function (e)
|
<> </>/* Non-breaking space */)
|
||||||
<>{e[0]}: <span highlight={e[2]}>{e[1]}</span></>,
|
})
|
||||||
<> </>/* 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>,
|
||||||
|
|||||||
Reference in New Issue
Block a user