mediawiki.js: Clean up and improve documentation coverage
authorTimo Tijhof <krinklemail@gmail.com>
Mon, 10 Jun 2013 04:40:21 +0000 (06:40 +0200)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 20 Jun 2013 23:47:05 +0000 (23:47 +0000)
commita0c6d38d225c3bcf0e23563fb88683376d44e97f
treef2c64d64b56c801daa175fb3d874a5018cc322d0
parent8f90a2c828c0caad50aa2f25d8a5ec3a6e1abd38
mediawiki.js: Clean up and improve documentation coverage

Function addStyleTag was only documented as a private function,
since a while now it is also exposed as a public method.

Rename the private function so that they can both be included
in the JSDuck index (jsduck can't deal with name clashes between
public and private). Optimised by letting it inherit the
documentation instead of repeating it.

The following were missing documentation:
* mw
* mw.hook
* mw.legacy
* mw.loader#addEmbeddedCSS

Moved assignment of `done` in mw.loader#addScript to where it
was needed. The other if/else paths in that function don't use
it and don't need it to have a value.

With the introduction of mw.log#deprecate (fe46903) we no longer
need mw.legacy. mw.legacy was created for future use to move
legacy stuff into to make it easier to keep track of where they
are used (simple search for 'mw.legacy') however that never
happened and in retrospect was probably a bad idea as it would
require people to change code twice.

We now have a much cleaner solution now that we're able to
create little accessors on any host-object with mw.log#deprecate.
This makes mw.legacy obsolete and it should not be used for
anything. Just in case something is using it I won't remove it
just yet, instead I've deprecated the (what would have become
the) deprecator ;-). We should be able to remove this in 1.23.
Note: Can't use mw.log#deprecate here because that isn't defined
yet at this point, this is the core library which can't have any
dependencies.

Change-Id: I5d241e4284f07a6be271c04cec3a5833dbaeed91
resources/mediawiki/mediawiki.js