AbstractCallback to run after a row has been selected.
jQuery selector for input we're adding the autocomplete widget to.
OptionalacAfter AbstractAutocompleteAdapter#setupAutocomplete is run, holds a reference to the autocomplete widget used by this instance.
CSS prefix for the autocomplete widget.
Delay in milliseconds before performing a search.
Key (into the row objects retrieved via the request handler)
that determines which value is used as the main text in the autocomplete
widget.
'label' corresponds to what the main application expects, but if you
want to show something different than what gets passed to the
application, you may want to change it.
Default row key for the optional secondary, smaller text shown in the autocomplete widget below each result.
OptionalsourceIDCanonical identifier for this source. Lower-case string, no whitespace.
OptionalsupportedRegExp for URLs this adapter can handle.
Callback to run after a successful lookup
Protected_renderRender "No search results" text row at the bottom with default styles.
Protected Optional Abstract_renderCallback for rendering a row within the autocomplete widget, overriding default rendering.
The row object to render
Protected Optional Abstract_requestCallback for fetching row data.
The characters entered by the user
Optionaloffset: numberOptional offset for pagination
Protected_selectPass along row data we can handle to the main application. Will also query lib.reviews itself (through the native adapter) for the URL, so we can give preferential treatment to an existing native record for the review subject.
row data object. All properties except "url" are only used for display purposes, since the server performs its own lookup on the URL.
the click or keyboard event which triggered this row selection.
Does this adapter support the given URL? By default, performs a simple regex check.
the URL to test
true if supported
Hide activity indicator in the input widget. Must be called in handler code via this.adapter.
Show activity indicator in the input widget. Must be called in handler code via this.adapter.
Return the canonical source identifier for this adapter
the source ID
AbstractlookupPerform a lookup for a given URL.
the URL to perform lookup for
promise that resolves with a LookupResult on success, and rejects with an error on failure
Remove the autocomplete widget including all its event listeners.
Run the autocomplete widget on the current input.
Initialize the autocomplete widget. You can add additional callbacks /
custom properties in the inherited class; just remember to call
super.setupAutocomplete() first.
Adapter that handles ordinary URL lookup (as specified in AbstractLookupAdapter) and autocomplete searches. Autocomplete searches rely on the remote-ac package written by Danqing Liu.
The autocomplete class (
ACglobal) must exist before this code is run. We communicate with the widget using callbacks, prefixed with_, which are bound to it.