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-04-24T23:29:01Z
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
, isToolOrGroup
,
45 classes
= OO
.ui
.WikimediaUITheme
.parent
.prototype.getElementClasses
.call( this, element
);
48 element
instanceof OO
.ui
.IconWidget
&&
49 element
.$element
.hasClass( 'oo-ui-checkboxInputWidget-checkIcon' )
51 // Icon on CheckboxInputWidget
52 variants
.invert
= true;
53 } else if ( element
.supports( [ 'hasFlag' ] ) ) {
54 isFramed
= element
.supports( [ 'isFramed' ] ) && element
.isFramed();
55 isActive
= element
.supports( [ 'isActive' ] ) && element
.isActive();
57 ( OO
.ui
.Tool
&& element
instanceof OO
.ui
.Tool
) ||
58 ( OO
.ui
.ToolGroup
&& element
instanceof OO
.ui
.ToolGroup
);
60 // Button with a dark background
61 isFramed
&& ( isActive
|| element
.isDisabled() || element
.hasFlag( 'primary' ) ) ||
62 // Toolbar with a dark background
63 isToolOrGroup
&& element
.hasFlag( 'primary' )
65 // … use white icon / indicator, regardless of other flags
66 variants
.invert
= true;
67 } else if ( !isFramed
&& element
.isDisabled() ) {
68 // Frameless disabled button, always use black icon / indicator regardless of other flags
69 variants
.invert
= false;
70 } else if ( !element
.isDisabled() ) {
71 // Any other kind of button, use the right colored icon / indicator if available
72 variants
.progressive
= element
.hasFlag( 'progressive' ) ||
73 // Active tools/toolgroups
74 ( isToolOrGroup
&& isActive
) ||
75 // Pressed or selected outline option widgets
77 OO
.ui
.OutlineOptionWidget
&& element
instanceof OO
.ui
.OutlineOptionWidget
&&
78 ( element
.isPressed() || element
.isSelected() )
81 variants
.destructive
= element
.hasFlag( 'destructive' );
82 variants
.warning
= element
.hasFlag( 'warning' );
86 for ( variant
in variants
) {
87 classes
[ variants
[ variant
] ? 'on' : 'off' ].push( 'oo-ui-image-' + variant
);
96 OO
.ui
.WikimediaUITheme
.prototype.getDialogTransitionDuration = function () {
102 OO
.ui
.theme
= new OO
.ui
.WikimediaUITheme();
106 //# sourceMappingURL=oojs-ui-wikimediaui.js.map