Merge "API: Properly handle limit and continuation for generator=prefixsearch"
[mediawiki.git] / resources / lib / oojs-ui / oojs-ui-mediawiki.js
blob27938066380f8f926d84aadb559eb61144839a4b
1 /*!
2 * OOjs UI v0.8.2
3 * https://www.mediawiki.org/wiki/OOjs_UI
5 * Copyright 2011–2015 OOjs Team and other contributors.
6 * Released under the MIT license
7 * http://oojs.mit-license.org
9 * Date: 2015-02-27T18:02:31Z
11 /**
12 * @class
13 * @extends OO.ui.Theme
15 * @constructor
17 OO.ui.MediaWikiTheme = function OoUiMediaWikiTheme() {
18 // Parent constructor
19 OO.ui.MediaWikiTheme.super.call( this );
22 /* Setup */
24 OO.inheritClass( OO.ui.MediaWikiTheme, OO.ui.Theme );
26 /* Methods */
28 /**
29 * @inheritdoc
31 OO.ui.MediaWikiTheme.prototype.getElementClasses = function ( element ) {
32 // Parent method
33 var variant,
34 variants = {
35 invert: false,
36 progressive: false,
37 constructive: false,
38 destructive: false
40 // Parent method
41 classes = OO.ui.MediaWikiTheme.super.prototype.getElementClasses.call( this, element );
43 if ( element.supports( [ 'isFramed', 'isDisabled', 'hasFlag' ] ) ) {
44 if ( element.isFramed() && ( element.isDisabled() || element.hasFlag( 'primary' ) ) ) {
45 variants.invert = true;
46 } else {
47 variants.progressive = element.hasFlag( 'progressive' );
48 variants.constructive = element.hasFlag( 'constructive' );
49 variants.destructive = element.hasFlag( 'destructive' );
53 for ( variant in variants ) {
54 classes[ variants[ variant ] ? 'on' : 'off' ].push( 'oo-ui-image-' + variant );
57 return classes;
60 /* Instantiation */
62 OO.ui.theme = new OO.ui.MediaWikiTheme();