Aller au contenu

Utilisateur:Mabifixem/monobook.js

Une page de Wikipédia, l'encyclopédie libre.
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) ;

Firefox (sur GNU/Linux) / Chrome / Internet Explorer / Opera : maintenez la touche Ctrl en cliquant sur le bouton Actualiser ou pressez Ctrl-F5.
// Documentation : [[Projet:Portails/Articles_sans_portail/intro]]
 
// <source lang=javascript><pre><nowiki>
 
var PagesSansBandeauDePortail_GoodPages = 'Projet:Portails/Articles_sans_portail/';
var PagesSansBandeauDePortail_BadPages = 'Projet:Portails/Articles_sans_portail/intro';
 
 
var PagesSansBandeauDePortail_WorkingImage = "/media/wikipedia/commons/d/de/Ajax-loader.gif";
 
var PagesSansBandeauDePortail_Modeles = new Array();
var PagesSansBandeauDePortail_Images = new Array();
 
PagesSansBandeauDePortail_Modeles.push('[[File:Yes check.svg|15px|Fait|link=]]');
PagesSansBandeauDePortail_Images.push('<img height="15" width="15" src="/media/wikipedia/commons/thumb/f/fb/Yes_check.svg/15px-Yes_check.svg.png" alt="Fait">');
 
PagesSansBandeauDePortail_Modeles.push('[[File:Disambig.png|15px|Homonymie|link=]]');
PagesSansBandeauDePortail_Images.push('<img height="11" width="15" src="/media/wikipedia/commons/thumb/6/69/Disambig.png/15px-Disambig.png" alt="Disambig.png">');
 
 
if((mw.config.get('wgPageName').indexOf(PagesSansBandeauDePortail_GoodPages)!=-1)&&(mw.config.get('wgPageName').indexOf(PagesSansBandeauDePortail_BadPages)==-1)&&(mw.config.get('wgAction')=="view")){
 addOnloadHook(PagesSansBandeauDePortail_AddNavigLinks);
 addOnloadHook(PagesSansBandeauDePortail_AddLinks);
 
document.write('<style type="text/css">'
+ '.SpanLinks {margin-right:1em;}'
+ '.NavContent { display:block !important; }'
+ '.TopBarDiv {padding:0.3em;cursor:move !important;}'
+ '</style>');
 
}
 
function PagesSansBandeauDePortail_AddNavigLinks(){
      var Content = document.getElementById('bodyContent');               // monobook, myskin, chick, simple, vector
      if(!Content) Content = document.getElementById('article');          // cologneblue, nostalgia, standard
      if(!Content) Content = document.getElementById('mw_contentholder'); // modern
      if(!Content) return;
 
      var ThisPage = false;
      var TDs = Content.getElementsByTagName('td');
      for(var a=0;a<TDs.length;a++){
            if($(TDs[a]).hasClass("list")){
                  var Strongs = TDs[a].getElementsByTagName('strong');
                  for(var b=0;b<Strongs.length;b++){
                        if($(Strongs[b]).hasClass("selflink")){
                              ThisPage = Strongs[b];
                        }
                  }
            }
      }
      if(!ThisPage) return;
 
      var PreviousPage = false;
      var Node = ThisPage.previousSibling;
      while(Node){
            if(Node.tagName){
                  if(Node.tagName.toLowerCase() == "a"){
                        PreviousPage = Node;
                         break;
                  }
            }
            Node = Node.previousSibling;
      }
 
      var NextPage = false;
      var Node = ThisPage.nextSibling;
      while(Node){
            if(Node.tagName){
                  if(Node.tagName.toLowerCase() == "a"){
                        NextPage = Node;
                         break;
                  }
            }
            Node = Node.nextSibling;
      }
      var PreviousLink = "";
      if(PreviousPage){
            PreviousLink='<a href="'+PreviousPage.href+'" title="'+PreviousPage.title+'">Page précédente : '+PreviousPage.innerHTML+'</a>';
      }
      var NextLink = "";
      if(NextPage){
            NextLink='<a href="'+NextPage.href+'" title="'+NextPage.title+'">Page suivante : '+NextPage.innerHTML+'</a>';
      }           
      var Tables = document.getElementsByTagName('table');
      for(var a=0;a<Tables.length;a++){
            if($(Tables[a]).hasClass("navbox")){
                  var TitleLinks = Tables[a].getElementsByTagName('th')[0].getElementsByTagName('a');
                  var TitleDiv = TitleLinks[(TitleLinks.length-1)].parentNode;
                  TitleDiv.innerHTML = '<small>('+PreviousLink +')</small>&nbsp;&nbsp;—&nbsp;&nbsp;'+ TitleDiv.innerHTML + '&nbsp;&nbsp;—&nbsp;&nbsp;<small>(' + NextLink+')</small>';
            }
      }
}
 
