Class: exports

(abstract) exports(updateCallback, searchBoxSelector)

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 (AC global) must exist before this code is run. We communicate with the widget using callbacks, prefixed with _, which are bound to it.

Constructor

(abstract) new exports(updateCallback, searchBoxSelector)

Parameters:
Name Type Description
updateCallback function

Callback to run after a row has been selected.

searchBoxSelector String

jQuery selector for input we're adding the autocomplete widget to.

Source:

Extends

  • AbstractLookupAdapter

Members

ac :AC

After AbstractAutocompleteAdapter#setupAutocomplete is run, holds a reference to the autocomplete widget used by this instance.

Type:
  • AC
Source:

acCSSPrefix :String

CSS prefix for the autocomplete widget.

Type:
  • String
Source:

acDelay :Number

Delay in milliseconds before performing a search.

Type:
  • Number
Source:

acPrimaryTextKey :String

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.

Type:
  • String
Source:

acSecondaryTextKey :String

Default row key for the optional secondary, smaller text shown in the autocomplete widget below each result.

Type:
  • String
Source:

sourceID :String

Canonical identifier for this source. Lower-case string, no whitespace.

Type:
  • String
Source:

supportedPattern :RegExp

RegExp for URLs this adapter can handle.

Type:
  • RegExp
Source:

Methods

(abstract) _renderRowHandler(row)

Callback for rendering a row within the autocomplete widget, overriding default rendering.

This:
  • AbstractAutocompleteAdapter#ac
Parameters:
Name Type Description
row Object

The row object to render

Source:

(abstract) _requestHandler(query)

Callback for fetching row data.

This:
  • AbstractAutocompleteAdapter#ac
Parameters:
Name Type Description
query String

The characters entered by the user

Source:

(abstract) exports(updateCallback)

Adapter that, given a URL, looks up metadata that can identify a review subject, such as a book's title or a restauraunt name.

Constructor

(abstract) new exports(updateCallback)

Parameters:
Name Type Description
updateCallback function

(optional) callback to run after a successful lookup

Source:

Members

ac :AC

After AbstractAutocompleteAdapter#setupAutocomplete is run, holds a reference to the autocomplete widget used by this instance.

Type:
  • AC
Source:

acCSSPrefix :String

CSS prefix for the autocomplete widget.

Type:
  • String
Source:

acDelay :Number

Delay in milliseconds before performing a search.

Type:
  • Number
Source:

acPrimaryTextKey :String

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.

Type:
  • String
Source:

acSecondaryTextKey :String

Default row key for the optional secondary, smaller text shown in the autocomplete widget below each result.

Type:
  • String
Source:

sourceID :String

Canonical identifier for this source. Lower-case string, no whitespace.

Type:
  • String
Source:

supportedPattern :RegExp

RegExp for URLs this adapter can handle.

Type:
  • RegExp
Source:

Methods

(abstract) _renderRowHandler(row)

Callback for rendering a row within the autocomplete widget, overriding default rendering.

This:
  • AbstractAutocompleteAdapter#ac
Parameters:
Name Type Description
row Object

The row object to render

Source:

(abstract) _requestHandler(query)

Callback for fetching row data.

This:
  • AbstractAutocompleteAdapter#ac
Parameters:
Name Type Description
query String

The characters entered by the user

Source: