Jump to content

User:Logicwiki/indicLang.js

From Wikipedia, the free encyclopedia
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/*/function indicLanguages()
{
    var mylangsArray = ["hi", "ta", "ml", "kn", "mr", "bn", "te"];

    var first; //element to insert before
 
    for (var i = 0; i < mylangsArray.length; i++)
    {
        var els = getElementsByClassName(document, "*", "interwiki-"+mylangsArray[i]); 
 
        if (els.length == 0) //interwiki not found
            continue; 
 
        var parent = els[0].parentNode; 
 
        if (!first) //first loop run
            first = parent.firstChild;
 
        for (var n = 0; n < els.length; n++)
        {
            alert(els[n].text) 
            /* els[n].style.fontWeight = "bold"; 
 
            if (first == els[n]) //don't move element before itself
                first = first.nextSibling; 
            else
                parent.insertBefore(els[n], first); 
        }
    }
}
 
hookEvent("load", indicLang);
*/