Properties
defaults
#
Properties:
| Name | Type | Description | |||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
defaults |
Object | Default options hash. Properties:
|
- Mixes in:
- Source:
template
#
Methods
confirmSave() → {boolean}
#
If this is a new article, require confirmation before saving.
Returns:
The user confirmed saving
- Type
- boolean
createAnonTalkWarning() → {jQuery.Element}
#
createAnonWarning(options) → {jQuery.Element}
#
Sets additional values used for anonymous editing warning.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
Object |
Returns:
- Type
- jQuery.Element
getCaptchaPanelTemplateSource() → {string}
#
Provides the template code to be used for the captcha step.
This method is called by template(), and provided so that extending classes can change the HTML provided here.
Returns:
- Type
- string
getLoadingPromise() → {jQuery.Promise}
#
Get a promise that is resolved when the editor data has loaded, or rejected when we're refusing to load the editor because the user is blocked.
Returns:
- Type
- jQuery.Promise
Get a promise that is resolved when the editor data has loaded, or rejected when we're refusing to load the editor because the user is blocked.
getOptionsForSwitch() → {Object}
#
Get an options object not containing any defaults or editor specific options, so that it can be used to construct a different editor for switching.
Returns:
Options
- Type
- Object
Get an options object not containing any defaults or editor specific options, so that it can be used to construct a different editor for switching.
getSavePanelTemplateSource() → {string}
#
Provides the template code to be used for the save panel, where the user is asked for an edit summary.
This method is called by template(), and provided so that extending classes can change the HTML provided here.
Returns:
- Type
- string
Provides the template code to be used for the save panel, where the user is asked for an edit summary.
handleCaptcha(details)
#
Handles a failed save due to a CAPTCHA provided by ConfirmEdit extension.
Parameters:
| Name | Type | Description |
|---|---|---|
details |
Object | Details returned from the api. |
hasChanged()
#
Checks whether the state of the thing being edited as changed. Expects to be implemented by child class.
initialize()
#
log(data)
#
Logs an event to http://meta.wikimedia.org/wiki/Schema:EditAttemptStep
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Object |
logFeatureUse(data)
#
Logs an event to http://meta.wikimedia.org/wiki/Schema:VisualEditorFeatureUse
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Object |
onBeforeExit(exit, cancel)
#
Parameters:
| Name | Type | Description |
|---|---|---|
exit |
function | Callback to exit the overlay |
cancel |
function | Callback to cancel exiting the overlay |
onClickAnonymous()
#
"Edit without logging in" button click handler
onClickBack()
#
Back button click handler
onClickContinue()
#
Continue button click handler
onClickSubmit()
#
Submit button click handler
onSaveBegin()
#
Executed when the editor clicks the save button. Expects to be overridden by child class. Checks if the save needs to be confirmed.
onSaveComplete(newRevId, [redirectUrl], [tempUserCreated])
#
Executed when page save is complete. Updates urls and shows toast message.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
newRevId |
number
|
null
|
ID of the newly created revision, or null if it was a null edit. |
|
redirectUrl |
string |
optional |
URL to redirect to, if different than the current URL. |
tempUserCreated |
boolean |
optional |
Whether a temporary user was created |
onSaveFailure(data)
#
Executed when page save fails. Handles logging the error. Subclasses should display error messages as appropriate.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Object | API response |
onStageChanges()
#
Prepares the penultimate screen before saving. Expects to be overridden by child class.
postRender()
#
preRender()
#
reportError(text)
#
Report load errors back to the user. Silently record the error using EventLogging.
Parameters:
| Name | Type | Description |
|---|---|---|
text |
string | Text (HTML) of message to display to user |
showSaveCompleteMsg(action, [tempUserCreated])
#
Show a save-complete message to the user
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
action |
string | One of 'saved', 'created', 'restored' |
|
tempUserCreated |
boolean |
optional |
Whether a temporary user was created |
Events
hide()
#
Fired when the overlay is closed.
- Inherited from:
- Source: