Diferencia entre revisiones de «MediaWiki:Launchpad.js»
Sin resumen de edición |
Sin resumen de edición |
||
Línea 22: | Línea 22: | ||
div.parent( 'launchpad' ); | div.parent( 'launchpad' ); | ||
} | } | ||
} | } | ||
}; | }; | ||
$( Launchpad.init ); | $( Launchpad.init ); |
Revisión del 15:09 10 abr 2019
var Launchpad = {
/**
* Initialization script
* Load p5 and the CSS, and then build the GUI for each launchpad
*/
init: function () {
var launchpads = $( '#launchpad' );
if ( launchpads.length ) {
mw.loader.load( '/index.php?title=MediaWiki:Launchpad.css&action=raw&ctype=text/css', 'text/css' );
mw.loader.getScript( 'https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.8.0/p5.min.js' ).then( function () {
mw.loader.getScript( 'https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.8.0/addons/p5.dom.min.js' ).then( function () {
launchpads.each( Launchpad.build );
});
});
}
},
build: function () {
function setup() {
div = createDiv( 'All OK!' );
div.parent( 'launchpad' );
}
}
};
$( Launchpad.init );