From 57b54e80d0e1621c65c7eb27712706a4cc24afe1 Mon Sep 17 00:00:00 2001 From: Jiiks Date: Wed, 26 Aug 2015 19:37:51 +0300 Subject: [PATCH] Emote inject --- js/quickemotemenu.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/js/quickemotemenu.js b/js/quickemotemenu.js index ddf417f..6e7fc4b 100644 --- a/js/quickemotemenu.js +++ b/js/quickemotemenu.js @@ -2,7 +2,7 @@ * Version: 1.0 * Author: Jiiks | http://jiiks.net * Date: 26/08/2015 - 11:49 - * Last Updated: 26/08/2015 - 15:51 + * Last Update: 26/08/2015 - 19:37 * https://github.com/Jiiks/BetterDiscordApp */ @@ -42,7 +42,13 @@ QuickEmoteMenu.prototype.init = function () { var command = emote; var id = globalEmotes[emote]; - emoteMenuBody.append($("
" , { class: "emote-container" }).append($("", { class: "emote-icon", src: "https://static-cdn.jtvnw.net/emoticons/v1/"+id+"/1.0", title: emote }))); + emoteMenuBody.append($("
" , { class: "emote-container" }).append($("", { class: "emote-icon", id: emote, src: "https://static-cdn.jtvnw.net/emoticons/v1/"+id+"/1.0", title: emote }))); } + + $(".emote-icon").on("click", function() { + var emote = $(this).attr("id"); + var ta = $(".channel-textarea-inner textarea"); + ta.val(ta.val().slice(-1) == " " ? ta.val() + emote : ta.val() + " " + emote); + }); } \ No newline at end of file