User:ARandomCitizen/common.js

importArticles({  	type: 'script',   	articles: [		'u:dev:MediaWiki:MassNullEdit/code.js',		'u:dev:MediaWiki:PPDataModule.js',		'u:dev:MediaWiki:SyntaxHighlight.js'	] });

$( function {	if ((mw.config.get('wgCategories').includes('Items')) || (mw.config.get('wgCategories').includes('Mutations'))) {		$.when( $('.portable-infobox').append(				$(' ',{ 'class': 'pi-data', 'style': 'justify-content:center' }).append( $('', {						id: 'pi-sequence',						'style': 'cursor:pointer',						text: 'Show ID'					}) )			)		).done(function { $("#pi-sequence").click(function {				new mw.Api.get({ action: "query", prop: "revisions", titles: mw.config.get("wgPageName"), rvslots: '*', rvprop: 'content', format: "json", formatversion: 2 }).done(function(data){ var content = data.query.pages[0].revisions[0].slots.main.content; var res = content.match(/\|\s*id\s*\=\s*\d+/g); var seq = 'blank'; if (res !== null) { seq = res[0].match(/\d+/g); }					$('#pi-sequence').replaceWith(' ' + seq + ' '); });			});		});	} });

$(function {	$.when( $('.spoiler-test').each(function {			$(this).css({'position': 'relative'});			$(this).append( $(' ').append(					$(' ', { text: ' Spoiler alert!' }).prepend( $(' ', {							'src': 'https://static.wikia.nocookie.net/deadcells_gamepedia_en/images/c/c0/Exclamation.png/revision/latest/scale-to-width-down/15?cb=20210304214608'						}) ).css({'color': '#d1394e', 'font-weight': 'bold', 'font-size': '20px'}),					$('', { 'class': 'spoiler-text', href: 'javascript:void(0)', text: 'Tap to reveal' })				).css({'position': 'absolute', 'inset': '0px', 'background-color': 'black', 'display': 'flex', 'justify-content': 'center', 'flex-flow': 'column wrap', 'align-items': 'center'}) );		})	).done(function { $('.spoiler-text').click(function {			$(this).parent.fadeOut("400", function { $(this).remove; });		});	}); } );