User:MateyY/CommentsDisabled.js/doc

The following script changes the text in the comments button and all other comments counters depending on whether comments have been removed and/or disabled.

Use
To use the code, import it by writing:

Note that  is a new Wikia function, and it doesn't support MediaWiki versions previous to 1.19! For older versions, use this code:

Feel free to add any comment you want to describe what the script does, etc. However, I would be thankful if you would not remove the credits.

Performance
 What you see above is a screenshot of an article on Avatar Wiki that had its comments removed per older forum consensus. The script calculated that and changed the text in the comments box from "Comments 23k" to "Comments disabled". You can see that the comment counting bubble was kept.

 What you see above is the header of an article that has not had its comments removed. The script calculated that and did not alter the text.

 This is a blog post on Community Wikia that had its comments disabled — not removed, just disabled. As you can see, the comments button still changes. The script has also been made to work when comments from a blog post are removed. It will also not affect talk page buttons and other comment counter buttons on the page.

As of version 1.4, the script also supports disabling of the button for blog posts that have had their comments disabled using Wikia's comment disabling feature and not through JavaScript. Here is a screenshot:



The footer is also affected just the way it is affected on blogs with their comments disabled through JavaScript:



Version 1.4 also fixes some other issues, as well as prevents possible issues. For more, see the release notes.

As of version 2.0 (see release notes here) the code is fully compatible with, its alias skin,  ,  , and its alias skins.

As of version 2.1 (see release notes here)

Release notes
A collection of release notes for the script. {| class="collapsed collapsible" style="width:650px; text-align:left" ! style="font-weight:normal" |

Version 1.4
The following corrections were made: * represents minor addition/fix.
 * As of version 1.4, the following features were added:
 * 1) There is now support for blog posts that have had their comments disabled through the Wikia disabling feature (located above minor edit on editing pages).
 * 1) There is now support for blog posts that have had their comments disabled through the Wikia disabling feature (located above minor edit on editing pages).
 * 1) There is now support for blog posts that have had their comments disabled through the Wikia disabling feature (located above minor edit on editing pages).
 * 1) There is now support for blog posts that have had their comments disabled through the Wikia disabling feature (located above minor edit on editing pages).
 * 1) From now on, the script is wrapped in an anonymous function in which the   is passed the jQuery object. Thus, it is safe to use.
 * 2) m*: As of now, the   function has been shortened from using   to just using.
 * 3) m: From now on, the strict equality operator  is used to check the current skin.
 * 4) m:   replaced with.
 * }

{| class="collapsed collapsible" style="width:650px; text-align:left" ! style="font-weight:normal" |

Version 2.0

 * As of version 2.0, the following features were added:
 * 1) As of now,  's alias, , is supported.
 * 2)   and all of its alias skins are supported.
 * }
 * 1) As of now,  's alias, , is supported.
 * 2)   and all of its alias skins are supported.
 * }

{| class="collapsed collapsible" style="width:650px; text-align:left" ! style="font-weight:normal" |

Version 2.1

 * As of version 2.1, the following features and fixes were added/made:
 * 1) After Wikia's update, comments are loaded after the DOM is ready. Thus, multiple fixes were made to ensure that the script operates correctly.
 * 2) Also, if comments are disabled after the page is loaded, the script will also work.
 * }
 * 1) After Wikia's update, comments are loaded after the DOM is ready. Thus, multiple fixes were made to ensure that the script operates correctly.
 * 2) Also, if comments are disabled after the page is loaded, the script will also work.
 * }

Feedback
For any feedback, please contact me.