Utilisateur:Tieum512/monobook.js

Un article de Wikipédia, l'encyclopédie libre.

Note : Après avoir publié la page, vous devrez forcer son rechargement pour voir les changements : Mozilla / Konqueror / Firefox : Shift-Ctrl-R, Internet Explorer / Opera : Ctrl-F5, Safari : Cmd-R.

 
 /* D'après DainDwarf*/
 /* <pre> <nowiki> */
 /*Pour avoir la date du jour*/
 function TodayDate() {
     m = new Array("janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre");
     today = new Date();
     day = today.getDate();
     year = today.getYear();
     if (year < 2000)    
          year = year + 1900;
     return (day + " " + m[today.getMonth()] + " " + year);
 }
 
 /*Ajout d'une boite sur le cote, avec des liens*/
 function addLoadEvent(func) {
         if (window.addEventListener) {
             window.addEventListener("load", func, false);
         } else if (window.attachEvent) {
             window.attachEvent("onload", func);
         }
      }
 
      function nouvelleBoite() {
        var l = document.getElementById("column-one");
        if (l) {
          l.innerHTML = l.innerHTML
          + '<div class="portlet" id="p-nbx">'
          + ' <h5>Boîte personnelle</h5>'
          + ' <div class="pBody">'
          + '   <ul>'
          + '     <li><a href="http://fr.wikipedia.org/wiki/Wikipédia:Le_Bistro/' + TodayDate() + '">Le Bistro du jour</a></li>'
          + '     <li><a href="http://fr.wikipedia.org/wiki/WP:PaS">WP:PaS</a></li>'
          + '     <li><a href="http://fr.wikipedia.org/Wikipedia:Proposition%20articles%20de%20qualit%C3%A9">WP:pAdQ</a></li>'
          + '     <li><a href="http://fr.wikipedia.org/wiki/WP:BA">WP:BA</a></li>'
          + '     <li><a href="/wiki/Wikipédia:Requête aux administrateurs">Requêtes</a></li>'
          + '     <li><a href="/wiki/Special:Shortpages">Articles courts</a></li>' 
          + '     <li><a href="/wiki/Special:Log">Journaux</a></li>'                      
          + '     <li><a href="http://fr.wikipedia.org/wiki/Utilisateur:EDUCA33E/LiveRC">LiveRC de EDUCA33E</a></li>'
          + '     <li><a href="http://fr.wikipedia.org/wiki/Utilisateur:Maloq/AdvancedContribs">Suivi des utilisateurs de Maloq</a></li>'
          + '   </ul>'
          + ' </div>'
          + '</div> ';
        }
      }
      addLoadEvent(nouvelleBoite);
 /* </nowiki> </pre> */
 
 
 /**************************************************************/
 /* Ajoute un lien Google sur les liens rouges                 */
 /* Auteur original : Seb35                                    */
 /* Modifications pour IE/Firefox : Dake                       */
 /**************************************************************/
 function liensRouges_main()
 {
 if(/Spe[cz]ial(?::|%3A)Watchlist/i.test(window.location) || /edit/i.test(window.location)) return;
 var allLinks = document.getElementById('bodyContent').getElementsByTagName('a');
 for(i=0; i<allLinks.length; i++)
 {
  if(allLinks[i].getAttribute('class') == 'new')
  {
   titre = allLinks[i].getAttribute('title');
 
   var newElementOutside = document.createElement("sup");
 
   var newElement = document.createElement("a");
   newElement.setAttribute("title",'Rechercher \'' + titre + '\'');
   newElement.setAttribute("href", 'http://www.google.com/search?num=100&q=' + titre + '+site:fr.wikipedia.org');
   newElement.appendChild(document.createTextNode(" g "));
 
   newElementOutside.appendChild(newElement);
   insertAfter( allLinks[i].parentNode, newElementOutside, allLinks[i]);
   }
  }
 }
 addLoadEvent(liensRouges_main);
 
 
// Auteur : Anakin
// Dernière mise à jour : 11 décembre 2005
 