var PagesSansBandeauDePortail_AllLinks = new Array();
 
function PagesSansBandeauDePortail_AddLinks(){
      var Content = document.getElementById('bodyContent');               // monobook, myskin, chick, simple, vector
      if(!Content) Content = document.getElementById('article');          // cologneblue, nostalgia, standard
      if(!Content) Content = document.getElementById('mw_contentholder'); // modern
      if(!Content) return;
      var Count = -1;
      var Liste = Content.getElementsByTagName('li');
      for(var a=0;a<Liste.length;a++){
            var Lien = Liste[a].getElementsByTagName('a')[0];
            if(!Lien) continue;
            if(decodeURIComponent(Lien.href).indexOf(mw.config.get('wgFormattedNamespaces')[6]+":")!=-1) Lien = Liste[a].getElementsByTagName('a')[1];   
            if(!Lien) continue;
            if((Lien.href.indexOf("#")==-1)&&(Lien.className!="new")&&(Lien.className!="mw-redirect")&&(Lien.parentNode.tagName.toLowerCase()!="s")&&(Lien.href.indexOf("javascript:")==-1)){
                    Count++
                    PagesSansBandeauDePortail_AllLinks.push(Lien);
                    Lien.id = "Link_"+Count;
                    Lien.className = "LinkWithButtons";
                    var SpanLinks = document.createElement('span');
                    SpanLinks.className = "SpanLinks";
                    Lien.parentNode.insertBefore(SpanLinks, Lien);
 
                    var PreviewLink = document.createElement('a');
                    PreviewLink.href = "javascript:PagesSansBandeauDePortail_Preview('"+Count+"');";
                    PreviewLink.title = "Previsualiser la page";
                    PreviewLink.innerHTML = '<img height="15" width="15" src="/media/wikipedia/commons/thumb/6/61/Crystal_Clear_app_kappfinder.png/15px-Crystal_Clear_app_kappfinder.png" alt="Prévisualiser">';
                    SpanLinks.appendChild(PreviewLink);
            }
      }
      var Spans = document.getElementsByTagName('span');
      for(var a=0;a<Spans.length;a++){
            if($(Spans[a]).hasClass("editsection")){
                  var Section = Spans[a].getElementsByTagName('a')[0].href.split('section=')[1];
                  var UpdateAllLink = '<a href="javascript:PagesSansBandeauDePortail_UpdateAll('+Section+');" title="Marquer comme faites les pages de cette section ayant un bandeau de portail">[mettre à jour]</a>';
 
                  Spans[a].innerHTML += '&nbsp;'+UpdateAllLink;
                  Spans[a].id = "editsection_"+Section;
            }
      }
}
 
 
function PagesSansBandeauDePortail_Done(index, modeleIndex){
      //alert('Done - '+index);
      var Lien = document.getElementById("Link_"+index);
      if(!Lien) return;
      var Page = PagesSansBandeauDePortail_HTMLDecode(Lien.innerHTML);
      PagesSansBandeauDePortail_Edit(Page, modeleIndex, index);
}
 
