Methods
getCommunityConfiguration() → {Promise}
Get the community configuration for the featured templates.
Returns:
- Type
- Promise
getTemplateData(templates) → {Promise}
Get the template data for a given set of templates.
Parameters:
| Name | Type | Description |
|---|---|---|
templates |
Array | Template titles. |
Returns:
- Type
- Promise
onDialogApply(templateData)
Respond to edit dialog apply event
Parameters:
| Name | Type | Description |
|---|---|---|
templateData |
Object | New templatedata |
onEditOpenDialogButton()
Respond to edit dialog button click.
openEditDialog(dataModel)
Open the templatedata edit dialog
Parameters:
| Name | Type | Description |
|---|---|---|
dataModel |
Model | The data model associated with this edit dialog. |
parsePageId(pageId) → {number}
Parse a page ID to a number, or throw an error
Parameters:
| Name | Type | Description |
|---|---|---|
pageId |
string |
Throws:
-
If the pageId is not a number
- Type
- Error
Returns:
The parsed page ID
- Type
- number
replaceTemplateData(newTemplateData)
Replace the old templatedata string with the new one, or insert the new one into the page if an old one doesn't exist
Parameters:
| Name | Type | Description |
|---|---|---|
newTemplateData |
Object | New templatedata |
setNoticeMessage(label, type)
Display error message in the edit window
Parameters:
| Name | Type | Description |
|---|---|---|
label |
jQuery | string | OO.ui.HtmlSnippet | function | null | Message to display |
type |
string | Message type 'notice', 'error', 'warning' or 'success' |
Events
add-param
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | Parameter key |
data |
Object | Parameter data |
add-paramOrder
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | Parameter key |
added
When favorite is added
Parameters:
| Name | Type | Description |
|---|---|---|
pageId |
number |
change
change-description
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
description |
string | New template description |
|
language |
Object |
<optional> |
Description language, if supplied |
change-format
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
format |
string | null |
<optional> |
null | Preferred format |
change-map
Parameters:
| Name | Type | Description |
|---|---|---|
map |
Object | undefined | New template map info |
change-paramOrder
Parameters:
| Name | Type | Description |
|---|---|---|
orderArray |
Array.<string> | Parameter key array in order |
change-property
Parameters:
| Name | Type | Description |
|---|---|---|
paramKey |
string | Parameter key |
prop |
string | Property name |
value |
Mixed | |
language |
string |
choose
When a template is chosen from the list of favorites.
Parameters:
| Name | Type | Description |
|---|---|---|
The |
Object | template data of the chosen template. |
choose
When a template is choosen from the menu.
Parameters:
| Name | Type | Description |
|---|---|---|
The |
Object | template data of the chosen template. |
choose
When a template is chosen from the list of favorites.
Parameters:
| Name | Type | Description |
|---|---|---|
The |
Object | template data of the chosen template. |
choose
When a template is chosen.
Parameters:
| Name | Type | Description |
|---|---|---|
The |
Object | template data of the chosen template. |
choose
When a template is choosen by searching or other means.
Parameters:
| Name | Type | Description |
|---|---|---|
The |
Object | template data of the chosen template. |
choose
When a template is chosen from the list of favorites.
Parameters:
| Name | Type | Description |
|---|---|---|
The |
Object | template data of the chosen template. |
choose
When a template is chosen.
Parameters:
| Name | Type | Description |
|---|---|---|
The |
Object | template data of the chosen template. |
choose
When a template is chosen.
Parameters:
| Name | Type | Description |
|---|---|---|
The |
Object | template data of the chosen template. |
choose
Parameters:
| Name | Type | Description |
|---|---|---|
languageResultWidget |
LanguageResultWidget |
choose
Parameters:
| Name | Type | Description |
|---|---|---|
paramWidget |
ParamWidget |
delete-param
Parameters:
| Name | Type | Description |
|---|---|---|
paramKey |
string | Parameter key |
drop
aa
Parameters:
| Name | Type | Description |
|---|---|---|
The |
Object | template data of the chosen template. |
loadmore
When a "load more" item is clicked.
Parameters:
| Name | Type | Description |
|---|---|---|
column |
Column | |
cmcontinue |
string |
match
When the current value of the search input matches a search result (regardless of whether that result is highlighted).
Parameters:
| Name | Type | Description |
|---|---|---|
templateData |
Object | Template data of the matched search result. |
removed
When favorite is removed
Parameters:
| Name | Type | Description |
|---|---|---|
pageId |
number |
select
When an item in this column is selected.
Parameters:
| Name | Type | Description |
|---|---|---|
column |
Column | |
columnItem |
ColumnItem |
select
When the item is selected.
Parameters:
| Name | Type | Description |
|---|---|---|
The |
Object | template data of the chosen template. |