MediaWiki:Common.js: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
Miraheze>Adám Brudzewsky
No edit summary
(Add Omnibar)
 
(10 intermediate revisions by 4 users not shown)
Line 5: Line 5:
});
});
}
}
if ($(".crossword").length){
if ($('.image[href="/wiki/File:APLcart.png"]').length) {
$(".crossword .n,.crossword .e").html("<input maxlength=1 onfocus=this.select() oninput=this.select() value=' '>");
$('.image[href="/wiki/File:APLcart.png"]').replaceWith('<iframe src="https://aplcart.info?w" style="height:38vh;width:calc(100% - 4px)">');
    $(".puzzle").append("<button>Check</button>").on("click","button",function(){alert(["Wrong!","Right!"][+/V-¯1↓0[,⍪]V\)A\(÷10∊NMV←⎕\+[\\⍀][⌽⊖]-MB\+A⍳A[\/⌿]V⍳T11[\/⌿]R⍴VV⌊99\(0∊SN∊\.12⊥YMVV25×V\+×N\|K\)\+∘\.×V⍳9[\/⌿]\(M[∧^×]\.=V\)⍳1,⎕\(\/\+N20×M[Aa]\(3×⍳9\)\+7[≢⍴],[Vv]\(2⍴5\)⍴1[,⍪]5⍴0/.test($(".crossword input").map(function(_,i){i.value}).toArray().join(""))])});
$('.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','');
}
}

Latest revision as of 13:19, 15 February 2024

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','');
}