User:Rodehi/global.js

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:PortableCSSPad/code.js'    ] });

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:PurgeButton/code.js'    ] });

$(function {   mw.util.addCSS(".kockaEmoticonsIcon{width:19px;height:19px;border:1px solid black;padding: 10px;border-radius: 5px;background:#20B2AA;}.kockaEmoticonsIcon:hover{background:#20B2AA;}#kockaEmoticonsModalMain{height:400px;overflow-y:auto;}");    var obj = window.kockaEmoticons || {};    obj.emoticons = {};    obj.vocab = obj.vocab || {};    EMOTICONS.split("\n").forEach(function(el, index, arr) { if(el[0] === "*" && el[1] !== "*") obj.emoticons[arr[index + 1].substring(2).trim] = el.substring(1).trim; }, this);    function createEmoteElement(emote)    {        var el = document.createElement("img");        el.className = "kockaEmoticonsIcon";        el.src = obj.emoticons[emote];        el.onclick = function        {            var ap = $(".message textarea").last;            ap.val(ap.attr("value") + emote);            $("#kockaEmoticonsModal").closeModal;        }; $("#kockaEmoticonsModalMain").append(el); }   var button = document.createElement("button"); button.innerHTML = obj.vocab.emoticons || "Emotes"; button.className = "kockaEmoticonsSpan"; button.onclick = function {       $.showCustomModal(obj.vocab.emoticons || "Emotes", " ",        {            id: "kockaEmoticonsModal",            buttons: [{                id: "kockaEmoticonsClose",                defaultButton: true,                message: obj.vocab.close || "Cerrar",                handler: function{ $("#kockaEmoticonsModal").closeModal; }            }]        }); $("#kockaEmoticonsModalMain").append(" " + (typeof obj.help === 'undefined' ? "Para insertar un emote, simplemente haz clic en él.": obj.help) + " "); for(var emote in obj.emoticons) if(obj.emoticons.hasOwnProperty(emote)) createEmoteElement(emote); };   $('.public.wordmark').first.append(button); });