Utilisateur:Alecs.y/monobook.js

Une nouvelle de Wikinews, la source d'informations que vous pouvez écrire.

Note : après avoir publié vos modifications, il se peut que vous deviez forcer le rechargement complet du cache de votre navigateur pour voir les changements.

  • Firefox / Safari : maintenez la touche Maj (Shift) en cliquant sur le bouton Actualiser ou appuyez sur Ctrl + F5 ou Ctrl + R (⌘ + R sur un Mac).
  • Google Chrome : appuyez sur Ctrl + Maj + R (⌘ + Shift + R sur un Mac).
  • Internet Explorer / Edge : maintenez la touche Ctrl en cliquant sur le bouton Actualiser ou pressez Ctrl + F5.
  • Opera : appuyez sur Ctrl + F5.
/*
** Ajout de liens dans la fenêtre navigation
*/
      function nouvelnavigation() 
      {
  var a = document.getElementById("p-navigation");
  if (a)
  {
    b = a.getElementsByTagName("ul");
    if(b.length > 0)
    {
      b[0].innerHTML = b[0].innerHTML
+ '<br>'          
+ '<li><a href="http://fr.wikipedia.org/w/index.php?title=Special:Contributions&limit=50&target=Alecs.y">Contributions Alecs.y</a></li>'
+ '<li><a href="http://fr.wikipedia.org/w/index.php?title=Special:Contributions&limit=50&target=Alecs.bot">Contributions Alecs.bot</a></li>'
+ '<li><a href="http://fr.wikinews.org/w/index.php?title=Special:Contributions&limit=50&target=Alecs.y">Wikinews Alecs.y</a></li>'
+ '<li><a href="http://fr.wikinews.org/w/index.php?title=Special:Contributions&limit=50&target=Alecs.bot">Wikinews Alecs.bot</a></li>'
    }
  }
      } 
 
      addLoadEvent(nouvelnavigation);

function addLoadEvent(func) 
      {
         if (window.addEventListener) 
             window.addEventListener("load", func, false);
         else if (window.attachEvent) 
             window.attachEvent("onload", func);
      }
 
      function nouvelOnglet() 
      {
        var a = document.getElementById("p-cactions");
        if (a) 
        {
          b = a.getElementsByTagName("ul");
          if(b.length > 0)
          {
            b[0].innerHTML = b[0].innerHTML
            + '<li id="ca-nstab-user">'
            + '<a href="/wiki/Special:Prefixindex/' + wgPageName + '">'
            + 'Sous-pages</a></li>';
          }
 
 
 
         }
      }
 
      addLoadEvent(nouvelOnglet);

/*
 * Onglet Google
 *
 * Rajoute un onglet vers Google portant sur le titre de la page
 *
 * Auteur : Dake, Hégésippe
 * Dernière révision : 22 novembre 2007
 * [[w:Catégorie:MediaWiki:Fonction Monobook en JavaScript]]
 */
 
function OngletGoogle() {
  var a = document.getElementById("p-cactions");
  if (a && wgNamespaceNumber >= 0) {
    b = a.getElementsByTagName("ul");
    if (b.length > 0) {
      b[0].innerHTML = b[0].innerHTML
        + '<li id="ca-nstab-user"><img src="http://www.google.com/intl/en/logos/Logo_60wht.gif" height="20px">'
        + '<a href="http://www.google.fr/search?num=20&hl=en&safe=off&q=site%3Afr.wikipedia.org+' +  wgPageName + '&btnG=Search">'
        + '(fr)</a>'
        + '<a href="http://www.google.fr/search?num=20&hl=en&safe=off&q=' + wgPageName + '&btnG=Search">'
        + '(web)</a>'
        + '</li>';
    }
  }
}
$(OngletGoogle);

/*
 * OngletPurge
 *
 * Onglet permettant de réaliser une purge du cache
 *
 * Auteur : ??
 * Dernière révision : 7 juin 2007
 * [[w:Catégorie:MediaWiki:Fonction Monobook en JavaScript]]
 */
 
function OngletPurge() {
        if (wgNamespaceNumber >= 0 && !document.getElementById('toolbar')) {
                mw.util.addPortletLink('p-cactions', wgScriptPath + '/index.php?title=' + wgPageName + '&action=purge', 'purger', 'ca-purge', 'purger le cache de la page', 'p');
	}
}
 
$(OngletPurge);