diff --git a/extension.json b/extension.json index 6b0439268f..c6f0dc6dce 100644 --- a/extension.json +++ b/extension.json @@ -34,9 +34,6 @@ "VisualEditorAllowExternalLinkPaste": { "value": false }, - "VisualEditorAllowLossySwitching": { - "value": true - }, "VisualEditorAvailableContentModels": { "value": { "wikitext": "article" diff --git a/includes/Hooks.php b/includes/Hooks.php index ca390708c2..913c9de028 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -1130,7 +1130,8 @@ class Hooks { 'rebaserUrl' => $coreConfig->get( 'VisualEditorRebaserURL' ), 'restbaseUrl' => $useRestbase ? $coreConfig->get( 'VisualEditorRestbaseURL' ) : false, 'fullRestbaseUrl' => $useRestbase ? $coreConfig->get( 'VisualEditorFullRestbaseURL' ) : false, - 'allowLossySwitching' => $coreConfig->get( 'VisualEditorAllowLossySwitching' ), + // XXX: Do we still need to be able to disable switching? + 'allowSwitchingToVisualMode' => true, 'feedbackApiUrl' => $veConfig->get( 'VisualEditorFeedbackAPIURL' ), 'feedbackTitle' => $veConfig->get( 'VisualEditorFeedbackTitle' ), 'sourceFeedbackTitle' => $veConfig->get( 'VisualEditorSourceFeedbackTitle' ), diff --git a/modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js b/modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js index f1ca300a3e..c71c09d528 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js @@ -2249,7 +2249,8 @@ ve.init.mw.ArticleTarget.prototype.switchToFallbackWikitextEditor = function () */ ve.init.mw.ArticleTarget.prototype.switchToVisualEditor = function () { var config = mw.config.get( 'wgVisualEditorConfig' ), - canSwitch = config.fullRestbaseUrl || config.allowLossySwitching, + // NOTE: should be just config.allowSwitchingToVisualMode, but we need to preserve compatibility for a few minutes. + canSwitch = config.allowSwitchingToVisualMode || config.fullRestbaseUrl || config.allowLossySwitching, target = this; if ( !this.edited ) { diff --git a/modules/ve-mw/preinit/ve.init.mw.DesktopArticleTarget.init.js b/modules/ve-mw/preinit/ve.init.mw.DesktopArticleTarget.init.js index 91b863ceac..f47c22fe4a 100644 --- a/modules/ve-mw/preinit/ve.init.mw.DesktopArticleTarget.init.js +++ b/modules/ve-mw/preinit/ve.init.mw.DesktopArticleTarget.init.js @@ -1179,7 +1179,8 @@ sectionVal = $( 'input[name=wpSection]' ).val(), section = sectionVal !== '' && sectionVal !== undefined ? sectionVal : null, config = mw.config.get( 'wgVisualEditorConfig' ), - canSwitch = config.fullRestbaseUrl || config.allowLossySwitching, + // NOTE: should be just config.allowSwitchingToVisualMode, but we need to preserve compatibility for a few minutes. + canSwitch = config.allowSwitchingToVisualMode || config.fullRestbaseUrl || config.allowLossySwitching, modified = mw.config.get( 'wgAction' ) === 'submit' || ( mw.config.get( 'wgAction' ) === 'edit' &&