mw.ViewPageTarget: Make tabLayout configurable server-side

Bug: 46871
Change-Id: I3fcb0c2903ae62d61ff789b5504e0ea23932121b
This commit is contained in:
Timo Tijhof 2013-06-04 00:23:45 +02:00 committed by Catrope
parent 0730e4af6e
commit 52025855ae
3 changed files with 9 additions and 5 deletions

View file

@ -79,13 +79,16 @@ class VisualEditorHooks {
*/
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;

View file

@ -27,6 +27,10 @@ $wgVisualEditorNamespaces = array( NS_MAIN );
$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 */

View file

@ -71,10 +71,7 @@ ve.init.mw.ViewPageTarget = function VeInitMwViewPageTarget() {
);
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 ?