Utilisateur:Ficelle/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) ;

Chrome / Internet Explorer / Opera : maintenez la touche Ctrl en cliquant sur le bouton Actualiser ou pressez Ctrl-F5.
/* <pre><nowiki> */
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:GôTô/ufunctions.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

function remLoadEvent(func)
{
  if (window.removeEventListener) 
    window.removeEventListener("load", func, false);
  else if (window.detachEvent) 
    window.detachEvent("onload", func);
}

//remove toolbar
//remLoadEvent(ImprovedToolbar)

//------------------------------------------------------------------------------------------DeluxeBar
// Ajoute des boutons et autres jovialités dans la barre d'édition
function DeluxeBar()
{
        if (document.createTextNode)
        {
                var toolbar = document.getElementById("toolbar")
                if (!toolbar)
                        return

                ///// zone personnalisable ////
                // le texte a été splitté sinon Mediawiki casse tout...
                // Signature
                img = document.createElement("img")
                img.setAttribute("src", "http://upload.wikimedia.org/wikipedia/fr/d/d3/Button_copyvio_discuss.png")
                ref = document.createElement("a")
                ref.setAttribute("href", "javascript:insertTags(\"" + "~~" + "~~" + "\", '', '');")
                ref.setAttribute("title", "Ajouter la signature - 1")
                ref.setAttribute("accesskey", "1")
                ref.appendChild(img)
                toolbar.appendChild(ref)

                //Souligner
                img = document.createElement("img")
                img.setAttribute("src", "/skins-1.5/common/images/button_link.png")
                ref = document.createElement("a")
                ref.setAttribute("href", "javascript:insertTags('<u>', '</u>', '');")
                ref.setAttribute("title", "Souligner - 2")
                ref.setAttribute("accesskey", "2")
                ref.appendChild(img)
                toolbar.appendChild(ref)

                // Redirection
                var inputText = document.createElement("input")
                inputText.setAttribute("type", "text")
                inputText.setAttribute("size", "60")
                inputText.setAttribute("style", "font-size: 90%")
                inputText.setAttribute("id", "inputRedirect")
                img = document.createElement("img")
                img.setAttribute("src", "http://upload.wikimedia.org/wikipedia/fr/4/4d/Button_recyclage.png")
                ref = document.createElement("a")
                ref.setAttribute("href", "javascript:setSummary('redirection vers [['+ document.getElementById('inputRedirect').value + ']]'); setTextarea('#REDIRECT [[' + document.getElementById('inputRedirect').value + ']]');")
                ref.setAttribute("title", "Rediriger - 3")
                ref.setAttribute("accesskey", "3")
                ref.appendChild(img)
                toolbar.appendChild(ref)
                toolbar.appendChild(inputText)
                // Catégories
                var inputTextCat = document.createElement("input")
                inputTextCat.setAttribute("type", "text")
                inputTextCat.setAttribute("size", "20")
                inputTextCat.setAttribute("style", "font-size: 90%")
                inputTextCat.setAttribute("id", "inputCat")
                if (cookies.get("catégorie") !== null)
                        inputTextCat.setAttribute("value", cookies.get("catégorie"))
                img = document.createElement("img")
                img.setAttribute("src", "http://upload.wikimedia.org/wikipedia/fr/6/67/Button_%C3%A9clair.png")
                ref = document.createElement("a")
                ref.setAttribute("href", "javascript:setSummary('catégorie ' + document.getElementById('inputRedirect').value);cookies.setWithDelay('catégorie', document.getElementById('inputRedirect').value, 100000000);insertTags('" + "[[Catégorie:' + document.getElementById('inputRedirect').value + '|' + document.getElementById('inputCat').value + ']]'," + "'" + "', '');")
                ref.setAttribute("title", "Catégorie - 4")
                ref.setAttribute("accesskey", "4")
                ref.appendChild(img)
                toolbar.appendChild(ref)
                toolbar.appendChild(inputTextCat)

        }
}

$(DeluxeBar);

function FicelleCat()
{
        var nouveau_separateur = "|";  // changer le caractère séparateur selon ses préférences.
        var elm = document.getElementById("catlinks");
        elm = elm.firstChild;
        for (var child = elm.firstChild; child; child = child.nextSibling) {
                if (child.nodeType == 3) {
                        child.data = child.data.replace(/•/i, nouveau_separateur);
                }
        }
}

$(FicelleCat);

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