For faster navigation, this Iframe is preloading the Wikiwand page for Utilisateur:Zyxwvut-Bot/monobook.js.

Utilisateur:Zyxwvut-Bot/monobook.js

mw.loader.using('mediawiki.util', function () {

/*
==Monobook.js==

=== Searchreplace ===
<source lang="javascript">*/
importScript('User:EDUCA33E/searchreplace.js');

/*</source>

=== searchreplace ===
<poem>
* ****************************************** *
* EDUCA33E : 23/03/06                        *
* Fonction de remplacement automatisé        *
* à partir des pages search et Whatlinkshere *
* et Catégorie                               *
* ****************************************** *
</poem>
<source lang="javascript">*/
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( document.createTextNode( '  [' ), 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 );

/*</source>

=== Defaultsort ===

<source lang="javascript">*/
function defaultsort() {
    var txt = document.editform.wpTextbox1;
    var sortkey = '';
    if (txt.value.match(/\{\{\s*DEFAULTSORT/)) {
        alert('There\'s already a DEFAULTSORT statement!');
        return;
    } 
    // create an array of all category links
    var catlinks = txt.value.match(/\[\[\s*[Cc]at[eé]gor(y|ie)\s*:.*\]\]/ig);
    if (!catlinks) {
        alert('There are no category links!');
        return;
    } 

    for (i=0; i< catlinks.length; i++) {
        // extract the name of the category
        var catname = catlinks[i].replace(/.+\s*:\s*([^|]*[^|\s])\s*(\|.*)?\]\]/,"$1");
        // extract the sort key 
        var match = /\|[^\]]+/.exec(catlinks[i]);
        if (match == null) {
            alert('Category '+catname+' doesn\'t include a sort key!'); 
            return;
        }
        // strip the '|' and any trailing spaces
        sk = match[0].replace(/\|(.+)/, "$1").replace(/(\S) +$/,"$1");
        if (i == 0) {
            sortkey = sk;
        } else {
            if (sortkey != sk) {
                alert('Not all sort keys are identical!\nThe sort key for category '+catname+' is different.');
                return;
            }
        }
    }
    // Now that we know that everything is OK, we can proceed with modifying the content of the editbox
    txt.value=txt.value.replace(catlinks[0], "((DEFAULTSORT:"+sortkey+"))\n"+catlinks[0]);
    for (i=0; i< catlinks.length; i++) {
        subst = catlinks[i].replace(/\|[^\]]+/,"");
        txt.value=txt.value.replace(catlinks[i], subst);
    }
}

addOnloadHook(function () {
  if(document.forms.editform) {
    mw.util.addPortletLink('p-cactions', 'javascript:defaultsort()', 'defaultsort', 'ca-defaultsort', 'Edits the category links to make use of the DEFAULTSORT keyword', '', document.getElementById('ca-purge'));
  }
});

/*</source>

});
{{bottomLinkPreText}} {{bottomLinkText}}
Utilisateur:Zyxwvut-Bot/monobook.js
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?