From c2e8618fabd68fb9a920e5b6310e92fe31313e9d Mon Sep 17 00:00:00 2001 From: Phil Crosby Date: Sat, 5 May 2012 18:13:34 -0700 Subject: Explain what the smart completor is. --- lib/completion.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib') 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); -- cgit v1.2.3