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)
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)