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
(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
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*/
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)
Hi, welcome to Wikia Developers Wiki! Thanks for your edit to the User talk:Pecoes page.
The source tag is deprecated? Since when? Where does it say that? -- pecos 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. -- pecos 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" :) -- pecos 09:49, July 26, 2013 (UTC)
Creating a new discussion for ajaxRC
- Cheers, will do. cqm 19:46, 1 Aug 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)