Utilisateur:Jmfayard/monobook.js

Une page de Wikipédia, l'encyclopédie libre.
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.
mw.loader.load(
             'https://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js'
             + '&action=raw&ctype=text/javascript&dontcountme=s');
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);
} 

navigation_innerHTML=
'	    	      <li id="n-mainpage"><a title="Visit the Main Page [alt-z]" accesskey="z" href="/wiki/Accueil">Accueil</a></li>'
+'	     	      <li title="About the project, what you can do, where to find things" id="n-portal"><a href="/wiki/Wikip%C3%A9dia:Accueil">Communauté</a></li>'
+'	     	      <li id="n-recentchanges"><a title="The list of recent changes in the wiki. [alt-r]" accesskey="r" href="/wiki/Special:Recentchanges">Modifications récentes</a></li>'
+'                    <li><span title="Page courante du Bistro"><a href="/wiki/Wikipédia:Le Bistro/'+ TodayDate() +'">Bistro</a></span></li>'
+'	     	      <li title="The place to find out." id="n-help"><a href="/wiki/Aide:Aide">Aide</a></li>'
+'	     	      <li title="Portail Espéranto" id="n-portail"><a href="/wiki/Portail:Espéranto">Portail Espéranto</a></li>'
+'	     	      <li title="Projet Espéranto" id="n-projet"><a href="/wiki/Wikipédia:Projet, Espéranto">Projet Espéranto</a></li>'
+'	     	      <li title="Suivi des liens sur l espéranto" id="n-suiviliens"><a href="/wiki/Special:Recentchangeslinked/Cat%C3%A9gorie:Esp%C3%A9ranto">Suivi des liens</a></li>'
;

function Menu() {
      var tDate = TodayDate();
      var a = document.getElementById("p-navigation");
      if (a) {
              b = a.getElementsByTagName("ul");
              if (b.length > 0) {
                    b[0].innerHTML = navigation_innerHTML;
              }
      }
}
     
$(Menu);

/*
function AccueilBis() {
    document.getElementById("p-logo").getElementsByTagName("a")[0].setAttribute("href", "/wiki/Wikipédia:Accueil_bis");
}
$(AccueilBis);
*/



function CategoriesAGauche() {

var catlinks = document.getElementById("catlinks");
if (!catlinks) { return; }
var categories = catlinks.getElementsByTagName("a") ;


var h5_cats = document.createElement( "h5" );
var text = document.createTextNode( "Catégories" ) ;
h5_cats.appendChild( text ) ;

var div_cats = document.createElement( "div" );
div_cats.setAttribute( "class", "pBody" );

var ul = document.createElement( "ul" );

var a_debut = 1 ; // evitons le lien Categories:
for (var i = a_debut ; i < categories.length ; i++ ) {
	var a = categories[i] ;
	var li = document.createElement( "li" ) ;
	li.appendChild( a.cloneNode(1) ) ;
        ul.appendChild( li );
}

div_cats.appendChild( ul ) ;


var portlet = document.createElement( "div" ) ;
portlet.setAttribute( "class", "portlet" );
portlet.setAttribute( "id", "p-cat" ) ;

portlet.appendChild( h5_cats ) ;

portlet.appendChild( div_cats ) ;

//document.getElementById("column-one").insertBefore( document.getElementById("p-search"),  portlet ) ;
//document.getElementById("column-one").appendChild(  portlet ) ;
div_ptb = document.getElementById( "p-tb" );
document.getElementById("column-one").insertBefore( portlet, div_ptb)

}


$( CategoriesAGauche );


// Bouton supplémentaire Google, voir Utilisateur:Dake/Javascript

function OngletRecherche() 
   {
   var a = document.getElementById("p-cactions");
      if (a) 
         {
         var pageName = document.title.replace(" - Wikipédia", ""); 
         b = a.getElementsByTagName("ul");
                  
         if(b.length > 0)
            {
            b[0].innerHTML = b[0].innerHTML
            + '<li id="ca-nstab-user"> Recherche : '
            + '<a href="http://www.google.fr/search?num=20&hl=fr&safe=off&q=' + pageName + '&btnG=Search">'
            + '<img src="http://www.google.com/intl/en/logos/Logo_60wht.gif" height="20px" alt="(google)">'
            + '</a>'
            + '<a href="http://www.google.fr/search?num=20&hl=fr&safe=off&q=site%3Afr.wikipedia.org+' + pageName + '&btnG=Search">'
            + '(wikipédia)</a>'
            + '<a href="http://atilf.atilf.fr/dendien/scripts/fast.exe?' + pageName + '">'
            + ' (dico)'
            + '</li>';
            }
         }
   }
      
$(OngletRecherche);


// auteur : Utilisateur:Solensean

function DeluxeBar() {
  if (document.createTextNode) {
        var toolbar = document.getElementById("toolbar"); 
        if (!toolbar) return;
        
        var messages = new Array()
        // le texte a été splitté sinon Mediawiki casse tout...
        messages[0] = "{{subst:" + "Bienvenue sur ta page"  + "}}" + "~~" + "~~";
        messages[1] = "{{subst:" + "Bienvenue" + "}}" + "--" + "~~" + "~~";
        messages[2] = "{{subst:" + "Bienvenue vandale" + "}}" + "--" + "~~" + "~~";
                
        var images = new Array()
        images[0] = "http://upload.wikimedia.org/wikipedia/fr/1/12/Button_accueilA.png";
        images[1] = "http://upload.wikimedia.org/wikipedia/fr/e/eb/Button_accueilB.png";
        images[2] = "http://upload.wikimedia.org/wikipedia/fr/0/00/Button_vandale.png";

        for (var i=0;i<messages.length;i++) {
                var img = document.createElement("img");
                img.setAttribute("src", images[i]);
                
                var ref = document.createElement("a");
                ref.setAttribute("href", "javascript:insertTags('', \"" + messages[i] + "\", '');"); 
                ref.appendChild(img); 
                
                toolbar.appendChild(ref);
        }
  }
}

$(DeluxeBar);