Utilisateur:Chphe/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.

// [[Projet:JavaScript]]
// [[:Catégorie:MediaWiki:Fonction Monobook en JavaScript]]
obtenir("EditZeroth");
 
loadJs('Utilisateur:Spooky/JSScripts/Navigation popups');
popupFixDabs = true;
 
obtenir("HistoryNumDiff");
 
//obtenir("RevertDiff"); -> dans Preferences->gadget
//if(message.length >= 10) getMessage(where, user1, user2);
 
//loadJs('User:EDUCA33E/LiveRC.js');
 
document.write('<'+'script type="text/javascript" src="http://fr.wikipedia.org/w/index.php?title=Utilisateur:Chphe/Gadget-RevertDiff.js&action=raw&ctype=text/javascript"></script'+'>');
//Utilisation de la version commune :
//document.write('<'+'script type="text/javascript" src="http://fr.wikipedia.org/w/index.php?title=MediaWiki:Gadget-RevertDiff.js&action=raw&ctype=text/javascript"></script'+'>');
 
document.write('<'+'script type="text/javascript" src="http://fr.wikipedia.org/w/index.php?title=Utilisateur:Chphe/Verif-Copie.js&action=raw&ctype=text/javascript"></script'+'>');
 
// afficher l'élément id=ch_a
addOnloadHook(function ()
{
        if ( wgPageName == "Utilisateur:Chphe" )
        {
                var div_ch_a;
                if(div_ch_a = document.getElementById("ch_a")) div_ch_a.style.display = "inline"
        }
 
        //VerifCopie_prefixRecherche = 'http://search.live.com/results.aspx?q=';
}
)
 
function raccourciWikiLink() {
        var l = document.getElementById("editpage-copywarn");
        if (l) {
           l.innerHTML = "<a accesskey='1' style=\"display:none;\" " +
                         "   href=\"javascript:insertTags('[[',']]','')\">&nbsp;</a>" +
                         "<a accesskey='4' style=\"display:none;\" " +
                         "   href=\"javascript:insertTags('’','','')\">&nbsp;</a>"
                         + l.innerHTML;
        }
}
addLoadEvent(raccourciWikiLink);
 
document.write('<'+'script type="text/javascript" src="http://fr.wikipedia.org/w/index.php?title=Utilisateur:Chphe/Gadget-HotCats.js&action=raw&ctype=text/javascript"></script'+'>');
 
loadJs("Utilisateur:Chphe/SuiviCat.js");
/*
var en_lien_sep = "\\s,\\.;:!«»\\?\"\\[\\]\\(\\){}";
var en_lien_reg_sep = new RegExp("^["+en_lien_sep+"]+");
var en_lien_reg_texte = new RegExp("^[^"+en_lien_sep+"]+");
 
function en_lien(div)
{
    for(var i=0; i< div.childNodes.length; i++)
    {
	var fils = div.childNodes[i];
	if(fils.nodeName=="#text")
	{
	    var texte = fils.nodeValue;
	    while(texte != "")
	    {
		var tab = en_lien_reg_sep.exec(texte)
		if(tab)
		{
		    div.insertBefore(document.createTextNode(tab[0]), fils);
		    i++;
		    texte = texte.replace(en_lien_reg_sep, "");
		}
		if(tab = en_lien_reg_texte.exec(texte))
		{
		    var a = document.createElement("a");
	            a.href = "http://fr.wiktionary.org/wiki/"+tab[0];
		    a.innerHTML = tab[0];
		    a.style.color = 'inherit';
		    div.insertBefore(a, fils);
		    i++;
		    texte = texte.replace(en_lien_reg_texte, "");
		}
   	    }
	    i--;
	    div.removeChild(fils);
	}
	else if(fils.nodeName.toLowerCase()!="a") en_lien(fils);
    }
}
 
addOnloadHook(function ()
{   if(wgAction=="view")
    {   var cont = document.getElementById("bodyContent");
        if(cont) en_lien(cont);
    }
}
)
*/
 
//loadJs("Utilisateur:Chphe/PersoLiensListe.js");
//loadJs("Utilisateur:Chphe/PersoLiens.js");
 
//[[Discussion Projet:JavaScript#Lien « Stop » dans la liste de suivi]]
/*
function insertAfter(parent, node, referenceNode) {
    parent.insertBefore(node, referenceNode.nextSibling);
}
 
function OptimizedSuivi() 
{
        if (document.URL.indexOf("http://fr.wikipedia.org/wiki/Special:Liste_de_suivi")==0 ||
        document.URL.indexOf("http://fr.wikipedia.org/w/index.php?title=Special:Liste_de_suivi")==0 ){
                var admin = (wgUserGroups.indexOf("sysop") != -1);
                var allDays = document.getElementsByTagName("ul");
 
                for (i=0; i<allDays.length; i++) {
                        if (allDays[i].getAttribute("class") == "special") {
 
                                var artList = allDays[i].getElementsByTagName("li");
                                for (j=0; j<artList.length; j++) {
                                        var elem = artList[j];
                                        var aTag = elem.getElementsByTagName("a");
                                        var articleName = aTag[0].getAttribute("title");
                                        var ma = articleName.match(/^Special:Log\/(.*)$/);
                                        if(ma)
                                        {
                                                var lien;
                                                if(ma[1] == "newusers") lien = aTag[1];
                                                else if(admin) lien = aTag[5]; // lien supplémentaire (bloquer)
                                                else lien = aTag[4];
 
                                                if(lien.className == "new") articleName = lien.title.replace(/ \(page inexistante\)$/, "");
                                                else articleName = lien.title;
                                        }
 
                                        var stopWatch  = "/w/index.php?title=" + articleName + "&action=unwatch"
 
                                        var newElement = document.createElement("a");
                                        newElement.setAttribute("href",stopWatch);
                                        var newText = document.createTextNode("stop");
                                        newElement.appendChild(newText);
 
                                        var newPar = document.createTextNode(") (")
                                        // séparation des cas (nouvel article, ou déjà existant)
                                        if (aTag[0].childNodes[0].data == "diff") {
                                                insertAfter(elem, newPar, aTag[1]); 
                                        } else {
                                                insertAfter(elem, newPar, aTag[0]); 
                                        }
 
                                        insertAfter(elem, newElement, newPar);
                                }       
                        }
                }
        }
}
 
addLoadEvent(OptimizedSuivi);
*/
loadJs('Projet:Communes de France/listejavascript.js');
loadJs('Utilisateur:Chphe/LiensInterProjets.js');