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
This commit is contained in:
Timo Tijhof 2015-02-13 08:19:49 +00:00
parent d5530b87ff
commit 5bf0ac251a
3 changed files with 5 additions and 5 deletions

View file

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

View file

@ -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(

View file

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