This is an archive copy of wikilivres.ca as of 18 February 2017 (from the WikiTeam dump). The original site is closed.

MediaWiki:Common.js: Difference between revisions

Free texts and images.
Jump to navigation Jump to search
imported>Yann
Archive copy: scripts and images from the old wikilivres.ca domain (now third-party) and wikisource.org moved to ca.wikilivres.ru over https
 
(68 intermediate revisions by 8 users not shown)
Line 1: Line 1:
/*
===onglets===
Auteur: ThomasV
<pre>*/


function onglets()
/* <pre> */
{
 
  //first tab
/**********************
  var a = document.getElementById("ca-nstab-main");
*** Quality indicators on "article" tab
  if(a){
*** by [[user:ThomasV]]
          var s = a.innerHTML;
**********************/
          var i = s.indexOf('Texte');
// return src for icon given percentage
          if( document.getElementById("Author") )
function icon_src(t){
                {
var src='https://ca.wikilivres.ru/images/';
                  a.innerHTML = s.substring(0,i)+"Auteur"+s.substring(i+5,s.length-1);        
switch(t){
                }
case '0%': src+='8/8f/00%25.png'; break;
          q = document.getElementById("textquality");
case '25%': src+='5/5b/25%25.png'; break;
          if( q ) {
case '50%': src+='3/3a/50%25.png'; break;
                var image = "";
case '75%': src+='c/cd/75%25.png'; break;
                if( q.className == "0%") {  
case '100%': src+='6/64/100%25.png'; break;
                  image = " <img src='http://www.wikilivres.info/wiki/images/8/8f/00%25.png' alt='' width='9' height='9' longdesc='' />"; }
case 'Validated': src+='b/b7/Etoile.png'; break;
                if( q.className == "25%") {
}
                  image = " <img src='http://www.wikilivres.info/wiki/images/5/5b/25%25.png' alt='' width='9' height='9' longdesc='' />"; }
return src;
                if( q.className == "50%") {
}
                  image = " <img src='http://www.wikilivres.info/wiki/images/3/3a/50%25.png' alt='' width='9' height='9' longdesc='' />"; }
                if( q.className == "75%") {
// add indicator
                  image = " <img src='http://www.wikilivres.info/wiki/images/c/cd/75%25.png' alt='' width='9' height='9' longdesc='' />"; }
function pageQuality() {
                if( q.className == "100%") {
var a = document.getElementById('ca-nstab-main');
                  image = " <img src='http://www.wikilivres.info/wiki/images/6/64/100%25.png' alt='' width='9' height='9' longdesc='' />"; }
if(!a) return;
                  //a.innerHTML = a.innerHTML + image;
                  //a.innerHTML = s.substring(0,i+5)+"<a href='/wiki/Wikilivres:Qualité des textes'>"+image+"</a>"+s.substring(i+5,s.length-1);       
var pr_index = document.getElementById('pr_index');
                  a.innerHTML = s.substring(0,i+5)+image+s.substring(i+5,s.length-1);        
if(pr_index) return;
                }
      }
var q = document.getElementById('textquality');
if(q) {
var new_img = document.createElement('img');
new_img.setAttribute('src', icon_src(q.className));
a.firstChild.appendChild(new_img);
}
for(var i=0; spanElem = document.getElementsByTagName('span')[i]; i++) {
if (spanElem.className == 'pagequality') {
var new_img = document.createElement('img');
new_img.setAttribute('src', icon_src(spanElem.title));
if(wgCanonicalNamespace == 'Page') {
a.firstChild.appendChild(new_img);
}
else {
s1 = spanElem.parentNode.previousSibling;
opttext = s1.firstChild.firstChild;
img = opttext.firstChild.nextSibling.nextSibling.nextSibling;
next = img.nextSibling;
opttext.removeChild(img);
opttext.insertBefore(new_img,next);
}
}
}
}
addOnloadHook(pageQuality);
 
 
/* configure */
self.proofreadpage_add_container = true;
self.proofreadpage_disable_wheelzoom = false;
importScriptURI('https://ca.wikilivres.ru/index.php?title=MediaWiki:Base.js&action=raw&ctype=text/javascript');
/* importScriptURI('https://wikisource.org/w/index.php?title=MediaWiki:PageNumbers.js&action=raw&ctype=text/javascript'); */
importScriptURI('https://ca.wikilivres.ru/index.php?title=MediaWiki:DisplayFooter.js&action=raw&ctype=text/javascript');
importScriptURI('https://ca.wikilivres.ru/index.php?title=MediaWiki:IndexForm.js&action=raw&ctype=text/javascript');
 
/* Version ''correcte du script mais qui ne fonctionne pas, la version de jquery est trop ancienne */
/*importScriptURI('https://wikisource.org/w/index.php?title=MediaWiki:MatchSplit.js&action=raw&ctype=text/javascript');*/
/* Version de remplacement */
importScriptURI('https://ca.wikilivres.ru/index.php?title=MediaWiki:MatchSplit.js&action=raw&ctype=text/javascript');
 
 
/********************************************
*** New buttons on toolbar box
*** by [[user:ThomasV]]
********************************************/


  //2nd tab
function addCustomButton(imageFile, speedTip, tagOpen, tagClose, sampleText) {
  //if( document.getElementById("infoedit") )
       mwCustomEditButtons[mwCustomEditButtons.length] =
  //    {
        {"imageFile": imageFile,
  //       var b = document.getElementById("ca-talk");
          "speedTip": speedTip,
  //      if(b){
          "tagOpen": tagOpen,
  //            var s = b.innerHTML;
          "tagClose": tagClose,
  //            var i = s.indexOf('Discussion');
          "sampleText": sampleText};
  //            b.innerHTML = s.substring(0,i)+"Source"+s.substring(i+10,s.length-1);
  //            }
  //    }
}
}
addOnloadHook(onglets);


