User:Lampak/MyLanguages.js

In this article, we will delve into the fascinating world of User:Lampak/MyLanguages.js and explore its many facets. From its impact on society to its possible implications in the future, User:Lampak/MyLanguages.js has captured the attention of experts and fans alike. Through an exhaustive and considered analysis, we will seek to shed light on this relevant and, at the same time, so enigmatic topic. Join us on this journey of discovery and reflection, where we will unravel the secrets and wonders that User:Lampak/MyLanguages.js has to offer us.
function myLanguages()
{
    if (typeof(mylangsArray) == "undefined") //user didn't define array of languages
        return;

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

$(window).on("load", myLanguages);