function CategoryTree()
{
  var element = document.getElementById('ca-nstab-category');
  if (element)
  {
    var categoryname = element.firstChild.href;
    categoryname = categoryname.substring(7);
 
    var wikiname = categoryname.substring(0, categoryname.indexOf('.'));
 
    var indexofname = categoryname.indexOf(":") + 1;
    categoryname = categoryname.substring(indexofname);
 
    var indexofampersand = categoryname.indexOf("&");
    if (indexofampersand != -1)
      categoryname = categoryname.substring(0, indexofampersand);
 
    var li = document.createElement('li');
    li.id = 'ca-categorytree';
 
    var a = document.createElement('a');
    a.appendChild(document.createTextNode("Arborescence"));
    a.href = 'http://tools.wikimedia.de/~daniel/WikiSense/CategoryTree.php?wikilang=fr&wiki=' + wikiname + '&art=on&cat=' + categoryname;
 
    li.appendChild(a);
 
    document.getElementById('ca-nstab-category').parentNode.appendChild(li);
  }
}
 
addLoadEvent(CategoryTree);
loadJs('Utilisateur:EDUCA33E/LiveRC.js');
 
 
/* ****************************************** */
/* EDUCA33E : 23/03/06                        */
/* MAJ : 08/07/06                             */
/* Fonction de remplacement automatisé        */
/* à partir des pages search et Whatlinkshere */
/* et Catégorie (lettre par lettre)           */
/* ****************************************** */
/* searchreplace */
document.write('<script type="text/javascript" src="' 
             + 'http://fr.wikipedia.org/w/index.php?title=Utilisateur:EDUCA33E/searchreplace.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
function ORTHOPatrol()
{
        if ( window.location.href.indexOf('Search') < 0 && window.location.href.indexOf('Special:Whatlinkshere') < 0 && window.location.href.indexOf('Special:Pages_li%C3%A9es') < 0 && window.location.href.indexOf('Cat%C3%A9gorie:') < 0 && 
window.location.href.indexOf('Image:') < 0) return;        
 
        var page_nom = document.getElementById( 'content' ).getElementsByTagName( 'h1' )[ 0 ];
        var page_name = page_nom.firstChild.nodeValue;
 
        var items, item, ulitems, i, links, user, name, talk, contribs, insertLoc, link;
 
        function NewLink( txt, url, plainlinks, linkColor )
        {
                var a = document.createElement( 'a' );
                a.appendChild( document.createTextNode( txt ) );
                a.href = url;
                if ( plainlinks ) a.className = 'plainlinks';
                if ( linkColor )
                {       if ( typeof linkColor == "string" )
                                        a.style.color = linkColor;
                        else    a.style.color = '#FF0000'; // old default behavior
                }
                return a;
        }
 
ulitems = document.getElementById( 'bodyContent' ).getElementsByTagName( 'ul' );
        for ( w = 0; w < ulitems.length; w++ )
        {
        items = ulitems[w].getElementsByTagName( 'li' );
        for ( i = 0; i < items.length; i++ )
        {
                item = items[ i ];              
                links = item.getElementsByTagName( 'a' );
                user = links[ 0 ]; name = user.firstChild.nodeValue;
                insertLoc = user.nextSibling; // ' newusers '
 
                item.insertBefore( NewLink( '  [S&R]', 'javascript:SearchPrompt();', true, 'green' ), insertLoc );
 
                item.insertBefore( NewLink( '  [Diff]', '/w/index.php?title='+name+'&action=edit&searchreplace=diff', true, 'blue' ), insertLoc );
 
                item.insertBefore( NewLink( '  [Save]', '/w/index.php?title='+name+'&action=edit&searchreplace=save', true, 'red' ), insertLoc );
 
        }
        }
}
if ( window.addEventListener ) window.addEventListener( 'load', ORTHOPatrol, false );
else if ( window.attachEvent ) window.attachEvent( 'onload', ORTHOPatrol );
 
 
var alwaysEval = false; //mettez cette valeur à ''true'' si vous voulez que l'évaluation soit lancée automatiquement (à éviter en temps normal)
function initEvalProjectNames()
{
        evalProjectNames=new Array(); //liste de vos projets
        evalProjectNames.push("Croatie")
        evalProjectNames.push("Politique")
        evalProjectNames.push("Histoire militaire") 
        evalProjectNames.push("Serbie")
 
}