User:Fubuki風吹/chatCommands.js

/** * chatCommands.js * * For all those lazy users who don't like typing same things over and over * @author w:User:Fubuki風吹 */

$(function {   if (mw.config.get('wgCanonicalSpecialPageName') == 'Chat') {        var commands = (typeof window.chatCommands == 'object' ? window.chatCommands : {});       $('[name="message"]').keydown(function(e) { if (e.which == 13) { for (var i in commands) { if (new RegExp(i).test($(this).val)) { $(this).val(commands[i]); }               }            }        });    } });