Extends
Constructor
new ve.ui.MWTransclusionDialog([config])
#
Dialog for inserting and editing MediaWiki transclusions, i.e. a sequence of one or more template invocations that strictly belong to each other (e.g. because they are unbalanced), possibly mixed with raw wikitext snippets.
Note the base class {@see ve.ui.MWTemplateDialog} alone does not allow to manage more than a single template invocation. Most of the code for this feature set is exclusive to this subclass.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
config |
Object |
optional |
Configuration options |
Methods
addHotkeyToTitle(element, hotkey)private
#
Parameters:
Name | Type | Description |
---|---|---|
element |
OO.ui.mixin.TitledElement | |
hotkey |
string |
addParameter(e)private
#
addPart(part)
#
Add a part to the transclusion.
Parameters:
Name | Type | Description |
---|---|---|
part |
ve.dm.MWTransclusionPartModel | Part to add |
addTemplatePlaceholder()private
#
Create a new template part at the end of the transclusion.
addWikitext()private
#
Handle add wikitext button click or hotkey events.
autoExpandSidebar()protected
#
Automatically expand or collapse the sidebar according to default logic.
checkRequiredParameters() → {jQuery.Deferred}private
#
If the user has left blank required parameters, confirm that they actually want to do this. If no required parameters were left blank, or if they were but the user decided to go ahead anyway, the returned deferred will be resolved. Otherwise, the returned deferred will be rejected.
- Inherited from:
- Source:
Returns:
- Type
- jQuery.Deferred
closeConfirm(prompt) → {jQuery.Promise}
#
Show a confirm prompt before closing the dialog
Parameters:
Name | Type | Description |
---|---|---|
prompt |
string | Prompt |
Returns:
Close promise
- Type
- jQuery.Promise
connectHotKeyBinding(hotkey, handler, [validTypes])private
#
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
hotkey |
string | ||
handler |
function | ||
validTypes |
RegExp |
optional |
getActionProcess()
#
getBodyHeight()
#
- Inherited from:
- Source:
getMessageButton(message, icon) → {OO.ui.ButtonWidget}private
#
Converts a message link into an OO.ui.ButtonWidget with an icon.
Parameters:
Name | Type | Description |
---|---|---|
message |
string | i18n message key |
icon |
string | icon name |
- Inherited from:
- Source:
Returns:
- Type
- OO.ui.ButtonWidget
getPageFromPart(part) → {OO.ui.PageLayout|null
}protected
#
null
}protected
#
Get a page for a transclusion part.
Parameters:
Name | Type | Description |
---|---|---|
part |
ve.dm.MWTransclusionModel | Part to get page for |
- Overrides:
- Source:
Returns:
Page for part, null if no matching page could be found
- Type
-
OO.ui.PageLayout
|
null
getReadyProcess()
#
- Inherited from:
- Source:
getSelectedNode()
#
- Inherited from:
- Source:
getSetupProcess()
#
- Overrides:
- Source:
getSizeProperties()
#
getTeardownProcess()
#
- Inherited from:
- Source:
initialize()
#
- Overrides:
- Source:
initializeTemplateParameters()
#
Intentionally empty. This is provided for Wikia extensibility.
- Inherited from:
- Source:
onAddParameter(param)private
#
Handle add param events.
Parameters:
Name | Type | Description |
---|---|---|
param |
ve.dm.MWParameterModel | Added param |
- Inherited from:
- Source:
onHasValueChange(pageName, hasValue)private
#
Parameters:
Name | Type | Description |
---|---|---|
pageName |
string | |
hasValue |
boolean |
- Inherited from:
- Source:
onKeyDown(e)protected
#
onOutlineControlsMove(places)private
#
Handle outline controls move events.
Parameters:
Name | Type | Description |
---|---|---|
places |
number | Number of places to move the selected item |
onOutlineControlsRemove()private
#
Handle outline controls remove events.
onRemoveParameter(param)private
#
Handle remove param events.
Parameters:
Name | Type | Description |
---|---|---|
param |
ve.dm.MWParameterModel | Removed param |
- Inherited from:
- Source:
onReplacePart(removed, added)protected
#
Handle parts being replaced.
Parameters:
Name | Type | Description |
---|---|---|
removed |
ve.dm.MWTransclusionPartModel
|
null
|
Removed part |
added |
ve.dm.MWTransclusionPartModel
|
null
|
Added part |
- Overrides:
- Source:
onWindowResize()private
#
resetDialog()private
#
Revert the dialog back to its initial state.
setApplicableStatus()private
#
Sets transclusion applicable status
If the transclusion is empty or only contains a placeholder it will not be insertable. If the transclusion only contains a placeholder it will not be editable.
- Inherited from:
- Source:
Sets transclusion applicable status
If the transclusion is empty or only contains a placeholder it will not be insertable.
setupHotkeyTriggers()private
#
toggleSidebar(expandSidebar)private
#
Set if the sidebar is visible (which means the dialog is expanded), or collapsed.
Parameters:
Name | Type | Description |
---|---|---|
expandSidebar |
boolean |
touch()private
#
Update dialog actions whenever the content changes.
- Inherited from:
- Source:
updateActionSet()private
#
Update the widgets in the dialog's action bar.
updateModeActionState()private
#
Update the state of the 'mode' action
updateTitle()protected
#
Update the dialog title.
- Overrides:
- Source: