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:Arkanosis/xpatrol.js');

/* Retrait des bandeaux siteNotice */
#siteNotice { 
	display: none;
}

// <nowiki>

// Options
window.xdone_options = {
  'done_message': '{{Fait}} Cordialement, ~~~~'
};

// Activation de xdone
importScript( 'User:Arkanosis/xdone.js' );

// </nowiki>

// Script d'affichage et édition des courtes descriptions sur Wikidata
mw.loader.getScript( 'https://en.wikipedia.org/w/load.php?modules=ext.gadget.libSettings' ).then( function() {
	mw.loader.load( 'https://en.wikipedia.org/w/load.php?modules=ext.gadget.Shortdesc-helper' );
})

/* DisamAssist */
mw.loader.load('//fr.wikipedia.org/w/index.php?title=Utilisateur:Midas02/DisamAssist.js&action=raw&ctype=text/javascript');

/**
 * Outils pour réverter
 *
 * fournit des liens dans les pages de diff pour révoquer facilement une modification et avertir son auteur
 *
 * Auteurs : Lorian (en), Chphe (fr)
 * Dernière révision : 27 décembre 2013 — séparation des annulations et révocations
 * {{Projet:JavaScript/Script|RevertDiff}}
 */
//<nowiki>

if (typeof window.RevertDiffParams === 'undefined') {
  window.RevertDiffParams = new Object();

  window.RevertDiffParams.Text = new Object();
  window.RevertDiffParams.Text.Annul = "Annuler";
  window.RevertDiffParams.Text.AnnulResume = 'Annulation des modifications de [[Special:Contributions/$2|$2]] (retour à la précédente version de [[Special:Contributions/$1|$1]])';
  window.RevertDiffParams.Text.Message = "Message";
  window.RevertDiffParams.Text.MessageAlert = 'Quel message faut-il laisser ?';
  window.RevertDiffParams.Text.Revert = "Révoquer";
  window.RevertDiffParams.Text.RevertResume = 'Révocation des modifications de [[Special:Contributions/$2|$2]] (retour à la précédente version de [[Special:Contributions/$1|$1]])';
  window.RevertDiffParams.Text.Warn = "Avertir";


  window.RevertDiffParams.Warn = [
    {urlparam:"warn=01", text:"Test1",        template:'{{subst:Test 1|$page}} ~~~~'},
    {urlparam:"warn=02", text:"Test2",        template:'{{subst:Test 2}} ~~~~'},
    {urlparam:"warn=03", text:"Test3",        template:'{{subst:Test 3}} ~~~~'},
    {urlparam:"warn=04", text:"Test4",        template:'{{subst:Seul avertissement}} ~~~~'},
    {urlparam:"warn=05", text:"Lien externe", template:'{{subst:Bienvenue spammeur|$page}} ~~~~'},
    {urlparam:"warn=06", text:"Faut sourcer", template:'{{subst:Faut sourcer|$page}} ~~~~'},
    {urlparam:"warn=07", text:"Bienvenue",    template:'{{Bienvenue nouveau|sign=~~~~}}'},
    {urlparam:"warn=08", text:"BienvenueIP",  template:'{{subst:Bienvenue IP}} ~~~~'},
    {urlparam:"warn=09", text:"MerciIP",      template:'{{Bienvenue IP méritante|sign=~~~~}}'}
  ];
}


function getURLParameters(x) {
  var questionMark = x.indexOf('?');
  if (questionMark == -1) return {}
  var fieldsArray = x.substr(questionMark + 1).split('&');
  var fields = {};
  for (var i = 0; i < fieldsArray.length; i++) {
    var field = fieldsArray[i];
    var equal = field.indexOf('=');
    if (equal == -1) {
      fields[decodeURIComponent(field)] = '';
    } else {
      fields[decodeURIComponent(field.substr(0, equal))] =
          decodeURIComponent(field.substr(equal + 1));
    }
  }
  return fields;
}

var _GET = getURLParameters(location.href);

window.getMessage = function(chemin, where, user1, user2) {
  var message = prompt (window.RevertDiffParams.Text.MessageAlert, '');
  if (message) {
    window.location = chemin + '&'+where+'=2&user1='+user1+'&user2='+user2+'&message='+message;
  }
};

