User:Zocky/LanguageLinks.js

/*
 * LanguageLinks.js
 * Changes the text of language links in the sidebar,
 * by replacing the name of the language with the code
 * of the language and the name of the linked page,
 * changing the language box into an ersatz multi-lingual
 * dictionary.
 * dictionary.

// wait for everything to load addOnloadHook(function {

// get the language portlet langs = document.getElementById('p-lang');

// proceed only if the language portlet exists if(langs) { // get the links var lnks=langs.getElementsByTagName('a');

// start building the replacement table var html = ' '; //insert it into the first div in the portlet langs.getElementsByTagName('div')[0].innerHTML=html }; });