_ _    _ _____  ___   __                       
 __      _(_) | _(_)___ / ( _ ) / /_   ___ ___  _ __ ___  
 \ \ /\ / / | |/ / | |_ \ / _ \| '_ \ / __/ _ \| '_ ` _ \ 
  \ V  V /| |   <| |___) | (_) | (_) | (_| (_) | | | | | |
   \_/\_/ |_|_|\_\_|____/ \___/ \___(_)___\___/|_| |_| |_|

Discussion utilisateur:Dr Brains/GlobalWatchlist.js

Dans le monde d'aujourd'hui, Discussion utilisateur:Dr Brains/GlobalWatchlist.js a acquis une grande importance dans notre société. Que ce soit en raison de son impact sur la culture populaire, de sa pertinence dans le domaine historique, de son influence sur la politique ou de son importance dans le monde du divertissement, Discussion utilisateur:Dr Brains/GlobalWatchlist.js est devenu un sujet d'intérêt pour un grand nombre de personnes à travers le monde. Au fil des années, Discussion utilisateur:Dr Brains/GlobalWatchlist.js a généré de nombreux débats et discussions, et a suscité l'intérêt d'experts de diverses disciplines. Dans cet article, nous explorerons en détail les différents aspects de Discussion utilisateur:Dr Brains/GlobalWatchlist.js et son impact sur notre société actuelle.

//

//

// <pre><nowiki>
  
/////////////////////////////// PARTIE PERSONNALISABLE /////////////////////////////
 
//// Liste des wikis disponibles ////
if(typeof(GlobalWatchlist_WikiList) == 'undefined'){
window.GlobalWatchlist_WikiList = new Array();
GlobalWatchlist_WikiListCount=0;
 
// wikis globaux
GlobalWatchlist_WikiList = '//www.mediawiki.org';
GlobalWatchlist_WikiList = '//meta.wikimedia.org';
GlobalWatchlist_WikiList = '//commons.wikimedia.org';
GlobalWatchlist_WikiList = '//species.wikimedia.org';
GlobalWatchlist_WikiList = '//www.wikidata.org';
GlobalWatchlist_WikiList = '//translatewiki.net';

// wikis multi-langues
var GlobalWatchlist_WikiListLang = new Array();
GlobalWatchlist_WikiListLangCount=0;
GlobalWatchlist_WikiListLang = 'aa';
GlobalWatchlist_WikiListLang = 'ab';
GlobalWatchlist_WikiListLang = 'ace';
GlobalWatchlist_WikiListLang = 'af';
GlobalWatchlist_WikiListLang = 'ak';
GlobalWatchlist_WikiListLang = 'als';
GlobalWatchlist_WikiListLang = 'am';
GlobalWatchlist_WikiListLang = 'an';
GlobalWatchlist_WikiListLang = 'ang';
GlobalWatchlist_WikiListLang = 'ar';
GlobalWatchlist_WikiListLang = 'arc';
GlobalWatchlist_WikiListLang = 'arz';
GlobalWatchlist_WikiListLang = 'as';
GlobalWatchlist_WikiListLang = 'ast';
GlobalWatchlist_WikiListLang = 'av';
GlobalWatchlist_WikiListLang = 'ay';
GlobalWatchlist_WikiListLang = 'az';
GlobalWatchlist_WikiListLang = 'ba';
GlobalWatchlist_WikiListLang = 'bar';
GlobalWatchlist_WikiListLang = 'bat-smg';
GlobalWatchlist_WikiListLang = 'bcl';
GlobalWatchlist_WikiListLang = 'be';
GlobalWatchlist_WikiListLang = 'be-x-old';
GlobalWatchlist_WikiListLang = 'bg';
GlobalWatchlist_WikiListLang = 'bh';
GlobalWatchlist_WikiListLang = 'bi';
GlobalWatchlist_WikiListLang = 'bm';
GlobalWatchlist_WikiListLang = 'bn';
GlobalWatchlist_WikiListLang = 'bo';
GlobalWatchlist_WikiListLang = 'bpy';
GlobalWatchlist_WikiListLang = 'br';
GlobalWatchlist_WikiListLang = 'bs';
GlobalWatchlist_WikiListLang = 'bug';
GlobalWatchlist_WikiListLang = 'bxr';
GlobalWatchlist_WikiListLang = 'ca';
GlobalWatchlist_WikiListLang = 'cbk-zam';
GlobalWatchlist_WikiListLang = 'cdo';
GlobalWatchlist_WikiListLang = 'ce';
GlobalWatchlist_WikiListLang = 'ceb';
GlobalWatchlist_WikiListLang = 'ch';
GlobalWatchlist_WikiListLang = 'cho';
GlobalWatchlist_WikiListLang = 'chr';
GlobalWatchlist_WikiListLang = 'chy';
GlobalWatchlist_WikiListLang = 'ckb';
GlobalWatchlist_WikiListLang = 'co';
GlobalWatchlist_WikiListLang = 'cr';
GlobalWatchlist_WikiListLang = 'crh';
GlobalWatchlist_WikiListLang = 'cs';
GlobalWatchlist_WikiListLang = 'csb';
GlobalWatchlist_WikiListLang = 'cu';
GlobalWatchlist_WikiListLang = 'cv';
GlobalWatchlist_WikiListLang = 'cy';
GlobalWatchlist_WikiListLang = 'cz';
GlobalWatchlist_WikiListLang = 'da';
GlobalWatchlist_WikiListLang = 'de';
GlobalWatchlist_WikiListLang = 'diq';
GlobalWatchlist_WikiListLang = 'dk';
GlobalWatchlist_WikiListLang = 'dsb';
GlobalWatchlist_WikiListLang = 'dv';
GlobalWatchlist_WikiListLang = 'dz';
GlobalWatchlist_WikiListLang = 'ee';
GlobalWatchlist_WikiListLang = 'el';
GlobalWatchlist_WikiListLang = 'eml';
GlobalWatchlist_WikiListLang = 'en';
GlobalWatchlist_WikiListLang = 'eo';
GlobalWatchlist_WikiListLang = 'epo';
GlobalWatchlist_WikiListLang = 'es';
GlobalWatchlist_WikiListLang = 'et';
GlobalWatchlist_WikiListLang = 'eu';
GlobalWatchlist_WikiListLang = 'ext';
GlobalWatchlist_WikiListLang = 'fa';
GlobalWatchlist_WikiListLang = 'ff';
GlobalWatchlist_WikiListLang = 'fi';
GlobalWatchlist_WikiListLang = 'fiu-vro';
GlobalWatchlist_WikiListLang = 'fj';
GlobalWatchlist_WikiListLang = 'fo';
GlobalWatchlist_WikiListLang = 'fr';
GlobalWatchlist_WikiListLang = 'frp';
GlobalWatchlist_WikiListLang = 'fur';
GlobalWatchlist_WikiListLang = 'fy';
GlobalWatchlist_WikiListLang = 'ga';
GlobalWatchlist_WikiListLang = 'gan';
GlobalWatchlist_WikiListLang = 'gd';
GlobalWatchlist_WikiListLang = 'gl';
GlobalWatchlist_WikiListLang = 'glk';
GlobalWatchlist_WikiListLang = 'gn';
GlobalWatchlist_WikiListLang = 'got';
GlobalWatchlist_WikiListLang = 'gu';
GlobalWatchlist_WikiListLang = 'gv';
GlobalWatchlist_WikiListLang = 'ha';
GlobalWatchlist_WikiListLang = 'hak';
GlobalWatchlist_WikiListLang = 'haw';
GlobalWatchlist_WikiListLang = 'he';
GlobalWatchlist_WikiListLang = 'hi';
GlobalWatchlist_WikiListLang = 'hif';
GlobalWatchlist_WikiListLang = 'ho';
GlobalWatchlist_WikiListLang = 'hr';
GlobalWatchlist_WikiListLang = 'hsb';
GlobalWatchlist_WikiListLang = 'ht';
GlobalWatchlist_WikiListLang = 'hu';
GlobalWatchlist_WikiListLang = 'hy';
GlobalWatchlist_WikiListLang = 'hz';
GlobalWatchlist_WikiListLang = 'ia';
GlobalWatchlist_WikiListLang = 'id';
GlobalWatchlist_WikiListLang = 'ie';
GlobalWatchlist_WikiListLang = 'ig';
GlobalWatchlist_WikiListLang = 'ii';
GlobalWatchlist_WikiListLang = 'ik';
GlobalWatchlist_WikiListLang = 'ilo';
GlobalWatchlist_WikiListLang = 'io';
GlobalWatchlist_WikiListLang = 'is';
GlobalWatchlist_WikiListLang = 'it';
GlobalWatchlist_WikiListLang = 'iu';
GlobalWatchlist_WikiListLang = 'ja';
GlobalWatchlist_WikiListLang = 'jbo';
GlobalWatchlist_WikiListLang = 'jp';
GlobalWatchlist_WikiListLang = 'jv';
GlobalWatchlist_WikiListLang = 'ka';
GlobalWatchlist_WikiListLang = 'kaa';
GlobalWatchlist_WikiListLang = 'kab';
GlobalWatchlist_WikiListLang = 'kg';
GlobalWatchlist_WikiListLang = 'ki';
GlobalWatchlist_WikiListLang = 'kj';
GlobalWatchlist_WikiListLang = 'kk';
GlobalWatchlist_WikiListLang = 'kl';
GlobalWatchlist_WikiListLang = 'km';
GlobalWatchlist_WikiListLang = 'kn';
GlobalWatchlist_WikiListLang = 'ko';
GlobalWatchlist_WikiListLang = 'kr';
GlobalWatchlist_WikiListLang = 'ks';
GlobalWatchlist_WikiListLang = 'ksh';
GlobalWatchlist_WikiListLang = 'ku';
GlobalWatchlist_WikiListLang = 'kv';
GlobalWatchlist_WikiListLang = 'kw';
GlobalWatchlist_WikiListLang = 'ky';
GlobalWatchlist_WikiListLang = 'la';
GlobalWatchlist_WikiListLang = 'lad';
GlobalWatchlist_WikiListLang = 'lb';
GlobalWatchlist_WikiListLang = 'lbe';
GlobalWatchlist_WikiListLang = 'lg';
GlobalWatchlist_WikiListLang = 'li';
GlobalWatchlist_WikiListLang = 'lij';
GlobalWatchlist_WikiListLang = 'lmo';
GlobalWatchlist_WikiListLang = 'ln';
GlobalWatchlist_WikiListLang = 'lo';
GlobalWatchlist_WikiListLang = 'lt';
GlobalWatchlist_WikiListLang = 'lv';
GlobalWatchlist_WikiListLang = 'map-bms';
GlobalWatchlist_WikiListLang = 'mdf';
GlobalWatchlist_WikiListLang = 'mg';
GlobalWatchlist_WikiListLang = 'mh';
GlobalWatchlist_WikiListLang = 'mhr';
GlobalWatchlist_WikiListLang = 'mi';
GlobalWatchlist_WikiListLang = 'minnan';
GlobalWatchlist_WikiListLang = 'mk';
GlobalWatchlist_WikiListLang = 'ml';
GlobalWatchlist_WikiListLang = 'mn';
GlobalWatchlist_WikiListLang = 'mo';
GlobalWatchlist_WikiListLang = 'mr';
GlobalWatchlist_WikiListLang = 'ms';
GlobalWatchlist_WikiListLang = 'mt';
GlobalWatchlist_WikiListLang = 'mus';
GlobalWatchlist_WikiListLang = 'mwl';
GlobalWatchlist_WikiListLang = 'my';
GlobalWatchlist_WikiListLang = 'myv';
GlobalWatchlist_WikiListLang = 'mzn';
GlobalWatchlist_WikiListLang = 'na';
GlobalWatchlist_WikiListLang = 'nah';
GlobalWatchlist_WikiListLang = 'nan';
GlobalWatchlist_WikiListLang = 'nap';
GlobalWatchlist_WikiListLang = 'nb';
GlobalWatchlist_WikiListLang = 'nds';
GlobalWatchlist_WikiListLang = 'nds-nl';
GlobalWatchlist_WikiListLang = 'ne';
GlobalWatchlist_WikiListLang = 'new';
GlobalWatchlist_WikiListLang = 'ng';
GlobalWatchlist_WikiListLang = 'nl';
GlobalWatchlist_WikiListLang = 'nn';
GlobalWatchlist_WikiListLang = 'no';
GlobalWatchlist_WikiListLang = 'nomcom';
GlobalWatchlist_WikiListLang = 'nov';
GlobalWatchlist_WikiListLang = 'nrm';
GlobalWatchlist_WikiListLang = 'nv';
GlobalWatchlist_WikiListLang = 'ny';
GlobalWatchlist_WikiListLang = 'oc';
GlobalWatchlist_WikiListLang = 'om';
GlobalWatchlist_WikiListLang = 'or';
GlobalWatchlist_WikiListLang = 'os';
GlobalWatchlist_WikiListLang = 'pa';
GlobalWatchlist_WikiListLang = 'pag';
GlobalWatchlist_WikiListLang = 'pam';
GlobalWatchlist_WikiListLang = 'pap';
GlobalWatchlist_WikiListLang = 'pcd';
GlobalWatchlist_WikiListLang = 'pdc';
GlobalWatchlist_WikiListLang = 'pi';
GlobalWatchlist_WikiListLang = 'pih';
GlobalWatchlist_WikiListLang = 'pl';
GlobalWatchlist_WikiListLang = 'pms';
GlobalWatchlist_WikiListLang = 'pnb';
GlobalWatchlist_WikiListLang = 'pnt';
GlobalWatchlist_WikiListLang = 'ps';
GlobalWatchlist_WikiListLang = 'pt';
GlobalWatchlist_WikiListLang = 'qu';
GlobalWatchlist_WikiListLang = 'rm';
GlobalWatchlist_WikiListLang = 'rmy';
GlobalWatchlist_WikiListLang = 'rn';
GlobalWatchlist_WikiListLang = 'ro';
GlobalWatchlist_WikiListLang = 'roa-rup';
GlobalWatchlist_WikiListLang = 'roa-tara';
GlobalWatchlist_WikiListLang = 'ru';
GlobalWatchlist_WikiListLang = 'rw';
GlobalWatchlist_WikiListLang = 'sa';
GlobalWatchlist_WikiListLang = 'sah';
GlobalWatchlist_WikiListLang = 'sc';
GlobalWatchlist_WikiListLang = 'scn';
GlobalWatchlist_WikiListLang = 'sco';
GlobalWatchlist_WikiListLang = 'sd';
GlobalWatchlist_WikiListLang = 'se';
GlobalWatchlist_WikiListLang = 'sg';
GlobalWatchlist_WikiListLang = 'sh';
GlobalWatchlist_WikiListLang = 'si';
GlobalWatchlist_WikiListLang = 'simple';
GlobalWatchlist_WikiListLang = 'sk';
GlobalWatchlist_WikiListLang = 'sl';
GlobalWatchlist_WikiListLang = 'sm';
GlobalWatchlist_WikiListLang = 'sn';
GlobalWatchlist_WikiListLang = 'so';
GlobalWatchlist_WikiListLang = 'sq';
GlobalWatchlist_WikiListLang = 'sr';
GlobalWatchlist_WikiListLang = 'srn';
GlobalWatchlist_WikiListLang = 'ss';
GlobalWatchlist_WikiListLang = 'st';
GlobalWatchlist_WikiListLang = 'stq';
GlobalWatchlist_WikiListLang = 'su';
GlobalWatchlist_WikiListLang = 'sv';
GlobalWatchlist_WikiListLang = 'sw';
GlobalWatchlist_WikiListLang = 'szl';
GlobalWatchlist_WikiListLang = 'ta';
GlobalWatchlist_WikiListLang = 'te';
GlobalWatchlist_WikiListLang = 'tet';
GlobalWatchlist_WikiListLang = 'tg';
GlobalWatchlist_WikiListLang = 'th';
GlobalWatchlist_WikiListLang = 'ti';
GlobalWatchlist_WikiListLang = 'tk';
GlobalWatchlist_WikiListLang = 'tl';
GlobalWatchlist_WikiListLang = 'tn';
GlobalWatchlist_WikiListLang = 'to';
GlobalWatchlist_WikiListLang = 'tp';
GlobalWatchlist_WikiListLang = 'tpi';
GlobalWatchlist_WikiListLang = 'tr';
GlobalWatchlist_WikiListLang = 'ts';
GlobalWatchlist_WikiListLang = 'tt';
GlobalWatchlist_WikiListLang = 'tum';
GlobalWatchlist_WikiListLang = 'tw';
GlobalWatchlist_WikiListLang = 'ty';
GlobalWatchlist_WikiListLang = 'udm';
GlobalWatchlist_WikiListLang = 'ug';
GlobalWatchlist_WikiListLang = 'uk';
GlobalWatchlist_WikiListLang = 'ur';
GlobalWatchlist_WikiListLang = 'uz';
GlobalWatchlist_WikiListLang = 've';
GlobalWatchlist_WikiListLang = 'vec';
GlobalWatchlist_WikiListLang = 'vi';
GlobalWatchlist_WikiListLang = 'vls';
GlobalWatchlist_WikiListLang = 'vo';
GlobalWatchlist_WikiListLang = 'wa';
GlobalWatchlist_WikiListLang = 'war';
GlobalWatchlist_WikiListLang = 'wo';
GlobalWatchlist_WikiListLang = 'wuu';
GlobalWatchlist_WikiListLang = 'xal';
GlobalWatchlist_WikiListLang = 'xh';
GlobalWatchlist_WikiListLang = 'yi';
GlobalWatchlist_WikiListLang = 'yo';
GlobalWatchlist_WikiListLang = 'za';
GlobalWatchlist_WikiListLang = 'zea';
GlobalWatchlist_WikiListLang = 'zh';
GlobalWatchlist_WikiListLang = 'zh-cfr';
GlobalWatchlist_WikiListLang = 'zh-classical';
GlobalWatchlist_WikiListLang = 'zh-min-nan';
GlobalWatchlist_WikiListLang = 'zh-yue';
GlobalWatchlist_WikiListLang = 'zu';
 
for(a=0;a<GlobalWatchlist_WikiListLang.length;a++){
      GlobalWatchlist_WikiList = '//'+GlobalWatchlist_WikiListLang+'.wikipedia.org';
      GlobalWatchlist_WikiList = '//'+GlobalWatchlist_WikiListLang+'.wikibooks.org';
      GlobalWatchlist_WikiList = '//'+GlobalWatchlist_WikiListLang+'.wiktionary.org';
      GlobalWatchlist_WikiList = '//'+GlobalWatchlist_WikiListLang+'.wikinews.org';
      GlobalWatchlist_WikiList = '//'+GlobalWatchlist_WikiListLang+'.wikiquote.org';
      GlobalWatchlist_WikiList = '//'+GlobalWatchlist_WikiListLang+'.wikisource.org';
      GlobalWatchlist_WikiList = '//'+GlobalWatchlist_WikiListLang+'.wikiversity.org';
      GlobalWatchlist_WikiList = '//'+GlobalWatchlist_WikiListLang+'.wikivoyage.org';
}
} 
 
if(typeof(GlobalWatchlist_Classes) == 'undefined'){
  window.GlobalWatchlist_Classes = new Object();
  GlobalWatchlist_Classes = 'wwwmediawiki';
  GlobalWatchlist_Classes = 'metawiki';
  GlobalWatchlist_Classes = 'commons';
  GlobalWatchlist_Classes = 'wikispecies';
  GlobalWatchlist_Classes = 'wikidata';
  GlobalWatchlist_Classes = 'wikipedia';
  GlobalWatchlist_Classes = 'wikibooks';
  GlobalWatchlist_Classes = 'wiktionary';
  GlobalWatchlist_Classes = 'wikinews';
  GlobalWatchlist_Classes = 'wikiquote';
  GlobalWatchlist_Classes = 'wikisource';
  GlobalWatchlist_Classes = 'wikiversity';
  GlobalWatchlist_Classes = 'wikivoyage';

}

var GlobalWatchlist_Options = new Array();
var GlobalWatchlist_TimeCorrection = "00:00";

var GlobalWatchlist_Bugs = new Array();

//// Textes des liens ////
if(typeof(GlobalWatchlist_Text) == 'undefined'){
  window.GlobalWatchlist_Text = new Object();

  GlobalWatchlist_Text = 'Liste de suivi globale';
  GlobalWatchlist_Text = 'Liste de suivi globale de différents wikis';

  GlobalWatchlist_Text = 'Options de la liste de suivi globale';
  GlobalWatchlist_Text = 'Il est possible de sélectionner plusieurs wikis en maintenant enfoncée la touche CTRL';
  GlobalWatchlist_Text = 'Liste complète';
  GlobalWatchlist_Text = 'Rechercher un wiki dans la liste';
  GlobalWatchlist_Text = 'Wikis sélectionnés';
  GlobalWatchlist_Text = '<';
  GlobalWatchlist_Text = 'Supprimer un wiki de la liste';
  GlobalWatchlist_Text = '>';
  GlobalWatchlist_Text = 'Ajouter un wiki à la liste';
  GlobalWatchlist_Text = 'Rafraîchir';
  GlobalWatchlist_Text = 'Rafraîchir la liste de suivi globale';

  GlobalWatchlist_Text = 'Masquer les robots';
  GlobalWatchlist_Text = 'Masquer les utilisateurs anonymes';
  GlobalWatchlist_Text = 'Masquer les utilisateurs enregistrés';
  GlobalWatchlist_Text = 'Masquer les modifications mineures';
  GlobalWatchlist_Text = 'Masquer mes modifications';
  GlobalWatchlist_Text = 'Masquer les journaux';
  GlobalWatchlist_Text = 'Afficher uniquement les modifications les plus récentes';
  GlobalWatchlist_Text = 'Afficher en <b>gras</b> les pages qui ont été modifiées depuis ma dernière visite';
  GlobalWatchlist_Text = 'Grouper les changements par page';

  GlobalWatchlist_Text = 'Masquer ces changements';
  GlobalWatchlist_Text = 'Afficher ces changements';
  GlobalWatchlist_Text = '▼';
  GlobalWatchlist_Text = '►';

  GlobalWatchlist_Text = "Fuseau horaire";

  GlobalWatchlist_Text    = "Page de discussion de l'article";
  GlobalWatchlist_Text     = "discuter";
  GlobalWatchlist_Text        = "Différence entre les versions";
  GlobalWatchlist_Text         = "diff";
  GlobalWatchlist_Text         = "Journal";
  GlobalWatchlist_Text          = "Journal";
  GlobalWatchlist_Text        = "Historique de la page";
  GlobalWatchlist_Text         = "hist";
  GlobalWatchlist_Text        = "Modifier la page";
  GlobalWatchlist_Text         = "modifier";
  GlobalWatchlist_Text     = "Ne plus suivre la page";
  GlobalWatchlist_Text      = "ne plus suivre";
  GlobalWatchlist_Text    = "Page de discussion de l'utilisateur";
  GlobalWatchlist_Text     = "discuter";
  GlobalWatchlist_Text = "Contributions de l'utilisateur";
  GlobalWatchlist_Text  = "contributions";

  GlobalWatchlist_Text = '<b><u>Rapport de bug</u></b><br>Contacter $1 avec le message suivant : <pre>Classes problématiques :\n';

  GlobalWatchlist_Text = {
    "minor":'<abbr class="minoredit" title="Cette modification est mineure.">m</abbr>',
    "bot":'<abbr class="botedit" title="Cette modification a été effectuée par un robot.">b</abbr>' /*,
    "patrol":'<abbr class="unpatrolled" title="Cette modification n’a pas été relue.">!</abbr>'
*/
  };


  GlobalWatchlist_Text = {
                                          "1":"janvier",
                                          "2":"février",
                                          "3":"mars",
                                          "4":"avril",
                                          "5":"mai",
                                          "6":"juin",
                                          "7":"juillet",
                                          "8":"août",
                                          "9":"septembre",
                                          "10":"octobre",
                                          "11":"novembre",
                                          "12":"décembre"
  };


}

/////////////////////////////// FIN DE LA PARTIE PERSONNALISABLE /////////////////////////////
 
 
// Mise à jour du cookie

function GlobalWatchlist_SetCookie(cookieName, cookieValue) {
        var now = new Date();
        var nextYear = new Date(now.getTime() + 1000 * 60 * 60 * 24 * 365 );
        return jQuery.cookie(cookieName, cookieValue, {expires:nextYear, path:"/"});
}
 
// Interrogation du cookie

function GlobalWatchlist_GetCookie(cookieName) {
        return jQuery.cookie(cookieName);
}

// Ajax
var GlobalWatchlist_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){ GlobalWatchlist_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); }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); }else{ }}
};


 
// Mise en forme de la page

function GlobalWatchlist_Init(){ 
       GlobalWatchlist_getShowOptions();
       GlobalWatchlist_getTimeOptions();
       $(document.body).addClass("GlobalWatchlist");
       var Title = document.getElementsByTagName('title');
       Title.innerHTML = GlobalWatchlist_Text;  
       var FirstHeading = document.getElementById("firstHeading"); 
       FirstHeading.innerHTML = GlobalWatchlist_Text;  
       var Content = document.getElementById("mw-content-text"); 
       while(Content.firstChild){ Content.removeChild(Content.firstChild); } 
       var Options = GlobalWatchlist_GetCookie("GlobalWatchlistOptions");
       if(Options !== null){
              GlobalWatchlist_Options = new Array();
              OptionsSplit = decodeURIComponent(Options).split("SPLIT")
              for(a=0;a<OptionsSplit.length;a++) {
                     if (OptionsSplit != '' && OptionsSplit != 'null') {
                            GlobalWatchlist_Options.push(OptionsSplit);
                     }
              }
       }
       var WikiTime = GlobalWatchlist_GetCookie("GlobalWatchlistTimeCorrection");
       if(WikiTime != null) GlobalWatchlist_TimeCorrection = decodeURIComponent(WikiTime);
       var tip = '&nbsp;<sup><small><abbr title="'+GlobalWatchlist_Text+'">(?)</abbr></small></sup>';
       var GlobalWatchlist_Form = '<fieldset><legend>'+GlobalWatchlist_Text+'</legend>'
       +'<table align="center" style="background-color:transparent;"><tr><td>'
       + '<ul id="showOptions">'
       +'<li><select id="timecorrection" >';
       for(var a=-23,l=24;a<l;a++){
         var time = (a<0 ? "-" : (a>0 ? "+" : ""))+( (a*a)<100 ? "0"+Math.abs(a) : Math.abs(a))+":00";
         GlobalWatchlist_Form +=''
         + '<option value="'+time+'" '+ ( (time==GlobalWatchlist_TimeCorrection)? 'selected="selected" ' : '' )
         +'>'+time+'</option>';
       }
       GlobalWatchlist_Form +=''
       +'</select>&nbsp;<label for="timecorrection">'+GlobalWatchlist_Text+'</label></li>'
       +'<li><input type="checkbox" id="hideBots" '
       +'value="!bot" '+(GlobalWatchlist_Options.indexOf("!bot")!=-1 ? 'checked="checked" ': '')+'/>'
       +'&nbsp;<label for="hideBots">'+GlobalWatchlist_Text+'</label></li>'
       +'<li><input type="checkbox" id="hideAnon" '
       +'value="!anon" '+(GlobalWatchlist_Options.indexOf("!anon")!=-1 ? 'checked="checked" ': '')+'/>'
       +'&nbsp;<label for="hideAnon">'+GlobalWatchlist_Text+'</label></li>'
       +'<li><input type="checkbox" id="hideRegistred" '
       +'value="anon" '+(GlobalWatchlist_Options.indexOf("anon")!=-1 ? 'checked="checked" ': '')+'/>'
       +'&nbsp;<label for="hideRegistred">'+GlobalWatchlist_Text+'</label></li>'
       +'<li><input type="checkbox" id="hideMinor" '
       +'value="!minor" '+(GlobalWatchlist_Options.indexOf("!minor")!=-1 ? 'checked="checked" ': '')+'/>'
       +'&nbsp;<label for="hideMinor">'+GlobalWatchlist_Text+'</label></li>'
       +'<li><input type="checkbox" id="hideMyself" '
       +'value="!self" '+(GlobalWatchlist_Options.indexOf("!self")!=-1 ? 'checked="checked" ': '')+'/>'
       +'&nbsp;<label for="hideMyself">'+GlobalWatchlist_Text+'</label></li>'
       +'<li><input type="checkbox" id="hideLogs" '
       +'value="!log" '+(GlobalWatchlist_Options.indexOf("!log")!=-1 ? 'checked="checked" ': '')+'/>'
       +'&nbsp;<label for="hideLogs">'+GlobalWatchlist_Text+'</label></li>'
       +'<li><input type="checkbox" id="hideAll" '
       +'value="!all" '+(GlobalWatchlist_Options.indexOf("!all")!=-1 ? 'checked="checked" ': '')+'/>'
       +'&nbsp;<label for="hideAll">'+GlobalWatchlist_Text+'</label></li>'
       +'<li><input type="checkbox" id="showGrouped" '
       +'value="grouped" '+(GlobalWatchlist_Options.indexOf("grouped")!=-1 ? 'checked="checked" ': '')+'/>'
       +'&nbsp;<label for="showGrouped">'+GlobalWatchlist_Text+'</label></li>'
       +'<li><input type="checkbox" id="showNotif" onclick="GlobalWatchlist_checkNotifShow()" '
       +'value="notif" '+(GlobalWatchlist_Options.indexOf("notif")!=-1 ? 'checked="checked" ': '')+'/>'
       +'&nbsp;<label for="showNotif">'+GlobalWatchlist_Text+'</label></li>'
       +'</ul>'
       +'</td><td width="3%">'
       +'</td><td>'
       +'<center><span style="margin:0.3em;"><b>'+GlobalWatchlist_Text+tip+'</b></span></center>'
       +'<center><input type="text" id="searchwiki" size="28" style="padding-top:0;padding-bottom:0;" '
       + 'onkeyup="GlobalWatchlist_Search();" title="'+GlobalWatchlist_Text+'"/></center>';
       GlobalWatchlist_Form +=''
       +'<select id="ListWiki" name="ListWiki" align="top" size="12" multiple="multiple">';
       GlobalWatchlist_WikiList.sort();
       for (i=0; i<GlobalWatchlist_WikiList.length; i++) {
              GlobalWatchlist_Form += '<option value="'+GlobalWatchlist_WikiList+'">'+GlobalWatchlist_WikiList.split("//").join("")+'</option>'
       }
       GlobalWatchlist_Form +='</select>'
       +'</td><td>'
       +'<center><input type="button" name="Wiki_Del" '
       +'value="'+GlobalWatchlist_Text+'" '
       +'title="'+GlobalWatchlist_Text+'" '
       +'onclick="GlobalWatchlist_SupprWiki();" onselect="GlobalWatchlist_SupprWiki();" />'
       +'<input type="button" name="Wiki_Add" '
       +'value="'+GlobalWatchlist_Text+'" '
       +'title="'+GlobalWatchlist_Text+'" '
       +'onclick="GlobalWatchlist_AddWiki();" onselect="GlobalWatchlist_AddWiki();" /></center>'
       +'<center><input type="button" name="OK" '
       +'value="'+GlobalWatchlist_Text+'" '
       +'title="'+GlobalWatchlist_Text+'" '
       +'style="padding:0;" '
       +'onclick="GlobalWatchlist_Init();" onselect="GlobalWatchlist_Init();" /></center>'
       +'</td><td><center><span style="margin:0.3em;"><b>'+GlobalWatchlist_Text+tip+'</b></span></center>'
       +'<select id="WatchWiki" name="WatchWiki" align="top" size="13" multiple="multiple">'; 
       var WikiList = GlobalWatchlist_GetCookie("GlobalWatchlist");
       if(WikiList != null){
              var GlobalWatchlist_WikiSuivis = new Array();
              WikiListSplit = WikiList.split("SPLIT")
              for (a=0;a<WikiListSplit.length;a++) {
                     if (WikiListSplit != '' && WikiListSplit != 'null') {
                            GlobalWatchlist_WikiSuivis.push (WikiListSplit);
                     }
              }
       }else{
              var GlobalWatchlist_WikiSuivis = new Array();
              GlobalWatchlist_WikiSuivis.push(mw.config.get('wgServer'));
       }
       for(a=0;a<GlobalWatchlist_WikiSuivis.length;a++){
              GlobalWatchlist_Form += '<option value="'+GlobalWatchlist_WikiSuivis+'" style="color:red;">'+GlobalWatchlist_WikiSuivis.split("//").join("")+'</option>';
       }
       GlobalWatchlist_Form += '</select>'
       + '</td></tr><tr></table>'
       + '<div id="GlobalWatchlist_bugreport" style="display:none;"></div></fieldset><div id="GlobalWatchlist_edits"></div>'; 
       Content.innerHTML += GlobalWatchlist_Form;
       GlobalWatchlist_checkNotifShow();
       GlobalWatchlist_Launch();       
}

function GlobalWatchlist_deleteNotShowOptions(Text){
  var unwantedoptions = ;
  for(var a=0,l=unwantedoptions.length;a<l;a++){ Text = Text.split(unwantedoptions).join(""); }
  Text = Text.split("||").join("");
  return Text;
}

function GlobalWatchlist_checkNotifShow(){
  var notifInput = document.getElementById("showNotif");
  if(notifInput.checked) $(document.body).addClass("mw-special-GlobalWatchlist");
  else $(document.body).removeClass("mw-special-GlobalWatchlist");
}


// Affiche un lien vers la liste de suivi globale dans les outils personnels

function GlobalWatchlist_Link(){
        var LienWatchlist = document.getElementById('pt-watchlist');
        if(LienWatchlist!=null){
                var LienGlobalWatchlist = document.createElement('li');
                LienGlobalWatchlist.id = 'pt-Gwatchlist';
                if((mw.config.get('wgCanonicalSpecialPageName')=="Blankpage")&&(mw.config.get('wgTitle').split("/")==="GlobalWatchlist"))
                  LienGlobalWatchlist.className = "active";
                LienGlobalWatchlist.innerHTML = '<a href="'+mw.config.get('wgArticlePath').split("$1").join("Special:Blankpage/GlobalWatchlist")+'" title="'+GlobalWatchlist_Text+'" >'+GlobalWatchlist_Text+'</a>';
                LienWatchlist.parentNode.insertBefore(LienGlobalWatchlist,LienWatchlist);
        }else if(mw.config.get('skin')=="cologneblue"){
                var LienWatchlist = document.getElementById('topbar').getElementsByTagName('a');
                var Separator = document.createTextNode(' | ');
                var LienGlobalWatchlist = document.createElement('a');
                if((mw.config.get('wgCanonicalSpecialPageName')=="Blankpage")&&(mw.config.get('wgTitle').split("/")==="GlobalWatchlist"))
                  LienGlobalWatchlist.className = "active";
                LienGlobalWatchlist.href = mw.config.get('wgArticlePath').split("$1").join("Special:Blankpage/GlobalWatchlist");
                LienGlobalWatchlist.innerHTML = GlobalWatchlist_Text;
                LienGlobalWatchlist.title = GlobalWatchlist_Text;
                LienWatchlist.parentNode.insertBefore(Separator,LienWatchlist);
                LienWatchlist.parentNode.insertBefore(LienGlobalWatchlist,Separator);   
        }
}
 
// Ajoute un wiki à la liste de suivi

function GlobalWatchlist_AddWiki(){
        var ListeCompleteSelect = document.getElementById('ListWiki');
        var ListeWikisSelect = document.getElementById('WatchWiki');
        var ListeComplete = ListeCompleteSelect.getElementsByTagName('option');
        var ListeWikis = ListeWikisSelect.getElementsByTagName('option');
        var AncienneListe = new Array();
        var NouvelleListe = new Array();
        for(a=0;a<ListeWikis.length;a++){
                var WikiName = ListeWikis.value;
                AncienneListe.push(WikiName);
                NouvelleListe.push(WikiName);
        }
        for(var a=0;a<ListeComplete.length;a++){
                if(!ListeComplete.selected) continue;
                var WikiSelectedName = ListeComplete.value;
                if(NouvelleListe.indexOf(WikiSelectedName)==-1) NouvelleListe.push(WikiSelectedName);
                ListeComplete.selected = false;
        }
        var CookieValue = '';
        for(var b=0;b<NouvelleListe.length;b++){
                var NewWiki = NouvelleListe;
                CookieValue += NewWiki + 'SPLIT';
                if(AncienneListe.indexOf(NewWiki)==-1){
                        var opt = document.createElement('option');
                        opt.value = NewWiki;
                        opt.innerHTML = NewWiki.split("//").join("");
                        opt.style.color = "red";
                        ListeWikisSelect.appendChild(opt);
                }
        }
        GlobalWatchlist_SetCookie('GlobalWatchlist',CookieValue);
}
 
// Supprime un wiki de la liste de suivi

function GlobalWatchlist_SupprWiki(){
        var ListeWikisSelect = document.getElementById('WatchWiki');
        var ListeWikis = ListeWikisSelect.getElementsByTagName('option');
        var NouvelleListe = new Array();
        var CookieValue = '';
        for(a=0;a<ListeWikis.length;a++){
                var opt = ListeWikis;
                if(!opt) continue;
                if(opt.selected){
                        opt.parentNode.removeChild(opt);
                        a--
                }else{
                        var WikiName = opt.value;
                        NouvelleListe.push(WikiName);
                        CookieValue += WikiName + 'SPLIT';
                }
        }
        GlobalWatchlist_SetCookie('GlobalWatchlist',CookieValue);
} 

function GlobalWatchlist_Search(){
  var searchwiki = document.getElementById("searchwiki");
  var Select = document.getElementById("ListWiki");
  if(!searchwiki || !Select) return;
  var text = "//"+searchwiki.value;
  if(text === "//") return;
  var Options = Select.getElementsByTagName('option');
  for(var a=0,l=Options.length;a<l;a++){
    var opt = Options;
    if(opt.value.indexOf(text)==0){
      GlobalWatchlist_ScrollToOption(Options);
      GlobalWatchlist_ScrollToOption(opt);
      return;
    }
  }
}

function GlobalWatchlist_ScrollToOption(opt){
  if(!opt) return;
  var isSelected = (opt.selected ? "selected" : false);
  opt.selected = false;
  opt.selected = "selected";
  opt.selected = isSelected;
}

function GlobalWatchlist_Launch(){
  var Target = document.getElementById("GlobalWatchlist_edits");
  var Select = document.getElementById("WatchWiki");
  if(!Target || !Select) return;
  while(Target.firstChild){ Target.removeChild(Target.firstChild); };
  if(GlobalWatchlist_Options.indexOf("!bot")!=-1) $(Target).addClass("nobots");
  else $(Target).removeClass("nobots");
  if(GlobalWatchlist_Options.indexOf("!minor")!=-1) $(Target).addClass("nominors");
  else  $(Target).removeClass("nominors");
  var Options = Select.getElementsByTagName('option');
  if(Options.length===0) return;
  var Servers = new Array();
  for(var a=0,l=Options.length;a<l;a++){
    var Option = Options;
    Option.style.color = "red";
    Servers.push(Option.value);
  }
  GlobalWatchlist_Request(Servers, 0);
}

function GlobalWatchlist_getShowOptions(){
  var ShowOptions = document.getElementById("showOptions");
  if(!ShowOptions) return;
  GlobalWatchlist_Options = new Array();
  var opts = ShowOptions.getElementsByTagName('input');
  for(var a=0,l=opts.length;a<l;a++){
    var opt = opts;
    if(opt.type != "checkbox") continue;
    var thisopt = opt.value;
    if(opt.checked){
      GlobalWatchlist_Options.push(thisopt);
    }
  }
  GlobalWatchlist_SetCookie('GlobalWatchlistOptions', GlobalWatchlist_Options.join("SPLIT"));
}

function GlobalWatchlist_getTimeOptions(){
  var Select = document.getElementById("timecorrection");
  if(!Select) return;
  var Time = Select.value;
  GlobalWatchlist_TimeCorrection = Time;
  GlobalWatchlist_SetCookie('GlobalWatchlistTimeCorrection', GlobalWatchlist_TimeCorrection);
}

var GlobalWatchlist_StandardURL = ''
  + '/w/api.php?format=xml&action=query&list=watchlist'
  + '&wllimit=499'
  + '&wlprop=ids|title|flags|user|userid|comment|parsedcomment|timestamp|sizes|notificationtimestamp|loginfo'
  + '&wltype=new|edit'; // |external

function GlobalWatchlist_Request(Servers, position){
  var Server = Servers;
  if(!Server){
    if(GlobalWatchlist_Options.indexOf("grouped")!=-1) GlobalWatchlist_GroupEdits();
    return;
  }
  if(Server == mw.config.get('wgServer')){
    var URL = Server + GlobalWatchlist_StandardURL;
    if(GlobalWatchlist_Options.indexOf("!log")==-1) URL += '|log';
    if(GlobalWatchlist_Options.indexOf("!all")==-1) URL += '&wlallrev';
    if(GlobalWatchlist_Options.indexOf("!self")!=-1) URL += '&wlexcludeuser=' + encodeURIComponent(mw.config.get('wgUserName'));
    var otherShowOptions = GlobalWatchlist_deleteNotShowOptions(GlobalWatchlist_Options.join("|"));
    if(otherShowOptions != "") URL += '&wlshow=' + otherShowOptions;
    GlobalWatchlist_ajax.http({
          url: URL,
          servers:Servers,
          serverpos: position,
          onSuccess:GlobalWatchlist_FillEditsDiv,
          onFailure:GlobalWatchlist_FillEditsDiv
    });
  }else{
    var URL = mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/api.php?format=xml&action=centralauthtoken';
    GlobalWatchlist_ajax.http({
          url: URL,
          servers:Servers,
          serverpos: position,
          onSuccess:GlobalWatchlist_ManageCentralAuthToken,
          onFailure:GlobalWatchlist_ManageCentralAuthToken
    });
  }
}

function GlobalWatchlist_ManageCentralAuthToken(Req, data){
  var centralauthtoken = false;
  try{
    var XML = Req.responseXML;
    var Tokens = XML.getElementsByTagName('centralauthtoken');
    centralauthtoken = Tokens.getAttribute('centralauthtoken');
  }catch(e){ }
  if(!centralauthtoken) return GlobalWatchlist_Request(data.servers, (data.serverpos+1));;
  var Server = data.servers;
  var URL = Server + GlobalWatchlist_StandardURL
  if(GlobalWatchlist_Options.indexOf("!log")==-1) URL += '|log';
  if(GlobalWatchlist_Options.indexOf("!all")==-1) URL += '&wlallrev';
  if(GlobalWatchlist_Options.indexOf("!self")!=-1) URL += '&wlexcludeuser=' + encodeURIComponent(mw.config.get('wgUserName'));
  var otherShowOptions = GlobalWatchlist_deleteNotShowOptions(GlobalWatchlist_Options.join("|"));
  if(otherShowOptions!="") URL += '&wlshow=' + otherShowOptions;
  URL += '&origin='+encodeURIComponent(window.location.protocol+mw.config.get('wgServer'))
       + '&centralauthtoken='+encodeURIComponent(centralauthtoken);
  GlobalWatchlist_ajax.http({
          url: URL,
          servers:data.servers,
          serverpos: data.serverpos,
          onSuccess:GlobalWatchlist_FillEditsDiv,
          onFailure:GlobalWatchlist_FillEditsDiv
  });
}

function GlobalWatchlist_FillEditsDiv(Req, data){
  var Target = document.getElementById("GlobalWatchlist_edits");
  var Select = document.getElementById("WatchWiki");
  if(!Target || !Select) return;
  var XML = Req.responseXML;
  if(!XML){
    GlobalWatchlist_Request(data.servers, (data.serverpos+1));
    return;
  }
  var api = XML.getElementsByTagName('api');
  if(!api || api.firstChild.nodeName == "error"){
    GlobalWatchlist_Request(data.servers, (data.serverpos+1));
    return;
  }
  var query = api.getElementsByTagName('query');
  if(!query){
    GlobalWatchlist_Request(data.servers, (data.serverpos+1));
    return;
  }
  var Server = data.servers;
  var items = api.getElementsByTagName('item');
  for(var a=0,l=items.length;a<l;a++){
    var item = items;
    var watchtimestamp = GlobalWatchlist_FillEditsDiv_ManageTimestamp(item.getAttribute('timestamp'));
    var watchpage = item.getAttribute('title');
    var bot = (item.getAttribute('bot')==="");
    var minor = (item.getAttribute('minor')==="");
    var patrolled = (item.getAttribute('patrolled')==="");
    var watchtype = item.getAttribute('type');
    var watchlogtype = item.getAttribute('logtype');
    var watchaction = item.getAttribute('logaction');
    var notificationtimestamp = item.getAttribute('notificationtimestamp');
    var date = parseInt(watchtimestamp.split("T").split("-").join(""));
    var oldUL = document.getElementById(date);
    if(!oldUL){
      var uladded = false;
      oldUL = document.createElement('ul');
      oldUL.id = date;
      oldUL.className = "special";
      var AllUl = Target.getElementsByTagName('ul');
      if(AllUl.length===0){
        uladded = true;
        Target.appendChild(oldUL);
      }else{
        for(var u=0,ulen=AllUl.length;u<ulen;u++){
          if(uladded) continue;
          var ul = AllUl;
          var ulid = parseInt(ul.id);
          if(ulid < date){
            ul.parentNode.insertBefore(oldUL, ul.previousSibling);
            uladded = true;
          }
        }
      }
      if(!uladded) Target.appendChild(oldUL);
      var DateLi = document.createElement("h4");
      DateLi.className = "DateLi";
      oldUL.parentNode.insertBefore(DateLi, oldUL);
      var FormattedDate = watchtimestamp.split("T").split("-");
      FormattedDate = parseInt(FormattedDate) + " " + GlobalWatchlist_Text)] + " " + FormattedDate;
      DateLi.innerHTML = FormattedDate;
    }
    var NotifyText = GlobalWatchlist_FillEditsDiv_CreateLiContent(item, Server);
    var LiTs = parseInt(watchtimestamp.split("T").join("").split("Z").join("").split("-").join("").split(":").join(""));
    var Li = document.createElement('li');
    Li.id = LiTs;
    Li.title = Server;
    for(var servername in GlobalWatchlist_Classes){
        if(Server.indexOf(servername)!=-1) Li.className = GlobalWatchlist_Classes;
    }
    $(Li).addClass("GWLpage-"+GlobalWatchlist_FillEditsDiv_SanitizeClass(Server+"-_-"+watchpage));
    if(watchtype === "log"){
       $(Li).addClass("mw-changeslist-line-log");
       $(Li).addClass("mw-changeslist-line-"+watchlogtype);
       $(Li).addClass("mw-changeslist-line-"+watchlogtype+"-"+watchaction);
    }
    if(notificationtimestamp==="") $(Li).addClass("mw-changeslist-line-not-watched");
    else $(Li).addClass("mw-changeslist-line-watched");
    if(bot) $(Li).addClass("bot");
    if(minor) $(Li).addClass("minor"); 
    if(patrolled) $(Li).addClass("patrolled");
    Li.innerHTML = NotifyText;
    var addedli = false;
    var alllis = oldUL.getElementsByTagName('li');
    if(alllis.length===0){
      oldUL.appendChild(Li);
      addedli = true;
    }else{
      for(var u=0,ulen=alllis.length;u<ulen;u++){
        if(addedli) continue;
        var li = alllis;
        var liid = parseInt(li.id);
        if(liid < LiTs){
          li.parentNode.insertBefore(Li, li);
          addedli = true;
        }
      }
    }
    if(!addedli) oldUL.appendChild(Li);
    GlobalWatchlist_FillEditsDiv_ManageLiContent(Li, Server);
  }
  var Options = Select.getElementsByTagName('option');
  for(var a=0,l=Options.length;a<l;a++){
    var Option = Options;
    if(Option.value != Server) continue;
    Option.style.color = "green";
  }  
  GlobalWatchlist_Request(data.servers, (data.serverpos+1));
}

function GlobalWatchlist_FillEditsDiv_SanitizeClass(ClassName){
  ClassName = ClassName.replace(/\{\}\.\$\?]/g, "_");
//  ClassName = ClassName.replace(/\{\}\.\$\?]/g, "_"); // For tests
  return ClassName;
}

function GlobalWatchlist_FillEditsDiv_CreateLiContent(item, Server){
    var watchtimestamp = GlobalWatchlist_FillEditsDiv_ManageTimestamp(item.getAttribute('timestamp'));
    var watchtype = item.getAttribute('type');
    var watchlogtype = item.getAttribute('logtype');
    var watchaction = item.getAttribute('logaction');
    var watchpageid = item.getAttribute('pageid');
    var watcholdrevid = item.getAttribute('old_revid');
    var watchrevid = item.getAttribute('revid');
    var watchpage = item.getAttribute('title');
    var watchuser = item.getAttribute('user');
    var watchsum = item.getAttribute('parsedcomment');
    var oldlen = parseInt(item.getAttribute('oldlen'));
    var newlen = parseInt(item.getAttribute('newlen'));
    var codedpage = encodeURIComponent(watchpage);
    var codeduser = encodeURIComponent(watchuser);
    var Time = watchtimestamp.split("T").split("Z").join("");
    var Type = (Server == mw.config.get('wgServer') ? 'target="_blank" ' : 'class="extiw" target="_blank" ' );
    var PageLink = '<a '+Type+'href="'+Server+mw.config.get('wgScript')+'?title='+codedpage+'" '
                 + 'title="'+watchpage+'">'+watchpage+'</a>';

    var DiffLink = "";
    if(watchtype=="new"){
      DiffLink = GlobalWatchlist_Text;
    }else if(watchtype=="edit"){
      DiffLink = '<a '+Type+'href="'+Server+mw.config.get('wgScript')+'?title='+codedpage+'&diff='+watchrevid+'&oldid='+watcholdrevid+'" '
                 + 'title="'+GlobalWatchlist_Text+'">'+GlobalWatchlist_Text+'</a>';
    }else if(watchtype=="log"){
      DiffLink = '<a '+Type+'href="'+Server+mw.config.get('wgScript')+'?title=Special:Log&type='+watchlogtype+'&page='+codedpage+'&user='+codeduser+'" '
                 + 'title="'+GlobalWatchlist_Text+' '+watchtype+'">'+GlobalWatchlist_Text+' '+watchlogtype+'/'+watchaction+'</a>';
    }
    var HistLink = '<a '+Type+'href="'+Server+mw.config.get('wgScript')+'?title='+codedpage+'&action=history" '
                 + 'title="'+GlobalWatchlist_Text+'">'+GlobalWatchlist_Text+'</a>';
    var EditLink = '<a '+Type+'href="'+Server+mw.config.get('wgScript')+'?title='+codedpage+'&action=edit" '
                 + 'title="'+GlobalWatchlist_Text+'">'+GlobalWatchlist_Text+'</a>';
    var StopLink = '<a '+Type+'href="'+Server+mw.config.get('wgScript')+'?title='+codedpage+'&action=unwatch" '
                 + 'title="'+GlobalWatchlist_Text+'">'+GlobalWatchlist_Text+'</a>';
    var UserLink = '<a '+Type+'href="'+Server+mw.config.get('wgArticlePath').split('$1').join('User:'+codeduser)+'" '
                 + 'title="User:'+watchuser+'">'+watchuser+'</a>';
    var UserTalkLink = '<a '+Type+'href="'+Server+mw.config.get('wgArticlePath').split('$1').join('User talk:'+codeduser)+'" '
                 + 'title="'+GlobalWatchlist_Text+'">'+GlobalWatchlist_Text+'</a>';
    var UserContribLink = '<a '+Type+'href="'+Server + mw.config.get('wgArticlePath').split('$1').join('Special:Contributions/'+codeduser)+'" '
                 + 'title="'+GlobalWatchlist_Text+'">'+GlobalWatchlist_Text+'</a>';
    var sizespan = "";
    var loginfos = "";
    if(watchtype!="log"){    
        var diffsize = (newlen-oldlen);
        var sizeclass = "mw-plusminus-null";
        if(diffsize<0) sizeclass = "mw-plusminus-neg";
        if(diffsize>0) sizeclass = "mw-plusminus-pos";
        sizespan = '<span class="mw-sizespan '+sizeclass+'">'+((diffsize*diffsize>250000)?'<b>('+diffsize+')</b>':'('+diffsize+')' )+'</span>';
    }else{
        loginfos = GlobalWatchlist_FillEditsDiv_getItemLogIfos(item, Server);
    }
    var tags = "";
    for(var tag in GlobalWatchlist_Text){
      tags += GlobalWatchlist_Text;
    }
    var NotifyText = '$00 <span class="mw-changeslist-date" title="$01">$02</span> (<span class="mw-difflink">$04</span>|$05|$06|$07) <span class="mw-changeslist-separator">. .</span> <span class="mw-title">$03</span> <span class="mw-changeslist-separator">. .</span> $12 <span class="mw-changeslist-separator">. .</span> <span class="mw-user">$08</span> <span class="mw-usertoollinks">($09|$10)</span> <span class="comment">($11)</span>';
    if(watchtype=="log"){
        NotifyText = '$00 <span class="mw-changeslist-date" title="$01">$02</span> (<span class="mw-difflink">$04</span>) <span class="mw-changeslist-separator">. .</span> <span class="mw-title">$03</span> <span class="mw-changeslist-separator">. .</span> <span class="mw-user">$08</span> <span class="mw-usertoollinks">($09|$10)</span> $13 <span class="comment">($11)</span>';
    }
    NotifyText = NotifyText.split('$00').join(tags);
    NotifyText = NotifyText.split('$01').join(Server);
    NotifyText = NotifyText.split('$02').join(Time);
    NotifyText = NotifyText.split('$03').join(PageLink);
    NotifyText = NotifyText.split('$04').join(DiffLink);
    NotifyText = NotifyText.split('$05').join(HistLink);
    NotifyText = NotifyText.split('$06').join(EditLink);
    NotifyText = NotifyText.split('$07').join(StopLink);
    NotifyText = NotifyText.split('$08').join(UserLink);
    NotifyText = NotifyText.split('$09').join(UserTalkLink);
    NotifyText = NotifyText.split('$10').join(UserContribLink); 
    NotifyText = NotifyText.split('$11').join(watchsum);
    NotifyText = NotifyText.split('$12').join(sizespan);
    NotifyText = NotifyText.split('$13').join(loginfos);
    return NotifyText;
}

function GlobalWatchlist_FillEditsDiv_getItemLogIfos(item, Server){
  var loginfos = "";
  var watchlogtype = item.getAttribute('logtype');
  var watchaction = item.getAttribute('logaction');
  var Type = (Server == mw.config.get('wgServer') ? 'target="_blank" ' : 'class="extiw" target="_blank" ' );
  switch (watchlogtype) {
      case 'protect': 
        try{ loginfos = item.firstChild.firstChild.nodeValue; }catch(e){ }
        break;
      case 'move': 
        try{ 
        var newtitle = item.firstChild.getAttribute("new_title");
        if(!newtitle) newtitle = item.firstChild.getAttribute("target_title");
        loginfos = "→‎"+'<a '+Type+'href="'+Server+mw.config.get('wgScript')+'?title='+encodeURIComponent(newtitle)+'" '
                 + 'title="'+newtitle+'">'+newtitle+'</a>';
        }catch(e){ }
        break;
      case 'block':
        try{ 
        var itemFSAttr = item.firstChild.attributes;
        for(var a=0,l=itemFSAttr.length;a<l;a++){
          var attrname = itemFSAttr.name;
          var attrvalue = itemFSAttr.value;
          loginfos = (loginfos=="" ? "" : "|" ) + attrname + "="+(attrname=="expiry" ? GlobalWatchlist_FillEditsDiv_ManageTimestamp(attrvalue) : attrvalue);
        }
        }catch(e){ }
        break;
  }
  return "";
}

function GlobalWatchlist_FillEditsDiv_ManageTimestamp(ts){
    var Correction = parseInt(GlobalWatchlist_TimeCorrection.split(":"));
    var TS = ts.replace(/\D/g, "|").split("|");
    var year = parseInt(TS);
    var month = (parseInt(TS)-1);
    var day = parseInt(TS);
    var hours = parseInt(TS);
    var minutes = parseInt(TS);
    var seconds = parseInt(TS);    
    var TSDate = (new Date(year, month, day, hours, minutes, seconds)).getTime();
    var CorrectedTSDate = TSDate+(Correction*1000*60*60);
    var RD = new Date();
    RD.setTime(CorrectedTSDate);
    function AddZ(txt){ return ((parseInt(txt)<10)?"0"+txt:txt); }
    var RDS = {
      "y":RD.getFullYear(),
      "M":AddZ(RD.getMonth()+1),
      "d":AddZ(RD.getDate()),
      "h":AddZ(RD.getHours()),
      "m":AddZ(RD.getMinutes()),
      "s":AddZ(RD.getSeconds())
    }
    var correctedts = RDS+"-"+RDS+"-"+RDS+"T"+RDS+":"+RDS+":"+RDS+"Z";
    return correctedts;
}

function GlobalWatchlist_FillEditsDiv_ManageLiContent(Li, Server){
    if(Server == mw.config.get('wgServer')) return;
    var Links =  $.makeArray( $(Li).find('span.comment a') );
    for(var a=0,l=Links.length;a<l;a++){
        var Link = Links;
        if(!$(Link).hasClass("extiw")){
            Link.href = Server + Link.href.split(window.location.protocol+mw.config.get('wgServer')).join("").split(mw.config.get('wgServer')).join("");
            $(Link).addClass("extiw");
        }
        Link.target = "_blank";
    }
}

function GlobalWatchlist_GroupEdits(){
    GlobalWatchlist_Bugs = new Array();
    var Div = document.getElementById("GlobalWatchlist_edits");
    if(!Div) return;
    var Uls = $.makeArray( $(Div).find('ul.special') );
    for(var a=0,l=Uls.length;a<l;a++){
        GlobalWatchlist_GroupULEdits(Uls);
    }
    GlobalWatchlist_GroupEdits_ReportBugs();
}
 
function GlobalWatchlist_GroupULEdits(UL){
    var Li = UL.firstChild;
    while(Li){
        var infos = "";
        var Classes = Li.className.split(" ");
        for(var a=0,l=Classes.length;a<l;a++){
            var ThisClass = Classes;
            if(ThisClass.indexOf("GWLpage-")===0) infos = ThisClass;
        }
        if(infos!==""){
            try{
                var AllLis = $.makeArray( $(UL).find('li.'+infos) );
                if(AllLis.length>1){
                    var NewLi = document.createElement("li");
                    Li.parentNode.insertBefore(NewLi, Li);
                    var NewUL = document.createElement("ul");
                    NewLi.appendChild(NewUL);
                    for(var a=0,l=AllLis.length;a<l;a++){
                        var thisli = AllLis;
                        thisli.parentNode.removeChild(thisli);
                        NewUL.appendChild(thisli);
                    }
                    GlobalWatchlist_GroupULEdits_EditLiContent(NewLi);
                    Li = NewLi;
                }
            }catch(e){
                if(GlobalWatchlist_Bugs.indexOf(infos)==-1) GlobalWatchlist_Bugs.push(infos);
            }
        }
        Li = Li.nextSibling;
        if(!Li) break;
    }
    var ToggleLinks = $.makeArray( $(UL).find('a.GlobalWatchlist-toggleLink') );
    for(var a=0,l=ToggleLinks.length;a<l;a++){ GlobalWatchlist_ToggleEdits(ToggleLinks); }
}

function GlobalWatchlist_GroupEdits_ReportBugs(){
    var BugDiv = document.getElementById("GlobalWatchlist_bugreport");
    var BugLength = GlobalWatchlist_Bugs.length;
    if(BugLength===0){
        BugDiv.innerHTML = "";
        BugDiv.style.display = "none";
        return;
    }
    var DevLink = '<a href="//fr.wikipedia.orghttps://wiki386.com/fr/Discussion_utilisateur:Dr_Brains">Dr Brains</a>';
    var Text = GlobalWatchlist_Text.split("$1").join(DevLink);
    for(var a=0,l=BugLength;a<l;a++){
        Text += '* '+GlobalWatchlist_Bugs + '\n';
    }
    Text += '</pre>';
    BugDiv.innerHTML = Text;
    BugDiv.style.display = "";
}

function GlobalWatchlist_GroupULEdits_EditLiContent(NewLi){
    var Lis = $.makeArray( $(NewLi).find('li'));
    var FirstOldLi = Lis;
    var Title = $.makeArray( $(FirstOldLi).find('span.mw-title a')).innerHTML;
    var Server = FirstOldLi.title;
    var Type = (Server == mw.config.get('wgServer') ? 'target="_blank" ' : 'class="extiw" target="_blank" ' );
    var Time = $.makeArray( $(FirstOldLi).find('span.mw-changeslist-date')).innerHTML;
    var PageLink = '<a '+Type+'href="'+Server+mw.config.get('wgScript')+'?title='+encodeURIComponent(Title)+'" '
                 + 'title="'+Title+'">'+Title+'</a>';
    var HistLink = '<a '+Type+'href="'+Server+mw.config.get('wgScript')+'?title='+encodeURIComponent(Title)+'&action=history" '
                 + 'title="'+GlobalWatchlist_Text+'">'+GlobalWatchlist_Text+'</a>';
    var EditLink = '<a '+Type+'href="'+Server+mw.config.get('wgScript')+'?title='+encodeURIComponent(Title)+'&action=edit" '
                 + 'title="'+GlobalWatchlist_Text+'">'+GlobalWatchlist_Text+'</a>';
    var StopLink = '<a '+Type+'href="'+Server+mw.config.get('wgScript')+'?title='+encodeURIComponent(Title)+'&action=unwatch" '
                 + 'title="'+GlobalWatchlist_Text+'">'+GlobalWatchlist_Text+'</a>';
    var Users = new Array();
    var watchmissing = false;
    var diffsize = 0;
    for(var a=0,l=Lis.length;a<l;a++){
        if($(Lis).hasClass("mw-changeslist-line-watched")) watchmissing = true;
        var User = $.makeArray( $(Lis).find('span.mw-user a')).innerHTML;
        var UserLink = '<a '+Type+'href="'+Server+'https://wiki386.com/fr/User:'+encodeURIComponent(User)+'" '
                 + 'title="User:'+User+'">'+User+'</a>';
        Users.push(UserLink);
        var SizeSpan = $.makeArray( $(Lis).find('span.mw-sizespan'));
        if(SizeSpan){
            var ThisSize = parseInt(SizeSpan.innerHTML.replace(//g, ""));
            diffsize = diffsize + ThisSize;
        }
        var PageTitle = $.makeArray( $(Lis).find('span.mw-title a'));
        PageTitle.parentNode.removeChild(PageTitle);
        var FirstSeperator = $.makeArray( $(Lis).find('span.mw-changeslist-separator'));
        FirstSeperator.parentNode.removeChild(FirstSeperator);
    }
    var UserLinks = new Array();
    var UserLinksCount = new Array();
    for(var a=0,l=Users.length;a<l;a++){
      var ThisUserLink = Users;
      var index = UserLinks.indexOf(ThisUserLink);
      if(index==-1){
        UserLinks.push(ThisUserLink);
        UserLinksCount.push(1);
      }else{
        UserLinksCount = (UserLinksCount+1);
      }
    }
    for(var a=0,l=UserLinks.length;a<l;a++){
      if(UserLinksCount>1) UserLinks = UserLinks + "("+UserLinksCount+"×)";
    }
    var tags = "";
    for(var tag in GlobalWatchlist_Text){
      tags += GlobalWatchlist_Text;
    }  
    var sizeclass = "mw-plusminus-null";
    if(diffsize<0) sizeclass = "mw-plusminus-neg";
    if(diffsize>0) sizeclass = "mw-plusminus-pos";
    var sizespan = '<span class="mw-sizespan '+sizeclass+'">'+((diffsize*diffsize>250000)?'<b>('+diffsize+')</b>':'('+diffsize+')' )+'</span>';
    var NotifyText = '<span class="notag">$00 </span><span class="mw-changeslist-date" title="$01">$02</span> ($05|$06|$07) <span class="mw-changeslist-separator">. .</span> <span class="mw-title">$03</span> <span class="mw-changeslist-separator">. .</span> $12 <span class="mw-changeslist-separator">. .</span> <span class="changedby"></span>';
    NotifyText = NotifyText.split('$00').join(tags);
    NotifyText = NotifyText.split('$01').join(Server);
    NotifyText = NotifyText.split('$02').join(Time);
    NotifyText = NotifyText.split('$03').join(PageLink);
    NotifyText = NotifyText.split('$05').join(HistLink);
    NotifyText = NotifyText.split('$06').join(EditLink);
    NotifyText = NotifyText.split('$07').join(StopLink);
    NotifyText = NotifyText.split('$12').join(sizespan);
    NotifyText = NotifyText.split('$14').join(UserLinks.join(" ; "));
    for(var servername in GlobalWatchlist_Classes){
        if(Server.indexOf(servername)!=-1) $(NewLi).addClass(GlobalWatchlist_Classes);
    }

    if(watchmissing) $(NewLi).addClass("mw-changeslist-line-watched");
    else $(NewLi).addClass("mw-changeslist-line-not-watched");
    var Span = document.createElement('span');
    Span.innerHTML = NotifyText;
    NewLi.insertBefore(Span, NewLi.firstChild);
    NewLi.insertBefore(GlobalWatchlist_GroupULEdits_CreateToggleLink(NewLi), NewLi.firstChild);
}

function GlobalWatchlist_GroupULEdits_CreateToggleLink(NewLi){
   var Link = document.createElement('a');
   Link.className = "GlobalWatchlist-toggleLink";
   Link.title = GlobalWatchlist_Text;
   Link.innerHTML = GlobalWatchlist_Text;
   Link.href = "javascript:;";
   Link.onclick = function(){ GlobalWatchlist_ToggleEdits(this); return false; }
   return Link;
}

function GlobalWatchlist_ToggleEdits(ToggleLink){
  if(!ToggleLink) return;
  var Li = ToggleLink.parentNode;
  var Ul = Li.getElementsByTagName('ul');
  if(!Ul) return;
  if(ToggleLink.title == GlobalWatchlist_Text){
    Ul.style.display = "";
    ToggleLink.title = GlobalWatchlist_Text;
    ToggleLink.innerHTML = GlobalWatchlist_Text;
  }else{
    Ul.style.display = "none";
    ToggleLink.title = GlobalWatchlist_Text;
    ToggleLink.innerHTML = GlobalWatchlist_Text;
  }
  ToggleLink.blur();
}

// Fonction de lancement

if((mw.config.get('wgCanonicalSpecialPageName')=="Blankpage")&&(mw.config.get('wgTitle').split("/")==="GlobalWatchlist")){
  mw.loader.load('//fr.wikipedia.org/w/index.php?title=MediaWiki:Gadget-GlobalWatchlist.css&action=raw&ctype=text/css', 'text/css');
  $(GlobalWatchlist_Init);
}
$(GlobalWatchlist_Link);

// </nowiki></pre>