From e1d5236261a32c9fe34a43b63034ce72e8d7be93 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sat, 20 Dec 2008 13:54:35 -0500 Subject: [PATCH] Remove other uses of CompletionContextcompletion.jsgetKey --- common/content/completion.js | 2 +- common/content/template.js | 36 ++++++++++++++++-------------------- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/common/content/completion.js b/common/content/completion.js index be606b99..24a20e53 100644 --- a/common/content/completion.js +++ b/common/content/completion.js @@ -128,7 +128,7 @@ function CompletionContext(editor, name, offset) //{{{ * results. */ 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)) { if (this.match(String(str))) diff --git a/common/content/template.js b/common/content/template.js index 0f7a08a3..0baaaf00 100644 --- a/common/content/template.js +++ b/common/content/template.js @@ -49,8 +49,8 @@ const template = { } else { - var text = this.process[0].call(this, item, item.text || this.getKey(item, "text")); - var desc = this.process[1].call(this, item, this.getKey(item, "description")); + var text = this.process[0].call(this, item, item.text); + var desc = this.process[1].call(this, item, item.description); } // @@ -66,27 +66,23 @@ const template = { }, bookmarkDescription: function (item, text) - { - let extra = this.getKey(item, "extra"); - return <> - {text}  - { - !(extra && extra.length) ? "" : - - ({ - template.map(extra, function (e) - <>{e[0]}: {e[1]}, - <> /* Non-breaking space */) - }) - - } - - }, + <> + {text}  + { + !(item.extra && item.extra.length) ? "" : + + ({ + template.map(item.extra, function (e) + <>{e[0]}: {e[1]}, + <> /* Non-breaking space */) + }) + + } + , icon: function (item, text) { - let icon = this.getKey(item, "icon"); - return <>{icon ? : <>}{text} + return <>{item.icon ? : <>}{text} }, filter: function (str) {str},