User:ARandomCitizen/common.js

importArticles({  	type: 'script',   	articles: [		'u:dev:MediaWiki:MassNullEdit/code.js',		'u:dev:MediaWiki:MobileWikiTheme.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 + ' '); });			});		});	} });