addCustomButton('https://upload.wikimedia.org/wikipedia/commons/3/30/Btn_toolbar_rayer.png','Rayer','<s>','</s>','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/8/88/Btn_toolbar_enum.png','Énumération','\\n# élément 1\\n# élément 2\\n# élément 3','','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/1/11/Btn_toolbar_liste.png','Liste','\\n* élément A\\n* élément B\\n* élément C','','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/8/8f/Button_poeme.png','Poésie','<poem>','</poem>','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/9/9e/Btn_toolbar_gallery.png','Galerie Photo','<gallery>\\n','\\n</gallery>','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/3/37/Btn_toolbar_commentaire.png','Commentaire','<!--','-->','Insérer votre commentaire');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/c/c8/Button_redirect.png','Redirection','#REDIRECT \[\[','\]\]','nom de la destination');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/b/b4/Button_category03.png','Catégorie','\[\[Category:','\]\]','nom de la catégorie');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/5/5f/Button_center.png','Texte centré','<center>','</center>','');
addCustomButton('https://upload.wikimedia.org/wikipedia/en/e/e9/Button_headline2.png','paragraphe niveau 3','===','===','');
addCustomButton('https://upload.wikimedia.org/wikipedia/en/8/8e/Button_shifting.png', 'Insérer un retrait',':','',':' );
addCustomButton('https://upload.wikimedia.org/wikipedia/en/5/58/Button_small.png','Texte plus petit','<small>','</small>','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/2/28/Bouton_noir.png','Texte plus grand','<big>','</big>','');
addCustomButton('https://upload.wikimedia.org/wikipedia/en/8/80/Button_upper_letter.png','Exposant','<sup>','</sup>','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/4/4b/Button_nbsp.png','Espace insécable','&nbsp\;','','');
addCustomButton('https://upload.wikimedia.org/wikipedia/en/9/93/Button_sub_link.png','Lien vers sous-titre','\[\[Page\#','\]\]','Sub_page' );
addCustomButton('https://upload.wikimedia.org/wikipedia/en/f/fd/Button_blockquote.png','Block quote','<blockquote style=&quot;border: 1px solid blue; padding: 2em;&quot;>\\n','\\n</blockquote>','Block quote');
addCustomButton('https://upload.wikimedia.org/wikipedia/en/1/13/Button_enter.png','Aller à la ligne','<br />','','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/4/4b/Button_class_text.png', 'Paragraphe texte','<div class=\'text\'>','</div>','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/7/78/Button_titre.png','Titre de page','\{\{Titre\|','\|\|\}\}','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/0/03/Button_chapitre.png','Titre de Chapitre','\{\{chapitre\|livre=','\|auteur=\|nrpartie=\|nrchapitre=\|TitreChapitre=\|commentaires=\}\}','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/c/c4/Button_ref.png','Ajoute une référence','<ref>','</ref>','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/6/64/Buttonrefvs8.png','Liste des références','<references />','','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/c/c3/Button_travaux.png','Relecture','\{\{subst:Infoédit\|1=','\|2= \|3= \|4= \|5= \|6= \}\}','');
/********************************************
*** Copyright tab
*** by [[user:ThomasV]]
********************************************/


function ongletCopyright()  
function ongletCopyright() { // id created by Template:Licence. It should match Template:Licence parameters
      {
         var a = document.getElementById("p-cactions");
         var a = document.getElementById("p-cactions");
         if (a)  
         if (a)  
Line 59: Line 128:
               { b[0].innerHTML = b[0].innerHTML  
               { b[0].innerHTML = b[0].innerHTML  
                 + '<li id="ca-nstab-user">'
                 + '<li id="ca-nstab-user">'
                 + '<a href="/wiki/Wikisource:Creative Commons by-nc-sa">'
                 + '<a href="https://fr.wikisource.org/wiki/Wikisource:Creative_Commons_by-nc-sa">'  // /wiki/Wikilivres:Creative Commons by-nc-sa
                 + 'License</a></li>';
                 + 'Copyright</a></li>';
               }
               }
             else if(document.getElementById("Copyright-ONU"))
             else if(document.getElementById("Copyright-ONU"))
               { b[0].innerHTML = b[0].innerHTML  
               { b[0].innerHTML = b[0].innerHTML  
                 + '<li id="ca-nstab-user">'
                 + '<li id="ca-nstab-user">'
                 + '<a href="/wiki/Wikisource:Copyright-ONU">'
                 + '<a href="https://fr.wikisource.org/wiki/Wikisource:Copyright-ONU">'   // /wiki/Wikilivres:Copyright-ONU
                 + 'License</a></li>';
                 + 'Copyright</a></li>';
               }
               }
             else if(document.getElementById("Copyright-UNESCO"))
             else if(document.getElementById("Copyright-UNESCO"))
               { b[0].innerHTML = b[0].innerHTML  
               { b[0].innerHTML = b[0].innerHTML  
                 + '<li id="ca-nstab-user">'
                 + '<li id="ca-nstab-user">'
                 + '<a href="/wiki/Wikisource:Copyright-UNESCO">'
                 + '<a href="https://fr.wikisource.org/wiki/Wikisource:Copyright-UNESCO">' // /wiki/Wikilivres:Copyright-UNESCO
                 + 'License</a></li>';
                 + 'Copyright</a></li>';
               }
               }
             else if(document.getElementById("GFDL"))
             else if(document.getElementById("GFDL"))
               { b[0].innerHTML = b[0].innerHTML  
               { b[0].innerHTML = b[0].innerHTML  
                 + '<li id="ca-nstab-user">'
                 + '<li id="ca-nstab-user">'
                 + '<a href="/wiki/Wikisource:Licence GFDL">'
                 + '<a href="https://fr.wikisource.org/wiki/Wikisource:Licence_GFDL">' // /wiki/Wikilivres:Licence GFDL
                 + 'License</a></li>';
                 + 'Copyright</a></li>';
               }
               }
           }
           }
         }
         }
      }
}
        
        
addOnloadHook(ongletCopyright);
addOnloadHook(ongletCopyright);




/*</pre>
===interwikiextra===
Auteur:ThomasV
<pre>*/


/*****************************************************************
*** Edittools: Menu for selecting subsets of special characters
***
******************************************************************/


