Thread:Trellar/@comment-4830404-20120914061859

Hi there Trellar,

Our wiki was using the user group boxes MediaWiki addon (like the one listed on this link: http://community.wikia.com/wiki/Forum:Adding_User_Group_boxes_help). This addon was put there by Tatzelwyrm, and I saw that it says that you are currently maintaining it, so I thought I would let you know.

I noticed that recently, there have been some changes to wikia, which have changed the way that the code needs to work. I have an example of the fixed code on our wiki here:

http://dragon-story.wikia.com/wiki/MediaWiki:Common.js/userRightsIcons.js

There were a few problems caused to this add-on by the recent changes:

1) The class "group" seems to have been renamed to "tag". Thus, any reference to the old class "group" must be changed to "tag" instead. Otherwise the button does not show up anymore, and it looks just like plain text. (This issue needs to be fixed in two places: span.group should be changed to span.tag where the remove operation is being done, and should say instead.)

2) The spacing between multiple tags was no longer correct. I have narrowed down the issue to how jQuery's .appendTo function inserts a new span element. It seems that .appendTo likes to trim trailing white space, even if you use the &nbsp tag. So, instead of using .appendTo multiple times, I built a String that contained the desired spacing and then used .appendTo only one time after the loop completed. That fixed the spacing issues. (Note that because the desired innerHTML is now located in a string, escape characters must be used for quotation marks that are meant to appear in the innerHTML, like so: )

I hope this is helpful! I will be away on vacation for a week, so I apologize if I do not provide further responses on a timely manner.

Thank you for your time.

[EDIT]: It seems that on the DragonVale Wiki (the place Tatz got the code from), the same issues were already fixed by Rappy.

The group to tag class change was fixed in this edit:

http://dragonvale.wikia.com/index.php?title=MediaWiki%3ACommon.js%2FuserRightsIcons.js&diff=689195&oldid=683974

The spacing change was fixed in this edit:

http://dragonvale.wikia.com/index.php?title=MediaWiki%3ACommon.js%2FuserRightsIcons.js&diff=689197&oldid=689195

Rappy had a different approach to the spacing. Instead of building an entire String with a single append at the end, Rappy applied style=margin of 10 px to each span element.

Either way works just fine. 