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 |
Methods
clearAllMessages()
#
Remove all messages from the save dialog.
clearDiff()
#
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 |
getActionProcess()
#
getBodyHeight()
#
getReadyProcess()
#
getSetupProcess([data])
#
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
Object |
optional |
Properties:
|
getTeardownProcess()
#
initialize()
#
onRetryButtonClick()
#
Handle retry button click events.
Hides errors and then tries again.
onReviewChoose(item)
#
Update the current review mode
Parameters:
Name | Type | Description |
---|---|---|
item |
OO.ui.OptionWidget | Item chosen |
popPending()
#
positionDiffElement()
#
Re-position elements within the diff element
Should be called whenever the diff element's container has changed width.
Re-position elements within the diff element
Should be called whenever the diff element's container has changed width.
pushPending()
#
reset()
#
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 |
setDimensions()
#
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 |
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 |
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. |
Returns:
Promise which resolves when the message has been shown, rejects if no new message shown.
- Type
- jQuery.Promise
showPreview(response)
#
Set preview content and show preview panel.
Parameters:
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) |
Throws:
-
Unknown saveDialog panel
- Type
- Error
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 |
Events
preview()
#
Emitted when the user clicks the show preview button
resolve()
#
Emitted when the user clicks the resolve conflict button
retry()
#
Emitted when the user clicks the retry/continue save button after an error.
review()
#
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. |