From 4ce5022da5b79fe038f4c34dc27675b219d9f979 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 31 May 2015 15:02:37 +0100 Subject: Completion page; functional version. --- pages/completion_engines.coffee | 19 +++++++++++++++++++ pages/completion_engines.css | 15 +++++++++++++++ pages/completion_engines.html | 14 ++++++++------ pages/options.css | 2 +- pages/options.html | 5 +++-- 5 files changed, 46 insertions(+), 9 deletions(-) create mode 100644 pages/completion_engines.css diff --git a/pages/completion_engines.coffee b/pages/completion_engines.coffee index 8b137891..aa8bb6cc 100644 --- a/pages/completion_engines.coffee +++ b/pages/completion_engines.coffee @@ -1 +1,20 @@ +DomUtils.documentReady -> + html = "" + for engine in CompletionEngines[0...CompletionEngines.length-1] + engine = new engine + html += "

#{engine.constructor.name}

\n" + html += "
" + if engine.regexps + html += "
"
+      for re in engine.regexps
+        re = re.toString().replace(/^\//, '').replace /\/$/, ''
+        html += "#{re}\n"
+      html += "
" + if engine.prefix + html += "

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

" + html += "
" + + document.getElementById("engineList").innerHTML = html + + diff --git a/pages/completion_engines.css b/pages/completion_engines.css new file mode 100644 index 00000000..3e3aab1f --- /dev/null +++ b/pages/completion_engines.css @@ -0,0 +1,15 @@ + +div#wrapper +{ + width: 730px; +} + +h4, h5 +{ + color: #777; +} + +div.engine +{ + margin-left: 20px; +} diff --git a/pages/completion_engines.html b/pages/completion_engines.html index 42c60e31..69158c78 100644 --- a/pages/completion_engines.html +++ b/pages/completion_engines.html @@ -3,8 +3,10 @@ Vimium Search Completion + + @@ -13,17 +15,17 @@
Vimium Search Completion

Search completion is available for custom search engines whose search URL matches one of Vimium's - built-in completion engines. Search completion is not available for the default search engine. + built-in completion engines; that is, the search URL matches one of the regular expressions below. + Search completion is not available for the default search engine.

- Custom search engines are configured on the options page. + Custom search engines can be configured on the options + page.
+ Further information is available on the wiki.

Available Completion Engines

- The following completion engines are available. -

- {{{ENGINES}}} -
+

diff --git a/pages/options.css b/pages/options.css index ffb348c6..282a523b 100644 --- a/pages/options.css +++ b/pages/options.css @@ -114,7 +114,7 @@ input#scrollStepSize, input#omniSearchWeight { } textarea#userDefinedLinkHintCss, textarea#keyMappings, textarea#searchEngines { width: 100%;; - min-height: 130px; + min-height: 140px; white-space: nowrap; } input#previousPatterns, input#nextPatterns { diff --git a/pages/options.html b/pages/options.html index b14c454f..7b66efde 100644 --- a/pages/options.html +++ b/pages/options.html @@ -44,7 +44,7 @@ unmap j unmapAll " this is a comment # this is also a comment - Show available commands. + Show available commands. @@ -61,7 +61,8 @@ a: http://a.com/?q=%s b: http://b.com/?q=%s description " this is a comment # this is also a comment - %s is replaced with the search terms. + %s is replaced with the search terms.
+ For search completion, see here. -- cgit v1.2.3