$(document).ready(function (){
  if (location.href.match(/diff=/)) {
    // Get username of submitter
    var user1TD = $('td.diff-otitle');
    var user2TD = $('td.diff-ntitle');
    if (!user1TD.length || !user2TD.length) return;

    // Récupération du chemin vers la version à rétablir
    var chemin = encodeURI(user1TD.find('span.mw-diff-edit a').attr('href'));

    var user1 = user1TD.find('a.mw-userlink').text();
    var user2 = user2TD.find('a.mw-userlink').text();

    var Annul = '('
               + '<a href="'+chemin+'&annul=1&user1='+user1+'&user2='+user2+'">'+window.RevertDiffParams.Text.Annul+'</a>'
               + ' / '
               + '<a href="javascript:window.getMessage(\''+chemin+'\',\'annul\',\''+user1+'\',\''+user2+'\');">'+window.RevertDiffParams.Text.Message+'</a>'
               + ')';

    var Revert = '('
               + '<a href="'+chemin+'&revert=1&user1='+user1+'&user2='+user2+'">'+window.RevertDiffParams.Text.Revert+'</a>'
               + ' / '
               + '<a href="javascript:window.getMessage(\''+chemin+'\',\'revert\',\''+user1+'\',\''+user2+'\');">'+window.RevertDiffParams.Text.Message+'</a>'
               + ')';

    var Warn = '('+window.RevertDiffParams.Text.Warn+' : ';
    var SiteURL = mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=';
    for(var a=0,l=window.RevertDiffParams.Warn.length;a<l;a++){
        if(a!=0) Warn += ' / ';
        Warn += '<a href="'+SiteURL+'User_talk:'+user2+'&action=edit&section=new'
              + '&revertdiffsrc=' + encodeURIComponent(mw.config.get('wgPageName'))
              + '&'+window.RevertDiffParams.Warn[a].urlparam+'" '
              + 'title="'+window.RevertDiffParams.Warn[a].template+'" '
              + '>'+window.RevertDiffParams.Warn[a].text+'</a>';
    }
    Warn += ')';
    document.getElementById('contentSub').innerHTML = Annul + " " + Revert + " " + Warn;

  }else if (location.href.match(/annul=1/)) {
    document.getElementById('wpSummary').value = window.RevertDiffParams.Text.AnnulResume.split("$1").join(_GET['user1']).split("$2").join(_GET['user2']);
    document.getElementById('editform').submit();
  }else if (location.href.match(/annul=2/)) {
    document.getElementById('wpSummary').value =
window.RevertDiffParams.Text.AnnulResume.split("$1").join(_GET['user1']).split("$2").join(_GET['user2']) + ' : '+_GET['message'];
    document.getElementById('editform').submit();
  }else if (location.href.match(/revert=1/)) {
    document.getElementById('wpSummary').value = window.RevertDiffParams.Text.RevertResume.split("$1").join(_GET['user1']).split("$2").join(_GET['user2']);
    document.getElementById('editform').submit();
  }else if (location.href.match(/revert=2/)) {
    document.getElementById('wpSummary').value =
window.RevertDiffParams.Text.RevertResume.split("$1").join(_GET['user1']).split("$2").join(_GET['user2']) + ' : '+_GET['message'];
    document.getElementById('editform').submit();
  }else{
    for(var a=0,l=window.RevertDiffParams.Warn.length;a<l;a++){
      var Warn = window.RevertDiffParams.Warn[a];
      if (location.href.match(new RegExp(Warn.urlparam))) {
        var Template = Warn.template;
        Template = Template.split('$page').join(_GET['revertdiffsrc'].replace(/_/g, " "));
        Template = Template.split('$user').join(mw.config.get('wgUserName'));
        document.getElementById('wpTextbox1').value = Template;
        document.getElementById('editform').submit();
      }
    }
  }
});
//</nowiki>
// [[:en:User:Lupin/popups.js]]
// Traduction de [[Utilisateur:Leag|Leag]] : [[Utilisateur:Leag/Navigation popups|Navigation popups]]

obtenir("BistroDuJour");

mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Equazcion/OneClickArchiver.js&action=raw&ctype=text/javascript');

//Gadget DJ
var DJparam_sidebarlink = true;
importScript('Utilisateur:0x010C/script/DrapeauJaune.js');


window.alwaysEval = false; //mettez cette valeur à ''true'' si vous voulez que l'évaluation soit lancée automatiquement (à éviter en temps normal)
window.initEvalProjectNames = function()
{
	evalProjectNames=new Array(); //liste de vos projets
	evalProjectNames.push("Jeux olympiques") 
}

importScript("Utilisateur:Framawiki/js/addNotificationCounterToDocumentTitle.js");

importScript('Utilisateur:Lgd/refErrors/refErrors.js');

//Script pour insérer PopupVandalism.js sur toutes les pages
importScript('Utilisateur:0x010C/script/PopupVandalism.js');
//Paramètres de PopupVandalisme.js
var PopVand_Mode = "text";
var PopVand_Color = true;

function addMarkAsReadButtonsInWatchlist() {
    $('a:contains("diff")').each(function() {
        var diff = /diff=([0-9]+)/.exec($(this).prop('href'));
        if (!diff) return;
        $(this).before($('<a href="#">vu</a>').data('diff', diff[1]).click(function(){
            $(this).closest('li').removeClass('mw-changeslist-line-watched');
            new mw.Api().postWithToken('csrf', {action: 'setnotificationtimestamp', revids: $(this).data('diff')});
        return false;	
        }), ' | ');
    });
}

