Usuario:Vriullop/common.js

Na Galipedia, a Wikipedia en galego.
Revisión feita o 23 de xaneiro de 2014 ás 07:43 por Vriullop (conversa | contribucións) (+)
function LinkFA() {
    if ( document.getElementById( 'p-lang' ) ) {
        var InterwikiLinks = document.getElementById( 'p-lang' ).getElementsByTagName( 'li' );
 
        for ( var i = 0; i < InterwikiLinks.length; i++ ) {
            var className = InterwikiLinks[i].className.match(/interwiki-[-\w]+/);
            if ( document.getElementById( className + '-fa') ) {
                InterwikiLinks[i].className += ' FA';
                InterwikiLinks[i].title = 'Este é un artigo de calidade noutra lingua.';
            } else if ( document.getElementById( className + '-ga') ) {
                InterwikiLinks[i].className += ' GA';
                InterwikiLinks[i].title = 'Este é un artigo bo noutra lingua.';
            }
        }
    }
}

mw.hook( 'wikipage.content' ).add( LinkFA );