3 * https://www.mediawiki.org/wiki/OOjs_UI
5 * Copyright 2011–2016 OOjs UI Team and other contributors.
6 * Released under the MIT license
7 * http://oojs.mit-license.org
9 * Date: 2016-02-22T22:33:33Z
17 * @extends OO.ui.Theme
21 OO
.ui
.MediaWikiTheme
= function OoUiMediaWikiTheme() {
23 OO
.ui
.MediaWikiTheme
.parent
.call( this );
28 OO
.inheritClass( OO
.ui
.MediaWikiTheme
, OO
.ui
.Theme
);
35 OO
.ui
.MediaWikiTheme
.prototype.getElementClasses = function ( element
) {
37 var variant
, isFramed
, isActive
,
46 classes
= OO
.ui
.MediaWikiTheme
.parent
.prototype.getElementClasses
.call( this, element
);
48 if ( element
.supports( [ 'hasFlag' ] ) ) {
49 isFramed
= element
.supports( [ 'isFramed' ] ) && element
.isFramed();
50 isActive
= element
.supports( [ 'isActive' ] ) && element
.isActive();
52 ( isFramed
&& ( isActive
|| element
.isDisabled() || element
.hasFlag( 'primary' ) ) ) ||
53 ( !isFramed
&& element
.hasFlag( 'primary' ) )
55 variants
.invert
= true;
57 variants
.progressive
= element
.hasFlag( 'progressive' );
58 variants
.constructive
= element
.hasFlag( 'constructive' );
59 variants
.destructive
= element
.hasFlag( 'destructive' );
60 variants
.warning
= element
.hasFlag( 'warning' );
64 for ( variant
in variants
) {
65 classes
[ variants
[ variant
] ? 'on' : 'off' ].push( 'oo-ui-image-' + variant
);
73 OO
.ui
.theme
= new OO
.ui
.MediaWikiTheme();