Index: trunk/phase3/skins/common/htmlform.js |
— | — | @@ -1,36 +0,0 @@ |
2 | | -// Find select-or-other fields. |
3 | | -addOnloadHook( function() { |
4 | | - var fields = getElementsByClassName( document, 'select', 'mw-htmlform-select-or-other' ); |
5 | | - |
6 | | - for( var i = 0; i < fields.length; i++ ) { |
7 | | - var select = fields[i]; |
8 | | - |
9 | | - addHandler( select, 'change', htmlforms.selectOrOtherSelectChanged ); |
10 | | - |
11 | | - // Use a fake 'e' to update it. |
12 | | - htmlforms.selectOrOtherSelectChanged( { 'target': select } ); |
13 | | - } |
14 | | -} ); |
15 | | - |
16 | | -window.htmlforms = { |
17 | | - 'selectOrOtherSelectChanged' : function( e ) { |
18 | | - var select; |
19 | | - if ( !e ) { |
20 | | - e = window.event; |
21 | | - } |
22 | | - if ( e.target ) { |
23 | | - select = e.target; |
24 | | - } else if ( e.srcElement ) { |
25 | | - select = e.srcElement; |
26 | | - } |
27 | | - if ( select.nodeType == 3 ) { // defeat Safari bug |
28 | | - select = select.parentNode; |
29 | | - } |
30 | | - |
31 | | - var id = select.id; |
32 | | - var textbox = document.getElementById( id + '-other' ); |
33 | | - |
34 | | - textbox.disabled = ( select.value != 'other' ); |
35 | | - } |
36 | | -}; |
37 | | - |
Index: trunk/phase3/includes/HTMLForm.php |
— | — | @@ -54,7 +54,6 @@ |
55 | 55 | * TODO: Document 'section' / 'subsection' stuff |
56 | 56 | */ |
57 | 57 | class HTMLForm { |
58 | | - static $jsAdded = false; |
59 | 58 | |
60 | 59 | # A mapping of 'type' inputs onto standard HTMLFormField subclasses |
61 | 60 | static $typeMappings = array( |
— | — | @@ -160,15 +159,10 @@ |
161 | 160 | /** |
162 | 161 | * Add the HTMLForm-specific JavaScript, if it hasn't been |
163 | 162 | * done already. |
| 163 | + * @deprecated @since 1.18 load modules with ResourceLoader instead |
164 | 164 | */ |
165 | | - static function addJS() { |
166 | | - if ( self::$jsAdded ) return; |
| 165 | + static function addJS() { } |
167 | 166 | |
168 | | - global $wgOut; |
169 | | - |
170 | | - $wgOut->addModules( 'mediawiki.legacy.htmlform' ); |
171 | | - } |
172 | | - |
173 | 167 | /** |
174 | 168 | * Initialise a new Object for the field |
175 | 169 | * @param $descriptor input Descriptor, as described above |
— | — | @@ -202,9 +196,6 @@ |
203 | 197 | throw new MWException( "You must call setTitle() on an HTMLForm" ); |
204 | 198 | } |
205 | 199 | |
206 | | - // FIXME shouldn't this be closer to displayForm() ? |
207 | | - self::addJS(); |
208 | | - |
209 | 200 | # Load data from the request. |
210 | 201 | $this->loadData(); |
211 | 202 | } |
Index: trunk/phase3/resources/Resources.php |
— | — | @@ -544,12 +544,6 @@ |
545 | 545 | 'localBasePath' => "{$GLOBALS['IP']}/skins", |
546 | 546 | 'dependencies' => 'mediawiki.legacy.wikibits', |
547 | 547 | ), |
548 | | - 'mediawiki.legacy.htmlform' => array( |
549 | | - 'scripts' => 'common/htmlform.js', |
550 | | - 'remoteBasePath' => $GLOBALS['wgStylePath'], |
551 | | - 'localBasePath' => "{$GLOBALS['IP']}/skins", |
552 | | - 'dependencies' => 'mediawiki.legacy.wikibits', |
553 | | - ), |
554 | 548 | 'mediawiki.legacy.IEFixes' => array( |
555 | 549 | 'scripts' => 'common/IEFixes.js', |
556 | 550 | 'remoteBasePath' => $GLOBALS['wgStylePath'], |
— | — | @@ -581,7 +575,7 @@ |
582 | 576 | 'scripts' => 'common/prefs.js', |
583 | 577 | 'remoteBasePath' => $GLOBALS['wgStylePath'], |
584 | 578 | 'localBasePath' => "{$GLOBALS['IP']}/skins", |
585 | | - 'dependencies' => array( 'mediawiki.legacy.wikibits', 'mediawiki.legacy.htmlform' ), |
| 579 | + 'dependencies' => array( 'mediawiki.legacy.wikibits', 'mediawiki.htmlform' ), |
586 | 580 | ), |
587 | 581 | 'mediawiki.legacy.preview' => array( |
588 | 582 | 'scripts' => 'common/preview.js', |