User:DutyS12345/common.js

// window.ecpButton = true

window.itemComparisonFormPages = [ "User:DutyS12345/Sandbox21", ];

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:EditorColorPicker.js',        'u:dev:MediaWiki:StickyRailToggler.js',        'u:dev:MediaWiki:ItemComparisonForm.js',        'u:dev:MediaWiki:Chart.js',    ] });

$(function{	mw.hook('wikipage.content').add(function { Array.from(document.getElementsByClassName('damage-comparison-graph')).forEach(function(elem){			var config;			try {				config = JSON.parse(elem.innerHTML);			} catch (error) {				console.log(error);				return;			}			var canvas = document.createElement('canvas');			elem.replaceChildren(canvas);			mw.hook('dev.chart').add(function{ var graph = new Chart(canvas, config); });		});	}); });

$(function {	var title = document.getElementsByClassName('page-header__title')[0];   // console.log(title);	var titleText = title.textContent.trim;    // console.log(titleText);    var href, linkText;    if(titleText.startsWith('Module:')){    	var temp = titleText.match(/^.*\/(.*)$/)[1];        href = 'https://planetside.fandom.com/wiki/' + temp;        linkText = 'Main';    }else{        href = 'https://planetside.fandom.com/wiki/Module:WeaponData/data/' + titleText;        linkText = 'Module:WeaponData';    }	var link = document.createElement('a');	link.setAttribute('href', href);    link.innerHTML = linkText;    link.style['align-self'] = 'end';	title.parentElement.after(link);	note.cssText += 'color:red;background-color:yellow'; });