autocomplete: move artist/pool/wiki autocompletion to autocomplete.js.

* Move all autocomplete code to autocomplete.js.

* Mark autocompleted fields with `data-autocomplete="<type>"` attributes,
  instead of hardcoding input field IDs in the javascript.
This commit is contained in:
evazion
2018-02-18 16:19:32 -06:00
parent a058a77c07
commit 962842815d
12 changed files with 118 additions and 137 deletions

View File

@@ -1,3 +1,3 @@
<%= form_tag(wiki_pages_path, :method => :get) do %>
<%= text_field "search", "title", :id => "quick_search_title", :placeholder => "Search wiki pages" %>
<%= text_field "search", "title", id: "quick_search_title", placeholder: "Search wiki pages", data: { autocomplete: "wiki-page" } %>
<% end %>

View File

@@ -1,7 +1,7 @@
<div id="c-wiki-pages">
<div id="a-search">
<%= form_tag(wiki_pages_path, :method => :get, :class => "simple_form") do %>
<%= search_field "title", :hint => "Use * for wildcard searches" %>
<%= search_field "title", :hint => "Use * for wildcard searches", :data => { :autocomplete => "wiki-page" } %>
<%= search_field "creator_name" %>
<%= search_field "body_matches", :label => "Body" %>
<%= search_field "other_names_match", :label => "Other names", :hint => "Use * for wildcard searches" %>