Merge "Do not show incompatible skin warning when page is not editable"

This commit is contained in:
jenkins-bot 2022-08-11 13:43:54 +00:00 committed by Gerrit Code Review
commit 54d0268847

View file

@ -706,6 +706,8 @@
var isViewPage = mw.config.get( 'wgIsArticle' ) && !( 'diff' in uri.query ); var isViewPage = mw.config.get( 'wgIsArticle' ) && !( 'diff' in uri.query );
var isEditPage = mw.config.get( 'wgAction' ) === 'edit' || mw.config.get( 'wgAction' ) === 'submit'; var isEditPage = mw.config.get( 'wgAction' ) === 'edit' || mw.config.get( 'wgAction' ) === 'submit';
var pageCanLoadEditor = isViewPage || isEditPage; var pageCanLoadEditor = isViewPage || isEditPage;
var pageIsProbablyEditable = mw.config.get( 'wgIsProbablyEditable' ) ||
mw.config.get( 'wgRelevantPageIsProbablyEditable' );
if ( pageCanLoadEditor ) { if ( pageCanLoadEditor ) {
$targetContainer.addClass( 've-init-mw-desktopArticleTarget-targetContainer' ); $targetContainer.addClass( 've-init-mw-desktopArticleTarget-targetContainer' );
} }
@ -1448,7 +1450,11 @@
initialWikitext = $( '#wpTextbox1' ).textSelection( 'getContents' ); initialWikitext = $( '#wpTextbox1' ).textSelection( 'getContents' );
} }
if ( ( init.isVisualAvailable || init.isWikitextAvailable ) && pageCanLoadEditor && !requiredSkinElements ) { if ( ( init.isVisualAvailable || init.isWikitextAvailable ) &&
pageCanLoadEditor &&
pageIsProbablyEditable &&
!requiredSkinElements
) {
mw.log.warn( mw.log.warn(
'Your skin is incompatible with VisualEditor. ' + 'Your skin is incompatible with VisualEditor. ' +
'See https://www.mediawiki.org/wiki/Extension:VisualEditor/Skin_requirements for the requirements.' 'See https://www.mediawiki.org/wiki/Extension:VisualEditor/Skin_requirements for the requirements.'
@ -1571,11 +1577,8 @@
( init.isVisualAvailable || init.isWikitextAvailable || $( '#wpTextbox1' ).length ) && ( init.isVisualAvailable || init.isWikitextAvailable || $( '#wpTextbox1' ).length ) &&
isEditPage && isEditPage &&
init.shouldShowWelcomeDialog() && init.shouldShowWelcomeDialog() &&
(
// Not on protected pages // Not on protected pages
mw.config.get( 'wgIsProbablyEditable' ) || pageIsProbablyEditable
mw.config.get( 'wgRelevantPageIsProbablyEditable' )
)
) { ) {
mw.loader.using( 'ext.visualEditor.welcome' ).done( function () { mw.loader.using( 'ext.visualEditor.welcome' ).done( function () {
var windowManager, welcomeDialog; var windowManager, welcomeDialog;