Constructor
new mw.widgets.TitleWidget([config])abstract
#
Create an instance of mw.widgets.TitleWidget
.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object |
optional |
Configuration options Properties:
|
Methods
createOptionWidget(data) → {OO.ui.MenuOptionWidget}
#
Create a menu option widget with specified data.
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | Data for option widget |
Returns:
Data for option widget
getApiParams(query) → {Object}
#
getMWTitle([value]) → {mw.Title|null
}
#
null
}
#
getNamespace() → {number|null
}
#
null
}
#
Get the namespace to prepend to titles in suggestions, if any.
Returns:
Namespace number
- Type
-
number
|
null
getOptionWidgetData(title, data) → {Object}
#
Get menu option widget data from the title and page data.
Parameters:
Returns:
Data for option widget
- Type
- Object
getOptionsFromData(data) → {Array.<OO.ui.OptionWidget>}
#
Get option widgets from the server response.
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | Query result |
Returns:
Menu items
- Type
- Array.<OO.ui.OptionWidget>
getQueryValue() → {string}abstract
#
getSectionSuggestions(title, fragmentQuery) → {jQuery.Promise}
#
Suggest link fragments from the sections API.
Parameters:
Name | Type | Description |
---|---|---|
title |
string | Title, extracted form the user input |
fragmentQuery |
string | Partial link fragment, from the user input |
Returns:
Suggestions promise
- Type
- jQuery.Promise
getSuggestionsPromise() → {jQuery.Promise}
#
Get a promise which resolves with an API response for suggested links for the current query.
Returns:
Suggestions promise
- Type
- jQuery.Promise
Get a promise which resolves with an API response for suggested links for the current query.