Merge "Preserve vehidebetadialog URL flag when switching editor mode"

This commit is contained in:
jenkins-bot 2021-01-13 17:38:22 +00:00 committed by Gerrit Code Review
commit 187a5fe7ac
2 changed files with 17 additions and 3 deletions

View file

@ -1591,6 +1591,9 @@ ve.init.mw.DesktopArticleTarget.prototype.switchToFallbackWikitextEditor = funct
if ( oldId && oldId !== mw.config.get( 'wgCurRevisionId' ) ) {
uri.extend( { oldid: oldId } );
}
if ( mw.libs.ve.isWelcomeDialogSuppressed() ) {
uri.extend( { vehidebetadialog: 1 } );
}
location.href = uri.toString();
} );
} else {

View file

@ -1054,14 +1054,25 @@
return !(
// Disabled in config?
!mw.config.get( 'wgVisualEditorConfig' ).showBetaWelcome ||
// Disabled for the current request?
this.isWelcomeDialogSuppressed() ||
// Hidden using preferences, local storage or cookie?
checkPreferenceOrStorage( 'visualeditor-hidebetawelcome', 've-beta-welcome-dialog' )
);
},
/**
* Check whether the welcome dialog is temporarily disabled.
* @return {boolean}
*/
isWelcomeDialogSuppressed: function () {
return !!(
// Disabled by calling disableWelcomeDialog()?
welcomeDialogDisabled ||
// Hidden using URL parameter?
'vehidebetadialog' in new mw.Uri().query ||
// Check for deprecated hidewelcomedialog parameter (T249954)
'hidewelcomedialog' in new mw.Uri().query ||
// Hidden using preferences, local storage or cookie?
checkPreferenceOrStorage( 'visualeditor-hidebetawelcome', 've-beta-welcome-dialog' )
'hidewelcomedialog' in new mw.Uri().query
);
},