Always allow switching to visual when using DirectParsoidClient.

When using DirectParsoidClient, switching should be lossless.

Depends-On: I86c611fa0b717ef619e5ffe550b6c2be49a28c99
Change-Id: Ie30ccbc8c12ce48f481b9f727f28e60d21ee37b9
This commit is contained in:
daniel 2022-11-07 10:19:54 +01:00
parent 74bc24d362
commit ea62ee6b19
4 changed files with 6 additions and 6 deletions

View file

@ -34,9 +34,6 @@
"VisualEditorAllowExternalLinkPaste": {
"value": false
},
"VisualEditorAllowLossySwitching": {
"value": true
},
"VisualEditorAvailableContentModels": {
"value": {
"wikitext": "article"

View file

@ -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' ),

View file

@ -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 ) {

View file

@ -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' &&