Methods
_renderNoResultsHandler()
Render "No search results" text row at the bottom with default styles.
This:
- AbstractAutocompleteAdapter#ac
_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
|
||||||||||||||||||||
event |
Event | the click or keyboard event which triggered this row selection. |
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 |
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.
enableSpinner()
Show activity indicator in the input widget. Must be called in handler code via this.adapter.
getSourceID() → {String}
Return the canonical source identifier for this adapter
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 |
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 |
removeAutocomplete()
Remove the autocomplete widget including all its event listeners.
runAutocomplete()
Run the autocomplete widget on the current input.
setupAutocomplete()
Initialize the autocomplete widget. You can add additional callbacks /
custom properties in the inherited class; just remember to call
super.setupAutocomplete() first.
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
|
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
|
||||||||||||||||||||
sourceID |
String | canonical source that identifies this adapter |