aboutsummaryrefslogtreecommitdiffstats
path: root/pages
diff options
context:
space:
mode:
authorStephen Blott2015-06-06 06:18:35 +0100
committerStephen Blott2015-06-06 06:46:32 +0100
commitf5db9ea1dc8d23dff732dd3345bf85798d64f1e9 (patch)
treef8aff705dfe0a666f3ba53190a2c35799c689f0c /pages
parent97e5da6cbdcf1b5cf4f80cf550fc26c1ce194a3e (diff)
downloadvimium-f5db9ea1dc8d23dff732dd3345bf85798d64f1e9.tar.bz2
Re-work completions: initial refactor.
The original completion-engine interface was based on three functions. With some experience, it seems there is a pattern involving explicit regular expressions which is used by all actual engine implementations. This is a refactoring to make those regular expressions explicit (and required), and is a first step towards adding additional fucntionality. This also simplifies the completion cache key (use JSON instead of some weird hash).
Diffstat (limited to 'pages')
-rw-r--r--pages/completion_engines.coffee6
1 files changed, 3 insertions, 3 deletions
diff --git a/pages/completion_engines.coffee b/pages/completion_engines.coffee
index 94381fb5..d744b3b3 100644
--- a/pages/completion_engines.coffee
+++ b/pages/completion_engines.coffee
@@ -17,12 +17,12 @@ DomUtils.documentReady ->
html.push "</pre>"
if engine.prefix
html.push "<p>This uses the general Google completion engine, but adds the prefix \"<tt>#{engine.prefix.trim()}</tt>\" to the query.</p>"
- if engine.exampleSearchUrl and engine.exampleKeyword
- engine.exampleDescription ||= engine.constructor.name
+ if engine.example.searchUrl and engine.example.keyword
+ engine.example.description ||= engine.constructor.name
html.push "<p>"
html.push "Example:"
html.push "<pre>"
- html.push "#{engine.exampleKeyword}: #{engine.exampleSearchUrl} #{engine.exampleDescription}"
+ html.push "#{engine.example.keyword}: #{engine.example.searchUrl} #{engine.example.description}"
html.push "</pre>"
html.push "</p>"
html.push "</div>"