* Use `Danbooru.Autocomplete.render_item` for all menu item rendering.
Fixes usernames not being colorized when completing mentions, and post
counts not being shown when completing pools on the /pools page.
* Make the /pools page autocomplete pool names the same way that the
pool:<name> metatag does. Previously autocomplete on the /pools page
listed most recently updated pools first; now it lists largest pools first.
* Move all autocomplete code to autocomplete.js.
* Mark autocompleted fields with `data-autocomplete="<type>"` attributes,
instead of hardcoding input field IDs in the javascript.
* Disable autoFocus. This means that the first item in the autocomplete
menu isn't automatically selected.
* Add Tab keybinding, to make the Tab key work as normal with autoFocus disabled.
* Fix the Enter key to 1) insert the selected tag when inside the
autocomplete menu, and 2) submit the search as normal when not inside
the autocomplete menu.
-Otherwise, the last valid autocomplete result will remain
--Causes incorrect results on Tab/Enter completion
-This clears the autocomplete results instead
Previously we patched the jqueryui-autocomplete library in order to
customize how the Tab and Enter keys behaved. Specifically, we wanted to
prevent the Tab key from moving the focus out of the tag input box, and
we wanted to prevent the Enter key from submitting the page when editing tags.
These things can achieved without patching the library by using
`event.preventDefault` and `event.stopImmediatePropagation` to prevent
other event handlers from running after these keys trigger the
`autocompleteselect` event.
Fix bug in the double submit prevention from #2789. Rather than
unbinding the enter key on submit, have the enter key click the submit
button instead. This avoids form submission when the submit button is disabled.
- Add parent metatag defaults any and none
- Add missing user-based metatags to user source
- Remove all negative metatags since the prior code strips the '-'
On the uploads page, trigger `Fetch source data` automatically when the
user pastes an URL into the source field. Silently ignore invalid URLs
so that we don't trigger spurious errors when the user types in a source
manually.
On the uploads page, don't call /artist/finder.json to find the artist
on page load. Instead have `Fetch source data` fill in the artist using
the `artists` data returned by the `/source.json` call.
* In the `Fetch source data` box, list the Danbooru artist tag(s) that
were found beside the artist name.
* Unify `Fetch source data` code that was duplicated between the
uploads page and the post show page.