User:Dixtosa/link to GED.js

$( => {	const pageName = mw.config.values.wgPageName;	if ($("h2 span.mw-headline#Georgian").length > 0 || $("h2 span.mw-headline#Old_Georgian").length > 0 || mw.config.values.wgRelevantArticleId == 0)	{		addToRightVectorTabs("ena.ge", get_ena_ge);		addToRightVectorTabs("translate.ge", get_translate_ge);	}	else if ($("h2 span.mw-headline#English").length > 0)		addToRightVectorTabs("translate.ge", get_translate_ge);	function addToRightVectorTabs(title, link) {		let description = "გადადი ამ საიტზე და შეამოწმე ეს ტერმინი";		mw.util.addPortletLink('p-views', link, title, 'ca-' + title.replace(".", "-"), description, null, "#ca-view");	}	function get_translate_ge {		const base = "http://translate.ge/word/";		return base + pageName;	}	function get_ena_ge {		const base = "http://ena.ge/explanatory-online?ls=";		const phpobj = 'a:2:{s:12:"word_metauri";s:' + 3 * pageName.length + ':"' + pageName + '";s:11:"word_statia";s:0:"";}'; const php_base64 = btoa(unescape(encodeURIComponent(phpobj))); return base + php_base64; } });