MediaWiki:FandomizedChat/code.2.js

(function(mw, $, mainRoom, factory){   var global = typeof window == 'undefined' ? window : this,        config = typeof window.FandomizedChatConfig == 'object' ? window.FandomizedChatConfig : {};    if (typeof mainRoom !== 'undefined'){        if (typeof module == 'object' && typeof module.exports == 'object'){            module.exports = global.document ? factory(mw, $, mainRoom) : function(w){                if (!w.docoument){                    throw new Error('This script requires a window with a document.');                }                return factory(mw, $, mainRoom, config);            };        } else {            factory(mw, $, mainRoom, config);        }    } }(this.mediaWiki, this.jQuery, this.mainRoom, function(mw, $, mainRoom, config){ var main = {}; /**    * @method importResources * @param resources - The resources that will be imported **/   main.importResources = function(resources){ var scripts = [], styles = []; $.each(resources, function(resource, index){           if (resource.endsWith('.css')) styles[styles.length] = resource;            else if (resource.endsWith('js')) scripts[scripts.length] = resource;        }); importArticles(           { type: 'style', articles: styles },            { type: 'script', articles: scripts }        ); };   main.importResources([        // Styles        'u:dev:FandomizedChat/code.css',        // Scripts        'u:dev:Colors/code.js',        'u:dev:FandomizedChat/library.2.js'    ]); main.scrollSpeed = typeof window.userListScrollSpeed == 'number' ? window.userListScrollSpeed : 80; main.i18n = $.extend(true, {       en: {            toggleChatList: 'Toggle Chat List',            away: 'Away',            here: 'Here'        }    }, config.i18n    main.msg = main.i18n[mw.config.get('wgUserLanguage')] || main.i18n[mw.config.get('wgUserLanguage').split('-')[0]] || main.i18n.en; }));