if (mw.config.get('wgCanonicalSpecialPageName') === 'Watchlist') {
    mw.loader.using(['mediawiki.api'], function() {
        $(addMarkAsReadButtonsInWatchlist);
    });
}

obtenir("LiveRC");	

importScript('Utilisateur:Prométhée/TitreGras.js');
importScript('Utilisateur:Prométhée/AjouterSectionRefs.js');
mw.util.addPortletLink("p-cactions","https://tools.wmflabs.org/copyvios/?lang=fr&project=wikipedia&title="+mw.config.get( 'wgPageName' ),"copyviosquery");
window.ResumeDeluxe_affiches = {
	"organisation des sections": true,
	"wikification": true, // activé
	"mise en forme": true, // activé
};

//code pour ajouter un nouveau commentaire : 'commentaire du diff',
	
window.ResumeDeluxe_liens = [
	'Organisation des sections',
	'Évaluation',
	'Wikification',
	"Violation des droits d'auteur : ",
	'Mise en forme',
	'Mise en page',
	'Références',
	'Bibliographie',
	'Corrections multiples',
	'Gras dans un article',
	'Voir [[WP:LE]]',

];

// Provides several useful functions for rollback (custom edit summary, mark as bot edits and mass revert)
// by [[m:user:Hoo man]] <http://meta.wikimedia.org/wiki/User:Hoo_man/Scripts/Smart_rollback>
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hoo_man/smart_rollback.js&action=raw&ctype=text/javascript');

flowDeluxeSujetsOuverts = "#A9F5F2"; //Couleur des sujets ouverts
flowDeluxeSujetsClos = "rgba(60, 207, 90, 0.13)"; //Couleur des sujets fermés
flowDeluxeDiscuterContributions = true; //Voir en permanence les liens (discuter | contributions)
flowDeluxeDateComplete = true; //Voir en permanence les dates complètes en plus du texte "il y a X jours"
flowDeluxeBoutonsResumes = true; //Barre d'insertion rapide de modèles de résumé
flowDeluxeIndentationColors = true; //Indentation colorée comme dans l'ancien système de discussions
obtenir('FlowDeluxe');

importScript('MediaWiki:Gadget-Popups.js');

//wikidata dans l'histo
importScript('Utilisateur:H4stings/wef-history.js');

// Options
xpatrolEnableClear = true; // Active la fonctionnalité de blanchiment de page
xpatrolEnableBanner = true; // Active la fonctionnalité d'ajout de bandeau
xpatrolEnablePurge = true; // Active la fonctionnalité de demande de purge d'historique

xpatrolPurgeWarnEditor = true; // Coche par défaut la case pour avertir le contributeur concerné lors d'une demande de purge d'historique
xpatrolSignatureRegistered = 'Merci d\'avance~~' + '~~'; // Modifie la signature utilisée pour les demandes de purge d'historique automatisées
xpatrolSignatureAnonymous = 'Cordialement~~' + '~~'; // Modifie la signature utilisée pour les messages d'avertissement automatisés
xpatrolCopyvioWarningTemplate = 'Bienvenue Copyvio 1'; // Modifie le modèle utilisé pour les messages d'avertissement automatisés

xpatrolWatchMain = false;   // Ajoute les articles blanchis dans la liste de suivi
xpatrolWatchOthers = false; // Ajoute toutes les pages blanchies dans la liste de suivi

// Activation de xpatrol
importScript('User:Arkanosis/xpatrol.js');

// <nowiki>

// Options
window.xdone_options = {
  'done_message': '{{Fait}} Cordialement, ~~~~'
};

// Activation de xdone
importScript( 'User:Arkanosis/xdone.js' );

// </nowiki>

obtenir("BistroDuJour");

// Provides several useful functions for rollback (custom edit summary, mark as bot edits and mass revert)
// by [[m:user:Hoo man]] <http://meta.wikimedia.org/wiki/User:Hoo_man/Scripts/Smart_rollback>
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hoo_man/smart_rollback.js&action=raw&ctype=text/javascript');

/*
* This script allows a mass patrolling
*/

var totalRevisions;
var treatedRevisions = 0;

mw.loader.using( [ 'mediawiki.util', 'mediawiki.api', 'oojs-ui' ], function() {
  mw.util.addPortletLink( 'p-cactions', 'javascript:markAllAsPatrolled()', 'Smart patrol', 'Smart patrol' );
} );

function markAllAsPatrolled() {
  new OO.ui.confirm('Are you sure you want to patrol all the page revisions?').then( function( response ) {
    if ( response === true ) {
        getRevisionsList();
    }
  } );
}