function PagesSansBandeauDePortail_Preview(index){
      //alert('Preview - '+index);
      var Lien = document.getElementById("Link_"+index);
      if(!Lien) return;
      var Href = Lien.href;
      var Frame = document.getElementById("Frame_"+index);
      if(!Frame){ 
            var agt=navigator.userAgent.toLowerCase();
            var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
            if(is_ie){
                  LargeurEcran = parseInt(screen.width);
                  HauteurEcran = parseInt(screen.height);
            }else{
                  LargeurEcran = parseInt(window.innerWidth);
                  HauteurEcran = parseInt(window.innerHeight);
            }
            var Parent = Lien.parentNode;
            Frame = document.createElement('div');
            Frame.id="Frame_"+index;
            Parent.appendChild(Frame);
            Frame.style.position='fixed';
            Frame.style.zIndex= 1000;
            Frame.style.width= '75%';
            PositionGauche = parseInt((LargeurEcran-Frame.clientWidth)/2) ;
            PositionHaut = parseInt((HauteurEcran-Frame.clientHeight)/5) ;
            Frame.style.left=PositionGauche + 'px';
            Frame.style.top=PositionHaut + 'px';
            Frame.style.backgroundColor='white';
            Frame.style.border='3px double black';
 
            var TopBar = document.createElement('div');
            TopBar.className = "TopBarDiv";
            var CloseLink = document.createElement('a');
            CloseLink.href = "javascript:PagesSansBandeauDePortail_EndPreview('"+index+"');";
            CloseLink.title = "Fermer la fenêtre";
            CloseLink.setAttribute("style", "float:right");
            CloseLink.innerHTML = '<img height="30" width="30" src="/media/wikipedia/commons/thumb/2/2e/Crystal_Clear_action_button_cancel.png/30px-Crystal_Clear_action_button_cancel.png" alt="Fermer">';
            TopBar.appendChild(CloseLink);
 
            var CenterTag = document.createElement('center');
            TopBar.appendChild(CenterTag);
 
            var DoneLink = document.createElement('a');
            DoneLink.href = "javascript:PagesSansBandeauDePortail_Done('"+index+"', 0);";
            DoneLink.title = "Marquer comme fait";
            DoneLink.innerHTML = '<img height="30" width="30" src="/media/wikipedia/commons/thumb/4/47/Done.png/30px-Done.png" alt="Fait">';
            CenterTag.appendChild(DoneLink);
            CenterTag.appendChild(document.createTextNode(' - '));
 
            var HomonDoneLink = document.createElement('a');
            HomonDoneLink.href = "javascript:PagesSansBandeauDePortail_Done('"+index+"', 1);";
            HomonDoneLink.title = "Marquer comme page d\'homonymie";
            HomonDoneLink.innerHTML = '<img height="30" width="30" src="/media/wikipedia/commons/thumb/6/69/Disambig.png/30px-Disambig.png" alt="Fait : homonymie">';
            CenterTag.appendChild(HomonDoneLink);
            Frame.appendChild(TopBar);
            TopBar.onmousedown=function(event) {
                  monbody = document.body;
                  if(is_ie){ 
                        if(!event) { event= window.event; }
                        positionSouris_X = parseInt( event.clientX + monbody.scrollLeft );
                        positionSouris_Y = parseInt( event.clientY + monbody.scrollTop );
                  }else{
                        positionSouris_X = parseInt( event.clientX );
                        positionSouris_Y = parseInt( event.clientY );
                  }
 
                  Frame.initialX = parseInt( positionSouris_X - Frame.offsetLeft);
                  Frame.initialY = parseInt( positionSouris_Y - Frame.offsetTop);
                  monbody.onmousemove = function(event) {
                  if(is_ie){
                        if(!event) { event= window.event; }
                              positionSouris_X = parseInt( event.clientX + monbody.scrollLeft );
                              positionSouris_Y = parseInt( event.clientY + monbody.scrollTop );
                        }else{
                              positionSouris_X = parseInt( event.clientX );
                              positionSouris_Y = parseInt( event.clientY );
                        }
                        PositionGauche = parseInt( positionSouris_X ) - Frame.initialX;
                        PositionHaut = parseInt(positionSouris_Y ) - Frame.initialY;
                        if( PositionGauche < 0){
                              PositionGauche = 0;
                        }
                        if( PositionHaut < 0){
                              PositionHaut = 0;
                        }
                        Frame.style.left=PositionGauche + 'px';
                        Frame.style.top=PositionHaut + 'px';
                        Frame.style.opacity='.8';
                  }
 
                  monbody.onmouseup=function(event) {
                        Frame.style.opacity='';
                        monbody.onmousemove=null;
                        monbody.onmouseup=null;
                  }
            }
 
            var FrameContent = document.createElement('iframe');
            FrameContent.src=Href;
            FrameContent.width="100%";
            FrameContent.height= parseInt(HauteurEcran/2) + "px";
            Frame.appendChild(FrameContent);
            var BottomBar = document.createElement('div');
            BottomBar.style.height = "30px";
            BottomBar.style.cursor='se-resize';
            BottomBar.onmousedown = function(event){
                  monbody = document.body;
                  if(is_ie){ 
                        if(!event) { event= window.event; }
                        positionSouris_X = parseInt( event.clientX + monbody.scrollLeft );
                        positionSouris_Y = parseInt( event.clientY + monbody.scrollTop );
                  }else{
                        positionSouris_X = parseInt( event.clientX );
                        positionSouris_Y = parseInt( event.clientY );
                  }
                  FrameContent.initialWidth = parseInt( positionSouris_X - FrameContent.offsetWidth );
                  FrameContent.initialHeight = parseInt( positionSouris_Y - FrameContent.offsetHeight );
                  Frame.initialWidth = parseInt( positionSouris_X - Frame.offsetWidth );
                  Frame.initialHeight = parseInt( positionSouris_Y - Frame.offsetHeight );
                  Frame.style.opacity='.8';
 
                  monbody.onmousemove=function(event) {
                        if(is_ie){ 
                              if(!event) { event= window.event; }
                              positionSouris_X = parseInt( event.clientX + monbody.scrollLeft );
                              positionSouris_Y = parseInt( event.clientY + monbody.scrollTop );
                        }else{
                              positionSouris_X = parseInt( event.clientX );
                              positionSouris_Y = parseInt( event.clientY );
                        }
                        FrameContent.width  = parseInt( positionSouris_X - FrameContent.initialWidth  ) + 'px';
                        FrameContent.height = parseInt( positionSouris_Y - FrameContent.initialHeight ) + 'px';
                        Frame.style.width  = parseInt( positionSouris_X - Frame.initialWidth  ) + 'px';
                        Frame.style.height = parseInt( positionSouris_Y - Frame.initialHeight ) + 'px';
 
                  }
                  monbody.onmouseup=function(event) {
                        Frame.style.opacity = '';
                        monbody.onmousemove=null;
                        monbody.onmouseup=null;
                  }
            }
            Frame.appendChild(BottomBar);
            Parent.appendChild(Frame);
      }
}
 
