// ==UserScript== // @name Atelier 801 Smileys // @namespace https://github.com/Mcfloy/Atelier-801-Experiments // @version 0.6 // @description Great Smileys in Atelier 801 (Credits to Fxie & Melibellule) // @author Mcfloy // @match http://atelier801.com/* // @grant none // ==/UserScript== (function() { if (document.querySelector("#outils_message_reponse") !== null && document.querySelector("#outils_message_reponse") !== undefined) { var parent = document.querySelector("#outils_message_reponse > .btn-group:nth-last-child(2)"); var bloc = "message_reponse"; } else if (document.querySelector("#outils_message_sujet") !== null && document.querySelector("#outils_message_sujet") !== undefined) { var parent = document.querySelector("#outils_message_sujet > .btn-group:nth-last-child(2)"); var bloc = "message_sujet"; } else if (document.querySelector("#outils_message_conversation") !== null && document.querySelector("#outils_message_conversation") !== undefined) { var parent = document.querySelector("#outils_message_conversation > .btn-group:nth-last-child(2)"); var bloc = "message_conversation"; } else if (document.querySelector("#outils_presentation") !== null && document.querySelector("#outils_presentation") !== undefined) { var parent = document.querySelector("#outils_presentation > .btn-group:nth-last-child(2)"); var bloc = "presentation"; } if (parent !== undefined && parent !== null) { var node = document.createElement("div"); node.className = "btn-group groupe-boutons-barre-outils"; node.innerHTML = ""; parent.parentNode.insertBefore(node, parent.nextSibling); parent.parentNode.insertBefore(node, parent.nextSibling); node = document.createElement("div"); node.className = "btn-group groupe-boutons-barre-outils"; node.innerHTML = ""; parent.parentNode.insertBefore(node, parent.nextSibling); node = document.createElement("div"); node.className = "btn-group groupe-boutons-barre-outils"; node.innerHTML = ""; parent.parentNode.insertBefore(node, parent.nextSibling); } var forms = document.querySelectorAll("form[action='edit-topic-message']"); if (forms !== undefined) { for (var i = 0; i < forms.length; i++) { var id = forms[i].querySelector("input[name='m']").value; var parent = document.querySelector("#outils_edit_message_" + id + " > .btn-group:nth-last-child(2)"); var bloc = "edit_message_" + id; var node = document.createElement("div"); node.className = "btn-group groupe-boutons-barre-outils"; node.innerHTML = ""; parent.parentNode.insertBefore(node, parent.nextSibling); parent.parentNode.insertBefore(node, parent.nextSibling); node = document.createElement("div"); node.className = "btn-group groupe-boutons-barre-outils"; node.innerHTML = ""; parent.parentNode.insertBefore(node, parent.nextSibling); node = document.createElement("div"); node.className = "btn-group groupe-boutons-barre-outils"; node.innerHTML = ""; parent.parentNode.insertBefore(node, parent.nextSibling); }; } })();