Wikia

Wikia Developers Wiki

Cqm

Volunteer Developer
370 Edits since joining this wiki
April 13, 2012

Thanks

Thank you for the code formatting, and to answer the question... I have no idea how it worked but it just did. User:Shining-Armor

No problem. All I really did was run it through jshint and fixed the errors that came up there. cqm 14:21, 29 May 2013 (UTC)
Whenever I run code through Jslint it gives me errors that do not make sense. like saying $ in $.get is defined before use. User:Shining-Armor
It's because the jQuery object, $, isn't standard javascript. jQuery is a (popular, high use) library that is ported with MediaWiki. There's a checkbox below the code input area labelled something like "Assume jQuery" that'll fix that. You can just ignore those errors if you want through. It'll do the same for every use of the mw (mediaWiki) object too. cqm 17:14, 29 May 2013 (UTC)

(Reset indent) It's more convenient to add the options directly to your JS code as comments. This e.g. will tell jshint to treat jQuery, $ and mediaWiki as globals:

/*jshint jquery:true*/
/*global mediaWiki:true*/

Check the jshint documentation! There are a lot more options. This is the prologue that I copypaste into every new file:

/*jshint jquery:true, browser:true, devel:true, camelcase:true, curly:false, undef:true, bitwise:true, eqeqeq:true, forin:true, immed:true, latedef:true, newcap:true, noarg:true, unused:true, regexp:true, strict:true, trailing:false */
/*global mediaWiki:true*/

The mediaWiki makers recommend jshint too btw. Though their recommended procedure is a little too complicated for most needs. --  pecoes  16:45, May 30, 2013 (UTC) 

Closures

Can you please attempt to explain to me what this does -- why it's necessary to pass global variables into an IIFE? And what's the beginning semicolon for? That's not even in the recommendations and I don't think it looks good. ~Bobogoobo (talk) 05:52, June 22, 2013 (UTC)

I figured that was what the semicolon was for -- an idiocy shield. If something's broken it should be fixed anyway. I guess it's harmless and useful, but then why doesn't every script do it (that's the first time I've seen it) and why isn't it in the coding conventions? As for the closures, obviously $ and mw are undefined in jshint since it's not a page that the script is meant to run on, which always have those defined. The rest is unnecessary because what the heck else on a Wikia page would use those? If Wikia even wanted to use something that would override those, I'm sure they would prevent it, so that they didn't break every single thing that already uses it. But again, harmless and good practice I guess, so...anyway, thanks for the explanations. ~Bobogoobo (talk) 08:22, June 22, 2013 (UTC)

Welcome

Hi, welcome to Wikia Developers Wiki! Thanks for your edit to the User talk:Pecoes page.

Please leave a message on my talk page if I can help with anything! Grunny (talk) 09:44, July 22, 2013 (UTC)

Source Tag

The source tag is deprecated? Since when? Where does it say that? --  pecoes  09:01, July 26, 2013 (UTC) 

On the extension documentation itself: mw:Extension:SyntaxHighlight GeSHi. It's not obvious, Special:TagsReport still reports on source tags rather than syntaxhighlight and source tags still work (for backwards compatibility perhaps?). Nonetheless, the extension docs say to use syntaxhighlight as seen in the tags used section of the infobox. cqm 09:16, 26 Jul 2013 (UTC)
Ah. I see. You mean this:
"Before rev:50696, the extension used the tag <source>. This is still supported, but <syntaxhighlight> avoids conflicts if your source code itself contains <source> (for example XML)."
It doesn't say "deprecated" though. It only says that <syntaxhighlight> has less conflict potential. --  pecoes  09:31, July 26, 2013 (UTC) 
Considering the general lack of mention of them I'm inclined to remove them incase they become unsupported at some point in the future. cqm 09:42, 26 Jul 2013 (UTC)
I think you're overinterpreting the word "still" :) --  pecoes  09:49, July 26, 2013 (UTC) 

Creating a new discussion for ajaxRC

I'd submit your changes to AjaxRC at Portal:Code review so it can hopefully be pushed to AjaxRC/code.js by new week. --Kangaroopowah (Talk) 18:55, August 1, 2013 (UTC)

Cheers, will do. cqm 19:46, 1 Aug 2013 (UTC)

Code

Sorry to waist your time, but where did you learn code — OriginalAuthority at Wikia Developers Wiki File:Favicon.ico 17:21, August 10, 2013 (UTC)

I started out with a bit of codeacademy to teach me the basics. I got to the point where I wasn't learning anything particularly useful to me, so started reading through the various scripts on my home wiki. From there I picked a project and learned what I had to make it all work, largely through googling my problem which usually led me to stackoverflow (a truly fantastic resource). I think my earliest fully fledged script was w:c:rs:User:Cqm/adminreport.js. It sstarted out as querying the mediawiki api for the number of wanted files/page/templates/categories, broken and double redirects and unused files. From there I added a way to detect if there were pages in certain categories (page for deletion for example) and then when certain pages were last edited.
Just pick something you want to do, then figure out how to do it. It doesn't need to be an elegant script, as long as it works it serves as a learning exercise. I used HeaderLinks/code.js as an exercise in native js, as I'd largely been using jQuery up until then. If I got stuck I'd just google my problem until I found an answer.
PS. The favicon image in your sig doesn't work. cqm 18:08, 10 Aug 2013 (UTC)
Thanks, I'm actually using codecademy, I've been doing it for a while, I've run into the same problem as you, nothing useful. The sig problem is due to there being no favicon for this wiki, there using an alternative file. — OriginalAuthority at Wikia Developers Wiki File:Favicon.ico 18:22, August 10, 2013 (UTC)

