NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name EmoJV // @author Admonitio // @description Emoji // @include http://www.jeuxvideo.com/forums* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js // @grant GM_addStyle // @grant GM_setValue // @grant GM_getValue // @grant GM_notification // @grant GM_xmlhttpRequest // @grant GM_getResourceText // @grant GM_getResourceURL // @version 0.2.0 // @icon http://image.noelshack.com/fichiers/2016/50/1481684643-benissou.gif // @copyright 2016+, Admonitio // ==/UserScript== /*jshint multistr: true */ var emo_smile = [ "๐", "๐", "๐", "๐", "๐", "๐ ", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐ ", "๐ก", "๐ข", "๐ฃ", "๐ค", "๐ฅ", "๐ฆ", "๐ง", "๐จ", "๐ฉ", "๐ช", "๐ซ", "๐ฌ", "๐ญ", "๐ฎ", "๐ฏ", "๐ฐ", "๐ฑ", "๐ฒ", "๐ณ", "๐ด", "๐ต", "๐ถ", "๐ท", "๐ธ", "๐น", "๐บ", "๐ป", "๐ผ", "๐ฝ", "๐พ", "๐ฟ", "๐", "๐", "๐", "๐", "๐"]; var emo_astre = [ "๐", "๐", "๐", "๐", "๐", "๐ ", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐ ", "๐ก", "๐ค", "๐ฅ", "๐ฆ", "๐ง", "๐จ", "๐ฉ", "๐ช", "๐ซ", "๐ฌ"]; var emo_eat = [ "๐ญ", "๐ฎ", "๐ฏ", "๐ฐ", "๐ฑ", "๐ฒ", "๐ณ", "๐ด", "๐ต", "๐ถ", "๐ท", "๐ธ", "๐น", "๐บ", "๐ป", "๐ผ", "๐ฝ", "๐พ", "๐ฟ", "๐", "๐", "๐", "๐", "๐", "๐ ", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐ ", "๐ก", "๐ข", "๐ฃ", "๐ค", "๐ฅ", "๐ฆ", "๐ง", "๐จ", "๐ฉ", "๐ช", "๐ซ", "๐ฌ", "๐ญ", "๐ฎ", "๐ฏ", "๐ฐ", "๐ฑ", "๐ฒ", "๐ณ", "๐ด", "๐ต", "๐ถ", "๐ท", "๐ธ", "๐น", "๐บ", "๐ป", "๐ผ", "๐ฝ", "๐พ", "๐ฟ", "๐", "๐", "๐"]; var emo_act = [ "๐", "๐", "๐ ๐ป", "๐ ๐ผ", "๐ ๐ฝ", "๐ ๐พ", "๐ ๐ฟ", "๐ ", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐ ", "๐ก", "๐ข", "๐ฃ", "๐ค", "๐ฅ", "๐ฆ", "๐ง", "๐จ", "๐ฉ", "๐ช", "๐ซ", "๐ฌ", "๐ญ", "๐ฎ", "๐ฏ", "๐ฐ", "๐ฑ", "๐ฒ", "๐ณ", "๐ด", "๐ต", "๐ถ", "๐ท", "๐ธ", "๐น", "๐บ", "๐ป", "๐ผ", "๐ฝ", "๐พ", "๐ฟ", "๐", "๐", "๐๐ป", "๐๐ผ", "๐๐ฝ", "๐๐พ", "๐๐ฟ", "๐", "๐๐ปโโ๏ธ", "๐๐ปโโ๏ธ", "๐๐ป", "๐๐ผโโ๏ธ", "๐๐ผโโ๏ธ", "๐๐ผ", "๐๐ฝโโ๏ธ", "๐๐ฝโโ๏ธ", "๐๐ฝ", "๐๐พโโ๏ธ", "๐๐พโโ๏ธ", "๐๐พ", "๐๐ฟโโ๏ธ", "๐๐ฟโโ๏ธ", "๐๐ฟ", "๐โโ๏ธ", "๐โโ๏ธ", "๐", "๐๐ปโโ๏ธ", "๐๐ปโโ๏ธ", "๐๐ป", "๐๐ผโโ๏ธ", "๐๐ผโโ๏ธ", "๐๐ผ", "๐๐ฝโโ๏ธ", "๐๐ฝโโ๏ธ", "๐๐ฝ", "๐๐พโโ๏ธ", "๐๐พโโ๏ธ", "๐๐พ", "๐๐ฟโโ๏ธ", "๐๐ฟโโ๏ธ", "๐๐ฟ", "๐โโ๏ธ", "๐โโ๏ธ", "๐", "๐ ", "๐", "๐๐ป", "๐๐ผ", "๐๐ฝ", "๐๐พ", "๐๐ฟ", "๐", "๐", "๐", "๐๐ปโโ๏ธ", "๐๐ปโโ๏ธ", "๐๐ป", "๐๐ผโโ๏ธ", "๐๐ผโโ๏ธ", "๐๐ผ", "๐๐ฝโโ๏ธ", "๐๐ฝโโ๏ธ", "๐๐ฝ", "๐๐พโโ๏ธ", "๐๐พโโ๏ธ", "๐๐พ", "๐๐ฟโโ๏ธ", "๐๐ฟโโ๏ธ", "๐๐ฟ", "๐โโ๏ธ", "๐โโ๏ธ", "๐", "๐๐ปโโ๏ธ", "๐๐ปโโ๏ธ", "๐๐ป", "๐๐ผโโ๏ธ", "๐๐ผโโ๏ธ", "๐๐ผ", "๐๐ฝโโ๏ธ", "๐๐ฝโโ๏ธ", "๐๐ฝ", "๐๐พโโ๏ธ", "๐๐พโโ๏ธ", "๐๐พ", "๐๐ฟโโ๏ธ", "๐๐ฟโโ๏ธ", "๐๐ฟ", "๐๏ธโโ๏ธ", "๐๏ธโโ๏ธ", "๐", "๐๐ปโโ๏ธ", "๐๐ปโโ๏ธ", "๐๐ป", "๐๐ผโโ๏ธ", "๐๐ผโโ๏ธ", "๐๐ผ", "๐๐ฝโโ๏ธ", "๐๐ฝโโ๏ธ", "๐๐ฝ", "๐๐พโโ๏ธ", "๐๐พโโ๏ธ", "๐๐พ", "๐๐ฟโโ๏ธ", "๐๐ฟโโ๏ธ", "๐๐ฟ", "๐๏ธโโ๏ธ", "๐๏ธโโ๏ธ", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐"]; var emo_animal = [ "๐", "๐", "๐", "๐", "๐", "๐ ", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐ ", "๐ก", "๐ข", "๐ฃ", "๐ค", "๐ฅ", "๐ฆ", "๐ง", "๐จ", "๐ฉ", "๐ช", "๐ซ", "๐ฌ", "๐ญ", "๐ฎ", "๐ฏ", "๐ฐ", "๐ฑ", "๐ฒ", "๐ณ", "๐ด", "๐ต", "๐ถ", "๐ท", "๐ธ", "๐น", "๐บ", "๐ป", "๐ผ", "๐ฝ", "๐พ", "๐ฟ"]; var emo_build = [ "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐ ", "๐ก", "๐ข", "๐ฃ", "๐ค", "๐ฅ", "๐ฆ", "๐ง", "๐จ", "๐ฉ", "๐ช", "๐ซ", "๐ฌ", "๐ญ", "๐ฎ", "๐ฏ", "๐ฐ"]; var emo_obj = [ "โ๏ธ","๐ฑ","๐ฒ","๐ป","โฐ","โณ","โ๏ธ","๐ท","๐น","๐ฅ","๐บ","๐ป","๐","๐","โ๏ธ","๐ ","๐ฝ","๐พ","๐ฟ","๐","๐ผ","๐","๐","๐ก","๐ฆ","๐ก","๐ณ","๐ธ","๐ฐ","๐","๐","๐","๐","๐","๐ผ","๐","๐","๐","๐","๐ก","๐ ","๐ข","๐","๐","๐","๐","๐","๐","๐","๐","๐","๐ช","๐ฟ","๐","๐ฝ","๐","๐","๐","๐ฌ","๐ญ","๐ฎ","๐ง","๐ช","๐ฉ","๐จ","๐ฃ","๐ฌ","๐ซ","๐","๐ฐ","๐","โ๏ธ","๐ฉ","๐จ","๐ง","๐ฅ","๐ค","๐ฆ","๐ฏ","๐ฎ","๐ช","๐ซ","๐ฌ","๐ญ","๐","๐","๐","๐","๐","๐","๐ ","๐","๐ ","๐","๐","๐","๐","๐","๐","๐","๐","๐","๐","๐","๐","๐","๐","๐","๐","โ๏ธ","๐","๐","๐","๐ฉ","๐","๐","โ๏ธ","โ๏ธ","๐","๐","๐","๐","๐","๐ฃ","๐ข","๐","๐","๐","๐","๐ค","๐","๐","๐ญ","๐ฌ","๐ธ","๐","๐","๐ซ","โ๏ธ","๐","๐ท","๐ฏ","๐ณ","๐ฑ","๐ต","๐"];; (function() { 'use strict'; // Titre liste $( '<select id="titre_tag" style="margin-bottom:10px;"> \ <option value="">-</option>\ <option value="โ ๏ธ[ALERTE]">โ ๏ธ[Alerte]</option>\ <option value="๐ท[PHOTO]">๐ท[Photo]</option>\ <option value="๐บ[VIDEO]">๐บ[Vidรฉo]</option>\ <option value="๐ง[FILLE]">๐ง[Fille]</option>\ <option value="๐[SONDAGE]">๐[Sondage]</option>\ <option value="๐[RISITAS]">๐[Risitas]</option>\ <option value="โ๏ธ[DILEMME]">โ๏ธ[Dilemme]</option>\ </select> ' ).insertBefore( "#titre_topic" ); document.getElementsByClassName('btn btn-poster-msg datalayer-push')[0].addEventListener('click', function () { var e = document.getElementById("titre_tag"); var strUser = e.options[e.selectedIndex].value; var normaltext=document.getElementById('titre_topic').value; document.getElementById('titre_topic').value = strUser + " " + normaltext ; }); GM_addStyle('#jv-emoji .modal-generic-main {width: 630px;margin-top: 184.5px !important;}'); GM_addStyle('.emo {cursor: pointer;}'); GM_addStyle('#emojiclose {cursor: pointer;}'); var node = document.createElement("button"); node.className = "btn btn-jv-editor-toolbar"; node.type ="button"; node.name ="Emoji"; node.id = "emoji"; document.getElementsByClassName("btn-group")[2].appendChild(node); $('#emoji').append('<span style="color:#a90;">๐</span>'); $('body').append('<div class="modal-generic modal-generic-scroll active" id="jv-emoji" style="display: none;">\ <div class="modal-generic-main" style="margin-top: 0px;">\ <a class="modal-generic-close" id="emojiclose" ><span class="icon-close-popin-jv"></span></a>\ <div class="modal-generic-header">Emoji</div>\ <div class="modal-generic-content" id="emoji-list">\ <p><strong>Pour insรฉrer un emoji, cliquez dessus.</strong></p>\ </div></div></div>'); function appendArray (array) { var list = ""; for(var i=0;i<array.length;i++) { list+= "<a class=\"emo\">" + array[i] + "</a>"; } $('#emoji-list').append("<p style=\"font-size:24px !important;\">"+ list + "</p>"); } $('#emoji-list').append("<p style=\"text-align: center;\">Visage</p>"); appendArray(emo_smile); $('#emoji-list').append("<p style=\"text-align: center;\">Astre</p>"); appendArray(emo_astre); $('#emoji-list').append("<p style=\"text-align: center;\">Nourriture</p>"); appendArray(emo_eat); //appendArray(emo_act); $('#emoji-list').append("<p style=\"text-align: center;\">Construction</p>"); appendArray(emo_build); $('#emoji-list').append("<p style=\"text-align: center;\">Animal</p>"); appendArray(emo_animal); $('#emoji-list').append("<p style=\"text-align: center;\">Objet</p>"); appendArray(emo_obj); document.getElementById('emoji').addEventListener('click', function() {popup("open");}); document.getElementById('emojiclose').addEventListener('click', function() {popup("close");}); var classname = document.getElementsByClassName("emo"); for (var i =0; i < classname.length-1; i++) { classname[i].addEventListener('click', function() {addemo(this);}); } function addemo (ele) { popup("close"); elem.value = elem.value.substring(0,start) + ele.innerHTML + elem.value.substring(end,len); } var elem = document.getElementById('message_topic'); var start = elem.selectionStart; var end = elem.selectionEnd; var len = elem.value.length; var sel_txt = elem.value.substring(start,end); // POPUP function popup (type) { if(type=="close") { document.getElementById("jv-emoji").style.display = "none"; } else { elem = document.getElementById('message_topic'); start = elem.selectionStart; end = elem.selectionEnd; len = elem.value.length; sel_txt = elem.value.substring(start,end); document.getElementById("jv-emoji").style.display = "block"; } } })();