resources: Strip '$' and 'mw' from file closures
[lhc/web/wiklou.git] / resources / src / mediawiki.htmlform.ooui / Element.js
1 ( function () {
2
3 // FIXME: mw.htmlform.Checker also sets this to empty object
4 mw.htmlform = {};
5
6 /**
7 * Allows custom data specific to HTMLFormField to be set for OOUI forms. This picks up the
8 * extra config from a matching PHP widget (defined in HTMLFormElement.php) when constructed using
9 * OO.ui.infuse().
10 *
11 * Currently only supports passing 'hide-if' data.
12 *
13 * @ignore
14 * @param {Object} [config] Configuration options
15 */
16 mw.htmlform.Element = function ( config ) {
17 // Configuration initialization
18 config = config || {};
19
20 // Properties
21 this.hideIf = config.hideIf;
22
23 // Initialization
24 if ( this.hideIf ) {
25 this.$element.addClass( 'mw-htmlform-hide-if' );
26 }
27 };
28
29 mw.htmlform.FieldLayout = function ( config ) {
30 // Parent constructor
31 mw.htmlform.FieldLayout.parent.call( this, config );
32 // Mixin constructors
33 mw.htmlform.Element.call( this, config );
34 };
35 OO.inheritClass( mw.htmlform.FieldLayout, OO.ui.FieldLayout );
36 OO.mixinClass( mw.htmlform.FieldLayout, mw.htmlform.Element );
37
38 mw.htmlform.ActionFieldLayout = function ( config ) {
39 // Parent constructor
40 mw.htmlform.ActionFieldLayout.parent.call( this, config );
41 // Mixin constructors
42 mw.htmlform.Element.call( this, config );
43 };
44 OO.inheritClass( mw.htmlform.ActionFieldLayout, OO.ui.ActionFieldLayout );
45 OO.mixinClass( mw.htmlform.ActionFieldLayout, mw.htmlform.Element );
46
47 }() );