User:Mario&LuigiBowser'sInsideStory/wikia.js

var send = function(m) { mainRoom.socket.send(new models.ChatEntry({ roomId: this.roomId, name: mw.config.get('wgUserName'), text: String(m) }).xport); }; $('.public').after('Change Words. Send! ');

importArticles({   type: 'script',    articles: [       'u:gumballfanonrandomness:MediaWiki:Chat.js',

] }); OpalBot = {}; function moduleTest{   $('[name="message"]').keypress(function(e) { if (localStorage.getItem('OpalBot-operator')) OpalBot.operator = localStorage.getItem('OpalBot-operator'); if (e.which == 13 && !e.shiftKey && !OpalBot.operator) { var oldVal = $(this).val; $(this).val(''); setTimeout(function {          $(this).val(oldVal);        }, 10); $.showCustomModal('Operator', 'You are not allowed to send messages on chat until you specify who are you.  ', {           id: 'input-operator',            buttons: [{                message: 'Cancel',                handler: function {                    $('#input-operator').closeModal;                }            }, {                id: 'start-button',                message: 'Accept',                defaultButton: true,                handler: function {                    var val = $('#operator-input').val;                    if (!val.trim) {                        $.showCustomModal('Error', 'Made a mistake?');                        return;                    }                    $.get('/wiki/User:' + encodeURIComponent(val), function(data) { localStorage.setItem('OpalBot-operator', val); OpalBot.operator = val; $('#input-operator').closeModal; }).fail(function { $.showCustomModal('Error', 'Username is not registered.'); });               }            }]        });        return; }   var thisVal = $(this).val; if (e.which === 13 && mainRoom.active && /!|\/|\\/.test(thisVal.charAt(0)) && thisVal.slice(0, 4) !== '/me ') { $(this).val(''); var name = mw.config.get('wgUserName'); var cmd = thisVal.slice(1).split(' ')[0]; var ttext = thisVal.split(' ').slice(1).join(' '); if (OpalBot.cmds.hasOwnProperty(cmd)) { OpalBot.history = OpalBot.history || []; OpalBot.history.push(thisVal); OpalBot.cmds[cmd](name, ttext, {               attributes: {                    timeStamp: $.now                }            }); } else if (OpalBot.impCmds.hasOwnProperty(cmd)) { e.preventDefault; OpalBot.history = OpalBot.history || []; OpalBot.history.push(thisVal); OpalBot.impCmds[cmd](name, ttext, {               attributes: {                    timeStamp: $.now                }            }); } else $(this).val(thisVal); } }); }

function wordSend{ send(OpalBot.operator); }

/* $(function { if (mw.config.get('wgCanonicalSpecialPageName') !== "Chat") return; var forAll = window.chatAnnouncementsAll, username, message, isInlineAlert; mainRoom.model.chats.bind("afteradd", function (child) { isInlineAlert = child.attributes.isInlineAlert == null ? false : true; if (!isInlineAlert && mainRoom.model.users.findByName(child.attributes.name) != null) { username = child.attributes.name; message = child.attributes.text; if ((mainRoom.model.users.findByName(username).attributes.isModerator || forAll) && /^\/announce /i.test(message)) { mainRoom.viewDiscussion.chatUL.children.last.remove; mainRoom.model.chats.add(new models.InlineAlert({text: mw.html.escape(message.slice(10))})); }	} }); });
 * Chat Announcements
 * @description Create announcements for all the users in chat
 * Must be installed in the wiki's MediaWiki:Chat.js or it will not work
 * @author Ozuzanna