2 * OOjs UI v0.1.0-pre (9ed4cf2557)
3 * https://www.mediawiki.org/wiki/OOjs_UI
5 * Copyright 2011–2014 OOjs Team and other contributors.
6 * Released under the MIT license
7 * http://oojs.mit-license.org
9 * Date: 2014-11-22T01:21:13Z
13 * @extends OO.ui.Theme
17 OO
.ui
.MediaWikiTheme
= function OoUiMediaWikiTheme() {
19 OO
.ui
.MediaWikiTheme
.super.call( this );
24 OO
.inheritClass( OO
.ui
.MediaWikiTheme
, OO
.ui
.Theme
);
31 OO
.ui
.MediaWikiTheme
.prototype.getElementClasses = function ( element
) {
41 classes
= OO
.ui
.MediaWikiTheme
.super.prototype.getElementClasses
.call( this, element
);
43 if ( element
.supports( [ 'isFramed', 'isDisabled', 'hasFlag' ] ) ) {
44 if ( element
.isFramed() && !element
.isDisabled() ) {
46 element
.hasFlag( 'primary' ) ||
47 element
.hasFlag( 'constructive' ) ||
48 element
.hasFlag( 'destructive' )
50 variants
.invert
= true;
53 variants
.primary
= element
.hasFlag( 'primary' );
54 variants
.constructive
= element
.hasFlag( 'constructive' );
55 variants
.destructive
= element
.hasFlag( 'destructive' );
59 for ( variant
in variants
) {
60 classes
[variants
[variant
] ? 'on' : 'off'].push( 'oo-ui-image-' + variant
);
68 OO
.ui
.theme
= new OO
.ui
.MediaWikiTheme();