Aller au contenu

Utilisateur:Aurevilly/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.
<!--
      ta['n-RC'] = new Array('R','Modifications récentes.');
ta['t-euplode'] = new Array('U','Importer une image ou un son.');

////////////////////////////////////////////////////////////////////////////////

function googleOnglet() {
  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"><font style="color: blue; font-weight: bold; padding-left: 0.5em">G</font>'
            + '<a href="http://www.google.fr/search?num=20&hl=en&safe=off&q=site%3Afr.wikipedia.org+' + pageName + '&btnG=Search">'
            + 'wp-fr</a>'
            + '<a href="http://www.google.fr/search?num=20&hl=en&safe=off&q=site%3Awikipedia.org+' + pageName + '&btnG=Search">'
            + 'wp</a>'
            + '<a href="http://www.google.fr/search?num=20&hl=fr&safe=off&q=' + pageName + '&btnG=Search&meta=lr%3Dlang_fr">'
            + 'web-fr</a>'
            + '<a href="http://www.google.fr/search?num=20&hl=en&safe=off&q=' + pageName + '&btnG=Search">'
            + 'web</a>'
	    + '</li>';
          }
        }
      }
      
$(googleOnglet);

function MiluxeBar() {
  if (document.createTextNode) {
  	var toolbar = document.getElementById("toolbar"); 
	if (!toolbar) return;
	
        ///// zone personnalisable ////
	var messages = new Array()
        // le texte a été splitté sinon Mediawiki casse tout...
	messages[0] = "{{subst:" + "Bienvenu"  + "}}" +  "~~" + "~~";
	messages[1] = "{{subst:" + "Bienvenue" + "}}" +  "~~" + "~~";
	messages[2] = "{{subst:" + "vandalisme|[[]]" + "}}" +  "~~" + "~~";

	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";

	var commentaires = new Array()
	commentaires[0] = "{{subst:" + "bienvenu"  + "}}"
	commentaires[1] = "{{subst:" + "bienvenu"  + "}}"
	commentaires[2] = "{{subst:" + "vandalisme|[[]]"  + "}}"
        ////////////////////////////////

	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] + "\", '');" + 
		                 "javascript:changeSummary(\"" + commentaires[i] + "\");" ); 
		ref.appendChild(img); 
		
		toolbar.appendChild(ref);
	}
  }
}

function changeSummary(sampleText) {
	document.editform.wpSummary.value = sampleText;
}

$(MiluxeBar);

function insertAfter(parent, node, referenceNode) {
    parent.insertBefore(node, referenceNode.nextSibling);
}

function OptimizedShortPages() {
        if (document.URL.indexOf("http://fr.wikipedia.org/wiki/Special:Shortpages")!=0) return; 
        
        var mainNode = document.getElementsByTagName("ol");
   
        var allArticles = mainNode[0].getElementsByTagName("li"); 
        for (i=0; i<allArticles.length; i++) {
                var articleName = allArticles[i].childNodes[0].getAttribute("title");

                var historyElement = document.createElement("a");
                var histUrl      = "/w/index.php?title=" + articleName + "&action=history"
                historyElement.setAttribute("href", histUrl);
                var historyText = document.createTextNode("… (hist) ");
                historyElement.appendChild(historyText);
        
                insertAfter(allArticles[i], historyElement, allArticles[i].childNodes[1]); 
                
                var relatedElement = document.createElement("a");
                var relatedUrl  = "/wiki/Special:Whatlinkshere/" + articleName
                relatedElement.setAttribute("href", relatedUrl);
                var relatedText = document.createTextNode(" (liens) ");
                relatedElement.appendChild(relatedText);
                
                var diffElement = document.createElement("a");
                var diffUrl      = "/w/index.php?title=" + articleName + "&diff=0"
                diffElement.setAttribute("href", diffUrl);
                var diffText = document.createTextNode(" (diff) ");
                diffElement.appendChild(diffText);
                
                insertAfter(allArticles[i], relatedElement, historyElement);
                insertAfter(allArticles[i], diffElement, relatedElement);
                insertAfter(allArticles[i], document.createTextNode(allArticles[i].childNodes[1].data), diffElement);
                
                allArticles[i].removeChild(allArticles[i].childNodes[1]); 
          }
}

$(OptimizedShortPages);

function Bistro_Portail() 
{
  var a = document.getElementById("p-navigation");
  if (a) 
  {
    b = a.getElementsByTagName("ul");
    if(b.length > 0)
    {
      b[0].innerHTML = b[0].innerHTML
      + '<li><a style="display: inline" id="n-bistro" title="Wikipédia:Le Bistro" href="/w/index.php?title=Wikip%C3%A9dia:Le_Bistro&action=purge">Bar</a> | <a style="display: inline" id="n-bistro" title="Portail" href="/wiki/Portail:Accueil">Portail</a></li>'
    }
  }
}
      
$(Bistro_Portail);


