From 5bf0ac251af36646578f084d230aa0e5dc76cf55 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Fri, 13 Feb 2015 08:19:49 +0000 Subject: [PATCH] Move svgMaxSize and namespacesWithSubpages to site config These are currently in page-specific mw.config. As these are not related any page, they should be in the global export. This is needed to have our tests (and code base) run error-free without a MediaWiki page. Bug: T89434 Change-Id: Ic42bcd14028772ff0c06e28c76ffaf156f8b985f --- VisualEditor.hooks.php | 6 +++--- modules/ve-mw/dm/nodes/ve.dm.MWImageNode.js | 2 +- modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php index 2c23a8ba1f..b1ceae83cd 100644 --- a/VisualEditor.hooks.php +++ b/VisualEditor.hooks.php @@ -406,8 +406,6 @@ class VisualEditorHooks { $vars['wgVisualEditor'] = array( 'pageLanguageCode' => $pageLanguage->getHtmlCode(), 'pageLanguageDir' => $pageLanguage->getDir(), - 'svgMaxSize' => $out->getConfig()->get( 'SVGMaxSize' ), - 'namespacesWithSubpages' => $out->getConfig()->get( 'NamespacesWithSubpages' ) ); return true; @@ -440,7 +438,9 @@ class VisualEditorHooks { 'tabPosition' => $veConfig->get( 'VisualEditorTabPosition' ), 'tabMessages' => $veConfig->get( 'VisualEditorTabMessages' ), 'showBetaWelcome' => $veConfig->get( 'VisualEditorShowBetaWelcome' ), - 'enableTocWidget' => $veConfig->get( 'VisualEditorEnableTocWidget' ) + 'enableTocWidget' => $veConfig->get( 'VisualEditorEnableTocWidget' ), + 'svgMaxSize' => $coreConfig->get( 'SVGMaxSize' ), + 'namespacesWithSubpages' => $coreConfig->get( 'NamespacesWithSubpages' ), ); foreach ( $veConfig->get( 'VisualEditorPreferenceModules' ) as $pref => $module ) { diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWImageNode.js b/modules/ve-mw/dm/nodes/ve.dm.MWImageNode.js index 9fa3a5a186..8bd83f57b9 100644 --- a/modules/ve-mw/dm/nodes/ve.dm.MWImageNode.js +++ b/modules/ve-mw/dm/nodes/ve.dm.MWImageNode.js @@ -30,7 +30,7 @@ ve.dm.MWImageNode = function VeDmMWImageNode() { // fetch the actual media type from the API this.mediaType = 'BITMAP'; // Get wiki defaults - this.svgMaxSize = mw.config.get( 'wgVisualEditor' ).svgMaxSize; + this.svgMaxSize = mw.config.get( 'wgVisualEditorConfig' ).svgMaxSize; // Initialize this.constructor.static.syncScalableToType( diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js index 40fc908fa9..58f7954320 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js @@ -978,7 +978,7 @@ ve.ui.MWMediaDialog.prototype.getSetupProcess = function ( data ) { .next( function () { var pageTitle = mw.config.get( 'wgTitle' ), namespace = mw.config.get( 'wgNamespaceNumber' ), - namespacesWithSubpages = mw.config.get( 'wgVisualEditor' ).namespacesWithSubpages; + namespacesWithSubpages = mw.config.get( 'wgVisualEditorConfig' ).namespacesWithSubpages; // Read the page title if ( namespacesWithSubpages[ namespace ] ) {