function PagesSansBandeauDePortail_EndPreview(index){
      var Frame = document.getElementById("Frame_"+index);
      if(Frame) Frame.parentNode.removeChild(Frame);
}
 
function PagesSansBandeauDePortail_HTMLDecode(text){
      var EncodedCharacter = new Array();
      var DecodedCharacter = new Array();
      var CharacterCount = 0;
 
      EncodedCharacter[CharacterCount] = "&amp;";
      DecodedCharacter[CharacterCount] = "&";
      CharacterCount++;
      EncodedCharacter[CharacterCount] = "&#039;";
      DecodedCharacter[CharacterCount] = "'";
      CharacterCount++;
      EncodedCharacter[CharacterCount] = "&quot;";
      DecodedCharacter[CharacterCount] = '"';
      CharacterCount++; 
      EncodedCharacter[CharacterCount] = "&nbsp;";
      DecodedCharacter[CharacterCount] = ' ';
      CharacterCount++;
 
      for(var a=0;a<EncodedCharacter.length;a++){
            while(text.indexOf(EncodedCharacter[a])!=-1){
                  text = text.split(EncodedCharacter[a]).join(DecodedCharacter[a]);
                  if(text.indexOf(EncodedCharacter[a])==-1) break;
            }
      }
      return text;
}
 
function PagesSansBandeauDePortail_Edit(Page, ModeleIndex, index){
      PagesSansBandeauDePortail_EndPreview(index);
      var Image = document.createElement('img');
      Image.id = "Working_Image"+index;
      Image.src = PagesSansBandeauDePortail_WorkingImage;
      Image.width = 50
      Image.heigth = 50
      Image.style.position = "fixed";
      Image.style.zIndex = 10000;
      Image.style.top = 0;
      Image.style.right = 0;
      document.body.insertBefore(Image, document.body.firstChild);
 
      var AdresseEdition = mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=' + mw.config.get('wgPageName').replace(/&/g, "%26") + '&action=edit';
      var RequeteEdition = new XMLHttpRequest();
      RequeteEdition.open("GET", AdresseEdition, true);
      RequeteEdition.onreadystatechange = function() {
            if(RequeteEdition.readyState != 4 || RequeteEdition.status != 200) return;
            var ElementTraitement = document.createElement('div');
            ElementTraitement.id = "EditPage_"+index;
            ElementTraitement.style.display = "none";
            document.body.insertBefore(ElementTraitement, document.body.firstChild)  
            ElementTraitement.innerHTML = RequeteEdition.responseText;
            var ContenuPage = document.getElementById("wpTextbox1").value;
            var AncienSommaire = document.editform.wpSummary.value; 
            var AncienLien = '[['+Page+']]';
            var NouvelleLigne = '<li>'+PagesSansBandeauDePortail_Modeles[ModeleIndex]+'&nbsp;<s>[['+Page+']]</s></li>';
            var Lines = ContenuPage.split('\n');
            for(var a=0;a<Lines.length;a++){
                  var ThisLine = Lines[a];
                  if(ThisLine.indexOf(AncienLien)!=-1){
                        for(var b=0;b<PagesSansBandeauDePortail_Modeles.length;b++){
                              if(ThisLine.indexOf(PagesSansBandeauDePortail_Modeles[b])!=-1){
                                    ModeleIndex = b;
                                    PagesSansBandeauDePortail_EditOK(index, ModeleIndex)
                                    return;
                              }
                        }
                        Lines[a] = NouvelleLigne;
                  }
            }
            var NouveauContenuPage = Lines.join('\n');
            var NouveauSommaire = 'Mise à jour : - [['+Page+']]';
            document.getElementById("wpTextbox1").value = NouveauContenuPage;
            document.editform.wpSummary.value = NouveauSommaire ;
            document.editform.wpMinoredit.checked = "checked";
            document.editform.wpWatchthis.checked = false;
            var action = document.getElementById("editform").action;
            var boundary = '--------123xyz';
            var data = '';
            data += '--' + boundary + '\nContent-Disposition: form-data; name="wpTextbox1"\n\n' + NouveauContenuPage + '\n'
            data += '--' + boundary + '\nContent-Disposition: form-data; name="wpSummary"\n\n' + NouveauSommaire + '\n'
            data += '--' + boundary + '\nContent-Disposition: form-data; name="wpMinoredit"\n\n'
                  + document.editform.wpMinoredit.value + '\n'
            data += '--' + boundary + '\nContent-Disposition: form-data; name="wpSection"\n\n' 
                  + document.editform.wpSection.value + '\n'
            data += '--' + boundary + '\nContent-Disposition: form-data; name="wpStarttime"\n\n' 
                  + document.editform.wpStarttime.value + '\n'
            data += '--' + boundary + '\nContent-Disposition: form-data; name="wpEdittime"\n\n' 
                  + document.editform.wpEdittime.value + '\n'
            data += '--' + boundary + '\nContent-Disposition: form-data; name="wpEditToken"\n\n' 
                  + document.editform.wpEditToken.value + '\n'
            var RequetePublication = new XMLHttpRequest();
            RequetePublication.open('POST', action, true);
            RequetePublication.setRequestHeader('Content-Type', 'multipart/form-data; boundary='+boundary);
            RequetePublication.onreadystatechange = function(){
                  if (RequetePublication.readyState != 4) return;
                  PagesSansBandeauDePortail_EditOK(index, ModeleIndex);
            }
            RequetePublication.send(data + '--' + boundary);
      }
      RequeteEdition.send(null);
}
 
function PagesSansBandeauDePortail_EditOK(index, ModeleIndex){
      var EditDiv = document.getElementById("EditPage_"+index);
      if(EditDiv) EditDiv.parentNode.removeChild(EditDiv);
      var WorkingImage = document.getElementById("Working_Image"+index);
      if(WorkingImage) WorkingImage.parentNode.removeChild(WorkingImage);
 
      var Link = document.getElementById("Link_"+index);
      if(Link){
            var Modele = PagesSansBandeauDePortail_Images[ModeleIndex];
            var Li = Link.parentNode;
            var Span = Li.getElementsByTagName('span')[0];
            Li.removeChild(Link);
            var Barre = document.createElement('s');
            Barre.appendChild(Link);
            Li.innerHTML = Modele+'&nbsp;';
            Li.appendChild(Barre);
      }
}
 
 
 
 
var PagesSansBandeauDePortail_UpdateIsRunning = false;
 
