Note : après avoir enregistré la page, vous devrez forcer le rechargement complet du cache de votre navigateur pour voir les changements.

Mozilla / Firefox / Konqueror / Safari : maintenez la touche Majuscule (Shift) en cliquant sur le bouton Actualiser (Reload) ou pressez Maj-Ctrl-R (Cmd-R sur Apple Mac) ;

Chrome / Internet Explorer / Opera : maintenez la touche Ctrl en cliquant sur le bouton Actualiser ou pressez Ctrl-F5.
importScript('User:EDUCA33E/LiveRC.js');
importScript('Utilisateur:Darkoneko/nekotb_fc_1.0.js')
importScript('User:Lupin/recent2.js');
importScript('User:AzaToth/twinkle.js');
importScript('Utilisateur:Stef48/revocation.js');

importScript(":en:User:Csewiki/monobook.js");
document.write('<link rel="stylesheet" type="text/css" href="http://en.wikipedia.org/w/index.php?' +
  'title=User:Csewiki/monobook.css&action=raw&ctype=text/css"><\/link>');


/* Ci-dessous la fonction permettant de cacher des sections de texte par simple click http://darkoneko.wordpress.com/2010/03/10/personnalisons-wikipedia-enroulerderouler-des-sections-v2/ */
/* ajoute une classe à un element */
function addClass(elem,classe) {
  elem.className += " "+classe;
}

/* enlève la premiere occurence du nom d'une classe d'un element */
function removeClass(elem,classe) {
    var reg = new RegExp('(\\s|^)'+classe+'(\\s|$)');
    elem.className=elem.className.replace(reg,' '); //ne replace que la premiere occurence (comme ça les hide imbriqués restent en hide ^^)
}

/* Cette fonction ajoute un "onclick" sur chaque titre, qui lancera un appel à toggleTitle() lors d'un clic sur ceux ci */
function ImplementToggleOnclick() {
   for( var titleLevel = 1 ; titleLevel <= 6 ; titleLevel++) { //tous les h1, h2 ... h6
      var titleList = document.getElementsByTagName('h' + titleLevel)
      var nb = titleList.length
      for( var a = 0 ; a < nb ; a++) {
          titleList[a].setAttribute('onclick', "toggleTitle(this)");
      }
   }
  //pour que ça ne se replie pas quand on clique sur un bouton modifier, on annule l'event au niveau du lien
  var editLinkList = document.getElementsByClassName('editsection')
  nb = editLinkList.length
  for( a = 0 ; a < nb ; a++) {
     editLinkList[a].setAttribute('onclick', "event.cancelBubble=true;");
  }
}
$(ImplementToggleOnclick)

/* Cette fonction, quand invoquée, fait disparaitre ou réaparaitre le contenu placé sous un titre jusqu'au prochain titre de niveau egal ou supérieur
(= un h3 s'arrete au prochain h2 ou h3 mais continuera s'il rencontre un h4 ou h5) */
function toggleTitle(p_this) {
  var titre_niveau = p_this.nodeName.substring(1,2) //le x de hx (1 de h1, etc.)

  //construction de l'expression reguliere permettant le trouver le prochain titre de niveau égal ou supérieur
  var stopMatch = "(h1"
  for(var niveau = 2 ; niveau  stop
       if( nextSiblingNode.style && nextSiblingNode.nodeName != 'SCRIPT' ) addClass(nextSiblingNode, "hidden") //ne pas affecter les nodes texte ni script
       nextSiblingNode = nextSiblingNode.nextSibling //on passe au voisin suivant
    }
  } else { //il faut déplier
    p_this.className = ""

    while( nextSiblingNode ) {
       if( nextSiblingNode.nodeName.match(regex_stopMatch) ) break;
       if( nextSiblingNode.style && nextSiblingNode.nodeName != 'SCRIPT' ) removeClass(nextSiblingNode, "hidden")
       nextSiblingNode = nextSiblingNode.nextSibling
    }
  }
}

/**
 * Fusion d'historiques
 *
 * Fusionne les historiques de plusieurs contributeurs
 *
 * Auteur : Marc Mongenet
 * Dernière révision : 24 mai 2007
 * {{Projet:JavaScript/Script|FusionContribs}}
 */
 
// Fusion display of Wikipedia user contributions history
// Copyright 2006, 2007, Marc Mongenet
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// See http://www.gnu.org/licenses/gpl.html
 
// TODO: Special:Log
 
