Merge "Allow &veaction=editsource to load 2017WTE regardless of user prefs"

This commit is contained in:
jenkins-bot 2024-08-30 06:20:42 +00:00 committed by Gerrit Code Review
commit f363c943cc
2 changed files with 9 additions and 10 deletions

View file

@ -30,12 +30,8 @@
const url = new URL( location.href );
// Provide the new wikitext editor
if (
conf.enableWikitext &&
(
mw.user.options.get( 'visualeditor-newwikitext' ) ||
url.searchParams.get( 'veaction' ) === 'editsource'
) &&
mw.loader.getState( 'ext.visualEditor.mwwikitext' )
mw.user.options.get( 'visualeditor-newwikitext' ) ||
url.searchParams.get( 'veaction' ) === 'editsource'
) {
modules.push( 'ext.visualEditor.mwwikitext' );
}

View file

@ -1351,11 +1351,14 @@
init.isWikitextAvailable = (
init.isAvailable &&
// Enabled on site
conf.enableWikitext &&
// If forced by the URL parameter, skip the checks (T239796)
( url.searchParams.get( 'veaction' ) === 'editsource' || (
// Enabled on site
conf.enableWikitext &&
// User preference
mw.user.options.get( 'visualeditor-newwikitext' ) &&
// User preference
mw.user.options.get( 'visualeditor-newwikitext' )
) ) &&
// Only on wikitext pages
mw.config.get( 'wgPageContentModel' ) === 'wikitext'