Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name ChameColors
- // @namespace https://atelier801.com/
- // @version 0.1
- // @description Colorcitos personalizados pa chame
- // @author Eliaseeg
- // @match *://atelier801.com/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- // Edita los valores aquí
- var colors = {
- Lavanda: "#e6e6fa",
- Cyan: "#00ffff",
- Oro: "#ffd700",
- Gris: "#808080",
- Elias: "#000000",
- Salmon: "#fa8072",
- Ladrillo: "#b22222",
- Plata: "#c0c0c0",
- Cafe: "#8b4513",
- Rosa: "#ffc0cb",
- Turqueza: "#40e0d0",
- Coral: "#ff7f50",
- Tomate: "#ff6347",
- Elias2: "#ffffff",
- Vainilla: "#fff8dc",
- Violeta: "#c71585",
- };
- const itemsPerRow = 4 // puedes editar esto si quieres, esto te dice cuantos elementos se van a mostrar por fila.
- const newRow = "<tr>";
- const endRow = "</td></tr>";
- var divControl;
- var divControlSujet;
- var count = 0;
- var colorDiv = document.createElement('div');
- var fullDiv = newRow;
- for (var color in colors) {
- count++;
- fullDiv += '<td class="cellule-dropdown"> <li><a class="element-menu-outils" onclick="ajouterBBCode('+"'message_reponse'" + ", '[color=" + colors[color] + "]', '[/color]', "+ 15 + ");"+'"><font color="' + colors[color] + '"/>'+color+'</a></li></td>';
- if (count%4 == 0) {
- fullDiv += newRow;
- }
- }
- colorDiv.setAttribute("class", "btn-group groupe-boutons-barre-outils");
- colorDiv.innerHTML = '<button type="button" class="btn btn-reduit" onclick="ajouterBBCode('+"'message_reponse'"+"', '[color=]', '[/color]', 7);" + ' title="Colores"><img src="https://i.imgur.com/aPbjLMM.png"></button> <button class="btn btn-reduit dropdown-toggle" data-toggle="dropdown"> <span class="caret"></span> </button> \ <ul class="dropdown-menu label-message"><table><tbody>' + fullDiv + '</tbody></table></ul> </div>';
- if (document.getElementById("outils_message_reponse")) {
- divControl = document.getElementById("outils_message_reponse");
- divControl.insertBefore(colorDiv, divControl.childNodes[19]);
- }
- if (document.getElementById("outils_message_sujet")) {
- divControlSujet = document.getElementById("outils_message_sujet");
- divControlSujet.insertBefore(colorDiv, divControlSujet.childNodes[19]);
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement