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', ), 'skinScripts' => array_combine( array_keys( $themes ), array_map( function ( $theme ) { // TODO Allow extensions to specify this path somehow return "resources/lib/oojs-ui/oojs-ui-$theme.js"; }, array_values( $themes ) ) ), 'dependencies' => array( 'es5-shim', 'oojs', 'oojs-ui.styles', 'oojs-ui.styles.icons', 'oojs-ui.styles.indicators', 'oojs-ui.styles.textures', ), 'messages' => array( 'ooui-dialog-message-accept', 'ooui-dialog-message-reject', 'ooui-dialog-process-continue', 'ooui-dialog-process-dismiss', 'ooui-dialog-process-error', 'ooui-dialog-process-retry', 'ooui-outline-control-move-down', 'ooui-outline-control-move-up', 'ooui-outline-control-remove', 'ooui-selectfile-button-select', 'ooui-selectfile-dragdrop-placeholder', 'ooui-selectfile-not-supported', 'ooui-selectfile-placeholder', 'ooui-toolbar-more', 'ooui-toolgroup-collapse', 'ooui-toolgroup-expand', ), 'targets' => array( 'desktop', 'mobile' ), ); $modules['oojs-ui.styles'] = array( 'position' => 'top', 'styles' => 'resources/src/oojs-ui-local.css', // HACK, see inside the file 'skinStyles' => array_combine( array_keys( $themes ), array_map( function ( $theme ) { // TODO Allow extensions to specify this path somehow return "resources/lib/oojs-ui/oojs-ui-$theme-noimages.css"; }, array_values( $themes ) ) ), 'targets' => array( 'desktop', 'mobile' ), ); $imageSets = array( // Comments for greppability 'icons', // oojs-ui.styles.icons 'indicators', // oojs-ui.styles.indicators 'textures', // oojs-ui.styles.textures 'icons-accessibility', // oojs-ui.styles.icons-accessibility 'icons-alerts', // oojs-ui.styles.icons-alerts 'icons-content', // oojs-ui.styles.icons-content 'icons-editing-advanced', // oojs-ui.styles.icons-editing-advanced 'icons-editing-core', // oojs-ui.styles.icons-editing-core 'icons-editing-list', // oojs-ui.styles.icons-editing-list 'icons-editing-styling', // oojs-ui.styles.icons-editing-styling 'icons-interactions', // oojs-ui.styles.icons-interactions 'icons-layout', // oojs-ui.styles.icons-layout 'icons-location', // oojs-ui.styles.icons-location 'icons-media', // oojs-ui.styles.icons-media 'icons-moderation', // oojs-ui.styles.icons-moderation 'icons-movement', // oojs-ui.styles.icons-movement 'icons-user', // oojs-ui.styles.icons-user 'icons-wikimedia', // oojs-ui.styles.icons-wikimedia ); $rootPath = 'resources/lib/oojs-ui/themes'; foreach ( $imageSets as $name ) { $module = array( 'position' => 'top', 'class' => 'ResourceLoaderOOUIImageModule', 'name' => $name, 'rootPath' => $rootPath, ); 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}, .mw-ui-icon-{name}-{variant}:before, /* Hack for Flow, see T110051 */ .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; } return $modules; } );