User:Dixtosa/missing translations.js

//Description: inserts a random word from User:Ungoliant MMDCCLXIV/missing translations type of lists to the left of "pt-userpage".

$( => {	function loadData{		if (localStorage[missingURL] === undefined)			return $.get(mw.util.wikiScript('index'), { action: 'raw', title: missingURL }, function(response) { localStorage[missingURL] = response; return response; });		else			return Promise.resolve(localStorage[missingURL]);	}	let missingLink = "User:Ungoliant MMDCCLXIV/missing translations";	let missingLang = "ka";	let missingURL = missingLink + "/" + missingLang;

loadData(missingURL).then(data => {		let rnd = Math.floor(Math.random * 3000);		let rnd_term = $.trim(data.split("# ")[rnd]).replace ("", "").replace ("", "");		let link_rnd_term = rnd_term.replace("(", "").replace(")", "").replace("(", "").replace(/\d/g, ""); mw.util.addPortletLink('p-personal', mw.util.getUrl(link_rnd_term), rnd_term, 'pt-missing', "0idea", "", "#pt-kaRecentChanges"); $("[title=0idea]").css({color:"red"}); //LOL }); });