function interwikiExtra()
function addCharSubsetMenu() {   // the options should match MediaWiki:Edittools
{
  // iterate over all <span>-elements
  for(var i=0; a = document.getElementsByTagName("span")[i]; i++) {
      // if found a linkInfo span
      if(a.className == "interwiki-info") {
        // iterate over all <li>-elements
        var count=0;
       
        for(var j=0; b = document.getElementsByTagName("li")[j]; j++) {
            if(b.className == "interwiki-" + a.id) {
              b.innerHTML = b.innerHTML + " "+a.title;
              if(a.title == "(vo)") { b.title = "Texte original"; }
            }
        else if(b.className == "interwiki-" + a.id.substr(0,a.id.length-1)) {
              count = count+1;
              if(a.id.charAt(a.id.length-1) == count) {
                  b.innerHTML = b.innerHTML + " "+a.title;
              }
            }
        }
      }
      if(a.className == "AutreVersion") {
        p = a.title.indexOf("|");
        pvers = document.getElementById("p-version");
        if (pvers == null) {
          c = document.getElementById("column-one");
          c.innerHTML = c.innerHTML
            + "<div class=\"portlet\" id=\"p-version\">"
            + "<h5>Autres versions</h5>"
            + "<div class=\"pBody\">"
            + "<ul>"
            + "</ul>"
            + "</div>";
            pvers = document.getElementById("p-version");
          }
          e = pvers.getElementsByTagName("ul")[0];
          e.innerHTML = e.innerHTML
            + "<li class=\"\"><a href='"
            + a.title.substr(0,p)
            + "'>" + a.title.substr(p+1,a.title.length-1)+ "</a> " +"</li>"
      }
  }
}
 
addOnloadHook(interwikiExtra);
 
 
 
 
/*</pre>
===Liens bilingues===
Fonctionne avec l'extension DoubleWiki. Auteur: ThomasV
<pre>*/
 
 
function BilingualLink()
{
    if( wgNamespaceNumber != 0) return;
    var doc_url = document.URL;
    var url = '';
    // iterate over all <li>-elements
    for(var j=0; b = document.getElementsByTagName("li")[j]; j++) {
        if(b.className.substring(0,10) == "interwiki-" ) {
              var lang = b.className.substring(10,b.className.length);
              if( doc_url.indexOf('?title=') != -1 ) {
                  var qm  = doc_url.indexOf('&match=');
                  if( qm != -1 ) url = doc_url.substring(0,qm)+"&match="+lang;
                  else url = doc_url+"&match="+lang;
              } else {
                  var qm  = doc_url.indexOf('?');
                  if( qm != -1 ) url = doc_url.substring(0,qm)+"?match="+lang;
                  else url = doc_url+"?match="+lang;
              }
              b.innerHTML = b.innerHTML+"<a href='"+url+"'> &hArr;</a>";
            }
        }
}
 
addOnloadHook(BilingualLink);
/*</pre>
 
===Edittools===
<pre>*/
 
/* add menu for selecting subsets of secial characters */
/***** must match MediaWiki:Edittools *****/
function addCharSubsetMenu() {
   var specialchars = document.getElementById('specialchars');
   var specialchars = document.getElementById('specialchars');


Line 187: Line 168:
     var menu = "<select style=\"display:inline\" onChange=\"chooseCharSubset(selectedIndex)\">";
     var menu = "<select style=\"display:inline\" onChange=\"chooseCharSubset(selectedIndex)\">";
     menu += "<option>Wiki</option>";
     menu += "<option>Wiki</option>";
     menu += "<option>Latin/Romain</option>";
     menu += "<option>Latin</option>";
     menu += "<option>Grec</option>";
     menu += "<option>Grec</option>";
     menu += "<option>Cyrillique</option>";
     menu += "<option>Cyrillique</option>";
Line 213: Line 194:
     menu += "<option>Vieil anglais</option>";
     menu += "<option>Vieil anglais</option>";
     menu += "<option>Vietnamien</option>";
     menu += "<option>Vietnamien</option>";
    menu += "<option>API</option>";
     menu += "</select>";
     menu += "</select>";
     specialchars.innerHTML = menu + specialchars.innerHTML;
     specialchars.innerHTML = menu + specialchars.innerHTML;
Line 232: Line 214:
addOnloadHook(addCharSubsetMenu);
addOnloadHook(addCharSubsetMenu);


/****************************************/
function mwInsertEditButton(parent, item) {
        var image = document.createElement("img");
        image.width = 23;
        image.height = 22;
        image.src = item.imageFile;
        image.border = 0;
        image.style.cursor = "pointer";
        var ref = document.createElement("a")
        ref.setAttribute("href", "javascript:insertTags(\"" + item.tagOpen + "\",\"" + item.tagClose + "\",\"" + item.sampleText + "\");")
        ref.setAttribute("title", item.speedTip);
        ref.appendChild(image);
       
        parent.appendChild(ref);
}


/*</pre>


===Générateur de tableaux===
/*****************************************************************
<pre>*/
*** interwikiExtra
*** by [[user:ThomasV]]
******************************************************************/


/**
function interwikiExtra()  
*
* English: Generate an array using Mediawiki syntax
*
* @author: fr:user:dake
* @version: 0.1
*/
function generateTableau(nbCol, nbRow, border, styleHeader, styleLine)
{
{
        var code = "\n";
  // iterate over all <span>-elements
        if (styleHeader==1) {
  for(var i=0; a = document.getElementsByTagName("span")[i]; i++) {
                code += '{{entête tableau charte}}\n';
      // if found a linkInfo span
        } else {
      if(a.className == "interwiki-info") {  // class created by Template:Interwiki-info
                code += '{| border="' + border + '"\n';
        // iterate over all <li>-elements
                code += '|+ Titre du tableau\n';
        var count=0;
        }
       
       
        for(var j=0; b = document.getElementsByTagName("li")[j]; j++) {
        for (var i=0;i<nbCol;i++) code += '! en-tête ' + i + '\n'
            if(b.className == "interwiki-" + a.id) {
       
              b.innerHTML = b.innerHTML + " "+a.title;
        for (var j=0;j<nbRow;j++) {
              if(a.title == "(vo)") { b.title = "Original Text"; }
                if ((j+1)%2==0 && styleLine==1) {
            }
                        code += '|-{'+'{ligne grise}'+'}\n'
        else if(b.className == "interwiki-" + a.id.substr(0,a.id.length-1)) {
                } else {               
              count = count+1;
                        code += '|-----\n'
              if(a.id.charAt(a.id.length-1) == count) {
                }
                  b.innerHTML = b.innerHTML + " "+a.title;
               
               }
                for (var i=0;i<nbCol;i++) code += '| élément\n';
        }
       
        code += '|}';
        insertTags('','', code);
}
 
/**
*
* English: Open a popup with parameters to generate an array.
* The number of rows/columns can be modified. Some additional
* parameters are related to templates available on :fr
*
* @author: fr:user:dake
* @version: 0.1
*/
function popupTableau()
{
  var popup = window.open('','name','height=400,width=500');
 
  javaCode =  '<script type="text\/javascript">function insertCode(){';
  javaCode += 'var row = parseInt(document.paramForm.inputRow.value); '
  javaCode += 'var col = parseInt(document.paramForm.inputCol.value); '
  javaCode += 'var bord = parseInt(document.paramForm.inputBorder.value); '
  javaCode += 'var styleHeader = document.paramForm.inputHeader.checked; '
  javaCode += 'var styleLine = document.paramForm.inputLine.checked; '
  javaCode += 'window.opener.generateTableau(col,row,bord,styleHeader,styleLine); '
  javaCode += '}<\/script>';
 
  popup.document.write('<html><head><title>Paramètres du tableau</title>');
  popup.document.write('<script type="text\/javascript" src="\/skins-1.5\/common\/wikibits.js"><!-- wikibits js --><\/script>');
  popup.document.write('<style type="text\/css" media="screen,projection">/*<![CDATA[*/ @import "\/skins-1.5\/monobook\/main.css?5"; /*]]>*/<\/style>');
  popup.document.write(javaCode);
  popup.document.write('</head><body>');
  popup.document.write('<p>Veuillez entrer les paramètres du tableau : </p>');
  popup.document.write('<form name="paramForm">');
  popup.document.write('Nombre de lignes : <input type="text" name="inputRow" value="3" ><p>');
  popup.document.write('Nombre de colonnes : <input type="text" name="inputCol" value="3" ><p>');
  popup.document.write('Largeur de la bordure : <input type="text" name="inputBorder" value="1" ><p>');
  popup.document.write('En-tête en gris (style « charte graphique ») : <input type="checkbox" name="inputHeader" checked="1" ><p>');
  popup.document.write('Lignes grises alternées (style « charte graphique ») : <input type="checkbox" name="inputLine" checked="1" ><p>');
  popup.document.write('</form">');
  popup.document.write('<p><a href="javascript:insertCode()"> Insérer le code dans la fenêtre d\'édition</a></p>');
  popup.document.write('<p><a href="javascript:self.close()"> Fermer</a></p>');
  popup.document.write('</body></html>');
  popup.document.close();
}
 
 
/*</pre>
===Insertion de nouveaux boutons dans la barre d'outil===
<pre>*/
 
 
// Début du code pour le modèle interprojet (codice adattato da de:wikt:Mediawiki:monobook.js)
 
document.write('<style type="text/css">#interProject {display: none; speak: none;} #p-tb .pBody {padding-right: 0;}<\/style>');
function iProject() {
  if (document.getElementById("interProject")) {
  var iProject = document.getElementById("interProject").innerHTML;
  var interProject = document.createElement("div");
  interProject.style.marginTop = "0.7em";
  interProject.innerHTML = '<h5>compléments<\/h5><div class="pBody">'+iProject+'<\/div>';
  document.getElementById("p-tb").appendChild(interProject);
  }
}
  hookEvent("load", iProject);
// fin du code pour l'interprojet
 
//============================================================
// Insertion de nouveaux boutons dans la barre d'outil
//============================================================
 
//Remplit la variable mwCustomEditButtons (voir /skins-1.5/commons/wikibits.js) pour ajouter des boutons à la barre d'outils
function addCustomButton(imageFile, speedTip, tagOpen, tagClose, sampleText)
{
mwCustomEditButtons[mwCustomEditButtons.length] =
{"imageFile": imageFile,
  "speedTip": speedTip,
  "tagOpen": tagOpen,
  "tagClose": tagClose,
  "sampleText": sampleText};
}
 
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/3/30/Btn_toolbar_rayer.png','Rayer','<s>','</s>','');
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/8/88/Btn_toolbar_enum.png','Énumération','\\n# élément 1\\n# élément 2\\n# élément 3','','');
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/1/11/Btn_toolbar_liste.png','Liste','\\n* élément A\\n* élément B\\n* élément C','','');
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/8/8f/Button_poeme.png','Poésie','<poem>\\n\\n','\\n</poem>','');
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/9/9e/Btn_toolbar_gallery.png','Galerie Photo','<gallery>\\n','\\n</gallery>','');
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/3/37/Btn_toolbar_commentaire.png','Commentaire','<!--','-->','Insérer votre commentaire');
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/c/c8/Button_redirect.png','Redirection','#REDIRECT \[\[','\]\]','nom de la destination');
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/b/b4/Button_category03.png','Catégorie','\[\[Catégorie:','\]\]','nom de la catégorie');
addCustomButton('http://upload.wikimedia.org/wikipedia/en/5/5f/Button_center.png','Texte centré','<div style=&quot;text-align: center;&quot;>','</div>','');
addCustomButton('http://upload.wikimedia.org/wikipedia/en/e/e9/Button_headline2.png','paragraphe niveau 3','===','===','');
addCustomButton('http://upload.wikimedia.org/wikipedia/en/8/8e/Button_shifting.png', 'Insérer un retrait',':','',':' );
addCustomButton('http://upload.wikimedia.org/wikipedia/en/5/58/Button_small.png','Texte plus petit','<small>','</small>','');
addCustomButton('http://upload.wikimedia.org/wikipedia/en/8/80/Button_upper_letter.png','Exposant','<sup>','</sup>','');
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/4/4b/Button_nbsp.png','Espace insécable','&nbsp\;','','');
addCustomButton('http://upload.wikimedia.org/wikipedia/en/9/93/Button_sub_link.png','Lien vers sous-titre','\[\[Page\#','\]\]','Sub_page' );
addCustomButton('http://upload.wikimedia.org/wikipedia/en/f/fd/Button_blockquote.png','Block quote','<blockquote style=&quot;border: 1px solid blue; padding: 2em;&quot;>\\n','\\n</blockquote>','Block quote');
addCustomButton('http://upload.wikimedia.org/wikipedia/en/1/13/Button_enter.png','Aller à la ligne','<br />','','');
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/4/4b/Button_class_text.png', 'Paragraphe texte','<div class=text>\\n\\n','\\n</div>','');
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/7/78/Button_titre.png','Titre de page','\{\{Titre\|','\|\|\}\}','');
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/0/03/Button_chapitre.png','Titre de Chapitre','\{\{chapitre\|livre=','\|auteur=\|nrpartie=\|nrchapitre=\|TitreChapitre=\|commentaires=\}\}','');
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/a/a0/Button_references_alt.png','Ajoute une référence','<ref>','</ref>','');
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/9/9a/Button_references.png','Liste des références','<references />','','');
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/c/c3/Button_travaux.png','Relecture','\{\{subst:Infoédit\|1=','\|2= \|3= \|4= \|5= \|6= \}\}','');
 
//Ressemble à la fonction de /skins-1.5/commons/wikibits.js pour insérer un autre lien que insertTags
function marque_tab()
{
var toolbar = document.getElementById('toolbar');
if (!toolbar) return false;
var textbox = document.getElementById('wpTextbox1');
if (!textbox) return false;
if (!document.selection && textbox.selectionStart == null)
return false;
var image = document.createElement("img");
image.width = 23;
image.height = 22;
image.src = 'http://upload.wikimedia.org/wikipedia/fr/0/04/Button_array.png';
image.border = 0;
image.alt = 'Tableau';
image.title = 'Tableau';
image.style.cursor = "pointer";
image.onclick = function() {
  popupTableau();
  return false;
}
toolbar.appendChild(image);
}
 
addOnloadHook(marque_tab);
 
/*</pre>
</div>
 
===Options d'affichage===
Voir [[:Modèle:Option]]. Auteur:ThomasV
<pre>*/
 
 
//Cookies
function SetCookie(name,value) {
        document.cookie = name + "=" + escape(value);
}
 
function GetCookie(name) {
        var i =0;
        while (i < document.cookie.length) {
                if (document.cookie.substr(i,name.length) == name) {
                        var valend = document.cookie.indexOf(";",i+name.length+1);
                        if (valend == -1) {
                                valend = document.cookie.length;
                        }
                        return unescape(document.cookie.substring(i+name.length+1,valend));
                }
                i = document.cookie.indexOf(" ", i) + 1;
                if (i == 0) break;
        }
}
 
 
function OptionText() {
  var indexNavigationBar = 0;
  // iterate over all < span >-elements until class "OptionText" is found
  for(
          var i=0;  
          SpanElem = document.getElementsByTagName("span")[i];
          i++
      ) {
      // if found an option span
      if (SpanElem.className == "OptionText") {
          //SpanElem.style.display = 'none';
          OptionTitle = SpanElem.title;
          OptionStyle = SpanElem.firstChild.getAttribute('style');
 
          //check if option was already encountered...
          if(!document.getElementById(OptionTitle)){
 
            //read cookie
            var DisplayOptionDefault = true;
            CookieDisplayOption = GetCookie ("Display"+OptionTitle)
            if (CookieDisplayOption ) {
            if (CookieDisplayOption == "false") DisplayOptionDefault = false; }
 
            var PageDisplay = document.createElement("li");
            PageDisplay.setAttribute('id', OptionTitle);
            var PageDisplayLink = document.createElement("a");
 
            OptionText = document.createTextNode("Désactiver "+OptionTitle);
            PageDisplayLink.appendChild(OptionText);
            PageDisplayLink.setAttribute('href','javascript:displayOptionText("'+OptionTitle+'","' + OptionStyle +'", '+DisplayOptionDefault+');');
            PageDisplay.appendChild(PageDisplayLink);
 
            var optlist = document.getElementById("optlist");
            if(!optlist) {
              var displayOptions = document.createElement("div");
              displayOptions.style.marginTop = "0.7em";
              displayOptions.innerHTML = '<h5>options d’affichage<\/h5><div class="pBody"><ul id="optlist"></ul><\/div>';
              document.getElementById("p-tb").appendChild(displayOptions);
               optlist = document.getElementById("optlist");
             }
             }
            optlist.appendChild(PageDisplay);
        }
 
      }
            displayOptionText(OptionTitle,OptionStyle,DisplayOptionDefault);
      if(a.className == "OtherVersion") {  // class created by Template:OtherVersion (Modèle:AutreVersion in fr.ws)
          }
        p = a.title.indexOf("|");
      }
        pvers = document.getElementById("p-version");
  }
        if (pvers == null) {
}
           c = document.getElementById("column-one");
 
           c.innerHTML = c.innerHTML
function displayOptionText(optiontitle, optionstyle, bool) {
            + "<div class=\"portlet\" id=\"p-version\">"
    
            + "<h5>Other versions</h5>"
  SetCookie ("Display"+optiontitle,bool);
            + "<div class=\"pBody\">"
  var PageDisplayLink = document.getElementById(optiontitle).firstChild;;
            + "<ul>"
 
            + "</ul>"
  // iterate over all < span >-elements
            + "</div>";
  for(
            pvers = document.getElementById("p-version");
          var i=0;
          }
           SpanElem = document.getElementsByTagName("span")[i];  
          e = pvers.getElementsByTagName("ul")[0];  
           i++
          e.innerHTML = e.innerHTML
      ) {
            + "<li class=\"\"><a href='"
        // if found an option text
            + a.title.substr(0,p)
        if ((SpanElem.className == "OptionText") && (SpanElem.title == optiontitle)) {
            + "'>" + a.title.substr(p+1,a.title.length-1)+ "</a> " +"</li>";
          if(bool==true ) {
            SpanElem.setAttribute('style',optionstyle);
            PageDisplayLink.firstChild.data = (optiontitle);
            PageDisplayLink.setAttribute('href', 'javascript:displayOptionText("'+optiontitle+'","'+optionstyle+'", false);');
          }
          if(bool==false) {
            SpanElem.setAttribute('style','null');
            PageDisplayLink.firstChild.data = (optiontitle);
            PageDisplayLink.setAttribute('href', 'javascript:displayOptionText("'+optiontitle+'","'+optionstyle+'", true);');
 
        }       
       }
       }
   }
   }
}
addOnloadHook(OptionText);
function loadImage(ImageSrc,id){
  var d = document.getElementById(id);
  //if(d.firstChild){d.removeChild(d.firstChild);}
  d.firstChild.setAttribute('href', 'javascript:hideImage("'+ImageSrc+'", "'+id+'");');
  d.firstChild.setAttribute('title', 'cacher');
  d.firstChild.innerHTML='[-]';
  var newimg = document.createElement("img");
  //newimg.setAttribute("src", "/wiki/Special:Filepath/"+ImageSrc.substring(6));
  newimg.setAttribute("src", "/w/thumb.php?f="+ImageSrc.substring(6)+"&w=650");
  newimg.setAttribute("alt", "image not found : "+ImageSrc.substring(6));
  newimg.setAttribute("id", "img2");
  d.appendChild(newimg);
}
function hideImage(ImageSrc,id){
  var d = document.getElementById(id);
  d.firstChild.setAttribute('href', 'javascript:loadImage("'+ImageSrc+'", "'+id+'");');
  d.firstChild.setAttribute('title', 'montrer');
  d.firstChild.innerHTML='[+]';
  d.removeChild(d.lastChild);
}
}


addOnloadHook(interwikiExtra);


function onclickImages() {
 
  // iterate over all < span >-elements
  for(
          var i=0;
          spanElem = document.getElementsByTagName("span")[i];
          i++
      ) {
        if (spanElem.className == "onclickImage")  {
            spanElem.setAttribute('id', 'onclick'+i);
            title = spanElem.firstChild.getAttribute('title');
            spanElem.firstChild.setAttribute('href', 'javascript:loadImage("'+title+'", "onclick'+i+'");');
            spanElem.firstChild.innerHTML='[+]';
            spanElem.firstChild.setAttribute('title', 'montrer');
      }
  }
}
addOnloadHook(onclickImages);


/*</pre>


===Affichage double : texte et image scannée===
/*****************************************************************
Author: ThomasV
*** footnotes as tooltip
<pre>*/
*** from it.wikipedia.org
*** inserted by [[user:-jkb-]]
******************************************************************/


document.write('<script type="text/javascript" src="http://wikisource.org/wiki/MediaWiki:Page.js?action=raw&ctype=text/javascript&dontcountme=s"></script>');
addOnloadHook ( function ()
 
{
/*</pre>
sups = document.getElementsByTagName("sup");
 
for (i=0; i<sups.length; i++)
===Boutons Qualité===
  {
Author: ThomasV
  note_id = sups[i].childNodes[0].href;
<pre>*/
  if (note_id && (note_id.indexOf("#") != -1))
 
  {
function pageQuality() {
    note_id = document.getElementById(note_id.substr(note_id.indexOf("#")+1));
 
    if (note_id)
  for(
      if (document.all)  
        var i=0;  
      {  
        spanElem = document.getElementsByTagName("span")[i];  
          sups[i].title = note_id.innerText;  
        i++
          sups[i].childNodes[0].title = note_id.innerText;  
      ) {
      }
        if (spanElem.className == "pagequality") {
      else
            t = spanElem.title;
      {
            var new_img = document.createElement("img");
          sups[i].title = note_id.textContent;  
            new_img.setAttribute("src", "/wiki/Special:Filepath/"+t.substring(0,t.length-1)+'%25.png');
            new_img.setAttribute("title", "/wiki/Special:Filepath/"+t.substring(0,t.length-1)+'%25.png');
 
            if(wgPageName.substring(0,5) == "Page:") {
              a = document.getElementById("ca-nstab-page");
              if(a) a.firstChild.appendChild(new_img);
            }
            else {
              s1 = spanElem.parentNode.previousSibling;
              opttext = s1.firstChild.firstChild;
              img = opttext.firstChild.nextSibling.nextSibling.nextSibling;
              next = img.nextSibling;
              opttext.removeChild(img);
              opttext.insertBefore(new_img,next);
            }
       }
       }
   }
   }
  }
  }
})


addOnloadHook(pageQuality);
function addQuality(form,value){
  var text="";
  switch(value){
    case "0%": text = "En projet"; break;
    case "25%": text = "Texte incomplet"; break;
    case "50%": text = "Texte non formaté"; break;
    case "75%": text = "Complet et formaté"; break;
    case "100%": text = "Relu et corrigé"; break;
    }
  form.elements["wpSummary"].value="/* "+text+" */";
  s = form.elements["wpTextbox1"].value;
  if(wgPageName.substring(0,5) == "Page:") {
      prefix="Page";
      s = s.replace(/\{\{PageQuality\|(.*?)\}\}/gi,"")
  }
  else {
    prefix="Text";
    s = s.replace(/\{\{TextQuality\|(.*?)\}\}/gi,"")
  }
  form.elements["wpTextbox1"].value="{"+"{"+prefix+"Quality|"+value+"}"+"}"+s;
}
function addQualityButtons(){
  if( wgNamespaceNumber != 0 ) return;
  var ig  = document.getElementById("wpWatchthis");
  if(ig) {
            var f = document.createElement("span");
            f.innerHTML = ' <input type="radio" name="quality" value="25%" onclick="addQuality(this.form,this.value)"><img src = "/wiki/Special:Filepath/25%25.png">'+'<input type="radio" name="quality" value="50%" onclick="addQuality(this.form,this.value)"><img src = "/wiki/Special:Filepath/50%25.png">'+'<input type="radio" name="quality" value="75%" onclick="addQuality(this.form,this.value)"><img src = "/wiki/Special:Filepath/75%25.png">'+'<input type="radio" name="quality" value="100%" onclick="addQuality(this.form,this.value)"><img src = "/wiki/Special:Filepath/100%25.png"> Niveau d\'avancement du texte';
          ig.parentNode.insertBefore(f,ig.nextSibling.nextSibling.nextSibling)
          }
}
addOnloadHook(addQualityButtons);






/* </pre> */
/* </pre> */

Latest revision as of 20:19, 28 October 2026

/* <pre> */

/**********************
*** Quality indicators on "article" tab
*** by [[user:ThomasV]]
**********************/
// return src for icon given percentage
function icon_src(t){
	var src='https://ca.wikilivres.ru/images/';
	switch(t){
		case '0%': src+='8/8f/00%25.png'; break;
		case '25%': src+='5/5b/25%25.png'; break;
		case '50%': src+='3/3a/50%25.png'; break;
		case '75%': src+='c/cd/75%25.png'; break;
		case '100%': src+='6/64/100%25.png'; break;
		case 'Validated': src+='b/b7/Etoile.png'; break;
	} 
	return src;
}
 
// add indicator
function pageQuality() {
	var a = document.getElementById('ca-nstab-main');
	if(!a) return;
 
	var pr_index = document.getElementById('pr_index');
	if(pr_index) return;
 
	var q = document.getElementById('textquality');
	if(q) {
		var new_img = document.createElement('img');
		new_img.setAttribute('src', icon_src(q.className));
		a.firstChild.appendChild(new_img);
	}
 
	for(var i=0; spanElem = document.getElementsByTagName('span')[i]; i++) {
		if (spanElem.className == 'pagequality')  {
			var new_img = document.createElement('img');
			new_img.setAttribute('src', icon_src(spanElem.title));
 
			if(wgCanonicalNamespace == 'Page') {
				a.firstChild.appendChild(new_img);
			}
			else {
				s1 = spanElem.parentNode.previousSibling;
				opttext = s1.firstChild.firstChild;
				img = opttext.firstChild.nextSibling.nextSibling.nextSibling;
				next = img.nextSibling;
				opttext.removeChild(img);
				opttext.insertBefore(new_img,next);
			}
		}
	}
}
addOnloadHook(pageQuality);


/* configure */
self.proofreadpage_add_container = true;
self.proofreadpage_disable_wheelzoom = false;
 
importScriptURI('https://ca.wikilivres.ru/index.php?title=MediaWiki:Base.js&action=raw&ctype=text/javascript');
/* importScriptURI('https://wikisource.org/w/index.php?title=MediaWiki:PageNumbers.js&action=raw&ctype=text/javascript'); */
importScriptURI('https://ca.wikilivres.ru/index.php?title=MediaWiki:DisplayFooter.js&action=raw&ctype=text/javascript');
importScriptURI('https://ca.wikilivres.ru/index.php?title=MediaWiki:IndexForm.js&action=raw&ctype=text/javascript');

/* Version ''correcte du script mais qui ne fonctionne pas, la version de jquery est trop ancienne */
/*importScriptURI('https://wikisource.org/w/index.php?title=MediaWiki:MatchSplit.js&action=raw&ctype=text/javascript');*/
/* Version de remplacement */
importScriptURI('https://ca.wikilivres.ru/index.php?title=MediaWiki:MatchSplit.js&action=raw&ctype=text/javascript');


/********************************************
*** New buttons on toolbar box
*** by [[user:ThomasV]]
********************************************/

function addCustomButton(imageFile, speedTip, tagOpen, tagClose, sampleText) {
      mwCustomEditButtons[mwCustomEditButtons.length] =
         {"imageFile": imageFile,
          "speedTip": speedTip,
          "tagOpen": tagOpen,
          "tagClose": tagClose,
          "sampleText": sampleText};
}

addCustomButton('https://upload.wikimedia.org/wikipedia/commons/3/30/Btn_toolbar_rayer.png','Rayer','<s>','</s>','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/8/88/Btn_toolbar_enum.png','Énumération','\\n# élément 1\\n# élément 2\\n# élément 3','','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/1/11/Btn_toolbar_liste.png','Liste','\\n* élément A\\n* élément B\\n* élément C','','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/8/8f/Button_poeme.png','Poésie','<poem>','</poem>','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/9/9e/Btn_toolbar_gallery.png','Galerie Photo','<gallery>\\n','\\n</gallery>','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/3/37/Btn_toolbar_commentaire.png','Commentaire','<!--','-->','Insérer votre commentaire');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/c/c8/Button_redirect.png','Redirection','#REDIRECT \[\[','\]\]','nom de la destination');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/b/b4/Button_category03.png','Catégorie','\[\[Category:','\]\]','nom de la catégorie');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/5/5f/Button_center.png','Texte centré','<center>','</center>','');
addCustomButton('https://upload.wikimedia.org/wikipedia/en/e/e9/Button_headline2.png','paragraphe niveau 3','===','===','');
addCustomButton('https://upload.wikimedia.org/wikipedia/en/8/8e/Button_shifting.png', 'Insérer un retrait',':','',':' );
addCustomButton('https://upload.wikimedia.org/wikipedia/en/5/58/Button_small.png','Texte plus petit','<small>','</small>','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/2/28/Bouton_noir.png','Texte plus grand','<big>','</big>','');
addCustomButton('https://upload.wikimedia.org/wikipedia/en/8/80/Button_upper_letter.png','Exposant','<sup>','</sup>','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/4/4b/Button_nbsp.png','Espace insécable','&nbsp\;','','');
addCustomButton('https://upload.wikimedia.org/wikipedia/en/9/93/Button_sub_link.png','Lien vers sous-titre','\[\[Page\#','\]\]','Sub_page' );
addCustomButton('https://upload.wikimedia.org/wikipedia/en/f/fd/Button_blockquote.png','Block quote','<blockquote style=&quot;border: 1px solid blue; padding: 2em;&quot;>\\n','\\n</blockquote>','Block quote');
addCustomButton('https://upload.wikimedia.org/wikipedia/en/1/13/Button_enter.png','Aller à la ligne','<br />','','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/4/4b/Button_class_text.png', 'Paragraphe texte','<div class=\'text\'>','</div>','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/7/78/Button_titre.png','Titre de page','\{\{Titre\|','\|\|\}\}','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/0/03/Button_chapitre.png','Titre de Chapitre','\{\{chapitre\|livre=','\|auteur=\|nrpartie=\|nrchapitre=\|TitreChapitre=\|commentaires=\}\}','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/c/c4/Button_ref.png','Ajoute une référence','<ref>','</ref>','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/6/64/Buttonrefvs8.png','Liste des références','<references />','','');
addCustomButton('https://upload.wikimedia.org/wikipedia/commons/c/c3/Button_travaux.png','Relecture','\{\{subst:Infoédit\|1=','\|2= \|3= \|4= \|5= \|6= \}\}','');



/********************************************
*** Copyright tab
*** by [[user:ThomasV]]
********************************************/

function ongletCopyright() {  // id created by Template:Licence. It should match Template:Licence parameters
        var a = document.getElementById("p-cactions");
        if (a) 
        {
          b = a.getElementsByTagName("ul");
          if(b.length > 0)
          {
            if(document.getElementById("Creative Commons by-nc-sa"))
              { b[0].innerHTML = b[0].innerHTML 
                + '<li id="ca-nstab-user">'
                + '<a href="https://fr.wikisource.org/wiki/Wikisource:Creative_Commons_by-nc-sa">'   // /wiki/Wikilivres:Creative Commons by-nc-sa
                + 'Copyright</a></li>';
              }
            else if(document.getElementById("Copyright-ONU"))
              { b[0].innerHTML = b[0].innerHTML 
                + '<li id="ca-nstab-user">'
                + '<a href="https://fr.wikisource.org/wiki/Wikisource:Copyright-ONU">'   // /wiki/Wikilivres:Copyright-ONU
                + 'Copyright</a></li>';
              }
            else if(document.getElementById("Copyright-UNESCO"))
              { b[0].innerHTML = b[0].innerHTML 
                + '<li id="ca-nstab-user">'
                + '<a href="https://fr.wikisource.org/wiki/Wikisource:Copyright-UNESCO">'  // /wiki/Wikilivres:Copyright-UNESCO
                + 'Copyright</a></li>';
              }
            else if(document.getElementById("GFDL"))
              { b[0].innerHTML = b[0].innerHTML 
                + '<li id="ca-nstab-user">'
                + '<a href="https://fr.wikisource.org/wiki/Wikisource:Licence_GFDL">'  // /wiki/Wikilivres:Licence GFDL
                + 'Copyright</a></li>';
              }
          }
        }
}
      
addOnloadHook(ongletCopyright);



/*****************************************************************
*** Edittools: Menu for selecting subsets of special characters
*** 
******************************************************************/

function addCharSubsetMenu() {   // the options should match MediaWiki:Edittools
  var specialchars = document.getElementById('specialchars');

  if (specialchars) {
    var menu = "<select style=\"display:inline\" onChange=\"chooseCharSubset(selectedIndex)\">";
    menu += "<option>Wiki</option>";
    menu += "<option>Latin</option>";
    menu += "<option>Grec</option>";
    menu += "<option>Cyrillique</option>";
    menu += "<option>AHD</option>";
    menu += "<option>Allemand</option>";
    menu += "<option>Catalan</option>";
    menu += "<option>Croate</option>";
    menu += "<option>Espagnol</option>";
    menu += "<option>Espéranto</option>";
    menu += "<option>Estonien</option>";
    menu += "<option>Gallois</option>";
    menu += "<option>Hawaien</option>";
    menu += "<option>Hiéroglyphe</option>";
    menu += "<option>Islandais</option>";
    menu += "<option>Italien</option>";
    menu += "<option>Maltais</option>";
    menu += "<option>Pinyin</option>";
    menu += "<option>Polonais</option>";
    menu += "<option>Portugais</option>";
    menu += "<option>Rōmaji</option>";
    menu += "<option>Roumain</option>";
    menu += "<option>Scandinave</option>";
    menu += "<option>Serbe</option>";
    menu += "<option>Tchèque</option>";
    menu += "<option>Vieil anglais</option>";
    menu += "<option>Vietnamien</option>";
    menu += "<option>API</option>";
    menu += "</select>";
    specialchars.innerHTML = menu + specialchars.innerHTML;

    /* default subset - try to use a cookie some day */
    chooseCharSubset(0);
  }
}

/* select subsection of special characters */
function chooseCharSubset(s) {
  var l = document.getElementById('specialchars').getElementsByTagName('p');
  for (var i = 0; i < l.length ; i++) {
    l[i].style.display = i == s ? 'inline' : 'none';
    l[i].style.visibility = i == s ? 'visible' : 'hidden';
  }
}

addOnloadHook(addCharSubsetMenu);



/*****************************************************************
*** interwikiExtra
*** by [[user:ThomasV]]
******************************************************************/

function interwikiExtra() 
{
   // iterate over all <span>-elements
   for(var i=0; a = document.getElementsByTagName("span")[i]; i++) {
      // if found a linkInfo span
      if(a.className == "interwiki-info") {  // class created by Template:Interwiki-info
         // iterate over all <li>-elements
         var count=0;
         
         for(var j=0; b = document.getElementsByTagName("li")[j]; j++) {
            if(b.className == "interwiki-" + a.id) {
               b.innerHTML = b.innerHTML + " "+a.title;
               if(a.title == "(vo)") { b.title = "Original Text"; }
            }
         else if(b.className == "interwiki-" + a.id.substr(0,a.id.length-1)) {
               count = count+1;
               if(a.id.charAt(a.id.length-1) == count) {
                  b.innerHTML = b.innerHTML + " "+a.title;
               }
            }
         }
      }
      if(a.className == "OtherVersion") {   // class created by Template:OtherVersion (Modèle:AutreVersion in fr.ws)
         p = a.title.indexOf("|");
         pvers = document.getElementById("p-version");
         if (pvers == null) {
           c = document.getElementById("column-one");
           c.innerHTML = c.innerHTML
             + "<div class=\"portlet\" id=\"p-version\">"
             + "<h5>Other versions</h5>"
             + "<div class=\"pBody\">"
             + "<ul>"
             + "</ul>"
             + "</div>";
             pvers = document.getElementById("p-version");
           }
           e = pvers.getElementsByTagName("ul")[0]; 
           e.innerHTML = e.innerHTML 
             + "<li class=\"\"><a href='" 
             + a.title.substr(0,p)
             + "'>" + a.title.substr(p+1,a.title.length-1)+ "</a> " +"</li>";
      }
   }
}

addOnloadHook(interwikiExtra);



/*****************************************************************
*** footnotes as tooltip
*** from it.wikipedia.org
*** inserted by [[user:-jkb-]]
******************************************************************/

addOnloadHook ( function ()
{
 sups = document.getElementsByTagName("sup");
 for (i=0; i<sups.length; i++)
 {
   note_id = sups[i].childNodes[0].href;
   if (note_id && (note_id.indexOf("#") != -1))
   {
     note_id = document.getElementById(note_id.substr(note_id.indexOf("#")+1));
     if (note_id)
       if (document.all) 
       { 
           sups[i].title = note_id.innerText; 
           sups[i].childNodes[0].title = note_id.innerText; 
       } 
       else 
       { 
           sups[i].title = note_id.textContent; 
      }
   }
 }
})




/* </pre> */