function PagesSansBandeauDePortail_UpdateAll(Section){
      if(PagesSansBandeauDePortail_UpdateIsRunning) return;
      var PagesSansBandeauDePortail_AllLinksTitle = new Array();
      var SousTitre = document.getElementById("editsection_"+Section).parentNode;
      var Node = SousTitre.nextSibling;
      var FoundNode = false;
      while((Node)&&(!FoundNode)){
            if(Node.tagName){
                  if(Node.tagName.toLowerCase().indexOf("h")!=-1) break;
                  if((Node.tagName.toLowerCase().indexOf("ol")!=-1)&&(!FoundNode)){
                        FoundNode = Node;
                        break;
                  }
            }
            Node = Node.nextSibling;
      }
      var AllLinks = Node.getElementsByTagName('a');
      for(var a=0;a<AllLinks.length;a++){
            if($(AllLinks[a]).hasClass("LinkWithButtons")){
                  if(AllLinks[a].parentNode.tagName.toLowerCase()!="s"){
                        var Title = PagesSansBandeauDePortail_HTMLDecode(AllLinks[a].innerHTML);
                        PagesSansBandeauDePortail_AllLinksTitle.push(Title);
                  }
            }
      }
      var Conf = confirm('Nombre de pages à vérifier : '+PagesSansBandeauDePortail_AllLinksTitle.length);
      if((PagesSansBandeauDePortail_AllLinksTitle.length==0)||(!Conf)) return;
      var DivImage = document.createElement('div')
      DivImage.id = "Working_Image";
      DivImage.style.height = "100%"
      DivImage.style.position = "fixed";
      DivImage.style.zIndex = 10000;
      DivImage.style.top = 0;
      DivImage.style.right = 0;
      DivImage.style.overflowY = "scroll";
      DivImage.style.background = "white";
      DivImage.style.border = "2px solid silver";
      DivImage.style.opacity = 0.8;
      var Image = document.createElement('img');
      Image.src = PagesSansBandeauDePortail_WorkingImage;
      Image.width = 50
      Image.heigth = 50
      DivImage.appendChild(Image);
      var NewOl = document.createElement('ol');
      NewOl.id="Working_Image_Ol";
      DivImage.appendChild(NewOl);
      document.body.insertBefore(DivImage, document.body.firstChild);
      PagesSansBandeauDePortail_UpdateIsRunning = true;
      PagesSansBandeauDePortail_UpdateOne(Section, PagesSansBandeauDePortail_AllLinksTitle, 0);
}
 
function PagesSansBandeauDePortail_UpdateOne(Section, TitleList, position, TitleCheckedList){
      if(!TitleCheckedList) TitleCheckedList = new Array();
      if(!position) position = 0;
      var Link = TitleList[position];
      if(!Link){
            PagesSansBandeauDePortail_UpdateEdit(Section, TitleList, TitleCheckedList);
            return;
      }
      TitleCheckedList[position] = false;
      var Adresse = mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/api.php?format=xml&action=query&prop=templates&tllimit=499&titles='+Link.replace(/&/g, "%26");
      var Requete = new XMLHttpRequest();
      Requete.open("GET", Adresse, true);
      Requete.onreadystatechange = function() {
            if(Requete.readyState != 4 || Requete.status != 200) return;
            var XML = Requete.responseXML;
            var AllTemp = XML.getElementsByTagName('tl');
            for(var a=0;a<AllTemp.length;a++){
                  var Titre = AllTemp[a].getAttribute('title');
                  if(Titre=="Modèle:Méta lien vers portail"){
                        TitleCheckedList[position] = true;
                  }                  
            }
            document.getElementById("Working_Image_Ol").innerHTML += '<li>'
                                                                + Link
                                                                + ' : '
                                                                + TitleCheckedList[position]
                                                                + '</li>';
            PagesSansBandeauDePortail_UpdateOne(Section, TitleList, (position+1), TitleCheckedList);
      }
      Requete.send(null);
}
 
