X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/19e297c21b10b1b8a3acad5e73fc71dcb35db44a..6932310fd58ebef145fa01eb76edf7150284d8ea:/vendor/oojs/oojs-ui/demos/demos.php diff --git a/vendor/oojs/oojs-ui/demos/demos.php b/vendor/oojs/oojs-ui/demos/demos.php new file mode 100644 index 00000000..00eaca4b --- /dev/null +++ b/vendor/oojs/oojs-ui/demos/demos.php @@ -0,0 +1,163 @@ +Did you forget to run composer install?

'; + exit(); + } + require_once $autoload; + require_once 'classes/ButtonStyleShowcaseWidget.php'; + + // @codingStandardsIgnoreStart MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment + $themes = [ + 'wikimediaui' => 'WikimediaUI', // Do not change this line or you'll break `grunt add-theme` + 'apex' => 'Apex', + ]; + // @codingStandardsIgnoreEnd MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment + $theme = ( isset( $_GET['theme'] ) && isset( $themes[ $_GET['theme'] ] ) ) + ? $_GET['theme'] : 'wikimediaui'; + $themeClass = 'OOUI\\' . $themes[ $theme ] . 'Theme'; + OOUI\Theme::setSingleton( new $themeClass() ); + + $direction = ( isset( $_GET['direction'] ) && $_GET['direction'] === 'rtl' ) ? 'rtl' : 'ltr'; + $directionSuffix = $direction === 'rtl' ? '.rtl' : ''; + OOUI\Element::setDefaultDir( $direction ); + + // We will require_once a file by this name later, so this validation is important + $pages = [ 'widgets' ]; + $page = ( isset( $_GET['page'] ) && in_array( $_GET['page'], $pages ) ) + ? $_GET['page'] : 'widgets'; + + $query = [ + 'page' => $page, + 'theme' => $theme, + 'direction' => $direction, + ]; + + $additionalThemeImagesSuffixes = [ + 'wikimediaui' => [ + '-icons-movement', + '-icons-content', + '-icons-alerts', + '-icons-interactions', + '-icons-moderation', + '-icons-editing-core', + '-icons-editing-styling', + '-icons-editing-list', + '-icons-editing-advanced', + '-icons-media', + '-icons-location', + '-icons-user', + '-icons-layout', + '-icons-accessibility', + '-icons-wikimedia' + ], + 'apex' => [ + '-icons-movement', + '-icons-content', + '-icons-alerts', + '-icons-interactions', + '-icons-moderation', + '-icons-editing-core', + '-icons-editing-styling', + '-icons-editing-list', + '-icons-editing-advanced', + '-icons-media', + '-icons-user', + '-icons-layout', + '-icons-accessibility' + ] + ]; + // Stylesheets to load + $urls = []; + $urls[] = "oojs-ui-core-$theme$directionSuffix.css"; + $urls[] = "oojs-ui-images-$theme$directionSuffix.css"; + foreach ( $additionalThemeImagesSuffixes[ $theme ] as $suffix ) { + $urls[] = "oojs-ui-$theme$suffix$directionSuffix.css"; + } +?> + + + + + OOjs UI Widget Demo + + ' . "\n"; + } + ?> + + + + +
+ + +
+ + + + + + + + + + +