mw.loader.using( [ ‘mediawiki.util’ ] ).done( function () {
var importScript = function ( s ) {
function () {
var importStylesheet = function ( s ) {
};
* @rev 6
var extraCSS = mw.util.getParamValue( ‘withCSS’ ),
var extraCSS = mw.util.getParamValue( ‘withCSS’ ),
extraJS = mw.util.getParamValue( ‘withJS’ );
extraJS = mw.util.getParamValue( ‘withJS’ );
if ( extraCSS ) {
if ( extraCSS ) {
// WARNING: DO NOT REMOVE THIS “IF” – REQUIRED FOR SECURITY (against XSS/CSRF attacks)
if ( extraCSS.match( /^MediaWiki:[^&=%#]*\.css$/ ) ) {
if ( /^MediaWiki:[^&=%#]*\.css$/ ) ) {
mw.loader.load( ‘/w/index.php?title=” + extraCSS + “&action=raw&ctype=text/css’, ‘text/css’ );
} else {
} else {
mw.notify( ‘Only pages from the MediaWiki namespace are allowed.’, { title: ‘Invalid withCSS value’ } );
mw.notify( ‘Only pages from the MediaWiki namespace are allowed.’, { title: ‘Invalid withCSS value’ } );
if ( extraJS ) {
if ( extraJS ) {
// WARNING: DO NOT REMOVE THIS “IF” – REQUIRED FOR SECURITY (against XSS/CSRF attacks)
if ( extraJS.match( /^MediaWiki:[^&=%#]*\.js$/ ) ) {
if ( /^MediaWiki:[^&=%#]*\.js$/ ) ) {
mw.loader.load( ‘/w/index.php?title=” + extraJS + “&action=raw&ctype=text/javascript’ );
} else {
} else {
mw.notify( ‘Only pages from the MediaWiki namespace are allowed.’, { title: ‘Invalid withJS value’ } );
mw.notify( ‘Only pages from the MediaWiki namespace are allowed.’, { title: ‘Invalid withJS value’ } );
}
}
}
}
// =================================================================================
importScript( ‘MediaWiki:Tabber.js’ );
mw.loader.load( ‘/w/index.php?title=MediaWiki:Comments.js&action=raw&ctype=text/javascript’ );
importScript( ‘MediaWiki:Common.js/’ + mw.config.get( ‘wgPageName’ ) );
mw.loader.load( ‘/w/index.php?title=MediaWiki:DynamicNavigation.js&action=raw&ctype=text/javascript’ );
mw.loader.load( ‘/w/index.php?title=MediaWiki:Tabber.js&action=raw&ctype=text/javascript’ );
} );
/** * @source https://www.mediawiki.org/wiki/Snippets/Load_JS_and_CSS_by_URL Revision 2020-04-04 */ mw.loader.using( ['mediawiki.util'], function () { var extraCSS = mw.util.getParamValue( 'withCSS' ), extraJS = mw.util.getParamValue( 'withJS' ); if ( extraCSS ) { // WARNING: DO NOT REMOVE THIS "IF" - REQUIRED FOR SECURITY (against XSS/CSRF attacks) if ( /^MediaWiki:[^&=%#]*\.css$/.test( extraCSS ) ) { mw.loader.load( '/w/index.php?title=' + encodeURIComponent( extraCSS ) + '&action=raw&ctype=text/css', 'text/css' ); } else { mw.notify( 'Only pages from the MediaWiki namespace are allowed.', { title: 'Invalid withCSS value' } ); } } if ( extraJS ) { // WARNING: DO NOT REMOVE THIS "IF" - REQUIRED FOR SECURITY (against XSS/CSRF attacks) if ( /^MediaWiki:[^&=%#]*\.js$/.test( extraJS ) ) { mw.loader.load( '/w/index.php?title=' + encodeURIComponent( extraJS ) + '&action=raw&ctype=text/javascript' ); } else { mw.notify( 'Only pages from the MediaWiki namespace are allowed.', { title: 'Invalid withJS value' } ); } } }); // ================================================================================= // == Script Modules Loader == // ================================================================================= importScript( 'MediaWiki:Comments.js' ); importScript( 'MediaWiki:Tabber.js' ); importStylesheet( 'MediaWiki:Common.css/' + mw.config.get( 'wgPageName' ) ); importScript( 'MediaWiki:Common.js/' + mw.config.get( 'wgPageName' ) );
#MediaWikiMobile.js #Difference #revisions #Wikinews #free #news #source