var fusioncontribsFus = new Object(); // fusioncontribsFus is used as namespace.
fusioncontribsFus.main_contributor = undefined; // main contributor name
fusioncontribsFus.contributors_list = new Object(); // XHTML list of contributors
fusioncontribsFus.contribs_limit = 0; // 0 means default value
fusioncontribsFus.count = 0; // number of fusionned contribs
fusioncontribsFus.colors = [ "", "#FFB", "#FBF", "#BFF", "#DDF", "#DFD", "#FDD",
                             "#EEA", "#EAE", "#AEE", "#CCE", "#CEC", "#ECC",
                             "#DD9", "#D9D", "#9DD", "#BBD", "#BDB", "#DBB" ];
 
fusioncontribsFus.contributors_list.init = function() {
        this.elm = document.createElement("ol");
}
 
fusioncontribsFus.contributors_list.add = function(contributor) {
        // UI components
        var li = document.createElement("li");
        li.fusioncontribsFus = new Object();
        li.fusioncontribsFus.contributor = contributor;
        li.style.backgroundColor = fusioncontribsFus.colors[fusioncontribsFus.count];
 
        var aContributor = document.createElement("a");
        aContributor.href = mw.config.get('wgServer') + mw.config.get('wgArticlePath').split("$1").join(mw.config.get('wgFormattedNamespaces')[2]+":"+contributor.replace(/_/g, " "));
        aContributor.title = mw.config.get('wgFormattedNamespaces')[2]+":"+decodeURIComponent(contributor).replace(/_/g, " ");
        aContributor.appendChild(document.createTextNode(decodeURIComponent(contributor).replace(/_/g, " ")));
 
        var aTalk = document.createElement("a");
        aTalk.href = mw.config.get('wgServer') + mw.config.get('wgArticlePath').split("$1").join(mw.config.get('wgFormattedNamespaces')[3]+":"+contributor.replace(/_/g, " "));
        aTalk.title = mw.config.get('wgFormattedNamespaces')[3]+":"+decodeURIComponent(contributor).replace(/_/g, " ");
        aTalk.appendChild(document.createTextNode("d"));
 
        var aContribs = document.createElement("a");
        aContribs.href = mw.config.get('wgServer') + mw.config.get('wgArticlePath').split("$1").join("Special:Contributions/"+contributor.replace(/_/g, " "));
        aContribs.title = "Special:Contributions/"+decodeURIComponent(contributor).replace(/_/g, " ");
        aContribs.appendChild(document.createTextNode("c"));
 
        var aEditcount = document.createElement("a");
        aEditcount.href = "http://toolserver.org/~soxred93/pcount/index.php?lang=fr&wiki=wikipedia&name=" + decodeURIComponent(contributor).replace(/_/g, "+");
        aEditcount.title = "Editcount de "+decodeURIComponent(contributor).replace(/_/g, " ");
        aEditcount.appendChild(document.createTextNode("e"));
 
        li.appendChild(aContributor);
        li.appendChild(document.createTextNode(" ("));
        li.appendChild(aTalk);
        li.appendChild(document.createTextNode("|"));
        li.appendChild(aContribs);
        li.appendChild(document.createTextNode("|"));
        li.appendChild(aEditcount);
        li.appendChild(document.createTextNode(")"));
        this.elm.appendChild(li);
}
 
fusioncontribsFus.monthNameToNum = function(m) {
        if (m == "janvier") return 0;
        if (m == "février") return 1;
        if (m == "mars") return 2;
        if (m == "avril") return 3;
        if (m == "mai") return 4;
        if (m == "juin") return 5;
        if (m == "juillet") return 6;
        if (m == "août") return 7;
        if (m == "septembre") return 8;
        if (m == "octobre") return 9;
        if (m == "novembre") return 10;
        if (m == "décembre") return 11;
        return 12;
}
 
 
// Return Date of contribution listed in this li element.
fusioncontribsFus.contribTimeRegex = /(\d+)\s+(\S+)\s+(\d{4})\D+(\d+)\D+(\d{2})/;
fusioncontribsFus.parseContribTime = function(li) {
        var HTML = li.querySelector('.mw-changeslist-date').textContent;
        var datetime = HTML.match(fusioncontribsFus.contribTimeRegex);
        if(datetime==null) alert("Erreur lors de la récupération de date : \nContacter le Projet:JavaScript\n\n"+HTML);
        datetime[2] = fusioncontribsFus.monthNameToNum(datetime[2]);
        return new Date(parseInt(datetime[3]),
                            datetime[2],
                        parseInt(datetime[1]),
                        parseInt(datetime[4], 10),
                        parseInt(datetime[5], 10));
}
 
