Merge "OutputPage.php: Use descriptive $variant instead of $_v as local variable"
[lhc/web/wiklou.git] / resources / ResourcesOOUI.php
index 37203fb..974db87 100644 (file)
@@ -27,11 +27,12 @@ if ( !defined( 'MEDIAWIKI' ) ) {
 // WARNING: OOjs-UI is NOT TESTED with older browsers and is likely to break
 // if loaded in browsers that don't support ES5
 return call_user_func( function () {
-       // Core default themes
-       $themes = array( 'default' => 'mediawiki' );
-       $themes += ExtensionRegistry::getInstance()->getAttribute( 'SkinOOUIThemes' );
-       $modules = array();
+       $themes = ExtensionRegistry::getInstance()->getAttribute( 'SkinOOUIThemes' );
+       // We only use the theme names for file names, and they are lowercase
+       $themes = array_map( 'strtolower', $themes );
+       $themes['default'] = 'mediawiki';
 
+       $modules = array();
        $modules['oojs-ui'] = array(
                'scripts' => array(
                        'resources/lib/oojs-ui/oojs-ui.js',
@@ -112,10 +113,13 @@ return call_user_func( function () {
 
                if ( substr( $name, 0, 5 ) === 'icons' ) {
                        $module['selectorWithoutVariant'] = '.oo-ui-icon-{name}, .mw-ui-icon-{name}:before';
-                       $module['selectorWithVariant'] = '.oo-ui-image-{variant} .oo-ui-icon-{name}, .oo-ui-image-{variant}.oo-ui-icon-{name}, .mw-ui-icon-{name}-{variant}:before, .mw-ui-hovericon:hover .mw-ui-icon-{name}-{variant}-hover:before, .mw-ui-hovericon.mw-ui-icon-{name}-{variant}-hover:hover:before';
+                       $module['selectorWithVariant'] = '.oo-ui-image-{variant} .oo-ui-icon-{name}, 
+                               .oo-ui-image-{variant}.oo-ui-icon-{name}, .mw-ui-icon-{name}-{variant}:before,
+                               .mw-ui-hovericon:hover .mw-ui-icon-{name}-{variant}-hover:before,
+                               .mw-ui-hovericon.mw-ui-icon-{name}-{variant}-hover:hover:before';
                }
 
-               $modules[ "oojs-ui.styles.$name" ] = $module;
+               $modules["oojs-ui.styles.$name"] = $module;
        }
 
        return $modules;