Wikia Developers Wiki


aka Template Repairman

217 Edits since joining this wiki
April 30, 2013


Hi, welcome to Wikia Developers Wiki! Thanks for your edit to the CustomToolbarLinks page. If you need help, read through our help pages or contact a local admin. If there are no active admins here, stop by Community Central and check out our forums.

Looking for live help? Then join us for an upcoming webinar to chat with staff and other Wikia editors. You can also check our Staff blog to keep up-to-date with the latest news and events around Wikia. Lastly, check out the Wikia Video Library, where you can find premium licensed videos to add to the wiki.

All of these links are a great way to start exploring Wikia.

Happy editing, Grunny@Wikia (help forum | blog) 08:39, April 30, 2013 (UTC)


Hey, I'd strongly recommend wrapping your code in either an Immediately-Invoked-Function-Expression or an extension of the global Window object so as to not create global variables. Also, you might want to make some eye-candy changes as well with indentation and coding style. See for more info.TK-999 (talk) 16:20, April 30, 2013 (UTC)

Thanks for the information, I think I've addressed most of it. ~Bobogoobo (talk) 22:53, April 30, 2013 (UTC)

Semi-colon and closure

The semi colon is there to as a failsafe, in case someone forgot to add one at the end of of a script that is being imported before yours. There's more informaton on it here. It looks a little odd, but when you don't know what other scripts are being imported you can never be too safe. I actually had it happen to me last week with the importArticles() statement on RuneScape Wiki and it broke the ~10 scripts after the script with the error.

As for the globals in the closure, it's better described by plugging it into something like jshint. Remove the globals from the closure and you'll notice it comes back with $ and mw being undefined. These aren't standard javascript objects and the symbols/letters can be used by other libraries (Mootools is an example). If another library was to be imported there could be issues with what $ now means. Does it mean jQuery or this other library? Adding jQuery into the parens at the end of the function makes sure it always means jQuery. cqm 08:10, 22 Jun 2013 (UTC)

I believe Pecoes uses semi-colons at the start of his scripts, if you want more examples of it (one is SexyUserPage/code.js). It's not in the coding conventions because scripts should never need to fix other scripts failures, but as most of the script here are designed to be imported it's not hard to imagine there might be other scripts also being imported.
The other libraries may not be included by standard (jQuery is ported with MediaWiki since 1.16 or something), but you can just import them if you find a need for them. For instance at RuneScape Wiki we import tundra. In this case there's no confusion, but it shows how other libraries can be imported if you find a need for them. cqm 08:35, 22 Jun 2013 (UTC)


Hellow Bobo! I wanted to tell you about your script created, I talking about of "HighlightUsers". Works great, of course. The problem is that the script is not right when you want to highlight links users to have the AjaxRC enabled. When the RC is not auto-reload, the script works fine, but when used AjaxRC, colors are normal links to wiki's default color. Is there any solution for this? Thank you! ɥsɐD ʎʇooɔS 23:30, November 22, 2013 (UTC)

Add the following code above the importation of AjaxRC:
window.ajaxCallAgain = window.ajaxCallAgain || [];
~Bobogoobo (talk) 05:38, November 23, 2013 (UTC)
Bobogoobo wrote:
apparently I was asked about this before, might as well add this here since I guess people don't check the AjaxRC documentation or know what to do
Bobogoobo, U see, what happens is that the code you showed me in the top ONLY works only with wikis in English, because I inserted my global.js correctly, but when inserting the AjaxRC longer work for me, so I guess the problem is that I use different wikis into English. That's what I believe, and if I'm wrong, you can correct me. FluttershyWinkEmote.pngScooty Dash (talk) 16:57, December 4, 2013 (UTC)
That was a bug that I had meant to fix. It should be working now, thanks for reminding me. ~Bobogoobo (talk) 02:04, December 5, 2013 (UTC)

just reminding, how is progress on matching color code to user rights with only the highest user right displaying?Nerfmaster8 (talk) 04:45, December 26, 2013 (UTC)

I'm sorry for the delay! I have a lot of projects and things have been very busy. I tried coding a fix for this; does it work correctly now? (Keep in mind that higher user rights should be specified later in the setup code.) Let me know if there are any remaining issues and I'll try to fix them as soon as possible. Thanks, ~Bobogoobo (talk) 08:25, December 26, 2013 (UTC)

TopEditors Namespaces

