From 4eda19de339212f86a9b008a4f3142a61d62829e Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 6 Jun 2015 12:01:23 +0100 Subject: Re-work completions: extend engine wrapper to handle prefixes. This commit contains the bulk og the material changes for which the previous commits established the basis. 1) Add a general framework for detecting query prefixes in search URLs, adding them to query sent to the completion engine, and stripping them from the resulting suggestions. This allows the user to have a search engine... j: http://www.google.com/search?q=javascript+%s Javascript and have the prefix "javascript" included (automatically) in queries sent to completion engines, which results in substantially better suggestions. 2) Re-work completion for Google Maps in a simpler form. --- pages/completion_engines.coffee | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pages') diff --git a/pages/completion_engines.coffee b/pages/completion_engines.coffee index d744b3b3..790f2968 100644 --- a/pages/completion_engines.coffee +++ b/pages/completion_engines.coffee @@ -11,12 +11,15 @@ DomUtils.documentReady -> engine = new engine html.push "
#{engine.example.explanation}
" if engine.regexps + html.push "" + html.push "Regular expression#{if 1 < engine.regexps.length then 's' else ''}:" html.push "
"
       html.push "#{cleanUpRegexp re}\n" for re in engine.regexps
       html.push ""
-    if engine.prefix
-      html.push "This uses the general Google completion engine, but adds the prefix \"#{engine.prefix.trim()}\" to the query.
" + html.push "" if engine.example.searchUrl and engine.example.keyword engine.example.description ||= engine.constructor.name html.push "" -- cgit v1.2.3