Advertisement
Zenit

Iconos

Dec 11th, 2020
940
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name Iconos
  3. // @description Un saludo a Enrique y a Yasinator
  4. // @namespace Violentmonkey Scripts
  5. // @grant none
  6. // @include https://www.3djuegos.com/*
  7. // @version 1.1
  8. // @author Señor X
  9. // ==/UserScript==
  10.  
  11. if (window.location.href.indexOf("zona=escribir") > -1) {
  12.  
  13.  
  14. var body = document.getElementById("body");
  15. var caja = document.createElement("div");
  16. caja.id = "iconitos";
  17. caja.style.backgroundSize = "20px 20px";
  18. caja.style.backgroundPosition = "center center";
  19. caja.style.backgroundColor = "#37bed021";
  20. caja.style.height = "auto";
  21. caja.style.width = "419px";
  22. caja.style.position = "fixed";
  23. caja.style.top = "140px";
  24. caja.style.padding = "45px";
  25. caja.style.zIndex = "9";
  26. caja.style.opacity = "0";
  27. caja.style.transition = "opacity 1s";
  28. body.appendChild(caja);
  29.  
  30. var iconos = ["http://www.roto2.com/roto2.gif",
  31.               "https://iforo.3djuegos.com/files_foros/fo/fo5f.gif",
  32.               "http://st.forocoches.com/foro/images/smilies/roto2qtemeto.gif",
  33.               "http://st.forocoches.com/foro/images/smilies/roto2nuse.gif",
  34.               "http://st.forocoches.com/foro/images/smilies/roto2cafe.gif",
  35.               "http://st.forocoches.com/foro/images/smilies/roto2gaydude.gif",
  36.               "https://st.forocoches.com/foro/images/smilies/roto2rie.gif",
  37.               "http://st.forocoches.com/foro/images/smilies/sisi1.gif",
  38.               "https://st.forocoches.com/foro/images/smilies/meparto.gif",
  39.               "http://st.forocoches.com/foro/images/smilies/thumbsup.gif",
  40.               "https://st.forocoches.com/foro/images/smilies/smash2.gif",
  41.               "http://st.forocoches.com/foro/images/smilies/icon_popcorn.gif",
  42.               "https://iforo.3djuegos.com/files_foros/fo/fo5d.gif",
  43.               "http://st.forocoches.com/foro/images/smilies/clap.gif",
  44.               "http://st.forocoches.com/foro/images/smilies/dancer2.gif",
  45.               "http://st.forocoches.com/foro/images/smilies/buitre.gif",
  46.               "http://st.forocoches.com/foro/images/smilies/facepalm.gif",
  47.               "http://i.neoseeker.com/cm/52/badges/pc_master_race_iconZdVbe.png",
  48.               "http://1.bp.blogspot.com/_wICwAy4q81U/TROgTWCqiRI/AAAAAAAAAiA/6Xt_ZSrbVh0/s320/aplausos.gif",
  49.               "http://i.imgur.com/f9IXpQY.gif",
  50.               "http://i.imgur.com/lzTeK36.gif",
  51.               "http://i.imgur.com/Xes98hi.png",
  52.               "http://i.imgur.com/nluUNx4.png",
  53.               "http://cdn.arstechnica.net/wp-content/uploads/2015/11/kappa.png",
  54.               "http://a.deviantart.net/avatars/p/e/pedobear45.gif",
  55.               "http://iforo.3djuegos.com/files_foros/7x/7xo.png",
  56.               "http://iforo.3djuegos.com/files_foros/5h/5he.png",
  57.               "https://i.ibb.co/470nQvb/eleven.png",
  58.               "https://i.ibb.co/xGRBW4k/tonto.png",
  59.               "https://i.ibb.co/B37WZSD/3x-1.gif",
  60.               "https://i.ibb.co/ckGM6mJ/3x-2.gif",
  61.               "https://i.ibb.co/2qLwZwd/3x-3.gif",
  62.               "https://i.ibb.co/pKxmP5h/3x-4.gif",
  63.               "https://i.ibb.co/FDsJ3JZ/3x-5.gif",
  64.               "https://i.ibb.co/FHc25mS/3x-6.gif",
  65.               "https://i.ibb.co/64gWJfH/3x-7.gif",
  66.               "https://i.ibb.co/KWcgx18/3x-8.gif",
  67.               "https://i.ibb.co/44wPZt5/3x-9.gif",
  68.               "https://i.ibb.co/2n534xD/3x-10.gif",
  69.               "https://i.ibb.co/kJrw3qG/3x-11.gif",
  70.               "https://i.ibb.co/KqxqLDb/3x.gif",
  71.               "https://i.ibb.co/4PwhzcV/3x.gif",
  72.               "https://i.ibb.co/bWJvJYY/3x-1.gif",
  73.               "https://i.ibb.co/BqdHJWP/3x-2.gif",
  74.               "https://i.ibb.co/0Z6Gz09/3x-3.gif",
  75.               "https://i.ibb.co/s1cRCwD/3x-4.gif",
  76.               "https://i.ibb.co/txYHCTp/3x-5.gif"
  77.              ];
  78.  
  79. var memes = ["https://i.imgur.com/Vi5Qn1L.jpg",
  80.             "https://ep01.epimg.net/verne/imagenes/2020/02/12/articulo/1581533769_341780_1581537731_noticia_normal.jpg",
  81.             "https://i.gyazo.com/690136c1572cd1f75e27ec72467faf14.png",
  82.             "https://pbs.twimg.com/media/D43XT_dWwAE1Ac6.jpg",
  83.             "https://pbs.twimg.com/media/DuVXrgQW4AEncml.jpg",
  84.             "https://archive-media-1.nyafuu.org/vp/image/1515/99/1515999450920.gif",
  85.             "https://www.pngitem.com/pimgs/m/296-2965180_wojak-sony-playstation-4-hd-png-download.png",
  86.             "https://i.pinimg.com/564x/82/18/c9/8218c9217e082234f55c665551748d4c.jpg",
  87.             "https://thumbs.gfycat.com/ImpeccableDiscreteHyrax-max-1mb.gif",
  88.             "https://i.ytimg.com/vi/jc-svpCUbuc/maxresdefault.jpg",
  89.             "https://www.dailydot.com/wp-content/uploads/1b8/c9/f28d88cc84be32b4.png",
  90.             "https://memegenerator.net/img/instances/56768701/one-ticket-to-hell-plase.jpg",
  91.             "https://media1.tenor.com/images/bac206f4886b9d65d73eb803ba646e25/tenor.gif",
  92.             "https://media.tenor.com/images/f18b31a91406dac22baa1d47c6752096/tenor.gif",
  93.             "https://media1.tenor.com/images/7a6505ea7790cde4b0003a9c4b0ea57b/tenor.gif",
  94.             "https://media1.tenor.com/images/8c182d284869ea4d589f09ecad3f9abd/tenor.gif",
  95.             "https://media1.tenor.com/images/7f4acc4cb1fc88ea4426dcf1ad1ec27f/tenor.gif",
  96.             "https://media1.tenor.com/images/07d99c397f19a807439e313f5ce523a8/tenor.gif"];
  97.  
  98.       var icons = document.getElementById("iconitos");      
  99.  
  100.       /*Crear títols */
  101.       var titulo_iconos = document.createElement("h2");
  102.           titulo_iconos.style.color = "white";
  103.           titulo_iconos.style.fontSize = "20px";
  104.           titulo_iconos.style.marginLeft = "3px";
  105.       var text_iconos = document.createTextNode("Iconos");
  106.  
  107.       var titulo_memes = document.createElement("h2");
  108.           titulo_memes.style.color = "white";
  109.           titulo_memes.style.fontSize = "20px";
  110.           titulo_memes.style.marginLeft = "3px";
  111.           titulo_memes.style.marginTop = "10px";
  112.       var text_memes = document.createTextNode("Memes");
  113.       /*Crear títols */
  114.  
  115.       titulo_iconos.appendChild(text_iconos);      
  116.       icons.appendChild(titulo_iconos);
  117.  
  118.  
  119.       for(i=0;i<iconos.length;i++){
  120.         var temp = iconos[i];
  121.         var newicon = document.createElement("div");
  122.             newicon.className = "dib cur_p bbcode_boton";
  123.             newicon.id = i;
  124.             newicon.style.backgroundImage = "url('"+iconos[i]+"')";
  125.             newicon.style.backgroundRepeat = "no-repeat";
  126.             newicon.style.backgroundSize = "contain";
  127.             newicon.style.backgroundPosition = "center center";
  128.             newicon.style.height = "30px";
  129.             newicon.style.width = "30px";
  130.             newicon.style.border = "1px solid #676464";
  131.             newicon.style.margin = "3px";
  132.             newicon.addEventListener("click",function(){add_icon(this.id)}, true);
  133.             icons.appendChild(newicon);
  134.         }
  135.  
  136.       titulo_memes.appendChild(text_memes);      
  137.       icons.appendChild(titulo_memes);
  138.  
  139.       for(i=0;i<memes.length;i++){
  140.         var temp = memes[i];
  141.         var newicon = document.createElement("div");
  142.             newicon.className = "dib cur_p bbcode_boton";
  143.             newicon.id = i;
  144.             newicon.style.backgroundImage = "url('"+memes[i]+"')";
  145.             newicon.style.backgroundRepeat = "no-repeat";
  146.             newicon.style.backgroundSize = "contain";
  147.             newicon.style.backgroundPosition = "center center";
  148.             newicon.style.height = "60px";
  149.             newicon.style.width = "60px";
  150.             newicon.style.border = "1px solid #676464";
  151.             newicon.style.margin = "3px";
  152.             newicon.addEventListener("click",function(){add_meme(this.id)}, true);
  153.             icons.appendChild(newicon);
  154.         }
  155.  
  156.         function add_icon(id){          
  157.             var caretPos = document.getElementById("form_mensaje").selectionStart;
  158.             var textAreaTxt = document.getElementById("form_mensaje").value;
  159.             var txtToAdd = "[img]"+iconos[id]+"[/img]";
  160.             document.getElementById("form_mensaje").value = textAreaTxt.substring(0, caretPos) + txtToAdd + textAreaTxt.substring(caretPos);
  161.         }
  162.  
  163.         function add_meme(id){          
  164.             var caretPos = document.getElementById("form_mensaje").selectionStart;
  165.             var textAreaTxt = document.getElementById("form_mensaje").value;
  166.             var txtToAdd = "[img]"+memes[id]+"[/img]";
  167.             document.getElementById("form_mensaje").value = textAreaTxt.substring(0, caretPos) + txtToAdd + textAreaTxt.substring(caretPos);
  168.         }
  169.  
  170.     var barra = document.getElementsByClassName("comu_caja_fondo_boton br4 mar_rl5 mar_t10 tar pr")[0];
  171.     var barra2 = barra.innerHTML;
  172.     barra.innerHTML = '<a class="boton b_s14" id="boton_iconos" style="margin-left: 10px; float: left" href="#">Iconos</a>';
  173.     barra.innerHTML += barra2;
  174.  
  175.     document.getElementById("boton_iconos").addEventListener("click",function(){
  176.         var caja = document.getElementById("iconitos");
  177.         if (caja.style.opacity === "0") {
  178.             caja.style.opacity = "1";
  179.         }
  180.         else {
  181.           caja.style.opacity = "0";
  182.         }
  183.     });
  184. }
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement