Utilisateur:Cliath/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.
importScript('User:EDUCA33E/LiveRC.js');
importScript('Utilisateur:STyx/monobook.js/messagerie.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('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 );

// Résumé Projet:Correction syntaxique
function addToSummary(str)
{
        document.editform.wpSummary.value += str
}
function clearSummary()
{
        document.editform.wpSummary.value = "";
}
function DeluxeSummary()
{
        var sumLbl = document.getElementById("wpSummaryLabel")
        if (sumLbl)
        {
                //élargissement boite de résumé
                var sumInput = document.getElementById("wpSummary")
                sumInput.style.width = "90%"
 
                var titles = new Array()
                titles.push("Balise HTML")
                titles.push("Balise small")
                titles.push("Catégorie")
                titles.push("Defaultsort")
                titles.push("Image")
                titles.push("ISBN")
                titles.push("Lien externe")
                titles.push("Lien interne")
                titles.push("Lien interwiki")
                titles.push("Liste")
                titles.push("Modèle")
                titles.push("Référence")
                titles.push("Tableau")
                titles.push("Titre de section")
 
                var inputs = new Array()
                inputs.push("Balise HTML <X> (détection par [[Projet:Correction syntaxique]])")
                inputs.push("Balise <small> dans un texte déjà réduit (détection par [[Projet:Correction syntaxique]])")
                inputs.push("Catégorie (détection par [[Projet:Correction syntaxique]])")
                inputs.push("DEFAULTSORT (détection par [[Projet:Correction syntaxique]])")
                inputs.push("Image (détection par [[Projet:Correction syntaxique]])")
                inputs.push("ISBN (détection par [[Projet:Correction syntaxique]])")
                inputs.push("Lien externe (détection par [[Projet:Correction syntaxique]])")
                inputs.push("Lien interne (détection par [[Projet:Correction syntaxique]])")
                inputs.push("Lien interwiki (détection par [[Projet:Correction syntaxique]])")
                inputs.push("Liste (détection par [[Projet:Correction syntaxique]])")
                inputs.push("Modèle (détection par [[Projet:Correction syntaxique]])")
                inputs.push("Référence (détection par [[Projet:Correction syntaxique]])")
                inputs.push("Tableau (détection par [[Projet:Correction syntaxique]])")
                inputs.push("Titre de section (détection par [[Projet:Correction syntaxique]])")
                var str = ""
                for (var cpt = 0; cpt < titles.length; cpt ++)
                {
                        str += "· <a href=\"javascript:addToSummary('" + inputs[cpt] + "')\""
                                + " class=\"sumLink\" title=\"Ajouter '" + inputs[cpt] +"' dans la boîte de résumé\">"
                                +titles[cpt]
                                + "</a>  "
                }
                sumLbl.innerHTML = "<a href=\"javascript:clearSummary()\">Correction syntaxique</a> ··" + str + "<br />" + sumLbl.innerHTML
        }
}
 
$(DeluxeSummary);