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_renderRender callback for the autocomplete widget. For each result, we show authorship and edition information, which goes a bit beyond what we could cram into the default rendering.
row data object as obtained via OpenLibraryAutocompleteAdapter#_requestHandler
the element to insert into the DOM for this row
Protected_requestQuery the Open Library's main search endpoint for this search string, store the results in the instance of the autocomplete widget, and render them.
Fires off two requests per query to perform both a stemmed search and a wildcard search. Optionally also supports author searches if split off from main query string with ";".
the unescaped query string
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
Obtain data from Open Library for a given URL.
URL to an Open Library book or work
resolves to a LookupResult if successful, rejects with an error if not
Merge results from two Open Library search queries into a single array.
The overall size will not exceed this.limit.
set of results from two or more search queries
de-duplicated result array
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.
Perform an in-place sort on results from a search query, putting any exact matches against the query first
"docs" array from the Open Library JSON search API
original query text that yielded this result
Perform book metadata lookups on openlibrary.org. Like other frontend adapters, it is shallow and does not care for language, authorship, or other details.