User:Ultimate Dark Carnage/options.js

/** * ChatOptions * Change how Special:Chat looks and functions using an interface. * Uses cookies to store the changes. * A potential solution to all your chathacks problems. * * Many thanks to the Call of Duty Wiki Chat, * who supported and helped this the whole way through. * It has been much appreciated. Thank you! * * WARNING * Make sure you are not loading MediaWiki:Chat.js/load.js * with MediaWiki:Chat-edit-count. * Load it with MediaWiki:Chat-welcome-message, or this * will malfunction badly. * TODO: Improve user interface * * @version 2.0.1 * @author Callofduty4 * @author Madnessfan34537 * @author Sactage  */ /** * Table of Contents * 1 - Core functions * 2 - Configurations */ (function($, mw, config){   if (mw.config.get('wgCanonicalSpecialPageName') == 'Chat' || mw.config.get('wgPageName') == 'Special:Chat'){        /* 1 - Core functions */        /**         * Function to set a cookie         * @param cookie_name A string representing the cookie's name         * @param data The value of the cookie to be set         */         function setCookie(cooie_name, data){             var domain = wgServer.split('//')[1];             document.cookie =                 cookie_name + '=' + data +                '; max-age=' + 60*60*24*150 +                '; path=/; domain=' + domain;         }        /**         * Function to get a cookie's value         * @param cookie_name A string representing the cookie's name         * @param pos The index of the value to get from the cookie         * @return The string value of the cookie         */         function getCookie(cookie_name, pos){ var x, y, cookie_array = document.cookie.split(";"); for (var i=0; i < cookie_array.length; i++) { x = cookie_array[i].substr(0,cookie_array[i].indexOf("=")); y = cookie_array[i].substr(cookie_array[i].indexOf("=")+1); x = x.replace(/^\s+|\s+$/g,""); if (x == cookie_name) { var style_objects = y.split(", "); return unescape(style_objects[pos]); }	       }         }         /* 2 - Configurations */ /**         * Function to check if a chat options module is enabled * @since 1.3.0 * @author Sactage * @param name The name of the options module * @return boolean */         function isEnabled(module){ var c;             switch (module){ }         }    } })(jQuery, mediaWiki, window.chatOptions);