Utilisateur:LeYaYa/monobook.js

Un article de Wikipédia, l'encyclopédie libre.

Note : Après avoir publié la page, vous devrez forcer son rechargement pour voir les changements : Mozilla / Konqueror / Firefox : Shift-Ctrl-R, Internet Explorer / Opera : Ctrl-F5, Safari : Cmd-R.

///// liste de suivi amelioree ??
 
///historique en couleurs///
document.write('<script type="text/javascript" src="' 
             + 'http://fr.wikipedia.org/w/index.php?title=Utilisateur:GôTô/objects.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
document.write('<script type="text/javascript" src="' 
            + 'http://fr.wikipedia.org/w/index.php?title=Utilisateur:Dake/monobook.js/deluxehistory.js' 
            + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
 
///Edit count///
/* Lien Editcount */
var tabAction = "p-cactions";
function addECButton()
       {
        if ( window.location.href.indexOf('Contributions') < 0) return;
        var c = document.getElementById('contentSub');
        var a = c.getElementsByTagName('a');
        name = a[0].innerHTML;
        var l = document.getElementById(tabAction);
        t = l.innerHTML;
        ind = t.toLowerCase().indexOf("</ul>");
        before = t.substring(0,ind);
        after = t.substring(ind); 
        pitem = "<li><a href='http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?user="+escape(name)+"&dbname=frwiki_p'>"+
                "<div id='EditCount' style='display:inline;'>" + 
                "Editcount"  + 
                "</div></a></li>";
        l.innerHTML = before + pitem + after ;           
      }
addLoadEvent(addECButton);
 
 
///menu déroulant pour la boite de navigation///
/******************************************/
/* Amélioration de la boîte de navigation */
/* Auteur : Seb35                         */
/* Bistro d'aujourd'hui par Teofilo       */
/******************************************/
var isOpen = new Array();
var tempo;
function navigationBox_main()
{
 a = document.getElementById('p-navigation').getElementsByTagName('ul')[0];
 m = new Array('janvier','février','mars','avril','mai','juin','juillet','août','septembre','octobre','novembre','décembre'); 
 today = new Date();
 jjmoisaa = today.getDate() + '_' + m[today.getMonth()] + '_' + (today.getYear() + 1900);
 jjmm = today.getDate() + '/' + (today.getMonth()+1);
 
 //Tableau perso à remplir
 var pages = new Array(
  'Général',
      new Array('/wiki/Wikipédia:Le_Bistro/' + jjmoisaa, 'Le Bistro ' + jjmm,
                '/wiki/Wikipédia:Vandalisme_en_cours', 'WP:-(',
                '/wiki/Wikipédia:Requête_aux_administrateurs', 'WP:RA'
               ),
  'Maintenance',
      new Array('/w/index.php?title=Special:Recentchanges&hideliu=1&limit=200', 'RC IP',
                '/wiki/Wikipédia:Pages_à_fusionner', 'WP:PàF',
                '/wiki/Wikipédia:Pages_à_supprimer', 'WP:PàS'
               )
 );
 
 //Liens perso hors menu déroulant
 a.innerHTML = a.innerHTML
  + '<li><a href="/wiki/Special:Newpages" title="Special:Newpages">Nouvelles pages</a></li>';
 
 //----------------------------//
 //Ne pas modifier ce qui suit //
 //----------------------------//
 for(i = 0; i<(pages.length)/2; i++)
 {
  isOpen[i] = 0;
  temp = '';
  for(j=0; j<(pages[2*i+1].length)/2; j++) temp += '<li><a href="' + pages[2*i+1][2*j] + '">' + pages[2*i+1][2*j+1] + '</a></li>';
  a.innerHTML = a.innerHTML
   + '<li>'
    + '<a style="cursor:hand;" onMouseOver="if(!isOpen[' + i + ']) tempo = setTimeout(toggleMenu, 300, ' + (i+1) + ');" '
    + 'onMouseOut="clearTimeout(tempo);" onClick="clearTimeout(tempo); toggleMenu(' + (i+1) + ');" title="' + pages[2*i] + '">'
    + pages[2*i] + '</a>'
   + '</li>'
   + '<div id="MenuToggle' + (i+1) + '" style="display:none;">' + temp + '</div>';
 }
}
 
/************************************************/
/* Ouvre un menu créé par la fonction ci-dessus */
/************************************************/
function toggleMenu(v)
{
 if(isOpen[v-1] == 0)
 {
  document.getElementById('MenuToggle' + v).style.display = 'block';
  isOpen[v-1] = 1;
 }
 else if(isOpen[v-1] == 1)
 {
  document.getElementById('MenuToggle' + v).style.display = 'none';
  isOpen[v-1] = 0;
 }
}
addLoadEvent(navigationBox_main);
 
 
///navigation popups///
document.write('<script type="text/javascript" src="' 
    + 'http://fr.wikipedia.org/w/index.php?title=User:Leag/popups-strings-fr.js' 
    + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
document.write('<script type="text/javascript" src="' 
    + 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js' 
    + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
 
///commentaires améliorés ///
function addToSummary(str)
{
        document.editform.wpSummary.value += " " + str
}
 
function DeluxeSummary()
{
        var sumLbl = document.getElementById("wpSummaryLabel")
        if (sumLbl)
        {
                //élargissement boite de résumé
                var sumInput = document.getElementById("wpSummary")
                sumInput.style.width = "90%"
 
                var titles = new Array()
                titles.push("+ ébauche")
                titles.push("+ cat")
                titles.push("+ image")
                titles.push("+ interwiki")
                titles.push("+ portail")
                titles.push("- image")
                titles.push("- lien ext")
                titles.push("corr lien int")
                titles.push("lien ext -> lien int")
                titles.push("MeP")
                titles.push("ortho/gram")
                titles.push("retouches")
                titles.push("ajInfo")
                titles.push("rangmt")
                titles.push("recat")
                titles.push("PàS conservé")
 
                var inputs = new Array()
                inputs.push("+ {{ébauche}}")
                inputs.push("+ catégorie")
                inputs.push("+ image")
                inputs.push("+ liens interwiki")
                inputs.push("+ portail")
                inputs.push("- image manquante")
                inputs.push("- lien externe")
                inputs.push("correction lien interne")
                inputs.push("conversion lien externe en lien interne")
                inputs.push("mise en page")
                inputs.push("correction orthographe/grammaire")
                inputs.push("diverses retouches")
                inputs.push("ajout d’infos")
                inputs.push("rangement interwikis/catégories")
                inputs.push("changement catégorie")
                inputs.push("article listé sur PàS - retrait du bandeau (conservé)")
 
 
                var str = ""
                for (var cpt = 0; cpt < titles.length; cpt ++)
                {
                        str += "<a href=\"javascript:addToSummary('" + inputs[cpt] + "')\""
                                + " class=\"sumLink\" title=\"Ajouter '" + inputs[cpt] +"' dans la boîte de résumé\">"
                                + titles[cpt]
                                + " ·</a> "
                }
                sumLbl.innerHTML = str + "<br />" + sumLbl.innerHTML
        }
}
 
addLoadEvent(DeluxeSummary)
 
 
////suivi amélioré////
 
var suiviManagerAllPages = new Array();
 
function SuiviManagerRegexp(regexp)
{
        var match = new RegExp(regexp);
 
        for (var i=0;i<suiviManagerAllPages.length;i++) {
                var pageName = suiviManagerAllPages[i].childNodes[0].getAttribute("value");
                if (match.test(pageName)) {
                        suiviManagerAllPages[i].childNodes[0].checked=true; 
                }
        }
}
 
function SuiviManagerLiensRouges()
{
 
        for (var i=0;i<suiviManagerAllPages.length;i++) {
                var pageClass = suiviManagerAllPages[i].childNodes[1].getAttribute("class");
                if (pageClass && pageClass=="new") {
                        suiviManagerAllPages[i].childNodes[0].checked=true; 
                }
        }
}
 
function SuiviManagerDeselect()
{
        for (var i=0;i<suiviManagerAllPages.length;i++) {
                suiviManagerAllPages[i].childNodes[0].checked=false; 
        }
}
 
 
function SuiviManager() {
        if (document.URL.indexOf("http://fr.wikipedia.org/wiki/Special:Watchlist/edit")!=0) return; 
 
        var a=-1;
        var interfaceMsg = new Array(); 
        var regexpList = new Array(); 
 
        //////////////////////////////////////////////////
        // Expressions régulières et liens de l'interface
        //
        // besoin d'aide pour les regexp ? 
        // http://www.commentcamarche.net/javascript/jsregexp.php3
        //////////////////////////////////////////////////
 
        interfaceMsg[++a]       = "<b>Tout cocher</b>";
        regexpList[a]           = "^.*"; 
 
        interfaceMsg[++a]       = "Utilisateurs";
        regexpList[a]           = "^Utilisateur:";
 
        interfaceMsg[++a]       = "Wikipédia:*"; 
        regexpList[a]           = "^Wikipédia:";
 
        interfaceMsg[++a]       = "Sous-pages de PàS"; 
        regexpList[a]           = "^Wikipédia:Pages à supprimer\/";
 
        interfaceMsg[++a]       = "Sous-pages de PàV"; 
        regexpList[a]           = "^Wikipédia:Pages à vérifier\/";
 
        interfaceMsg[++a]       = "Pages du bistro"; 
        regexpList[a]           = "^Wikipédia:Le Bistro\/";
 
        interfaceMsg[++a]       = "Images"; 
        regexpList[a]           = "^Image:";
 
        interfaceMsg[++a]       = "Modèles"; 
        regexpList[a]           = "^Modèle:"; 
 
        interfaceMsg[++a]       = "Aide"; 
        regexpList[a]           = "^Aide:"; 
 
        interfaceMsg[++a]       = "Catégories"; 
        regexpList[a]           = "^Catégorie:";      
 
        interfaceMsg[++a]       = "Portails"; 
        regexpList[a]           = "^Portail:";        
 
        //////////////////////////////////////////////////
        var topTag = document.getElementById("contentSub")
 
        // récupère toutes les pages
        var watchlist = document.getElementsByTagName("ul");
 
        for (u=0;u<watchlist.length;u++) {
                        var entries = watchlist[u].getElementsByTagName("li"); 
                        for (i=0;i<entries.length;i++) {
                                suiviManagerAllPages.push(entries[i]);
                        }
        }
 
        // prépare la mini-interface
        var str = "<div style=\"background-color:#8ecfe4;font-size:1px;height:8px;border:1px solid #AAAAAA;-moz-border-radius-topright:0.5em;-moz-border-radius-topleft:0.5em;\"></div>"
        + "<div style=\"border:1px solid #6ac1de;border-top:0px solid white;padding:5px 5px 0 5px;margin-bottom:3ex;\"><p>"
        + "<div style=\"float: left; text-align: left; white-space: nowrap;\"></div>"
 
        for (var cpt = 0; cpt < interfaceMsg.length; cpt ++) {
                str += "<a href=\"javascript:SuiviManagerRegexp('" + regexpList[cpt] + "')\">"
                                                + interfaceMsg[cpt]
                                                + " ·</a> "
                }
 
                str += "<a href=\"javascript:SuiviManagerLiensRouges()\">"
                        + "Retirer les liens rouges"
                        + " ·</a> "
 
                str += "<a href=\"javascript:SuiviManagerDeselect()\">"
                        + "<b>Enlever toutes les coches</b>"
                        + " ·</a> "
 
        topTag.innerHTML =       topTag.innerHTML + "<br clear=all />" + str + "<p></div>"
 
}
 
addLoadEvent(SuiviManager);
 
///NAVIGATION ////
 
 
function OptimizedNavig() 
{
  var a = document.getElementById("p-navigation");
 
  if (a) 
  {
    b = a.getElementsByTagName("ul");
    if(b.length > 0)
    { 
      var startUrl = '/w/index.php?title='
      var endUrl = '&action=purge'
 
      // liste des URLs
      var urls = new Array()
      urls[0] = 'Wikipédia:Le Bistro'
      urls[1] = 'Wikipédia:Pages à supprimer'
      urls[2] = 'Wikipédia:Proposition articles de qualité'
      urls[3] = 'WP:BOT'
      urls[4] = 'Special:Newimages'
      urls[5] = 'Special:Newpages'
      urls[6] = 'Special:Blockip'
      urls[7] = 'Special:Log/delete'
      urls[8] = 'Special:Unusedcategories'
      urls[9] = 'Special:Export'
 
      var labels = new Array()
      labels[0] = 'Bistro'
      labels[1] = 'PàS'
      labels[2] = 'pAdQ'
      labels[3] = 'Bots'
      labels[4] = 'nImgs'
      labels[5] = 'nPage'
      labels[6] = 'Block'
      labels[7] = 'Log/Del'
      labels[8] = 'unCat'
      labels[9] = 'Export'
 
      for (var i=0;i<urls.length;i+=2) {
        tableHTML = '<table valign="top" cellspacing="0" cellpadding="0">'
        tableHTML += '<tr>'
        tableHTML += '<li><td><a href="' + startUrl + urls[i] + endUrl + '">' + labels[i] + ' | </a></td>'
        tableHTML += '<td><a href="' + startUrl + urls[i+1] + endUrl + '">' + labels[i+1] + '</a></td></li>'
        tableHTML += '</tr>'
        tableHTML += '</table>' 
        b[0].innerHTML = b[0].innerHTML + tableHTML
      }
 
    }
  }
}
 
 
addLoadEvent(OptimizedNavig);
 
 
///ARBORESCENCE CATEGORIES///
 
// Auteur : Anakin
// Dernière mise à jour : 11 décembre 2005
 
function CategoryTree()
{
  var element = document.getElementById('ca-nstab-category');
  if (element)
  {
    var categoryname = element.firstChild.href;
    categoryname = categoryname.substring(7);
 
    var wikiname = categoryname.substring(0, categoryname.indexOf('.'));
 
    var indexofname = categoryname.indexOf(":") + 1;
    categoryname = categoryname.substring(indexofname);
 
    var indexofampersand = categoryname.indexOf("&");
    if (indexofampersand != -1)
      categoryname = categoryname.substring(0, indexofampersand);
 
    var li = document.createElement('li');
    li.id = 'ca-categorytree';
 
    var a = document.createElement('a');
    a.appendChild(document.createTextNode("Arborescence"));
    a.href = 'http://tools.wikimedia.de/~daniel/WikiSense/CategoryTree.php?wikilang=fr&wiki=' + wikiname + '&art=on&cat=' + categoryname;
 
    li.appendChild(a);
 
    document.getElementById('ca-nstab-category').parentNode.appendChild(li);
  }
}
 
addLoadEvent(CategoryTree);