wiki.techinc.nl/resources/lib/oojs-ui/oojs-ui-mediawiki.js
James D. Forrester 5cca0292b0 Update OOjs UI to v0.1.0-pre (837b2f733e)
New changes:
d40dd30 build: Update grunt-contrib-uglify to v0.6.0
0d89c99 test: Load a theme for the test HTML file so the tests don't fail
f245aa4 Element: Remove test for deprecated onDOMEvent()
cd15f18 Follow-up I730e3d7d: Tab not spaces
a923881 build: Use Karma instead of grunt-contrib-qunit
381864c build: Use Chrome and Firefox for tests instead of PhantomJS
044faa5 Follow-up If2da01a2: Fix grunt watch
d6e7af8 Adding OO.ui.TitledElement as mixin to label widget
6385af7 MediaWiki theme: Add filled white background to toolbars
837b2f7 Revert "Try to stop user from tabbing outside of open dialog box"

Change-Id: I63d51311f73d1295a2a35ebadf7d9ac835dec5c7
2014-10-10 18:05:55 -07: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 (837b2f733e)
* 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-10-11T01:05:29Z
*/
/**
* @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.isFramed && element.hasFlag ) {
if ( element.isFramed() ) {
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();