Expand all

ve.ui.MWMobileSaveDialog

Extends

Constructor

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

Dialog for saving MediaWiki pages in mobile.

TODO: Currently this does no overriding so could be removed, but we may want to customise the mobile save dialog in the near future.

Parameters:

Name Type Attributes Description
config Object optional

Config options

Source:
Dialog for saving MediaWiki pages in mobile.

Methods

clearAllMessages() #

Remove all messages from the save dialog.

Inherited from:
Source:
Remove all messages from the save dialog.

clearDiff() #

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

Inherited from:
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

Inherited from:
Source:
Remove a message from the save dialog.

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

Inherited from:
Source:

onRetryButtonClick() #

Handle retry button click events.

Hides errors and then tries again.

Inherited from:
Source:
Handle retry button click events.

onReviewChoose(item) #

Update the current review mode

Parameters:

Name Type Description
item OO.ui.OptionWidget

Item chosen

Inherited from:
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.

Inherited from:
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.

Inherited from:
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

Inherited from:
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

Inherited from:
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

Inherited from:
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.

Inherited from:
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

Inherited from:
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)

Inherited from:
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

Inherited from:
Source:
Update the current review mode

Events

preview() #

Emitted when the user clicks the show preview button

Inherited from:
Source:
Emitted when the user clicks the show preview button

resolve() #

Emitted when the user clicks the resolve conflict button

Inherited from:
Source:
Emitted when the user clicks the resolve conflict button

retry() #

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

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

review() #

Emitted when the user clicks the review changes button

Inherited from:
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.

Inherited from:
Source:
Emitted when the user clicks the save button