diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-06-04 07:31:04 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-06-04 07:58:39 +0200 |
commit | f6d65e533c62f6deb21342d4901ece24497b433e (patch) | |
tree | f28adf0362d14bcd448f7b65a7aaf38650f923aa /vendor/oojs/oojs-ui/php/themes | |
parent | c27b2e832fe25651ef2410fae85b41072aae7519 (diff) |
Update to MediaWiki 1.25.1
Diffstat (limited to 'vendor/oojs/oojs-ui/php/themes')
-rw-r--r-- | vendor/oojs/oojs-ui/php/themes/ApexTheme.php | 6 | ||||
-rw-r--r-- | vendor/oojs/oojs-ui/php/themes/MediaWikiTheme.php | 39 |
2 files changed, 45 insertions, 0 deletions
diff --git a/vendor/oojs/oojs-ui/php/themes/ApexTheme.php b/vendor/oojs/oojs-ui/php/themes/ApexTheme.php new file mode 100644 index 00000000..e812736e --- /dev/null +++ b/vendor/oojs/oojs-ui/php/themes/ApexTheme.php @@ -0,0 +1,6 @@ +<?php + +namespace OOUI; + +class ApexTheme extends Theme { +} diff --git a/vendor/oojs/oojs-ui/php/themes/MediaWikiTheme.php b/vendor/oojs/oojs-ui/php/themes/MediaWikiTheme.php new file mode 100644 index 00000000..86e4c353 --- /dev/null +++ b/vendor/oojs/oojs-ui/php/themes/MediaWikiTheme.php @@ -0,0 +1,39 @@ +<?php + +namespace OOUI; + +class MediaWikiTheme extends Theme { + + /* Methods */ + + public function getElementClasses( Element $element ) { + $variants = array( + 'warning' => false, + 'invert' => false, + 'progressive' => false, + 'constructive' => false, + 'destructive' => false + ); + + // Parent method + $classes = parent::getElementClasses( $element ); + + if ( $element->supports( array( 'hasFlag' ) ) ) { + $isFramed = $element->supports( array( 'isFramed' ) ) && $element->isFramed(); + if ( $isFramed && ( $element->isDisabled() || $element->hasFlag( 'primary' ) ) ) { + $variants['invert'] = true; + } else { + $variants['progressive'] = $element->hasFlag( 'progressive' ); + $variants['constructive'] = $element->hasFlag( 'constructive' ); + $variants['destructive'] = $element->hasFlag( 'destructive' ); + $variants['warning'] = $element->hasFlag( 'warning' ); + } + } + + foreach ( $variants as $variant => $toggle ) { + $classes[$toggle ? 'on' : 'off'][] = 'oo-ui-image-' . $variant; + } + + return $classes; + } +} |