User:Dixtosa/link to GED.js
Note: You may have to bypass your browser’s cache to see the changes. In addition, after saving a sitewide CSS file such as MediaWiki:Common.css, it will take 5-10 minutes before the changes take effect, even if you clear your cache.
- Mozilla / Firefox / Safari: hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Command-R on a Macintosh);
- Konqueror and Chrome: click Reload or press F5;
- Opera: clear the cache in Tools → Preferences;
- Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-F5.
- This script lacks a documentation subpage. Please create it.
- Useful links: root page • root page’s subpages • links • redirects • your own
$(() => {
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;
}
});