Jump to content

User:Grondin/DeluxeBar.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
//<nowiki>
//////////BARRE EDITION BOUTON//////////////////////////////////

function DeluxeBar() {
  if (document.createTextNode) {
        var toolbar = document.getElementById("toolbar"); 
        if (!toolbar) return;
        

        var messages = new Array()
        var images = new Array()
        var commentaires = new Array()
        var a=-1;

//Le décompte commence à -1 avec une incrementation sur le premier message, pour éviter tout probleme en cas d'inversion ou suppression du premier message

        // le texte a été splitté sinon Mediawiki casse tout...

        messages[++a] = "{{" + "Bienvenue" + "}}" +  "--" + "~~" + "~~";
        images[a] = "http://upload.wikimedia.org/wikipedia/fr/e/eb/Button_accueilB.png";
        commentaires[a] = "Bienvenue !"

        messages[++a] = "{{bienvenue IP" + "}}" + "--" + "~~" + "~~";
        images[a] = "http://upload.wikimedia.org/wikipedia/commons/3/39/Button_IP.png";
        commentaires[a] = "Bienvenue !"

        messages[++a] = "{{subst:" + "motivation modif" +"|page=" + "}}" +  "--" + "~~" + "~~";
        images[a] = "http://upload.wikimedia.org/wikipedia/commons/7/74/Button_oeil.png";
        commentaires[a] = "Modification de page sans motif"

        messages[++a] = "{{bienvenue débutant" + "}} " + "--" + "~~" + "~~";
        images[a] = "http://upload.wikimedia.org/wikipedia/commons/2/28/Button_info.png";
        commentaires[a] = "Bienvenue débutant !"

        messages[++a] = "{{subst:" + "Bienvenue vandale" + "}}" +  "--" + "~~" + "~~";
        images[a] = "http://upload.wikimedia.org/wikipedia/fr/0/00/Button_vandale.png";
        commentaires[a] = "Avertissement vandalisme"

        messages[++a] = "{{subst:" + "Vandalisme| " + "}}" +  "--" + "~~" + "~~";
        images[a] = "http://upload.wikimedia.org/wikipedia/fr/a/ad/Button_vandale2.png";
        commentaires[a] = "Avertissement vandalisme" + " de niveau 1 "

        messages[++a] = "{{subst:" + "test 2" + "}} " + "--" + "~~" + "~~";
        images[a] = "http://upload.wikimedia.org/wikipedia/commons/1/1c/Button_flamme.png";
        commentaires[a] = "Avertissement vandalisme" + " de niveau 2 "

        messages[++a] = "{{subst:" + "test 3" + "}} " + "--" + "~~" + "~~";
        images[a] = "http://upload.wikimedia.org/wikipedia/commons/3/3b/Button_crocs.png";
        commentaires[a] = "Avertissement vandalisme" + " de niveau 3 "

        messages[++a] = "{{subst:" + "Bienvenue spammeur" + "}}" +  "--" + "~~" + "~~";
        images[a] = "http://upload.wikimedia.org/wikipedia/fr/f/fb/Button_spam2.png";
        commentaires[a] = "Avertissement spam " 

        messages[++a] = "{{subst:" + "Utilisateur:Dake/Traité||--" + "~~" + "~~" + "}}";
        images[a] = "http://upload.wikimedia.org/wikipedia/fr/d/d9/Button_trait%C3%A9.png";
        commentaires[a] = "Traité"

        messages[++a] = "{{subst:" + "Utilisateur:Dake/TraitéConserver||--" + "~~" + "~~" + "}}";
        images[a] = "http://upload.wikimedia.org/wikipedia/fr/a/ae/Button_trait%C3%A9conserver.png";
        commentaires[a] = "Traité : article conservé"

        messages[++a] = "{{subst:" + "Utilisateur:Dake/TraitéSupprimer||--" + "~~" + "~~" + "}}";
        images[a] = "http://upload.wikimedia.org/wikipedia/fr/9/96/Button_trait%C3%A9supprimer.png";
        commentaires[a] = "Traité : article supprimé"

        messages[++a] = "{{" + "suppression à revoir" + "}}";
        images[a] = "http://upload.wikimedia.org/wikipedia/commons/2/22/Button_radio_activite.png";
        commentaires[a] = "Article sensiblement modifié"

        messages[++a] = "{{" + "copie de site|URL|Titre" + "}}";
        images[a] = "http://upload.wikimedia.org/wikipedia/fr/e/e5/Button_copyvio.png";
        commentaires[a] = "Violation de copyright"

        messages[++a] = "{{" + "avis blanchi copyvio|1= |2= |3= |4= " + "}}"+ "--" + "~~" + "~~" ;
        images[a] = "http://upload.wikimedia.org/wikipedia/fr/e/e5/Button_copyvio.png";
        commentaires[a] = "Violation de copyright";

        messages[++a] = "{{" + "Bienvenue copyvio"+"| " + "}}" + "--" + "~~" + "~~";
        images[a] = "http://upload.wikimedia.org/wikipedia/fr/e/e5/Button_copyvio.png";
        commentaires[a] = "Violation de copyright"

        messages[++a] = "{{" + "suppression" + "}}";
        images[a] = "http://upload.wikimedia.org/wikipedia/fr/f/f8/Button_suppr.png";
        commentaires[a] = "Proposé à la suppression" 

        messages[++a] = "{{subst:" + "Utilisateur:Meanos/Modèles/PAdQ rejetée|premier/second tour|0|0|0|-|~~" + "~~}}";
        images[a] = "http://upload.wikimedia.org/wikipedia/fr/c/cf/Button_PAdQ_rejet.png";
        commentaires[a] = "Notification de rejet de la proposition"

        messages[++a] = "{{subst:" + "Utilisateur:Meanos/Modèles/PAdQ validée|premier/second tour|0|0|0|-|~~" + "~~}}";
        images[a] = "http://upload.wikimedia.org/wikipedia/fr/2/29/Button_PAdQ_validation.png";
        commentaires[a] = "Notification de validation de la proposition"

        messages[++a] = "{{subst:" + "Utilisateur:Dake/Toolbox/LicenceInconnue|test.jpg}}";
        images[a] = "http://upload.wikimedia.org/wikipedia/fr/6/67/Button_%C3%A9clair.png";
        commentaires[a] = "Image - licence inconnue ou imprécise"

        messages[++a] = "#{{supprimer" + "}} " + "--" + "~~" + "~~";
        images[a] = "http://upload.wikimedia.org/wikipedia/commons/f/fc/Button_supp.png";
        commentaires[a] = "/*Supprimer*/A voté !";

        messages[++a] = "#{{conserver" + "}} " + "--" + "~~" + "~~";
        images[a] = "http://upload.wikimedia.org/wikipedia/commons/b/ba/Button_conserver.png";
        commentaires[a] = "/*Conserver*/A voté !"

        messages[++a] = "#{{neutre" + "}} " + "--" + "~~" + "~~";
        images[a] = "http://upload.wikimedia.org/wikipedia/commons/4/4e/Button_neutre.png";
        commentaires[a] = "/*neutre*/Vote réservé !"

        messages[++a] = "#{{pour" + "}} " + "--" + "~~" + "~~";
        images[a] = "http://upload.wikimedia.org/wikipedia/commons/b/ba/Button_conserver.png";
        commentaires[a] = "/*Pour*/A voté !"

        messages[++a] = "#{{contre" + "}} " + "--" + "~~" + "~~";
        images[a] = "http://upload.wikimedia.org/wikipedia/commons/f/fc/Button_supp.png";
        commentaires[a] = "/*Contre*/A voté !"

        messages[++a] = "{{" + "recherche IP" + "}}";
        images[a] = "http://upload.wikimedia.org/wikipedia/commons/b/bd/Button_recherche_ip.png";
        commentaires[a] = "Bandeau recherche IP"

        messages[++a] = "{{" + "IP partagée" + "| " + "}}";
        images[a] = "http://upload.wikimedia.org/wikipedia/commons/7/7a/Button_ip_partag%C3%A9e.png";
        commentaires[a] = "Bandeau IP partagée"

        messages[++a] = ":"+ "{{" + "fait" + "}}" + " --" + "~~" + "~~";
        images[a] = "http://upload.wikimedia.org/wikipedia/commons/9/9d/Button_fait.png";
        commentaires[a] = "traité "

        messages[++a] = "{{" + "Article sans source" + "| " + "}}";
        images[a] = "http://upload.wikimedia.org/wikipedia/commons/3/33/Button_exclamation.png";
        commentaires[a] = "Apposition bandeau article sans source "

        messages[++a] = "{{" + "sourcer" + "| " + "}}" + "--" + "~~" + "~~";
        images[a] = "http://upload.wikimedia.org/wikipedia/commons/6/6d/Button_exclamation_1.png";
        commentaires[a] = "Avis d'article non sourcé "

        messages[++a] = "{{" + "sources" + "}}";
        images[a] = "http://upload.wikimedia.org/wikipedia/commons/6/6a/Button_exclamation_2.png";
        commentaires[a] = "Apposition bandeau sources "

        messages[++a] = "{{" + "Pour Wikisource" + "}}";
        images[a] = "http://upload.wikimedia.org/wikipedia/commons/e/eb/Button_wikisource.png";
        commentaires[a] = "Apposition bandeau pour wikisource "

        messages[++a] = "{{" + "Wikisource" + "}}";
        images[a] = "http://upload.wikimedia.org/wikipedia/commons/e/eb/Button_wikisource.png";
        commentaires[a] = "Lien sur wikisource "

        messages[++a] = "{{" + "Redirect Wikisource" + "}}";
        images[a] = "http://upload.wikimedia.org/wikipedia/commons/e/eb/Button_wikisource.png";
        commentaires[a] = "Redirect vers wikisource "

        messages[++a] = "{{" + "Pour Wiktionnaire" + "}}";
        images[a] = "http://upload.wikimedia.org/wikipedia/commons/1/1f/Button_wiktionnaire.png";
        commentaires[a] = "Apposition du bandeau pour Wiktionnaire "

        messages[++a] = "{{" + "Wiktionnaire" + "}}";
        images[a] = "http://upload.wikimedia.org/wikipedia/commons/1/1f/Button_wiktionnaire.png";
        commentaires[a] = "Lien vers Wiktionnaire "

        messages[++a] = "{{" + "Redirect Wiktionnaire" + "}}";
        images[a] = "http://upload.wikimedia.org/wikipedia/commons/1/1f/Button_wiktionnaire.png";
        commentaires[a] = "Redirect vers Wiktionnaire "


      ////////////////////////////////

for (var i=0;i<messages.length;i++) {
                var img = document.createElement("img");
                img.setAttribute("src", images[i]);
                
                var ref = document.createElement("a");
                ref.setAttribute("href", "javascript:insertTags('', \"" + messages[i] + "\", '');" + 
                                 "javascript:changeSummary(\"" + commentaires[i] + "\");" ); 
                ref.appendChild(img); 
                
                toolbar.appendChild(ref);
        }
  }
}

function changeSummary(sampleText) {
        document.editform.wpSummary.value = sampleText;
}

addOnloadHook(DeluxeBar);
//</nowiki>