Chat help

Yes well can you come to my wiki Chat i have few quesionsJarjarkine (talk) 00:20, November 22, 2013 (UTC)

Wait you cant edit the wiki cuz youy are not admin..Jarjarkine (talk) 00:23, November 22, 2013 (UTC)

The next iteration for ajaxrc

Hey cam. So this is what I was thinking we could do for the next version of ajaxrc. First, expose the script under either the dev.ajaxrc global or just the global AjaxRC. Secondly, make a way to change ajaxrc configuration through object notation, not individual global variables, while maintaining backwards compatibility with the old version. Finally, I want to see what I can do about submitting a pulls request so we don't need to have a recentchangeslocal variable in the script. Does that sound good to you? I'll probably have the first two done by the end of the first week in January. Best, --Kangaroopowah (Talk) 16:29, December 26, 2013 (UTC)

The global thing seems like the next step in the development of the script. I'd stick with keeping it under the dev global for consistency's sake, perhaps combine it with a version/timestamp to make sure we're using the version imported from dev (if for some reason we can't find the import). As for the config, what about using dev.ajaxrc for the config then extending it using $.extend in the main script.
For the pull request, it could take an extraordinarily long time. github:Wikia/app/pull/1470 has been open 4 months with negligible progress. That's assuming we can even convince wikia to class it as something that requires a fix. I assume you know it needs to enter wikia's bug tracker before a pull request can be opened, let me know if you want any help writing a s:c to argue your case. cqm 00:04, 27 Dec 2013 (UTC)
Two things. Firstly, don't worry about the pull request. Secondly, the way you exposed ajaxrc in cqm/ajaxrc.js is the more verbose (and honestly, a bit more complicated) of the way to do it. The way im planning to do it is to create an nd variable in the closure header as dev.ajaxrc and then initialize it at the bottom of the script with all the methods there in object literal form. --Kangaroopowah (Talk) 03:33, December 28, 2013 (UTC)
Ok so I finished my version of the new config and global object. They're over at /beta.js. The disadvantage to the way I handled the globalness is that it doesn't have "write" capabilities, that is to say modifiying the object's functions from console won't actually change the way the script performs. If we were to change it we would use the way you started coding it in your userspace. You should not however that this is an important design descicion for the script that should be thought about fairly carefully. Lastly about the config, our implementations user-side wise are the same but yours way buggy if dev.ajaxrc existed but only had some config options but not all so I fixed that. Best, Kangaroopowah (Talk) 03:25, December 29, 2013 (UTC)

Thanks

Thanks :-) Ismael Perez (talkcontribsblog) 18:28, February 16, 2014 (UTC)

Code Editor Permission

I have several scripts on this wiki, and would like to have them protected. However I would also like to still be able to work on them. Do you know how I can get "Code Editor" permissions?

Code Lyoko Wiki: User: Deadcoder 15:19, March 22, 2014 (UTC)

You'll need to request the right on Grunny's talk page. If he think you're competent enough to warrant being enough in the group, he'll grant your request. As a warning, he might take a while to respond to the message so don't expect a reply immediately. cqm 16:39, 22 Mar 2014 (UTC)
Thank you.
Code Lyoko Wiki: User: Deadcoder 20:07, March 22, 2014 (UTC)

ChatTags

Man, why the images of the chat tags are not working? I just tried to fix ...

--Affquesaco (talk) 15:19, March 23, 2014 (UTC)

It was intentionally removed because it was a security risk, not because it was broken. Re-enabling it on a wiki puts every user in chat at risk of malicious scripts. Please leave it removed until that risk has been patched. cqm 15:22, 23 Mar 2014 (UTC)

LESS

Your LESS project is very interesting. I cannot wait to see how it works out. Lil' Miss Rarity ]Open Source[ (talk) 13:20, March 26, 2014 (UTC)

You can take a look at it here if you'd like :)
The main problem is that the js version of less isn't designed to be used the way I need, so I'm working with next to no docs and from a few notes on stackoverflow. Added to all the other projects I'm doing, it's slowly coming along ;) cqm 02:10, 28 Mar 2014 (UTC)

Usertags

Hi do you know where's the code WIKIA use for adding masthead for: Wikia staff, Wikia star, VSTF or ect ? The script they uses i wuold like to see it Please.Emperor Jarjarkine (talk) 14:50, April 5, 2014 (UTC)

Wikia add the tags server side, the code for doing that is spread across at least two files: controller, template. The tags themselves are set elsewhere, likely using a database query, but I couldn't see anything from a quick search. cqm 15:07, 5 Apr 2014 (UTC)

Around Wikia's network

Random Wiki