Expand all

ve.ui.MWSaveDialog

Extends

Constructor

new ve.ui.MWSaveDialog([config]) #

Dialog for saving MediaWiki pages.

Note that most methods are not safe to call before the dialog has initialized, except where noted otherwise.

Parameters:

Name Type Attributes Description
config Object optional

Config options

Source:
Dialog for saving MediaWiki pages.

Methods

clearAllMessages() #

Remove all messages from the save dialog.

Source:
Remove all messages from the save dialog.

clearDiff() #

Clear the diff displayed in the review panel, if any.

Source:
Clear the diff displayed in the review panel, if any.

clearMessage(name) #

Remove a message from the save dialog.

Parameters:

Name Type Description
name string

Message's unique name

Source:
Remove a message from the save dialog.

getActionProcess() #

getSetupProcess([data]) #

Parameters:

Name Type Attributes Description
data Object optional
Properties:
Name Type Attributes Default Description
canReview boolean optional
false

User can review changes

canPreview boolean optional
false

User can preview changes

copyrightWarning string optional

HTML to display as the copyright message

checkboxFields Array.<OO.ui.FieldLayout> optional
[]

Checkbox fields

checkboxesByName Object optional
{}

Checkbox widgets, indexed by name

sectionTitle string optional

Section title, if in new section mode

editSummary string optional

Edit summary

initialPanel string optional
'save'

Initial panel to show

saveButtonLabel jQuery | string | OO.ui.HtmlSnippet | function | null optional

Label for the save button

Source:

getTeardownProcess() #

onRetryButtonClick() #

Handle retry button click events.

Hides errors and then tries again.

Source:
Handle retry button click events.

onReviewChoose(item) #

Update the current review mode

Parameters:

Name Type Description
item OO.ui.OptionWidget

Item chosen

Source:
Update the current review mode

positionDiffElement() #

Re-position elements within the diff element

Should be called whenever the diff element's container has changed width.

Source:

Re-position elements within the diff element

Should be called whenever the diff element's container has changed width.

reset() #

Reset the fields of the save dialog.

Source:
Reset the fields of the save dialog.

setDiffAndReview(wikitextDiffPromise, visualDiffGeneratorPromise, [baseDoc]) #

Set review content and show review panel.

Parameters:

Name Type Attributes Description
wikitextDiffPromise jQuery.Promise

Wikitext diff HTML promise

visualDiffGeneratorPromise jQuery.Promise

Visual diff promise

baseDoc HTMLDocument optional

Base document against which to normalise links when rendering visualDiff

Source:
Set review content and show review panel.

setEditSummary(summary) #

Change the edit summary prefilled in the save dialog.

This method is safe to call even when the dialog hasn't been initialized yet.

Parameters:

Name Type Description
summary string

Edit summary to prefill

Source:
Change the edit summary prefilled in the save dialog.

setupCheckboxes(checkboxFields) #

Initialize MediaWiki page specific checkboxes.

This method is safe to call even when the dialog hasn't been initialized yet.

Parameters:

Name Type Description
checkboxFields Array.<OO.ui.FieldLayout>

Checkbox fields

Source:
Initialize MediaWiki page specific checkboxes.

showMessage(name, label, config) → {jQuery.Promise} #

Show a message in the save dialog.

Parameters:

Name Type Description
name string

Message's unique name

label jQuery | string | function | OO.ui.HtmlSnippet

Message content. See OO.ui.mixin.LabelElement.

config string

MessageWidget config. Defaults to an inline warning.

Source:

Returns:

Promise which resolves when the message has been shown, rejects if no new message shown.

Type
jQuery.Promise
Show a message in the save dialog.

showPreview(response) #

Set preview content and show preview panel.

Parameters:

Name Type Description
response Object | jQuery

action=parse API response, or error message

Source:
Set preview content and show preview panel.

swapPanel(panel, [noFocus]) #

Swap state in the save dialog.

Parameters:

Name Type Attributes Default Description
panel string

One of 'save', 'review' or 'conflict'

noFocus boolean optional
false

Don't attempt to focus anything (e.g. while setting up)

Source:

Throws:

Unknown saveDialog panel

Type
Error
Swap state in the save dialog.

updateReviewMode([button]) #

Update the current review mode

Parameters:

Name Type Attributes Description
button OO.ui.ButtonOptionWidget optional

The button clicked, or false if this is the initial setup

Source:
Update the current review mode

Events

preview() #

Emitted when the user clicks the show preview button

Source:
Emitted when the user clicks the show preview button

resolve() #

Emitted when the user clicks the resolve conflict button

Source:
Emitted when the user clicks the resolve conflict button

retry() #

Emitted when the user clicks the retry/continue save button after an error.

Source:
Emitted when the user clicks the retry/continue save button after an error.

review() #

Emitted when the user clicks the review changes button

Source:
Emitted when the user clicks the review changes button

save(saveDeferred) #

Emitted when the user clicks the save button

Parameters:

Name Type Description
saveDeferred jQuery.Deferred

Deferred object to resolve/reject when the save succeeds/fails.

Source:
Emitted when the user clicks the save button