Utilisateur:Leag/ortho.js
Un article de Wikipédia, l'encyclopédie libre.
Note : Après avoir publié la page, vous devrez forcer son rechargement pour voir les changements : Mozilla / Konqueror / Firefox : Shift-Ctrl-R, Internet Explorer / Opera : Ctrl-F5, Safari : Cmd-R.
//<pre><nowiki> // Correction d'orthographe /* ****************************************** */ /* 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 ); //</nowiki></pre>