3 * https://www.mediawiki.org/wiki/OOjs_UI
5 * Copyright 2011–2015 OOjs UI Team and other contributors.
6 * Released under the MIT license
7 * http://oojs.mit-license.org
9 * Date: 2015-12-08T21:43:47Z
13 * @extends OO.ui.Theme
17 OO.ui.MediaWikiTheme = function OoUiMediaWikiTheme() {
19 OO.ui.MediaWikiTheme.parent.call( this );
24 OO.inheritClass( OO.ui.MediaWikiTheme, OO.ui.Theme );
31 OO.ui.MediaWikiTheme.prototype.getElementClasses = function ( element ) {
33 var variant, isFramed, isActive,
42 classes = OO.ui.MediaWikiTheme.parent.prototype.getElementClasses.call( this, element );
44 if ( element.supports( [ 'hasFlag' ] ) ) {
45 isFramed = element.supports( [ 'isFramed' ] ) && element.isFramed();
46 isActive = element.supports( [ 'isActive' ] ) && element.isActive();
48 ( isFramed && ( isActive || element.isDisabled() || element.hasFlag( 'primary' ) ) ) ||
49 ( !isFramed && element.hasFlag( 'primary' ) )
51 variants.invert = true;
53 variants.progressive = element.hasFlag( 'progressive' );
54 variants.constructive = element.hasFlag( 'constructive' );
55 variants.destructive = element.hasFlag( 'destructive' );
56 variants.warning = element.hasFlag( 'warning' );
60 for ( variant in variants ) {
61 classes[ variants[ variant ] ? 'on' : 'off' ].push( 'oo-ui-image-' + variant );
69 OO.ui.theme = new OO.ui.MediaWikiTheme();