mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-24 02:38:40 +00:00
mw.ViewPageTarget: Make tabLayout configurable server-side
Bug: 46871 Change-Id: I3fcb0c2903ae62d61ff789b5504e0ea23932121b
This commit is contained in:
parent
0730e4af6e
commit
52025855ae
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
|
|
@ -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 ?
|
||||
|
|
Loading…
Reference in a new issue