User:PipeDLH/chat.js

// Permitir imagenes y videos en chat tags // var chatags = { images: true, videos: true }; /* Añadir botones */ $(window).load(function addButtons {   var $o = $('#chatOptionsButton');    if ($o.length === 0) {        setTimeout(addButtons, 250);    } else if ([0, 1].indexOf($('.chat-button').length) != -1) {        $o.after(dayNightButton, clearChatText);    } }); /* Clear chat */ function clearChatText { var $clearDiv = $(' ').addClass('chat-button'); var $clearLink = $('').addClass('wikia-button').text('Limpiar Chat'); $clearDiv.html($clearLink); $clearLink.click(function {       $('.Chat li').remove;    }); return $clearDiv; } /* Dia-noche :v */ function dayNightButton { var dayText = 'Tema diurno'; var nightText = 'Tema nocturno'; var $dayNightButton = $(' ').addClass('chat-button'); var $dayNightLink = $('').addClass('wikia-button').text(dayText); var $body = $('body'); $dayNightButton.html($dayNightLink); $dayNightLink.click(function {       $body.toggleClass('day');        $body.toggleClass('night');        $(this).text(function(index, text) { return text === dayText ? nightText : dayText; });   });    $body.addClass('night'); return $dayNightButton; } // Chat's topic. Remember to escape single quotes in the topic using \' to prevent this from breaking. var chatTopic = 'Bienvenido al chat de la wiki Freddy Fazbear\'s pizza. Por favor asegurate de leer las reglas.'; $(function {    $('#ChatHeader .public.wordmark')        .prepend('' + chatTopic + ' ')        .find('a').attr('style','position:relative;text-decoration:none;'); }); $('#ChatHeader .public.wordmark div:not(:first-child)').remove; // Evitar que hagan bromitas con el "Special:Logout" // $(function {   var regexp = new Array;        regexp[0] = new RegExp("Especial:Salida_del_usuario", "gi");        regexp[1] = new RegExp("Special:Logout", "gi");    $('[name="message"]').keypress(function (e) { if (e.which == 13) { for (var i = 0; i < regexp.length; i++) { this.value = this.value.replace(regexp[i], ""); }       }    }); }); // Ping de mods window.ModPing = "http://vignette2.wikia.nocookie.net/freddy-fazbears-pizza/images/f/f5/Air_Horn-SoundBible.ogg/revision/latest?cb=20161013205123&path-prefix=es"; // Para el coso de los emotes :v window.EmoticonsWindowVocab = { emoticons: "Emotes" }; //Estados del chat // window.ChatStatus = { statuses: { afk: "AFk", edit: "Editando", food: "Comiendo", tv: "Haciendo cosas ukes", game: "Jugando", ufo: "Estudiando", cake: "Observando", book: "Programando", code: "Ocupado", homo: "Azotando niños", notsoos: "Tu hermana", google: "Viendo CP", },	debug: false }; $('[name="message"]').keypress(function(e) {   if (e.which == 13 && !e.shiftKey) {        var message = this.value;        // Evitar mensajes de espacios en blanco        if (!message.trim) {            e.preventDefault;            $('[name="message"]').val('').removeAttr('disabled').focus;          }    } }); var PrivateMessageAlert = { beepSound: 'http://vignette1.wikia.nocookie.net/freddy-fazbears-pizza/images/5/57/Cool_Notification_2-608847.ogg/revision/latest?cb=20161013204746&path-prefix=es', message: '$1 envió un mensaje!', notifications: true, alertWhileFocused: true }; //Chat announcements// chatAnnouncementsAll = true; // NO poner nada bajo "ImportArticles" por favor mantenerlo limpio para mayor orden importArticles({   type: 'script',    articles: [        'u:dev:AjaxEmoticons/code.js',         'u:dev:PrivateMessageAlert/code.js',        'u:kocka:MediaWiki:Emoticons.js',            'u:dev:MediaWiki:!mods/code.js',        'u:dev:MediaWiki:ChatStatus/code.js',        'u:dev:ChatOptions/code.js',        'u:dev:ChatTags/code.js',        'u:dev:MediaWiki:CustomChatPings/code.js',        'u:dev:ChatUserPageButton.js',        'u:dev:MediaWiki:ChatAnnouncements/code.js',        'u:dev:MediaWiki:FixAdminKick/code.js',        'u:dev:NewMessageCount.js',    ] });