Global

Methods

_renderNoResultsHandler()

Render "No search results" text row at the bottom with default styles.

This:
  • AbstractAutocompleteAdapter#ac
Source:

_selectRowHandler(row, event)

Pass 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.

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

row data object. All properties except "url" are only used for display purposes, since the server performs its own lookup on the URL.

Properties
Name Type Attributes Description
url String

the URL for this review subject

label String

the main name shown for this review subject

subtitle String <optional>

shown as secondary title for the subject

description String <optional>

shown as short description below label and subtitle

event Event

the click or keyboard event which triggered this row selection.

Source:

ask(url) → {Boolean}

Does this adapter support the given URL? By default, performs a simple regex check.

Parameters:
Name Type Description
url String

the URL to test

Source:
Returns:

true if supported

Type
Boolean

buildMenuItems(schema) → {Object}

Build a menu for nodes and marks supported in the markdown schema.

Parameters:
Name Type Description
schema Schema

the markdown schema

Source:
Returns:

the generated menu and all its items

Type
Object

disableSpinner()

Hide activity indicator in the input widget. Must be called in handler code via this.adapter.

Source:

enableSpinner()

Show activity indicator in the input widget. Must be called in handler code via this.adapter.

Source:

getSourceID() → {String}

Return the canonical source identifier for this adapter

Source:
Returns:
Type
String

(abstract) lookup(_url) → {Promise}

Perform a lookup for a given URL.

Parameters:
Name Type Description
_url String

the URL to perform lookup for

Source:
Returns:

promise that resolves with a result object of the form LookupResult on success, and rejects with an error on failure

Type
Promise

maybeSelectStar(event)

Key handler for selecting stars with [Enter] or [Space].

Parameters:
Name Type Description
event Event

the key event

Source:

removeAutocomplete()

Remove the autocomplete widget including all its event listeners.

Source:

runAutocomplete()

Run the autocomplete widget on the current input.

Source:

setupAutocomplete()

Initialize the autocomplete widget. You can add additional callbacks / custom properties in the inherited class; just remember to call super.setupAutocomplete() first.

Source:

showModalForEditingExistingReview(data)

Show modal that asks the user to edit an existing review of the given subject, or to pick another review subject.

Parameters:
Name Type Description
data Object

data used for the redirect

Properties
Name Type Description
reviews Array.<Object>

array of reviews by the current user for this thing. Under normal circumstances there should only be 1, but this is not a hard constraint at the database level.

Source:

uploadModal(successCallbackopt, errorCallbackopt)

Creates an overlay modal dialog which lets the user upload a single file via the upload API.

Parameters:
Name Type Attributes Description
successCallback function <optional>

Callback to run after a successful upload.

errorCallback function <optional>

Callback to run after a failed upload (does not run if modal is closed).

Source:

Type Definitions

LookupResult

Lookup adapters return a limited set of data that's displayed to the user. Lookup results take the following form. Note that strings are stored only in one language; the backend adapter performs the full lookup of all available translations.

Type:
  • Object
Properties:
Name Type Description
data Object

data for this result

Properties
Name Type Attributes Description
label String

name to be rendered for this result

subtitle String <optional>

subtitle to be shown below label

description String <optional>

short textual description

thing Thing <optional>

native object representing the review subject, used by native lookup adapter

sourceID String

canonical source that identifies this adapter

Source: