From f5db9ea1dc8d23dff732dd3345bf85798d64f1e9 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 6 Jun 2015 06:18:35 +0100 Subject: 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). --- pages/completion_engines.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pages') 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 "" if engine.prefix html.push "

This uses the general Google completion engine, but adds the prefix \"#{engine.prefix.trim()}\" to the query.

" - 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 "

" html.push "Example:" html.push "

"
-      html.push "#{engine.exampleKeyword}: #{engine.exampleSearchUrl} #{engine.exampleDescription}"
+      html.push "#{engine.example.keyword}: #{engine.example.searchUrl} #{engine.example.description}"
       html.push "
" html.push "

" html.push "" -- cgit v1.2.3