Expand all

ve.ui.MWTransclusionDialog

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

Source:
Dialog for inserting and editing MediaWiki transclusions, i.e.

Methods

addHotkeyToTitle(element, hotkey)private #

Parameters:

Name Type Description
element OO.ui.mixin.TitledElement
hotkey string
Source:

addParameter(e)private #

Handle add parameter hotkey events.

Parameters:

Name Type Description
e jQuery.Event

Key down event

Source:
Handle add parameter hotkey events.

addPart(part) #

Add a part to the transclusion.

Parameters:

Name Type Description
part ve.dm.MWTransclusionPartModel

Part to add

Source:
Add a part to the transclusion.

addTemplatePlaceholder()private #

Create a new template part at the end of the transclusion.

Source:
Create a new template part at the end of the transclusion.

addWikitext()private #

Handle add wikitext button click or hotkey events.

Source:
Handle add wikitext button click or hotkey events.

autoExpandSidebar()protected #

Automatically expand or collapse the sidebar according to default logic.

Source:
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
If the user has left blank required parameters, confirm that they actually want to do this.

closeConfirm(prompt) → {jQuery.Promise} #

Show a confirm prompt before closing the dialog

Parameters:

Name Type Description
prompt string

Prompt

Source:

Returns:

Close promise

Type
jQuery.Promise
Show a confirm prompt before closing the dialog

connectHotKeyBinding(hotkey, handler, [validTypes])private #

Parameters:

Name Type Attributes Description
hotkey string
handler function
validTypes RegExp optional
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
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

Overrides:
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.

initializeTemplateParameters() #

Intentionally empty. This is provided for Wikia extensibility.

Inherited from:
Source:
Intentionally empty.

onAddParameter(param)private #

Handle add param events.

Parameters:

Name Type Description
param ve.dm.MWParameterModel

Added param

Inherited from:
Source:
Handle add param events.

onHasValueChange(pageName, hasValue)private #

Parameters:

Name Type Description
pageName string
hasValue boolean
Inherited from:
Source:

onKeyDown(e)protected #

Handles key down events.

Parameters:

Name Type Description
e jQuery.Event

Key down event

Source:
Handles key down events.

onOutlineControlsMove(places)private #

Handle outline controls move events.

Parameters:

Name Type Description
places number

Number of places to move the selected item

Source:
Handle outline controls move events.

onOutlineControlsRemove()private #

Handle outline controls remove events.

Source:
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:
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

Overrides:
Source:
Handle parts being replaced.

onWindowResize()private #

resetDialog()private #

Revert the dialog back to its initial state.

Source:
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
Source:
Set if the sidebar is visible (which means the dialog is expanded), or collapsed.

touch()private #

Update dialog actions whenever the content changes.

Inherited from:
Source:
Update dialog actions whenever the content changes.

updateActionSet()private #

Update the widgets in the dialog's action bar.

Source:
Update the widgets in the dialog's action bar.

updateModeActionState()private #

Update the state of the 'mode' action

Source:
Update the state of the 'mode' action

updateTitle()protected #

Update the dialog title.

isSmallScreen() → {boolean}static #