wiki.techinc.nl/resources/lib/oojs-ui/oojs-ui-mediawiki.js
Roan Kattouw 07527e1e5b Update OOjs UI to v0.1.0-pre (f1abca8e82)
New changes:
5883e65 Add 'indeterminate' state to progress bar widget
fbe9248 Fix documentation for getRelativeSelectableItem
27f8805 Localisation updates from https://translatewiki.net.
2edfdaa Localisation updates from https://translatewiki.net.
40d08f0 Localisation updates from https://translatewiki.net.
ce8438f Update OOjs to v1.1.3
5721411 Prepare repository for RuboCop
f1abca8 Followup ca6a16f: use parent selector both for hiding and showing windows

Change-Id: I7b49bbc81e9b8ba501f0593daaacf7025f16bf00
2014-11-17 18:49:44 -05:00

68 lines
1.5 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*!
* OOjs UI v0.1.0-pre (f1abca8e82)
* https://www.mediawiki.org/wiki/OOjs_UI
*
* Copyright 20112014 OOjs Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
* Date: 2014-11-17T23:49:27Z
*/
/**
* @class
* @extends OO.ui.Theme
*
* @constructor
*/
OO.ui.MediaWikiTheme = function OoUiMediaWikiTheme() {
// Parent constructor
OO.ui.MediaWikiTheme.super.call( this );
};
/* Setup */
OO.inheritClass( OO.ui.MediaWikiTheme, OO.ui.Theme );
/* Methods */
/**
* @inheritdoc
*/
OO.ui.MediaWikiTheme.prototype.getElementClasses = function ( element ) {
// Parent method
var variant,
variants = {
invert: false,
primary: false,
constructive: false,
destructive: false
},
// Parent method
classes = OO.ui.MediaWikiTheme.super.prototype.getElementClasses.call( this, element );
if ( element.supports( [ 'isFramed', 'isDisabled', 'hasFlag' ] ) ) {
if ( element.isFramed() && !element.isDisabled() ) {
if (
element.hasFlag( 'primary' ) ||
element.hasFlag( 'constructive' ) ||
element.hasFlag( 'destructive' )
) {
variants.invert = true;
}
} else {
variants.primary = element.hasFlag( 'primary' );
variants.constructive = element.hasFlag( 'constructive' );
variants.destructive = element.hasFlag( 'destructive' );
}
}
for ( variant in variants ) {
classes[variants[variant] ? 'on' : 'off'].push( 'oo-ui-image-' + variant );
}
return classes;
};
/* Instantiation */
OO.ui.theme = new OO.ui.MediaWikiTheme();