[mediawiki.api] clean up
authorKrinkle <krinkle@users.mediawiki.org>
Wed, 21 Dec 2011 23:52:37 +0000 (23:52 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Wed, 21 Dec 2011 23:52:37 +0000 (23:52 +0000)
commit7975b0959d23bd1cef052eab9678698af30a6bad
tree3daa0b164b50001eda66b06e60193b564f05db71
parentff2ef8285a250979393e79dda7a9a460665950b9
[mediawiki.api] clean up

* Adding return values to most of the ajax functions so that the jqXHR object (originally returned by jQuery.ajax) is available. Some functions documented they already did this, some don't. Now they all do and are also documented as such.

* Renaming a few 'callback' arguments to 'success' to avoid confusion with 'error'.

* Removed unused variables
** mw.Api's instance this.url was unused
** var cachedToken was unused in mediawiki.api.titleblacklist.js

* Making closure argument order the same and referencing mediaWiki as a global (mw is something thought not to be a global but mediaWiki certainly is, no need to access window from the global scope and then the mediaWiki property of it). Also renamed any used of $j to $. Adding 'undefined' to the closure arguments where missing.

* Re-written the mw.Api constructor's logic for options. Now keeping a defaultOptions privately "statically" cached outside the constructor and using that to build the options object.

* Made all non-block comments the same comment style (some were /* */ or /* \n */)

* Completed parameter documentation and wrote TODO as @todo and added an example use for mw.Api in the documentation.

* Some other random whitespacing, line breaking, merged var statement, and moved them out of blocks (since JS doesn't have block scope) into the main function body for clarity. And some other random JS Lint/JS Hint stuff.

* Added comment to api.titleblacklist module about the module not being in core but in the TitleBlacklist extension.
resources/mediawiki/mediawiki.api.category.js
resources/mediawiki/mediawiki.api.edit.js
resources/mediawiki/mediawiki.api.js
resources/mediawiki/mediawiki.api.parse.js
resources/mediawiki/mediawiki.api.titleblacklist.js