mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-27 15:50:29 +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
(cherry picked from commit 596575582c
)
This commit is contained in:
parent
a8cfc95205
commit
8687237a05
|
@ -406,10 +406,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",
|
||||
|
@ -500,6 +496,8 @@
|
|||
"lastmodifiedat",
|
||||
"mw-widgets-abandonedit",
|
||||
"pagetitle",
|
||||
"postedit-confirmation-published",
|
||||
"postedit-confirmation-saved",
|
||||
"visualeditor-section-body-placeholder",
|
||||
"visualeditor-section-title-placeholder"
|
||||
]
|
||||
|
|
|
@ -1698,24 +1698,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