mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-11 16:48:43 +00:00
Follow-up Ieba322fd: Don't generate postedit notification now we set config var
Setting the config var then loading mediawiki.action.view.postEdit will already trigger the notification code, so we can remove this duplicated code now. Bug: T240041 Change-Id: If0d1aa4e734dab7cca168e78216f229b9924bab7
This commit is contained in:
parent
cd913b4f18
commit
596575582c
|
@ -408,10 +408,6 @@
|
|||
"accesskey-ca-editsource",
|
||||
"accesskey-ca-ve-edit",
|
||||
"pipe-separator",
|
||||
"postedit-confirmation-created",
|
||||
"postedit-confirmation-published",
|
||||
"postedit-confirmation-restored",
|
||||
"postedit-confirmation-saved",
|
||||
"tooltip-ca-createsource",
|
||||
"tooltip-ca-edit",
|
||||
"tooltip-ca-editsource",
|
||||
|
@ -502,6 +498,8 @@
|
|||
"lastmodifiedat",
|
||||
"mw-widgets-abandonedit",
|
||||
"pagetitle",
|
||||
"postedit-confirmation-published",
|
||||
"postedit-confirmation-saved",
|
||||
"visualeditor-section-body-placeholder",
|
||||
"visualeditor-section-title-placeholder"
|
||||
]
|
||||
|
|
|
@ -1701,24 +1701,9 @@
|
|||
// TODO: Also set wgPostEdit on non-redirecting edits (T240041)
|
||||
mw.config.set( 'wgPostEdit', notify );
|
||||
|
||||
// Load postEdit code to execute the queued event below, which will handle it once it arrives
|
||||
// Loadomg postEdit code will trigger the post edit notification as wgPostEdit is set
|
||||
mw.loader.load( 'mediawiki.action.view.postEdit' );
|
||||
|
||||
var messageSuffix;
|
||||
if ( notify === 'saved' ) {
|
||||
messageSuffix = mw.config.get( 'wgEditSubmitButtonLabelPublish' ) ? 'published' : 'saved';
|
||||
} else {
|
||||
messageSuffix = notify;
|
||||
}
|
||||
mw.hook( 'postEdit' ).fire( {
|
||||
// The following messages can be used here:
|
||||
// * postedit-confirmation-published
|
||||
// * postedit-confirmation-saved
|
||||
// * postedit-confirmation-created
|
||||
// * postedit-confirmation-restored
|
||||
message: mw.msg( 'postedit-confirmation-' + messageSuffix, mw.user )
|
||||
} );
|
||||
|
||||
delete uri.query.venotify;
|
||||
// Get rid of the ?venotify= from the URL
|
||||
if ( history.replaceState ) {
|
||||
|
|
Loading…
Reference in a new issue