function getRevisionsList() {
  var api = new mw.Api();
  api.get( {
	'action': 'query',
	'format': 'json',
	'prop': 'revisions',
	'titles': mw.config.get( 'wgPageName' ),
	'formatversion': '2',
	'rvprop': 'ids|user',
	'rvlimit': 'max'
  } ).then( function ( data ) {
    var revisions = data.query.pages[ 0 ].revisions;
    //var user = revisions[ 0 ].user;
    totalRevisions = revisions.length;
    revisions.forEach( function ( revision ) {
      treatedRevisions++;
      //if ( user === revision.user ) {
        markRevAsPatrolled( revision.revid );
      //}
    } );

  } ).fail( function ( error ) {
      mw.notify( 'Something went wrong: ' + error, { title: 'Smart Patrol', type: 'error' } );
  } );
}

function markRevAsPatrolled( revid ) {
  var api = new mw.Api();
  api.postWithToken( 'patrol', {
	'action': 'patrol',
	'revid': revid

  } ).then( function ( info ) {
    console.log( 'Success for ' + revid, { title: 'Smart Patrol', type: 'info' } );
    if ( totalRevisions == treatedRevisions ) { window.location.reload(); }

  } ).fail( function ( error ) {
    console.log( 'Something went wrong: ' + error, { title: 'Smart Patrol', type: 'error' } );
  } );
}

/* adapté de [[MediaWiki:Gadget-Evaluation.js]] (version du 12 septembre 2008) par Chphe
* {{Projet:JavaScript/Script|Evaluation}}
* rajouter l'onglet suivi des users
*
*/
//<source lang=javascript>//<pre><nowiki>
//jshint strict:false

if ( mw.config.get( 'wgNamespaceNumber' ) === 0 && mw.config.get( 'wgAction' ) === 'view' ) {
	mw.loader.using( 'mediawiki.util', function () {
		$( ev_addEvalTab );
	} );
}

function ev_addEvalTab( $ ) {
	var portletLink = mw.util.addPortletLink( 'p-cactions', '#', 'Évaluer' );

	$( portletLink ).click( function ( e ) {
		e.preventDefault();
		ev_launchEval();
	} );

	if ( window.alwaysEval ) {
		ev_launchEval();
	}
}


//initialise les variables
function ev_initVars() {
	if ( typeof window.initEvalProjectNames !== "undefined" ) {
		window.initEvalProjectNames();
	} else {
		window.evalProjectNames = [];
	}

	window.evaluation_multiprojets = {};
	window.evaluation_multiprojets.project = [];
	window.evaluation_multiprojets.importance = [];
	window.evaluation_multiprojets.state = [];
	window.evaluation_multiprojets.avancement_global = "?";
	window.evaluation_multiprojets.autres = {}; // pour ramasser le reste (WP1.0, todo, wikiconcours, ...)
}

function ev_launchEval() {
	if ( mw.util.getParamValue( 'printable' ) === 'yes' ) {
		/* version imprimable */
		return;
	}

	var EvalDiv = document.getElementById( 'EvalDiv' );

	if ( !EvalDiv ) {
		EvalDiv = document.createElement( 'div' );
		EvalDiv.id = "EvalDiv";
		EvalDiv.align = "center";
		$( '#mw-content-text' ).prepend( EvalDiv );
	}

	EvalDiv.innerHTML = "Interrogation de la page de discussion...";

	ev_initVars();

	mw.loader.using( 'mediawiki.api', function () {
		new mw.Api()
			.get( {
				action: 'query',
				titles: mw.config.get( 'wgFormattedNamespaces' )[1] + ':' + mw.config.get( 'wgPageName' ),
				prop: 'revisions',
				rvprop: 'content',
				formatversion: 2,
			} )
			.done( function ( results ) {
				var page = results.query.pages[0];
				window.evaluation_multiprojets.pdd_existe = !page.missing;
				if ( !page.missing ) {
					ev_ExtractEvaluation( page.revisions[0].content );
				}
				ev_AddMyProjects();
				ev_drawEvaluation();
			} );
	} );
}

function ev_addCell( line, html, bgcolor, rowSpan ) {
	var cell = line.insertCell();
	cell.innerHTML = html;

	if ( bgcolor ) {
		cell.style.backgroundColor = "#" + bgcolor;
	}
	if ( rowSpan ) {
		cell.rowSpan = rowSpan;
	}

	return cell;
}