fusioncontribsFus.fuse = function(ul1, ul2, contributor, color) {
        contributor = " -- " + contributor;
        var li1 = ul1.firstChild;
        for (var li22 = ul2.firstChild; li22; li22 = li22.nextSibling) {
                if (li22.nodeType == 1) {
                        var li2 = li22.cloneNode(true);
                        li2.appendChild(document.createTextNode(contributor));
                        li2.style.backgroundColor = color;
                        var time2 = fusioncontribsFus.parseContribTime(li2).getTime();
 
                        while (li1) {
                                if (li1.nodeType == 1) {
                                        var time1 = fusioncontribsFus.parseContribTime(li1).getTime();
                                        if (time1 <= time2) {
                                                if (time1 == time2) {
                                                        li1.style.borderLeftWidth = li2.style.borderLeftWidth = "0.25em";
                                                        li1.style.borderLeftStyle = li2.style.borderLeftStyle = "solid";
                                                        li1.style.borderLeftColor = li2.style.borderLeftColor = "red";
                                                }
                                                break;
                                        }
                                }
                                li1 = li1.nextSibling;
                        }
                        ul1.insertBefore(li2, li1);
                }
        }
}
 
fusioncontribsFus.getElementById = function(elm, id) {
        var res = null;
        if (elm.id == id) res = elm;
        for (var child = elm.firstChild; !res && child; child = child.nextSibling)
                if (child.nodeType == 1)
                        res = fusioncontribsFus.getElementById(child, id);
        return res;
}
 
fusioncontribsFus.onFusionWith = function(contributor) {
        ++fusioncontribsFus.count;
        fusioncontribsFus.contributors_list.add(contributor);
 
        // Load fusionned page with synchronous XMLHttpRequest
        var http_request;
        if (window.XMLHttpRequest) { // Mozilla, Safari, ...
                http_request = new XMLHttpRequest();
                if (http_request.overrideMimeType)
                        http_request.overrideMimeType('text/xml');
        } else if (window.ActiveXObject) { // IE
                try {
                        http_request = new ActiveXObject("Msxml2.XMLHTTP");
                } catch (e) {
                        try {
                                http_request = new ActiveXObject("Microsoft.XMLHTTP");
                        } catch (e) {}
                }
        }
        http_request.open('GET', "/w/index.php?title=Sp%C3%A9cial:Contributions&target="+contributor+"&limit="+fusioncontribsFus.contribs_limit, false);
        http_request.send(null);
 
        // Get both contributions histories
        var ul1 = document.getElementById("bodyContent");
        ul1 = ul1.getElementsByTagName("ul")[0];
 
        var ul2 = http_request.responseXML;
        if (!ul2.getElementById) { // MSIE
                ul2 = document.createElement("div");
                ul2.innerHTML = http_request.responseText;
                ul2 = fusioncontribsFus.getElementById(ul2, "bodyContent");
        } else {
                ul2 = ul2.getElementById("bodyContent");
        }
        ul2 = ul2.getElementsByTagName("ul")[0];
 
        // Fusion
        fusioncontribsFus.fuse(ul1, ul2, contributor, fusioncontribsFus.colors[fusioncontribsFus.count]);
}
 
fusioncontribsFus.parseContribUrlTarget = function(url) {
        var target = url.match(/&target=([^&]+)/);
        if (!target)
                target = url.match(/Sp%C3%A9cial:Contributions\/(\S+)/);
        return target[1];
}
 
fusioncontribsFus.parseContribUrlLimit = function(url) {
        var limit = url.match(/&limit=(\d+)/);
        if (limit)
                return parseInt(limit[1]);
        return 0;
}
 
fusioncontribsFus.onContribPage = function(url) {
        fusioncontribsFus.main_contributor = fusioncontribsFus.parseContribUrlTarget(url);
        fusioncontribsFus.contribs_limit = fusioncontribsFus.parseContribUrlLimit(url);
 
        // UI components
        fusioncontribsFus.contributors_list.init();
        fusioncontribsFus.contributors_list.add(fusioncontribsFus.main_contributor);
 
        var input = document.createElement("input");
        input.type = "text";
 
        var submit = document.createElement("input");
        submit.type = "submit";
 
        var form = document.createElement("form");
        form.onsubmit = function() {
                fusioncontribsFus.onFusionWith(input.value);
                return false;
        }
 
        // UI components layout
        submit.value = "Fusionner";
        var fusion = document.createTextNode("Fusionner avec les contributions de ");
        form.appendChild(fusion);
        form.appendChild(input);
        form.appendChild(submit);
        var bodyContent = document.getElementById("bodyContent");
        bodyContent.insertBefore(form, bodyContent.firstChild);
        bodyContent.insertBefore(fusioncontribsFus.contributors_list.elm, bodyContent.firstChild);
}
 
fusioncontribsFus.testForContribPage = function() {
        if (mw.config.get('wgCanonicalSpecialPageName') == "Contributions") {
                try {
                        fusioncontribsFus.onContribPage(window.location.href);
                } catch (e) { /* Something went wrong. */ }
        }
}
 
$(fusioncontribsFus.testForContribPage);