| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
mw.hook( 'htmlform.enhance' ).add( ( $root ) => { |
| 6 |
let $oouiNodes = $root.find( '.mw-htmlform-autoinfuse' ); |
| 7 |
|
| 8 |
$oouiNodes = $oouiNodes.filter( function () { |
| 9 |
return !$( this ).closest( '.mw-htmlform-autoinfuse-lazy' ).length; |
| 10 |
} ); |
| 11 |
|
| 12 |
if ( $oouiNodes.length ) { |
| 13 |
|
| 14 |
|
| 15 |
const modules = [ 'mediawiki.htmlform.ooui' ]; |
| 16 |
$oouiNodes.each( function () { |
| 17 |
const data = $( this ).data( 'mw-modules' ); |
| 18 |
if ( data ) { |
| 19 |
|
| 20 |
const extraModules = data.split( ',' ); |
| 21 |
modules.push( ...extraModules ); |
| 22 |
} |
| 23 |
} ); |
| 24 |
mw.loader.using( modules ).done( () => { |
| 25 |
$oouiNodes.each( function () { |
| 26 |
OO.ui.infuse( this ); |
| 27 |
} ); |
| 28 |
} ); |
| 29 |
} |
| 30 |
} ); |