Aller au contenu

Utilisateur:Guérin Nicolas/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) ;

Firefox (sur GNU/Linux) / Chrome / Internet Explorer / Opera : maintenez la touche Ctrl en cliquant sur le bouton Actualiser ou pressez Ctrl-F5.
// Fait disparaître la boite "contribuer" à gauche
$(function (){document.getElementById('p-Contribuer').style.display="none";})

// Utilisation de monobook d'autres utilisateur -> A travailler! Surtout options LiveRC
importScript('Utilisateur:EDUCA33E/LiveRC.js');
//importScript('Utilisateur:Tavernier/sous1/JS');

// POPUPS : Fenêtre de prévisualisation popups, prise depuis [[:en:User:Lupin/popups.js]]
// Traduction de [[Utilisateur:Leag|Leag]] : [[Utilisateur:Leag/Navigation popups|Navigation popups]]
importScript('MediaWiki:Gadget-Popups.js');


//-------------------------//
// ÉVALUATION DES ARTICLES //
//-------------------------//

// Barre d'évaluation pour [[WP:1.0]] : récupéré depuis [[Utilisateur:Kelson/monobook.js]]
document.write('<script type="text/javascript" src="' 
             + 'http://fr.wikipedia.org/w/index.php?title=Utilisateur:Kelson/evalbar.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

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("Pyrénées")
        evalProjectNames.push("Géologie")
        evalProjectNames.push("Préhistoire")
        evalProjectNames.push("Histoire")  
        evalProjectNames.push("Physique") 
        evalProjectNames.push("Archéologie")
        evalProjectNames.push("Histoire des sciences")
        evalProjectNames.push("OEV")
        evalProjectNames.push("Botanique")
        evalProjectNames.push("Zoologie")
}


//--------------------//
// ESPACE UTILISATEUR //
//--------------------//

// Lien vers les sous-pages dans l'espace utilisateur 
function SousPages() 
      {
        var a = document.getElementById("p-personal");
        if (a) 
        {
          b = a.getElementsByTagName("ul");
          if(b.length > 0)
          {
            b[0].innerHTML = b[0].innerHTML
            + '<li id="ca-nstab-user">'
            + '<a href="/wiki/Sp%C3%A9cial:Index/Utilisateur:Gu%C3%A9rin_Nicolas">'
            + 'Sous-pages</a></li>';
          }
        }
      }
$(SousPages);


//-----------------------//
// FENÊTRE DE NAVIGATION //
//-----------------------//

// Lien vers des pages pour maintenance
function Navigation_Maintenance() 
{
  var a = document.getElementById("p-navigation");
  if (a) 
  {
    b = a.getElementsByTagName("ul");
    if(b.length > 0)
    {
      b[0].innerHTML = b[0].innerHTML
      + '<li><span id="n-LiveRC" title="Maintenance LiveRC">'
      + '<a href="/wiki/Utilisateur:EDUCA33E/LiveRC">LiveRC</a>'
      + '</span> + <span id="n-Bistro" title="Bistro">'
      + '<a href="/wiki/Wikip%C3%A9dia:Le_Bistro">Bistro</a>'
      + '</span></li>'
      + '<li><span id="n-Wikidata" title="Wikidata">'
      + '<a href="https://www.wikidata.org/wiki/User:Gu%C3%A9rin_Nicolas">Wikidata</a>'
      + '</span> + <span id="n-Wikipedia" title="Commons">'
      + '<a href="https://commons.wikimedia.org/wiki/User:Gu%C3%A9rin_Nicolas">Commons</a>'
      + '</span></li>'
    }
  }
}
$(Navigation_Maintenance);


//---------//
// ONGLETS //
//---------//


//Recherche Commons
function addSearchCommons()
{
  var histo = document.getElementById("ca-history");
  if(histo)
  {
    var lien = document.createElement("a");
    
    lien.setAttribute("href", "http://commons.wikimedia.org/w/index.php?title=Special%3ASearch&search=" + mw.config.get('wgPageName') + "&fulltext=Rechercher");
    lien.appendChild(document.createTextNode("C2"));
 
    var stats = document.createElement("li");
    stats.setAttribute("id", "ca-stats");
    stats.appendChild(lien);
 
    histo.parentNode.insertBefore(stats, histo.nextSibling);
  }
}
 
$(addSearchCommons);


//Recherche Catégorie Commons
function addCatCommons()
{
  var histo = document.getElementById("ca-history");
  if(histo)
  {
    var lien = document.createElement("a");
    
    lien.setAttribute("href", "http://commons.wikimedia.org/wiki/Category:" + mw.config.get('wgPageName'));
    lien.appendChild(document.createTextNode("C1"));
 
    var stats = document.createElement("li");
    stats.setAttribute("id", "ca-stats");
    stats.appendChild(lien);
 
    histo.parentNode.insertBefore(stats, histo.nextSibling);
  }
}
 
$(addCatCommons);


//Recherche Flickr
function addSearchFlickr()
{
  var histo = document.getElementById("ca-history");
  if(histo)
  {
    var lien = document.createElement("a");
    
    lien.setAttribute("href", "https://www.flickr.com/search/?license=4%2C5%2C9%2C10&advanced=1&text=" + mw.config.get('wgPageName') );
    lien.appendChild(document.createTextNode("Flickr"));
 
    var stats = document.createElement("li");
    stats.setAttribute("id", "ca-stats");
    stats.appendChild(lien);
 
    histo.parentNode.insertBefore(stats, histo.nextSibling);
  }
}
 
$(addSearchFlickr);


// Onglet pour ouvrir le {{todo}}/'À faire' de l'article
function editerSousPageArticleAFaire() {
  var urlRegexp = /\/wiki\//;
  var url = self.location.pathname.split('&')[0].replace(urlRegexp, "/w/index.php?title=Discuter:");
  var a = document.getElementById("p-cactions");
  if (a) {
    b = a.getElementsByTagName("ul");
    if(b.length > 0) {
      b[0].innerHTML = b[0].innerHTML
      + '<li><a href="' + url + '/%C3%80_faire&action=edit">td</a></li>';  
    }
  }
}
$(editerSousPageArticleAFaire);