MediaWiki:Common.js

From APL Wiki
Jump to navigation Jump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
if ($(".LeadingAndTrailingCells").length) {
	mw.loader.getScript('/w/index.php?title=MediaWiki:D3.v5.min.js&action=raw&ctype=text/javascript')
		.then(function() {
			mw.loader.load('/w/index.php?title=MediaWiki:LeadingAndTrailingCells.js&action=raw&ctype=text/javascript');
		});
}
if ($('.image[href="/wiki/File:APLcart.png"]').length) {
	$('.image[href="/wiki/File:APLcart.png"]').replaceWith('<iframe src="https://aplcart.info?w" style="height:38vh;width:calc(100% - 4px)">');
	$('.internal[href="/wiki/File:APLcart.png"]').attr('href', 'https://aplcart.info?w');
	$('.thumbinner').css('width','38vw');
}
if ($('[title="File:Ngn/apl"]').length) {
	$('[title="File:Ngn/apl"]').replaceWith('<iframe src="https://abrudz.github.io/ngn-apl/web/" style="height:350px;width:calc(100% - 4px)">');
	$('.thumbinner').css('width','');
}
if ($('[title="File:TryAPL"]').length) {
	$('[title="File:TryAPL"]').replaceWith('<iframe src="https://tryapl.org" style="height:350px;width:calc(100% - 4px)">');
	$('.thumbinner').css('width','');
}
if ($('[title="File:Omnibar"]').length) {
	$('[title="File:Omnibar"]').replaceWith('<iframe src="https://omnibar.rubenverg.com/" style="height:350px;width:calc(100% - 4px)">');
	$('.thumbinner').css('width','');
}