function ev_htmlEncode( string ) {
	string = string.replace( /&/, '&amp;' );
	string = string.replace( />/, '&gt;' );
	string = string.replace( /</, '&lt;' );
	string = string.replace( /"/, '&quot;' );
	return string;
}

function ev_getRadioboxHtml( id, selected, n, prop, value ) {
	if ( prop == "avancement_global" ) {
		return "<input onclick='window.evaluation_multiprojets.avancement_global=\""
			+ value
			+ "\"'  name='"
			+ id
			+ "_mp' type='radio'"
			+ ( selected ? " checked='true'/>" : "/>" );
	} else {
		return "<input onclick='window.evaluation_multiprojets."
			+ prop
			+ "["
			+ n
			+ "]=\""
			+ value
			+ "\"'  name='"
			+ id
			+ "_mp' type='radio'"
			+ ( selected ? " checked='true'/>" : "/>" );
	}
}

function ev_addEvalLine( tab, project, im, state, n ) {
	var line = tab.insertRow();

	ev_addCell(
		line,
		'<a title="Projet:'
			+ ev_htmlEncode( project )
			+ '" href="/wiki/Projet:'
			+ encodeURIComponent( project )
			+ '">'
			+ project
			+ "</a>"
	);
	ev_addCell(
		line,
		"<input onclick='window.evaluation_multiprojets.state["
			+ n
			+ "]=this.checked' type='checkbox'"
			+ ( state ? " checked='true'/>" : "/>" )
	);

	ev_addCell( line, ev_getRadioboxHtml( n + "i", im=="maximum", n, "importance", "maximum" ) );
	ev_addCell( line, ev_getRadioboxHtml( n + "i", im=="élevée", n, "importance", "élevée" ) );
	ev_addCell( line, ev_getRadioboxHtml( n + "i", im=="moyenne", n, "importance", "moyenne" ) );
	ev_addCell( line, ev_getRadioboxHtml( n + "i", im=="faible", n, "importance", "faible" ) );
	ev_addCell( line, ev_getRadioboxHtml( n + "i", im=="?", n, "importance", "?" ) );
}

function ev_drawEvaluation() {
	var line;

	var tab = document.createElement( "table" );
	tab.className = 'wikitable';
	tab.style.textAlign = 'center';
	tab.style.fontSize = '90%';

	line = tab.insertRow();
	ev_addCell( line, "<b>Avancement commun</b>", null, 2 );
	ev_addCell( line, "<b>AdQ</b>", "6699FF" );
	ev_addCell( line, "<b>BA</b>", "66FF66" );
	ev_addCell( line, "<b>A</b>", "66FFFF" );
	ev_addCell( line, "<b>B</b>", "FFFF66" );
	ev_addCell( line, "<b>BD</b>", "FFAA66" );
	ev_addCell( line, "<b>Ébauche</b>", "FF6666" );
	ev_addCell( line, "<b>?</b>", "F8F8F8" );

	line = tab.insertRow();
	var av = window.evaluation_multiprojets.avancement_global;
	ev_addCell( line, ev_getRadioboxHtml( "ag", av=="AdQ", null, "avancement_global", "AdQ" ) );
	ev_addCell( line, ev_getRadioboxHtml( "ag", av=="BA", null, "avancement_global", "BA" ) );
	ev_addCell( line, ev_getRadioboxHtml( "ag", av=="A", null, "avancement_global", "A" ) );
	ev_addCell( line, ev_getRadioboxHtml( "ag", av=="B", null, "avancement_global", "B" ) );
	ev_addCell( line, ev_getRadioboxHtml( "ag", av=="BD", null, "avancement_global", "BD" ) );
	ev_addCell( line, ev_getRadioboxHtml( "ag", av=="ébauche", null, "avancement_global", "ébauche" ) );
	ev_addCell( line, ev_getRadioboxHtml( "ag", av=="?", null, "avancement_global", "?" ) );

	var tab2 = document.createElement( "table" );
	tab2.className = 'wikitable';
	tab2.style.textAlign = 'center';
	tab2.style.fontSize = '90%';

	line = tab2.insertRow();
	ev_addCell( line, "<b>Projet</b>", "F8F8F8" );
	ev_addCell( line, "<b>Bandeau présent</b>", "F8F8F8" );
	ev_addCell( line, "<b>Maximum</b>", "FF00FF" );
	ev_addCell( line, "<b>Élevée</b>", "FF88FF" );
	ev_addCell( line, "<b>Moyenne</b>", "FFCCFF" );
	ev_addCell( line, "<b>Faible</b>", "FFEEFF" );
	ev_addCell( line, "<b>?</b>", "F8F8F8" );

	for ( var i=0; i < window.evaluation_multiprojets.project.length; i++ ) {
		ev_addEvalLine(
			tab2,
			window.evaluation_multiprojets.project[i],
			window.evaluation_multiprojets.importance[i],
			window.evaluation_multiprojets.state[i],
			i,
			true
		);
	}

	var button = document.createElement( "button" );
	button.textContent = "Exporter cette évaluation vers la page de discussion";
	button.onclick = window.ev_setEvaluation;
	button.id = 'EvalButton';

	$( '#EvalDiv' )
		.empty()
		.append( tab, tab2, button );
}

function ev_AddMyProjects() {
	for ( var i=0; i < window.evalProjectNames.length;i++ ) {
		if ( window.evaluation_multiprojets.project.indexOf( window.evalProjectNames[i] ) == -1 ) {
			var t = window.evaluation_multiprojets.project.length;

			window.evaluation_multiprojets.project[t] = window.evalProjectNames[i];
			window.evaluation_multiprojets.importance[t] = "?";
			window.evaluation_multiprojets.state[t] = false;
		}
	}
}

function ev_ExtractEvaluation( discussion ) {
	var reg_modele_multiprojet = /{{[wW]ikiprojet\s*\|([^}]*)}}/;
	var m = reg_modele_multiprojet.exec( discussion );
	if ( m ) {
		var tab = m[1].split( "|" );
		var i=0;
		var ind=window.evaluation_multiprojets.project.length;
		while ( i < tab.length ) {
			var t = tab[i].split( "=" );
			if ( t.length == 2 ) {
				if ( t[0].trim() == "avancement" ) {
					window.evaluation_multiprojets.avancement_global = ev_cleanAvancement( t[1].trim() );
				} else {
					window.evaluation_multiprojets.autres[t[0]] = t[1].trim();
				}
			} else if ( t.length == 1 ) {
				var _proj =tab[i].trim();
				window.evaluation_multiprojets.project[ind] =_proj;
				if ( i == tab.length-1 ) alert( "Erreur de lecture du modèle {{Wikiprojet}}" );
				window.evaluation_multiprojets.importance[ind] = ev_cleanImportance( tab[i + 1].trim() );
				window.evaluation_multiprojets.state[ind] = true;
				ind++;
				i++;
			}
			i++;
		}
	}
}

