jenkins-bot has submitted this change and it was merged.

Change subject: mw.ViewPageTarget: Make tabLayout configurable server-side
......................................................................


mw.ViewPageTarget: Make tabLayout configurable server-side

Bug: 46871
Change-Id: I3fcb0c2903ae62d61ff789b5504e0ea23932121b
---
M VisualEditor.hooks.php
M VisualEditor.php
M modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
3 files changed, 9 insertions(+), 5 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php
index 660e356..3798008 100644
--- a/VisualEditor.hooks.php
+++ b/VisualEditor.hooks.php
@@ -79,13 +79,16 @@
         */
        public static function onResourceLoaderGetConfigVars( array &$vars ) {
                global $wgVisualEditorEnableSectionEditLinks, 
$wgVisualEditorParsoidProblemReportURL,
-                       $wgVisualEditorParsoidURL, 
$wgVisualEditorEnableExperimentalCode;
+                       $wgVisualEditorParsoidURL, 
$wgVisualEditorEnableExperimentalCode,
+                       $wgVisualEditorTabLayout;
+
                $vars['wgVisualEditorConfig'] = array(
                        'enableSectionEditLinks' => 
$wgVisualEditorEnableSectionEditLinks,
                        'reportProblemURL' => 
$wgVisualEditorParsoidProblemReportURL !== null ?
                                $wgVisualEditorParsoidProblemReportURL :
                                "$wgVisualEditorParsoidURL/_bugs/",
                        'enableExperimentalCode' => 
$wgVisualEditorEnableExperimentalCode,
+                       'tabLayout' => $wgVisualEditorTabLayout,
                );
 
                return true;
diff --git a/VisualEditor.php b/VisualEditor.php
index 276245a..08058e6 100644
--- a/VisualEditor.php
+++ b/VisualEditor.php
@@ -27,6 +27,10 @@
 $wgVisualEditorUseChangeTagging = true;
 // Whether to enable incomplete experimental code
 $wgVisualEditorEnableExperimentalCode = false;
+// Whether to use the 'add' or 'replace' tabLayout
+// * add: Adds #ca-ve-edit.
+// * replace: Re-creates #ca-edit for VisualEditor and adds #ca-editsource.
+$wgVisualEditorTabLayout = 'replace';
 
 /* Setup */
 
diff --git a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js 
b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
index 1907c28..ecac6b7 100644
--- a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
+++ b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
@@ -71,10 +71,7 @@
        );
        this.originalDocumentTitle = document.title;
        this.editSummaryByteLimit = 255;
-       // Tab layout.
-       // * add: Adds #ca-ve-edit.
-       // * replace: Re-creates #ca-edit for VisualEditor and adds 
#ca-editsource.
-       this.tabLayout = 'replace';
+       this.tabLayout = mw.config.get( 'wgVisualEditorConfig' ).tabLayout;
 
        browserWhitelisted = (
                currentUri.query.vewhitelist !== undefined ?

-- 
To view, visit https://gerrit.wikimedia.org/r/66881
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3fcb0c2903ae62d61ff789b5504e0ea23932121b
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Trevor Parscal <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to