MediaWiki:Gadget-EditZeroth.js

Jóge Wikipedia.

Karmat : Soo dence xët wi ba noppi, faaw nga far nëmbiitu sa joowukaay ngir man a gis say coppite, te nga, su dee Mozilla / Firefox / Safari : cuq ci yeesal te bësaale shift, walla nga bës Shift-R walla Ctrl-F5 (Command-R ci Mac ), su dee Konqueror: cuq yeesal walla nga bës F5; su dee Opera faral nëbiit li (Jumtukaay → Tànneef) su dee Internet Explorer: cuq ci yeesal te bësaale Ctrl walla nga bës Ctrl-F5.

/*
 * AddEditSection0
 *
 * Permet d'éditer la première section d'une page (en-tête)
 *
 * Auteur : ??
 * Contributeur : Pabix, Zelda
 * Dernière révision : 12 novembre 2006
 * [[Catégorie:MediaWiki:Fonction Monobook en JavaScript]]
 */

function addEditSection0() {
        if (!document.getElementById) {
                return;
        }
        var x = document.getElementById('ca-edit');
        if(!x) {
                return;
        }
        var y = document.createElement('LI');
        y.id = 'ca-edit-0';
        if (x.className == 'selected') {
                if (/&action=edit&section=0$/.test(window.location.href)) {
                        x.className = 'istalk';
                        y.className = 'selected';
                } else {
                        x.className = 'selected istalk';
                }
        } else if (x.className == 'selected istalk') {
                if (/&action=edit&section=0$/.test(window.location.href)) {
                        x.className = 'istalk';
                        y.className = 'selected istalk';
                } else {
                        y.className = 'istalk';
                }
        } else {
                y.className = x.className;
                x.className = 'istalk';
        }
        var z = document.createElement('A');
        if (x.children) {
                z.href = x.children[0].href + '&section=0';
                z.appendChild(document.createTextNode('en-tête'));
                y.appendChild(z);
                x.parentNode.insertBefore(y,x.nextSibling);
        } else {
                z.href = x.childNodes[0].href + '&section=0';
                z.appendChild(document.createTextNode('en-tête'));
                y.appendChild(z);
                x.parentNode.insertBefore(y,x.nextSibling);
        }
}
if ( mw.config.get('wgAction') != "edit" && mw.config.get('wgAction') != "submit" ) {
        $(addEditSection0);
}