function PagesSansBandeauDePortail_UpdateEdit(Section, TitleList, TitleCheckedList){
      var Adresse = mw.config.get('wgServer') + mw.config.get('wgScript') + '?title='+mw.config.get('wgPageName').replace(/&/g, "%26")+'&action=edit&section='+Section;
      var RequeteEdition = new XMLHttpRequest();
      RequeteEdition.open("GET", Adresse, true);
      RequeteEdition.onreadystatechange = function() {
            if(RequeteEdition.readyState != 4 || RequeteEdition.status != 200) return;
            var ElementTraitement = document.createElement('div');
            ElementTraitement.id = "EditPage";
            ElementTraitement.style.display = "none";
            document.body.insertBefore(ElementTraitement, document.body.firstChild)  
            ElementTraitement.innerHTML = RequeteEdition.responseText;
            var ContenuPage = document.getElementById("wpTextbox1").value;
            var AncienSommaire = document.editform.wpSummary.value; 
            var Lines = ContenuPage.split('\n');
            for(var a=0;a<Lines.length;a++){
                  var ThisLine = Lines[a];                  
                  for(var b=0;b<TitleList.length;b++){
                        var OldLink="[["+TitleList[b]+"]]";
                        if(ThisLine.indexOf(OldLink)!=-1){
                              var WithPortal = TitleCheckedList[b];
                              if(WithPortal){
                                    Lines[a] = '<li>'+PagesSansBandeauDePortail_Modeles[0]+'&nbsp;<s>[['+TitleList[b]+']]</s></li>';
                              }
                        }
                  }
            }
            var NouveauContenuPage = Lines.join('\n');
            var NouveauSommaire = AncienSommaire +'Mise à jour globale';
            document.getElementById("wpTextbox1").value = NouveauContenuPage;
            document.editform.wpSummary.value = NouveauSommaire ;
            document.editform.wpMinoredit.checked = "checked";
            document.editform.wpWatchthis.checked = false;
            var action = document.getElementById("editform").action;
            var boundary = '--------123xyz';
            var data = '';
            data += '--' + boundary + '\nContent-Disposition: form-data; name="wpTextbox1"\n\n' + NouveauContenuPage + '\n'
            data += '--' + boundary + '\nContent-Disposition: form-data; name="wpSummary"\n\n' + NouveauSommaire + '\n'
            data += '--' + boundary + '\nContent-Disposition: form-data; name="wpMinoredit"\n\n'
                  + document.editform.wpMinoredit.value + '\n'
            data += '--' + boundary + '\nContent-Disposition: form-data; name="wpSection"\n\n' 
                  + document.editform.wpSection.value + '\n'
            data += '--' + boundary + '\nContent-Disposition: form-data; name="wpStarttime"\n\n' 
                  + document.editform.wpStarttime.value + '\n'
            data += '--' + boundary + '\nContent-Disposition: form-data; name="wpEdittime"\n\n' 
                  + document.editform.wpEdittime.value + '\n'
            data += '--' + boundary + '\nContent-Disposition: form-data; name="wpEditToken"\n\n' 
                  + document.editform.wpEditToken.value + '\n'
            var RequetePublication = new XMLHttpRequest();
            RequetePublication.open('POST', action, true);
            RequetePublication.setRequestHeader('Content-Type', 'multipart/form-data; boundary='+boundary);
            RequetePublication.onreadystatechange = function(){
                  if (RequetePublication.readyState != 4) return;
                  PagesSansBandeauDePortail_UpdateFinish(TitleList, TitleCheckedList);
            }
            RequetePublication.send(data + '--' + boundary);
      }
      RequeteEdition.send(null);      
}
function PagesSansBandeauDePortail_UpdateFinish(TitleList, TitleCheckedList){
      for(var a=0;a<TitleList.length;a++){
            if(TitleCheckedList[a]){
                  var ThisTitle = TitleList[a];
                  for(var b=0;b<PagesSansBandeauDePortail_AllLinks.length;b++){
                        var LinkTitle = PagesSansBandeauDePortail_HTMLDecode(PagesSansBandeauDePortail_AllLinks[b].innerHTML);
                        if(LinkTitle==ThisTitle) PagesSansBandeauDePortail_EditOK(b, 0);
                  }
            }
      }
      var EditPage = document.getElementById("EditPage");
      if(EditPage) EditPage.parentNode.removeChild(EditPage);
      var Working = document.getElementById("Working_Image");
      if(Working) Working.parentNode.removeChild(Working);
      PagesSansBandeauDePortail_UpdateIsRunning = false;
}
 
//</nowiki></pre></source>