Don't display composer installed extensions/skins on Special:Version
[mediawiki.git] / resources / lib / oojs-ui / oojs-ui-mediawiki.js
blob09b447449c27106d0a34281345edfaea0549be06
1 /*!
2 * OOjs UI v0.6.1
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-01-05T13:04:40Z
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.isDisabled() && element.isFramed() && 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();