aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/completion.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/completion.js b/lib/completion.js
index 1e70297e..543b9117 100644
--- a/lib/completion.js
+++ b/lib/completion.js
@@ -41,9 +41,15 @@ var completion = (function() {
this.build = buildFunction;
}
- /** A simple completer that suggests to open the input string as an URL or to trigger a web search for the
- * given term, depending on whether it thinks the input is a URL or not. */
- var SmartCompletionSource = Class.extend({
+ /*
+ * A completer which takes in a list of keyword commands (like "wiki" for "search wikipedia") and will
+ * decide if your query is a command, a URL that you want to visit, or a search term.
+ */
+ var SmartKeywordCompleter = Class.extend({
+ /*
+ * - commands: a list of commands of the form: { keyword: [title, url] }, e.g.:
+ * { "wiki ": ["Wikipedia (en)", "http://en.wikipedia.org/wiki/%s" ]
+ */
init: function(commands) {
this.commands = commands || {};
this.commandKeys = Object.keys(commands);