Check for venotify on page load, not when VPT is created

Not sure what could have broken this or when. Or if it ever worked to be honest...

Bug: T58921
Change-Id: I069b5ccb4a78a6790e5791354402503676faa7fa
This commit is contained in:
Alex Monk 2015-01-22 23:41:10 +00:00
parent c9f6bfbbfa
commit 34e4c6a51b
3 changed files with 19 additions and 16 deletions

View file

@ -182,6 +182,9 @@ $wgResourceModules += array(
'tooltip-ca-editsource',
'tooltip-ca-ve-edit',
'visualeditor-ca-editsource-section',
'postedit-confirmation-created',
'postedit-confirmation-restored',
'postedit-confirmation-saved',
),
'position' => 'top',
),
@ -232,9 +235,6 @@ $wgResourceModules += array(
'summary-preview',
// Messages needed by VE in init phase only (rest go below)
'postedit-confirmation-created',
'postedit-confirmation-restored',
'postedit-confirmation-saved',
'visualeditor-loadwarning',
'visualeditor-loadwarning-token',
'visualeditor-savedialog-identify-anon',

View file

@ -474,9 +474,12 @@
}
$( function () {
var currentUri = new mw.Uri( location.href ),
isSection;
if ( init.isAvailable ) {
if ( isViewPage && uri.query.veaction === 'edit' ) {
var isSection = uri.query.vesection !== undefined;
isSection = uri.query.vesection !== undefined;
init.showLoading();
ve.track( 'mwedit.init', { type: isSection ? 'section' : 'page', mechanism: 'url' } );
@ -493,5 +496,17 @@
if ( userPrefEnabled ) {
init.setupSkin();
}
if ( currentUri.query.venotify ) {
// The following messages can be used here:
// postedit-confirmation-saved
// postedit-confirmation-created
// postedit-confirmation-restored
mw.hook( 'postEdit' ).fire( {
message: mw.msg( 'postedit-confirmation-' + currentUri.query.venotify, mw.user )
} );
delete currentUri.query.venotify;
}
} );
}() );

View file

@ -98,18 +98,6 @@ ve.init.mw.ViewPageTarget = function VeInitMwViewPageTarget() {
sanityCheckComplete: 'updateToolbarSaveButtonState'
} );
if ( currentUri.query.venotify ) {
// The following messages can be used here:
// postedit-confirmation-saved
// postedit-confirmation-created
// postedit-confirmation-restored
mw.hook( 'postEdit' ).fire( {
message: ve.msg( 'postedit-confirmation-' + currentUri.query.venotify, mw.user )
} );
delete currentUri.query.venotify;
}
if ( history.replaceState ) {
// This is to stop the back button breaking when it's supposed to take us back out
// of VE. It used to only be called when venotify is used. FIXME: there should be