function ev_cleanAvancement( val ) {
	val = val.toLowerCase();
	if ( val=="adq" ) { return "AdQ"; }
	if ( val=="ba" ) { return "BA"; }
	if ( val=="a" ) { return "A"; }
	if ( val=="b" ) { return "B"; }
	if ( val=="bd" ) { return "BD"; }
	if ( val=="ébauche" || val=="e" ) { return "ébauche"; }

	return "?";
}


function ev_cleanImportance( val ) {
	val = val.toLowerCase();
	if ( val=="maximum" || val=="maximale" ) { return "maximum"; }
	if ( val=="élevée" ) { return "élevée"; }
	if ( val=="moyenne" ) { return "moyenne"; }
	if ( val=="faible" ) { return "faible"; }

	return "?";
}

window.ev_setEvaluation = function () {
	document.getElementById( 'EvalButton' ).disabled = true;
	mw.loader.using( 'mediawiki.api.edit', function () {
		var talkpage = mw.config.get( 'wgFormattedNamespaces' )[1] + ':' + mw.config.get( 'wgPageName' );
		var summary = '[[MediaWiki:Gadget-Evaluation.js|Évaluation]]: ' + ev_getSummary_multiprojects();
		if ( window.evaluation_multiprojets.pdd_existe ) {
			new mw.Api()
				.edit( talkpage, function ( revision ) {
					return {
						text: ev_processText( revision.content ),
						summary: summary
					};
				} )
				.done( ev_doneCallback );
		} else {
			new mw.Api()
				.create( talkpage, { summary: summary }, ev_processText( '' ) )
				.done( ev_doneCallback );
		}
	} );
};

function ev_processText( text ) {
	text = ev_suppr_anc_eval( text );
	text = ev_process_multiprojects( text );
	text = ev_remise_en_tete( text );
	return text;
}

function ev_doneCallback() {
	document.getElementById( 'EvalButton' ).disabled = false;
}

function ev_getSummary_multiprojects() {
	var summary = " Multiprojet (" + window.evaluation_multiprojets.avancement_global+")";
	for ( var i=0; i < window.evaluation_multiprojets.project.length; i++ ) {
		if ( window.evaluation_multiprojets.state[i] ) {
			summary += " " + window.evaluation_multiprojets.project[i] + "|" + window.evaluation_multiprojets.importance[i];
		}
	}
	return summary+")";
}
function ev_suppr_anc_eval( text ) {
	var regtxt = /\{\{([W|w]ikiprojet [^\}|])[^\}]*\}\}/g;
	return text.replace( regtxt, '' );
}