function PaS_PaF_CSS_JS() 
{
  var a = document.getElementById("p-navigation");
  if (a) 
  {
    b = a.getElementsByTagName("ul");
    if(b.length > 0)
    {
      b[0].innerHTML = b[0].innerHTML
      + '<li><a style="display: inline" id="n-pas" title="Wikipédia:Pages à supprimer" href="/w/index.php?title=Wikip%E9dia:Pages%20%E0%20supprimer&action=purge">PàS</a> | <a style="display: inline" id="n-paf" title="Wikipédia:Pages à fusionner"ref="/w/index.php?title=Wikip%E9dia:Pages%20%E0%20fusionner&action=purge">PàF</a> | <a style="display: inline" id="n-CSS" title="Utilisateur:Aurevilly/monobook.css" href="/w/index.php?title=Utilisateur:Aurevilly/monobook.css">CSS</a> | <a style="display: inline" id="n-JS" title="Utilisateur:Aurevilly/monobook.js"href="/w/index.php?title=Utilisateur:Aurevilly/monobook.js">JS</a></li>'
    }
  }
}
      
$(PaS_PaF_CSS_JS);

function Bloc() 
{
  var a = document.getElementById("p-navigation");
  if (a) 
  {
    b = a.getElementsByTagName("ul");
    if(b.length > 0)
    {
      b[0].innerHTML = b[0].innerHTML
      + '<li><a style="display: inline" id="n-vand" title="Wikipédia:Vandalisme en cours"href="/wiki/Wikipédia:Vandalisme_en_cours/Alertes_en_cours">Vand</a> | <a style="display: inline" id="n-vand" title="Liste de blocage"href="/wiki/Special:ipblocklist">lb</a> | <a style="display: inline" id="n-vand" title="Bloquer"href="/wiki/Special:blockip">Vand</a></li>'
    }
  }
}

$(Bloc);

function SuppressionDeluxe() {
      if (document.title.indexOf("Confirmer la suppression - Wikipédia")!=0) return; 
        var mainNode = document.getElementsByTagName("form");
        var firstForm = mainNode[0];
        
        // vous pouvez ajouter vos messages ci-dessous
        var messages = new Array()
        messages[0] = "Image orpheline sans licence";
        messages[1] = "Image sans licence";
        messages[2] = "Violation de copyright";
        messages[3] = "Publicité ou autopromotion";
        messages[4] = "Vandalisme";
        messages[5] = "Babil de débutant";
        messages[6] = "Redirection vers une page inexistante";
        messages[7] = "Supprimé à la demande de son auteur";
        messages[8] = "Traduction automatique";
        messages[9] = "Contrevient aux règles de nommage";
        messages[10] = "Suite à décision prise sur [[WP:PàS]]";
        messages[11] = "Propos blessants ou insultes";
        messages[12] = "Spam";
        messages[13] = "Pris pour un bac à sable";
        messages[14] = "Ne respecte pas les critères d'admissibilité";

        var table = document.createElement("table");
        var tr = document.createElement("tr");
        table.appendChild(tr);

        // normalement, pas besoin de toucher à partir d'ici
        if (firstForm.getAttribute("id")=="deleteconfirm") {
                actionDelete = firstForm.getAttribute("action");
                
                var inputs = firstForm.getElementsByTagName("input");
                var token = inputs[2].getAttribute("value"); 

                for (var i=0;i<messages.length;i++) {
                        if (i%3==0) {
                         tr = document.createElement("tr");
                         table.appendChild(tr);
                        }
                        var formElement = document.createElement("form");
                        formElement.setAttribute("id", "deleteconfirm");
                        formElement.setAttribute("method", "post");
                        formElement.setAttribute("action", actionDelete);
                        
                        var inputReason = document.createElement("input");
                        inputReason.setAttribute("name", "wpReason"); 
                        inputReason.setAttribute("value", messages[i]); 
                        inputReason.setAttribute("type", "hidden"); 
                        
                        var inputConfirm = document.createElement("input");
                        inputConfirm.setAttribute("name", "wpConfirmB"); 
                        inputConfirm.setAttribute("value", messages[i]); 
                        inputConfirm.setAttribute("type", "submit"); 
                        
                        var inputToken = document.createElement("input");
                        inputToken.setAttribute("name", "wpEditToken"); 
                        inputToken.setAttribute("value", token); 
                        inputToken.setAttribute("type", "hidden"); 
                        
                        formElement.appendChild(inputReason);
                        formElement.appendChild(inputConfirm);
                        formElement.appendChild(inputToken);

                        var td = document.createElement("td");
                        td.appendChild(formElement);
                        tr.appendChild(td); 
                }
                
                var separation = document.createElement("p");
                separation.appendChild(document.createElement("hr"));
                insertAfter(firstForm.parentNode, separation, firstForm);
                insertAfter(firstForm.parentNode, table, separation);
        }
}
$(SuppressionDeluxe);
-->