3 * https://www.mediawiki.org/wiki/OOUI
5 * Copyright 2011–2018 OOUI Team and other contributors.
6 * Released under the MIT license
7 * http://oojs.mit-license.org
9 * Date: 2018-02-07T00:27:24Z
17 * @extends OO.ui.Theme
21 OO
.ui
.WikimediaUITheme
= function OoUiWikimediaUITheme() {
23 OO
.ui
.WikimediaUITheme
.parent
.call( this );
28 OO
.inheritClass( OO
.ui
.WikimediaUITheme
, OO
.ui
.Theme
);
35 OO
.ui
.WikimediaUITheme
.prototype.getElementClasses = function ( element
) {
37 var variant
, isFramed
, isActive
,
45 classes
= OO
.ui
.WikimediaUITheme
.parent
.prototype.getElementClasses
.call( this, element
);
47 if ( element
.supports( [ 'hasFlag' ] ) ) {
48 isFramed
= element
.supports( [ 'isFramed' ] ) && element
.isFramed();
49 isActive
= element
.supports( [ 'isActive' ] ) && element
.isActive();
51 // Button with a dark background
52 isFramed
&& ( isActive
|| element
.isDisabled() || element
.hasFlag( 'primary' ) ) ||
53 // Toolbar with a dark background
54 OO
.ui
.ToolGroup
&& element
instanceof OO
.ui
.ToolGroup
&& ( isActive
|| element
.hasFlag( 'primary' ) )
56 // … use white icon / indicator, regardless of other flags
57 variants
.invert
= true;
58 } else if ( !isFramed
&& element
.isDisabled() ) {
59 // Frameless disabled button, always use black icon / indicator regardless of other flags
60 variants
.invert
= false;
61 } else if ( !element
.isDisabled() ) {
62 // Any other kind of button, use the right colored icon / indicator if available
63 variants
.progressive
= element
.hasFlag( 'progressive' );
64 variants
.destructive
= element
.hasFlag( 'destructive' );
65 variants
.warning
= element
.hasFlag( 'warning' );
69 for ( variant
in variants
) {
70 classes
[ variants
[ variant
] ? 'on' : 'off' ].push( 'oo-ui-image-' + variant
);
79 OO
.ui
.WikimediaUITheme
.prototype.getDialogTransitionDuration = function () {
85 OO
.ui
.theme
= new OO
.ui
.WikimediaUITheme();
89 //# sourceMappingURL=oojs-ui-wikimediaui.js.map