function ev_process_multiprojects( text ) {
	var regtxt = /\{\{[wW]ikiprojet\s*\|[^\}]*\}\}/;
	var newtxt = "{{Wikiprojet";
	var regtodo=/\{\{([tT]odo\|?\*?|[àÀ] faire\|?\*?)\}\}/;
	var ok = false;
	var i;
	for ( i=0; i < window.evaluation_multiprojets.project.length; i++ ) {
		if ( window.evaluation_multiprojets.state[i] ) {
			newtxt += "\n|{{subst:Wikiprojet/alias|projet="
				+ window.evaluation_multiprojets.project[i]
				+ "}}|"
				+ window.evaluation_multiprojets.importance[i];
			ok = true;
		}
	}
	ok = ok || ( window.evaluation_multiprojets.avancement_global != "?" );
	newtxt += "\n|avancement=" + window.evaluation_multiprojets.avancement_global;

	for ( i in window.evaluation_multiprojets.autres ) {
		newtxt += "\n|" + i + "=" + window.evaluation_multiprojets.autres[i];
	}
	newtxt += "\n}}";

	if ( ok ) {
		if ( regtxt.test( text ) ) {
			text = text.replace( regtxt, newtxt );
		} else {
			text = newtxt + "\n" + text;
		}
		text = text.replace( regtodo, "" );
	}
	return text;
}
function ev_remise_en_tete( text ) {
	var reg = /(\{\{[tT]raduit de\s*\|[^}]*\}\})/;
	var m = reg.exec( text );
	if ( m ) {
		var left = RegExp.leftContext;
		var right = RegExp.rightContext;
		text = m[1]
			+ "\n"
			+ left.replace( /\s+$/, '' )
			+ "\n"
			+ right.replace( /^\s+/, '' );
	}
	return text;
}

//</nowiki></pre></source>

 obtenir('PaletteDeluxe');

/* **********************************************************************************************************************
AjouterSectionRefs

Permet d'ajouter une section Notes et références rapidement, en un click sur le lien "Ajout section refs" dans la section "plus" à côté des historiques.


Texte ajouté à l'article :

== Notes et références ==
{{Références}}
												
{{Projet:JavaScript/Script}} 
*********************************************************************************************************************** */
// ==================================================================================================================== 
// DEBUT DU CODE
// ====================================================================================================================
// <source lang=javascript><pre><nowiki>

/////////////////////////////////////////////////////////////////////////////////// Variables personnalisables

// Publication automatique
if(typeof window.Section_AutoEdit === 'undefined') window.Section_AutoEdit = true;

// Modification mineure
if(typeof window.Section_MinorEdit === 'undefined') window.Section_MinorEdit = true;

// Ajout à la liste de suivi ( -1 = défaut préférences, 0 = jamais, 1 = toujours)
if(typeof window.Section_Watchthis === 'undefined') window.Section_Watchthis = -1;

/////////////////////////////////////////////////////////////////////////////////// Édition

var Section_ajax = {
  http: function(bundle) {
    var xmlhttp;
    try {
      xmlhttp = new XMLHttpRequest();
    } catch(e) {
      try {
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
      } catch (e) {
        try {
          xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e) {
          xmlhttp = false;
        }
      }
    }
    if (xmlhttp) {
      xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState == 4)
          Section_ajax.httpComplete(xmlhttp,bundle);
      };
      xmlhttp.open(bundle.method ? bundle.method : "GET",bundle.url,bundle.async === false ? false : true);
      if (bundle.headers) {
        for (var field in bundle.headers)
          try {
            xmlhttp.setRequestHeader(field,bundle.headers[field]);
          } catch(err) {  }
      }
      xmlhttp.send(bundle.data ? bundle.data : null);
    }
    return xmlhttp;
  },
  httpComplete: function(xmlhttp,bundle) {
    if (xmlhttp.status == 200 || xmlhttp.status == 302) {
      if (bundle.onSuccess) bundle.onSuccess(xmlhttp,bundle);
    } else if (bundle.onFailure) {
      bundle.onFailure(xmlhttp,bundle);
    }
  }
};

