MediaWiki:Common.js: Difference between revisions

From Comprehensible Input Wiki
Content added Content deleted
No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 12: Line 12:




mw.loader.load( '/w/index.php?title=Mediawiki:Datatables.js&action=raw&ctype=text/javascript' ).then(function(){
mw.loader.load( '/w/index.php?title=Mediawiki:Datatables.js&action=raw&ctype=text/javascript'
mw.loader.load( '/w/index.php?title=Mediawiki:Datatables_custom.js&action=raw&ctype=text/javascript' );
mw.loader.load( '/w/index.php?title=Mediawiki:Datatables_custom.js&action=raw&ctype=text/javascript'





Revision as of 03:29, 5 February 2023

/* Any JavaScript here will be loaded for all users on every page load. */
//Wait for page to be parsed
$(document).ready( function () {
	if(window.location.hostname == 'comprehensibleinput.miraheze.org'){
		
		currentUrl = new RegExp("(^.*)" + window.location.hostname + "(.*$)", 'g').exec(window.location);
		newUrl = currentUrl[1] + "comprehensibleinputwiki.org" + currentUrl[2];
		
		$('#bodyContent').prepend('<div id="newUrlDiv" style="display:none">New URL! Go to <a href="' + newUrl + '"><b>comprehensibleinputwiki.org</b></a>!</div>');
		document.querySelector('#newUrlDiv').style.display="block"	
	}


        mw.loader.load( '/w/index.php?title=Mediawiki:Datatables.js&action=raw&ctype=text/javascript'
        mw.loader.load( '/w/index.php?title=Mediawiki:Datatables_custom.js&action=raw&ctype=text/javascript'



});