I have relatively recently rewritten ChatHacks and ChatOptions to make them translatable using I18n-js and generally make the code more readable and up to date with standards (more or less) used on Fandom Developers Wiki. Their code can be found here and here, because they are very widely used and could not be released live without thorough testing. </p> <h2><span class="mw-headline" id="ChatOptions"> ChatOptions </span></h2> <p>All changes to ChatOptions also include: </p>
-
wikia.ui.factorymodal instead of$.showCustomModal - Storing options in
$.storageinstead of cookies - Extracted CSS to a separate page
- Not leaking functions into global scope
- UI-js instead of concatenated HTML
- Double-loading prevention
- Chat-js options button instead of a custom one appended to the top of the Rail
- Slightly changed window look (old vs new)
- "Added functionality" options have been made customizable and therefore some modules were changed/added:
- ChatHacks module is importing the beta version of ChatHacks, but that is probably not going to be in the live version
- Multikick option is now only appearing for moderators
- MultiPM module has been switched with ExtendedPrivateMessaging, as it is a way newer script with way more options
- EmoticonsWindow, FasterBanModule and QuickModTools have been added as options
- Side scroll prevention option has been removed as that is a default feature of chat since about a year ago
- "Ignore URL in main chat" option has only ever been enabled on Call of Duty Wiki, which doesn't have chat anymore, so the option has been removed
- All inline CSS related to "Color changes"/"Font" sections has been converted into
<style>withmw.util.addCSS - Rubik font is an option now
- Module scripts are being imported all at once with
importArticlesinstead of one by one withimportScriptPage - ChatOptions code subpages will import the rewrite once it goes live
- Exposing the ChatHacks object globally (now that it exists).
- Empty pings should no longer ping for every message
- Killing emoticons should finally work as intended (
.children('.message img')was replaced with.find('.message img') - No more playing with
mw.hooks, all dependencies are preloaded together - Overwritten
sendMessagemethod respects message length limiting -
window.commandsobject has been changed to use objects instead of functions in order to contain information other than just the command handler - Simplified the logic in
/selfcommand
- ChatOptions modules should not be scripts intended for sitewide use, such as ChatTags, ChatSyntaxHighlight, ChatStatus, IsTyping or ChatAnnouncements - it is misleading to users as they would think these apply to everyone when they really apply only to them
- One of the ChatOptions authors, Callofduty4, has requested that ChatOptions current code remains on the /code.js page. As the long-term plan is to move all
/code.jspages to.jsanyways, I believe we could create a MediaWiki:ChatOptions.js page for the new code and add a notice into the old script that a new version exists, with instructions for migration. - As killing emoticons never seems to have worked in past, this functionality might be unexpected to previous users of ChatHacks. Should we just remove it instead of fixing it?