function Section_DoEdit(Req, data){
     while(document.body.firstChild){ document.body.removeChild(document.body.firstChild); }
     document.body.innerHTML = Req.responseText;
     var TextArea = document.getElementById('wpTextbox1');
     if(!TextArea) return;
     if(Section_AutoEdit) document.editform.style.display = "none";

     var OldText = TextArea.value;

     if((OldText.indexOf('{{Références')!=-1) || (OldText.indexOf('<references')!=-1) || (OldText.indexOf('{{Reflist')!=-1)){
        alert('Une balise références existe déjà');
        document.editform.style.display = "";
        return;
     } else if((OldText.indexOf('== Notes et')!=-1) || (OldText.indexOf('==Notes et')!=-1) || (OldText.indexOf('== Références')!=-1) || (OldText.indexOf('==Références')!=-1)){
        alert('Une section "Notes et référence" semble déjà exister');
        document.editform.style.display = "";
        return;
     } else{
          var NouveauModele = '== Notes et références ==\n{{Références}}\n\n';
          var Sommaire = 'Ajout de section Notes et références';
          if((OldText.indexOf('{{DEFAULTSORT:')!=-1)||(OldText.indexOf('[[Catégorie:')!=-1)||(OldText.indexOf('[[catégorie:')!=-1)||(OldText.indexOf('[[Categorie:')!=-1)||(OldText.indexOf('[[categorie:')!=-1)||(OldText.indexOf('{{Portail')!=-1)||(OldText.indexOf('{{portail')!=-1)||(OldText.indexOf('{{Palette')!=-1)||(OldText.indexOf('{{palette')!=-1)||(OldText.indexOf('{{page personnelle')!=-1)){
// ------------------------------------------------------------------------------------ Il y a des catégories/portails/palettes
               
               var DebutModele1 = OldText.substring(0, OldText.indexOf('{{Palette'));
               var DebutModele2 = OldText.substring(0, OldText.indexOf('{{palette'));
               var DebutModele3 = OldText.substring(0, OldText.indexOf('{{Portail'));
               var DebutModele4 = OldText.substring(0, OldText.indexOf('{{portail'));
               var DebutModele5 = OldText.substring(0, OldText.indexOf('{{DEFAULTSORT:'));
               var DebutModele6 = OldText.substring(0, OldText.indexOf('[[Catégorie:'));
               var DebutModele7 = OldText.substring(0, OldText.indexOf('[[catégorie:'));
               var DebutModele8 = OldText.substring(0, OldText.indexOf('[[Categorie:'));
               var DebutModele9 = OldText.substring(0, OldText.indexOf('[[categorie:'));
			   var DebutModele10 = OldText.substring(0, OldText.indexOf('{{page personnelle'));
			   
			   //TODO a refactorer
               var SuiteModele = OldText.split(DebutModele1).join('').split(DebutModele2).join('').split(DebutModele3).join('').split(DebutModele4).join('').split(DebutModele5).join('').split(DebutModele6).join('').split(DebutModele7).join('').split(DebutModele8).join('').split(DebutModele9).join('').split(DebutModele10).join('');
               var DebutModele = OldText.split(SuiteModele).join('');
          }else{
// ------------------------------------------------------------------------------------ Il n'y a pas de catégories/portails/palettes
               var interWiki = new RegExp('^\\s*\\[\\[([a-z][a-z].?(x?-[^\\]]+)?|simple|tokipona):([^\\]]*)\\]\\]\\s*$');
               var blank = new RegExp('^\\s*$');
               var lines = OldText.split('\n');
               var DebutModele = '';
               var SuiteModele = '';
               var FoundInterwiki = false;
               for (var lineId = lines.length - 1; lineId >= 0; --lineId){
                    if (!interWiki.exec(lines[lineId]) && !blank.exec(lines[lineId])){
                         DebutModele = lines.slice(0, lineId + 1).join('\n');
                         SuiteModele = lines.slice(lineId + 1).join('\n');
                         break;
                    }
               }
               DebutModele = DebutModele + '\n\n';
               while(SuiteModele.indexOf('\n\n')!=-1){
                    SuiteModele = SuiteModele.split("\n\n").join("\n");
               }
               SuiteModele = SuiteModele.replace(/^\n/, "");
          }
     }
     var TexteFinal = DebutModele + NouveauModele + SuiteModele;
     var SommaireFinal = Sommaire + ' ; avec [[Utilisateur:Prométhée/AjouterSectionRefs.js|AjouterSectionRefs]] #AjouterSectionRefs';
     document.getElementById('wpMinoredit').checked = Section_MinorEdit;
     if(Section_Watchthis===1) document.getElementById('wpWatchthis').checked = "checked";
     if(Section_Watchthis===0) document.getElementById('wpWatchthis').checked = false;
     document.getElementById('wpTextbox1').value = TexteFinal;
     document.getElementById('wpSummary').value = SommaireFinal;
     if(Section_AutoEdit)document.editform.submit();
}

function Section_Edit(){
    var URL = mw.config.get( 'wgServer' ) + mw.config.get( 'wgScript' ) + "?title=" +encodeURIComponent(mw.config.get( 'wgPageName' )) + "&action=edit";
     Section_ajax.http({url       : URL,
                                 onSuccess : Section_DoEdit,
     });
}

window.Section_AddOne = function(){
    var OngletsCactions = document.getElementById('p-cactions');
    if(OngletsCactions){
        var CactionsUl = OngletsCactions.getElementsByTagName('ul')[0];
        CactionsUl.innerHTML += '<li id="ref-add"><a href="javascript:Section_Edit();">Ajout section refs</a></li>';
        $(OngletsCactions).removeClass("emptyPortlet");
    }
};

/////////////////////////////////////////////////////////////////////////////////// Fonctions actives au chargement de la page

function AjouterSectionRefs(){
      var Homonymie = document.getElementById("homonymie");
      var Pagesliees = document.getElementById("t-whatlinkshere");
      if( Homonymie || !Pagesliees) return;

      Section_AddOne();
}

if ( ( mw.config.get( 'wgAction' ) === 'view' || mw.config.get( 'wgAction' ) === 'purge' ) && (mw.config.get( 'wgNamespaceNumber' ) === 0 || mw.config.get( 'wgNamespaceNumber' ) === 2)) {
	$( AjouterSectionRefs );
}

//</nowiki></pre>
// ====================================================================================================================
// FIN DU CODE
// ==================================================================================================================== 
//</source>