User:Cheeseskates/chat.js

var server = " http://vignette2.wikia.nocookie.net/undertale/images/"; var emoticons = { ":)": "9/91/Charaemote.png",   "(flowey)": "0/06/Emote_flowey.png" }; function createEmoteElement(emote) {    var el = document.createElement("img");    el.src = server + emoticons[emote];    el.onclick = function    {        var ap = $(".message textarea").last;        ap.val(ap.attr("value") + emote);        $("#kockaEmoticons").closeModal;    };    $("#kockaEmoticonsModalMain").append(el); } $(function {   var span = document.createElement("span"); span.innerHTML = "Emoticons"; span.className = "kockaEmoticonsSpan"; span.onclick = function {       $.showCustomModal("Title", "  ",         {            id: "kockaEmoticons",            buttons: [{                id: "kockaEmoticonsClose",                defaultButton: true,                message: "Close",                handler: function{ $("#kockaEmoticons").closeModal; }            }]         }); for(var emote in emoticons) if(emoticons.hasOwnProperty(emote)) createEmoteElement(emote); };   var base = $('.public.wordmark').first; base.append(span); });