« Utilisateur:HariBot/monobook.js » : différence entre les versions

Une page de Wikiquote, le recueil des citations libres.
Contenu supprimé Contenu ajouté
HariBot (discussion | contributions)
Annulation des modifications 39611 de HariBot (discuter)
HariBot (discussion | contributions)
Essai
 
Ligne 1 : Ligne 1 :
/////////////////////////////////
//////////////////////////////////
/* ****************************************** */
/* ****************************************** */
/* EDUCA33E : 23/03/06 */
/* EDUCA33E : 23/03/06 */
Ligne 57 : Ligne 57 :
if ( window.addEventListener ) window.addEventListener( 'load', ORTHOPatrol, false );
if ( window.addEventListener ) window.addEventListener( 'load', ORTHOPatrol, false );
else if ( window.attachEvent ) window.attachEvent( 'onload', ORTHOPatrol );
else if ( window.attachEvent ) window.attachEvent( 'onload', ORTHOPatrol );

/* </pre> */

Dernière version du 23 avril 2007 à 20:40

//////////////////////////////////
/* ****************************************** */
/* EDUCA33E : 23/03/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.wikiquote.org/w/index.php?title=Utilisateur:HariBot/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 );