MediaWiki:Common.js: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
sostituite importScriptURI deprecate per mw:ResourceLoader/Legacy JavaScript
aggiornato caricamento JavaScript da url, da en.wiki e mediawiki.org
Riga 11:
'wikipedia.deejay.it',
'wikipedia.kataweb.it',
'212.48.3.33',
'wikipedia.virgilio.it',
'213.92.16.218',
];
for( i = 0; i < badMirrors.length; i++ ) {
Riga 573:
});
 
/**
/** extract a URL parameter from the current URL **********
* @source www.mediawiki.org/wiki/Snippets/Load_JS_and_CSS_by_URL
* From [[en:User:Lupin/autoedit.js]] and [[en:MediaWiki:Common.js]]
* @rev 5
* paramName : the name of the parameter to extract
*/
var extraJS = getURLParamValuemw.util.getParamValue(" 'withJS"' );
//DEPRECATO
if ( extraJS ) {
function getURLParamValue(param, url) {
if ( extraJS && extraJS.match(" /^MediaWiki:[^&<>=%#]*\\.js$"/ ) ) {
return mw.util.getParamValue(param, url);
importScript( extraJS );
} else {
mw.notify( 'Only pages from the MediaWiki namespace are allowed.', { title: 'Invalid withJS value' } );
}
}
/** &withJS= URL parameter *******
* Allow to try custom scripts from MediaWiki space
* without editing [[Special:Mypage/monobook.js]]
*/
var extraJS = getURLParamValue("withJS");
if ( extraJS && extraJS.match("^MediaWiki:[^&<>=%]*\\.js$") ) {
importScript(extraJS);
}
 
 
/*** Codice per il Template:Galleria ***/