Expand all

abstract ve.ui.MWTemplateDialog

Extends

Constructor

new ve.ui.MWTemplateDialog([config])abstract #

Abstract base class for dialogs that allow to insert and edit 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. Currently used for:

  • {@see ve.ui.MWTransclusionDialog} for arbitrary transclusions. Registered via the name "transclusion".
  • {@see ve.ui.MWCitationDialog} in the Cite extension for the predefined citation types from [[MediaWiki:visualeditor-cite-tool-definition.json]]. These are strictly limited to a single template invocation. Registered via the name "cite".

Parameters:

Name Type Attributes Description
config Object optional

Configuration options

Properties:

Name Type Attributes Default Description
transclusionModel ve.dm.MWTransclusionModel | null
sidebar ve.ui.MWTransclusionOutlineWidget
canGoBack boolean optional
false
Source:
Abstract base class for dialogs that allow to insert and edit MediaWiki transclusions, i.e.

Properties

bookletLayoutConfigstatic #

Configuration for the {@see ve.ui.MWTwoPaneTransclusionDialogLayout} used in this dialog.

Properties:

Type Description
Object
Source:
Configuration for the {@see ve.ui.MWTwoPaneTransclusionDialogLayout} used in this dialog.

Methods

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.

Source:

Returns:

Type
jQuery.Deferred
If the user has left blank required parameters, confirm that they actually want to do this.

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

Source:

Returns:

Type
OO.ui.ButtonWidget
Converts a message link into an OO.ui.ButtonWidget with an icon.

getPageFromPart(part) → {OO.ui.PageLayout|null}protected #

Get a page for a transclusion part.

Parameters:

Name Type Description
part ve.dm.MWTransclusionModel

Part to get page for

Source:

Returns:

Page for part, null if no matching page could be found

Type
OO.ui.PageLayout | null
Get a page for a transclusion part.

getTeardownProcess() #

initializeTemplateParameters() #

Intentionally empty. This is provided for Wikia extensibility.

Source:
Intentionally empty.

onAddParameter(param)private #

Handle add param events.

Parameters:

Name Type Description
param ve.dm.MWParameterModel

Added param

Source:
Handle add param events.

onHasValueChange(pageName, hasValue)private #

Parameters:

Name Type Description
pageName string
hasValue boolean
Source:

onRemoveParameter(param)private #

Handle remove param events.

Parameters:

Name Type Description
param ve.dm.MWParameterModel

Removed param

Source:
Handle remove param events.

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

Source:
Handle parts being replaced.

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.

Source:

Sets transclusion applicable status

If the transclusion is empty or only contains a placeholder it will not be insertable.

touch()private #

Update dialog actions whenever the content changes.

Source:
Update dialog actions whenever the content changes.

updateTitle()protected #

Update the dialog title.

Source:
Update the dialog title.