Hi Bobogoobo! I have a question about the TopEditors extension. For the namespaces section, I looked on this page to find the namespace numbers I could use. But I could not find the number for the Thread namespace and that is something I am looking for. Do you know where I can find the namespace number for namespaces unlisted like Thread? Thanks! :)

{{SUBST:TheMattChatter}} 00:37, February 3, 2014 (UTC)

The easiest way is to go a page in that namespace, open the source code, and search for "wgNamespaceNumber". It's the number next to that. ~Bobogoobo (talk) 01:43, February 3, 2014 (UTC)
There's also runescape:MediaWiki:Namespace numbers. Everything from 112 to 121 are custom, non-standard namespaces that are only found on RuneScape Wiki. All others should be standard across Wikia. The only one I know of that it's missing is Board (2000) which is probably because we never installed the wikiaforum extension. cqm 02:31, 3 Feb 2014 (UTC)
Thank you so much! But I'm having a hard time finding the namespace for user blog and user blog comments.
{{SUBST:TheMattChatter}} 19:15, February 9, 2014 (UTC)
Try 500 and 501. ~Bobogoobo (talk) 00:36, February 10, 2014 (UTC)

TopEditors Usernames

Hello there,

For users who have ranks (and have different colored usernames), if they have a space in their name it will not show their username as the color it should be. For example, I'm an admin on the Club Penguin Wiki, and instead of my name showing as green, it shows up as if I have no rank. If you could fix this, that would be really great. Thank you :) —Preceding unsigned comment added by Kallie Jo (talkcontribs) 22:25, 9 February 2014‎ (UTC)

Could you link me to an example of what you're talking about? ~Bobogoobo (talk) 00:36, February 10, 2014 (UTC)
Try adding an underscore (_) instead of a space. Lil' Miss Rarity ]Open Source[ (talk) 12:44, February 10, 2014 (UTC)
What Lil' Miss Rarity said. Also, for an example of what I'm talking about click here. My username doesn't appear as green, but I'm an admin on that wiki and all admins' names should appear as green (everywhere else on that wiki my name is green :P). Sorry for not being clear enough, sometimes I'm really bad at explaining things.
Kallie Jo (talk) 21:41, February 10, 2014 (UTC)
Oh sorry, forgot to mention this: it also happens with UserRightsRecord, example here.
Kallie Jo (talk) 22:10, February 10, 2014 (UTC)

Both should be working now. Let me know if there are any more problems. Thanks for bringing this to my attention! ~Bobogoobo (talk) 23:51, February 10, 2014 (UTC)

Thank you, works perfectly now. :)
Kallie Jo (talk) 01:12, February 11, 2014 (UTC)


Continued from Talk:TopEditors

In some of these cases, I want to see a listing of the results that counted towards the totaled value. Having a link or a method to create that sub-list based on the initial list would be very helpful.

Nathan (Peteparker) (Earth-1218) (talkcontribsemail) 22:36, April 16, 2014 (UTC)

Yeah, that sounds useful. Can you link me to somewhere you're using this script so I can look at how best to add it? For now, I printed the API query used to the browser console - place the URL fragment given after ".com" in the URL of any page on the wiki to see the raw query data. I think I can link to the actual RecentChanges page for the query though, so it'll be a lot prettier. ~Bobogoobo (talk) 04:23, April 18, 2014 (UTC)

Sure! Here's the sandbox page I'm using to test it out on User:Peteparker/Top Editors.

I attempted to run the raw query using the last url fragment in the console, but didn't get exactly what I was looking for. I was hoping to see a list of the pages that made up each user's edit count, but instead saw a list of users. I used this url.

Thanks again!

Nathan (Peteparker) (Earth-1218) (talkcontribsemail) 22:39, May 27, 2014 (UTC)

Ah yeah, forgot I limited the output. Would something like this be readable enough or would you want it parsed into something prettier? ~Bobogoobo (talk) 01:11, May 28, 2014 (UTC)

HighlightUsers Bug

