3 * https://www.mediawiki.org/wiki/OOjs_UI
5 * Copyright 2011–2017 OOjs UI Team and other contributors.
6 * Released under the MIT license
7 * http://oojs.mit-license.org
9 * Date: 2017-09-26T20:18:42Z
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
,
46 classes
= OO
.ui
.WikimediaUITheme
.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 // Button with a dark background
53 isFramed
&& ( isActive
|| element
.isDisabled() || element
.hasFlag( 'primary' ) ) ||
54 // Toolbar with a dark background
55 OO
.ui
.ToolGroup
&& element
instanceof OO
.ui
.ToolGroup
&& ( isActive
|| element
.hasFlag( 'primary' ) )
57 // … use white icon / indicator, regardless of other flags
58 variants
.invert
= true;
59 } else if ( !isFramed
&& element
.isDisabled() ) {
60 // Frameless disabled button, always use black icon / indicator regardless of other flags
61 variants
.invert
= false;
62 } else if ( !element
.isDisabled() ) {
63 // Any other kind of button, use the right colored icon / indicator if available
64 variants
.progressive
= element
.hasFlag( 'progressive' );
65 variants
.constructive
= element
.hasFlag( 'constructive' );
66 variants
.destructive
= element
.hasFlag( 'destructive' );
67 variants
.warning
= element
.hasFlag( 'warning' );
71 for ( variant
in variants
) {
72 classes
[ variants
[ variant
] ? 'on' : 'off' ].push( 'oo-ui-image-' + variant
);
81 OO
.ui
.WikimediaUITheme
.prototype.getDialogTransitionDuration = function () {
87 OO
.ui
.theme
= new OO
.ui
.WikimediaUITheme();
91 //# sourceMappingURL=oojs-ui-wikimediaui.js.map