There is a bug with your HighlightUsers script. If the user has any kind of special characters in their name it dosen't get highlighted. To save you time, the problem is that the link uses the ASCII values of the characters. I was able to fix the problem for apostrophes on a local copy of the script by chaining another replace statement on lines 34 and 44
stuff[user].name.replace(/ /g, '_').replace(/'/g, '%27')
but this should be done for all the characters Wikia allows in usernames.

Jdm280 (Talk Contribs) 15:03, July 31, 2014 (UTC)

Edit: It is also impossible to integrate it with AjaxRC as the whole script is a self invoking function, preventing it from being called.

I think I have fixed both of these issues, thank you for bringing them to my attention. Let me know if anything is still amiss. ~Bobogoobo (talk) 21:50, July 31, 2014 (UTC)
It still does not work. The problem now is encodeURIComponent does not replace - _ . ! ~ * ' ( ) I can't seem to find a better fix then chaining a bunch of replace statements after it.
Jdm280 (Talk Contribs) 00:43, August 1, 2014 (UTC)
Wikia encodes those? Can you link me to some examples so I can take a closer look? ~Bobogoobo (talk) 03:40, August 1, 2014 (UTC)
It doesn't encode dashes, underscores, periods, asterisks, or parentheses but it does encode apostrophes I don't know about the rest. Here is the user I'm having problems with. Note: It is working on my wiki because its running a modified local copy of the script.
Jdm280 (Talk Contribs) 08:10, August 1, 2014 (UTC)
Edit: It's kinda annoying getting HighlightUsers to play nice with AjaxRC as window.ajaxCallAgain.push(highlightUsers); needs to be run after HighlightUsers but before AjaxRC loads it might be easier to just add the integration code at the end of HighlightUsers.
Instead of using encodeURIComponent (which I'm not entirely sure works for what you need), you can use mw.util.wikiUrlencode which correctly encodes spaces, colons and forward slashes for use on wiki urls as well as encoding special characters.
Also, it appears you're doing an ajax call every time you run that function which won't be so good with AjaxRC. Maybe run it once to get all the usernames/groups you want to highlight and cache the result? I saw the note about planning to rewrite it, so maybe save this for v2 :) cqm 09:19, 1 Aug 2014 (UTC)
"mw.util.wikiUrlencode" did not know there was such a thing. I tried it on my local copy and it fixed everything even removed the need for .replace(/ /g, '_')
Jdm280 (Talk Contribs) 13:58, August 1, 2014 (UTC)
Indeed, thanks for pointing out that function. Good suggestion also, though I'm not sure when I'll get around to rewriting it (still have several other projects I need to work on). As for ajaxCallAgain, I haven't used AjaxRC, but would think that with a name like "CallAgain", isn't that how it's supposed to work? ~Bobogoobo (talk) 16:10, August 1, 2014 (UTC)

[Chat CSS]

Hi, my name on Wikia is You'reMyPirate'sCove, and I'm trying to code the chat for and I can't seem to color my own name in the chat... I know it's because of the apostrophies, but is there anything I can do about it to color my username in chat?

/* the user's username color above his messages */
body.ChatWindow section#WikiaPage > .Chat li[data-user="You'reMyPirate'sCove'"] .username {
} /* the user's username color in the users rail */
body.ChatWindow #Rail li[data-user="You'reMyPirate'sCove'"] .username {

That's the code I'm using. Thanks so much!

Try changing each apostrophe to %27. Since username are usually encoded, that should find them properly. If that fails you could use your browser console to Inspect Element on your name in chat and see what the actual value is. Hope that helps, ~Bobogoobo (talk) 03:44, October 5, 2014 (UTC)

Highlight Users Help


I just wanted some help with the Highlight users feature. I followed all the instructions (I think I did) on your blog, but nothing seems to be happening. I was wondering if you please could check for any errors in the js. You can find it here. (

P.S. - My coding skills are basic...

Thanks a lot for your help!!


SPOOK THE WORLD! - Spooky Rish (talk) 18:12, January 7, 2015 (UTC)

Add a comma at the end of line 91 (chat moderator) and remove ... on line 95. Arkondi (talk) 20:43, January 7, 2015 (UTC)

HighlightUsers Suggestion

Hi, just a quick suggestion for HighlightUsers script, would it be possible if you could implement an option to modify font-weight as well? Bold or italic, this would make the script virtually match the regular capability of using CSS, but without the need to manually apply the configurations to each individual user. Thanks!

Hackey5 (talk) 02:59, January 31, 2015 (UTC)

Thanks for the suggestion! I have edited the script so that all links affected by the script have the class highlight-users-script, which you can use in CSS files. Did you want the option to customize the CSS of each group individually? I suppose I could add more classes to enable that. I don't really want to add substantial code to the script (e.g. to allow specifying CSS in the configuration) since I want to rewrite it anyway. Hope this helps, ~Bobogoobo (talk) 05:35, January 31, 2015 (UTC)

Around Wikia's network

Random Wiki