More JS documentation fixups
authorSam Reed <reedy@users.mediawiki.org>
Tue, 30 Nov 2010 18:26:52 +0000 (18:26 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Tue, 30 Nov 2010 18:26:52 +0000 (18:26 +0000)
resources/jquery/jquery.suggestions.js
resources/mediawiki/mediawiki.js
skins/common/protect.js
skins/common/wikibits.js

index bc69101..2c1f310 100644 (file)
@@ -270,7 +270,7 @@ $.suggestions = {
        },
        /**
         * Respond to keypress event
-        * @param {Integer} key Code of key pressed
+        * @param key Integer Code of key pressed
         */
        keypress: function( e, context, key ) {
                var wasVisible = context.data.$container.is( ':visible' );
index 57ac7f9..e0f6e4e 100644 (file)
@@ -276,8 +276,8 @@ window.mediaWiki = new ( function( $ ) {
        /**
         * Gets a message string, similar to wfMsg()
         *
-        * @param {string} key Key of message to get
-        * @param {mixed} params First argument in a list of variadic arguments, each a parameter for $
+        * @param key string Key of message to get
+        * @param parameters mixed First argument in a list of variadic arguments, each a parameter for $
         * replacement
         */
        this.msg = function( key, parameters ) {
@@ -392,7 +392,7 @@ window.mediaWiki = new ( function( $ ) {
                /**
                 * Gets a list of module names that a module depends on in their proper dependency order
                 *
-                * @param mixed string module name or array of string module names
+                * @param module string module name or array of string module names
                 * @return list of dependencies
                 * @throws Error if circular reference is detected
                 */
@@ -424,8 +424,8 @@ window.mediaWiki = new ( function( $ ) {
                 * state. Possible states are 'undefined', 'registered', 'loading',
                 * 'loaded', or 'ready'
                 *
-                * @param mixed string or array of strings of module states to filter by
-                * @param array list of module names to filter (optional, all modules
+                * @param states string or array of strings of module states to filter by
+                * @param modules array list of module names to filter (optional, all modules
                 *   will be used by default)
                 * @return array list of filtered module names
                 */
@@ -466,7 +466,7 @@ window.mediaWiki = new ( function( $ ) {
                /**
                 * Executes a loaded module, making it ready to use
                 *
-                * @param string module name to execute
+                * @param module string module name to execute
                 */
                function execute( module ) {
                        if ( typeof registry[module] === 'undefined' ) {
@@ -548,9 +548,9 @@ window.mediaWiki = new ( function( $ ) {
                 * Adds a dependencies to the queue with optional callbacks to be run
                 * when the dependencies are ready or fail
                 *
-                * @param mixed string moulde name or array of string module names
-                * @param function ready callback to execute when all dependencies are ready
-                * @param function error callback to execute when any dependency fails
+                * @param dependencies string module name or array of string module names
+                * @param ready function callback to execute when all dependencies are ready
+                * @param error function callback to execute when any dependency fails
                 */
                function request( dependencies, ready, error ) {
                        // Allow calling by single module name
@@ -777,11 +777,11 @@ window.mediaWiki = new ( function( $ ) {
                /**
                 * Executes a function as soon as one or more required modules are ready
                 *
-                * @param mixed string or array of strings of modules names the callback
+                * @param dependencies string or array of strings of modules names the callback
                 *   dependencies to be ready before
                 * executing
-                * @param function callback to execute when all dependencies are ready (optional)
-                * @param function callback to execute when if dependencies have a errors (optional)
+                * @param ready function callback to execute when all dependencies are ready (optional)
+                * @param error function callback to execute when if dependencies have a errors (optional)
                 */
                this.using = function( dependencies, ready, error ) {
                        // Validate input
@@ -816,9 +816,9 @@ window.mediaWiki = new ( function( $ ) {
                /**
                 * Loads an external script or one or more modules for future use
                 *
-                * @param {mixed} modules either the name of a module, array of modules,
+                * @param modules mixed either the name of a module, array of modules,
                 *   or a URL of an external script or style
-                * @param {string} type mime-type to use if calling with a URL of an
+                * @param type string mime-type to use if calling with a URL of an
                 *   external script or style; acceptable values are "text/css" and
                 *   "text/javascript"; if no type is provided, text/javascript is
                 *   assumed
@@ -884,8 +884,8 @@ window.mediaWiki = new ( function( $ ) {
                /**
                 * Changes the state of a module
                 *
-                * @param mixed module string module name or object of module name/state pairs
-                * @param string state string state name
+                * @param module string module name or object of module name/state pairs
+                * @param state string state name
                 */
                this.state = function( module, state ) {
                        if ( typeof module === 'object' ) {
@@ -903,7 +903,7 @@ window.mediaWiki = new ( function( $ ) {
                /**
                 * Gets the version of a module
                 *
-                * @param string module name of module to get version for
+                * @param module string name of module to get version for
                 */
                this.version = function( module ) {
                        if ( module in registry && 'version' in registry[module] ) {
index 36450ec..58df6aa 100644 (file)
@@ -263,7 +263,7 @@ window.ProtectionForm = {
        /**
         * Apply a callback to each expiry input
         *
-        * @param callable func Callback function
+        * @param func callable Callback function
         */
        'forEachExpiryInput': function(func) {
                var inputs = this.getExpiryInputs();
@@ -291,7 +291,7 @@ window.ProtectionForm = {
 
        /**
         * Apply a callback to each expiry selector list
-        * @param callable func Callback function
+        * @param func callable Callback function
         */
        'forEachExpirySelector': function(func) {
                var inputs = this.getExpirySelectors();
@@ -320,7 +320,7 @@ window.ProtectionForm = {
        /**
         * Enable/disable protection selectors and expiry inputs
         *
-        * @param boolean val Enable?
+        * @param val boolean Enable?
         */
        'enableUnchainedInputs': function(val) {
                var first = true;
index b01f309..6f27d8a 100644 (file)
@@ -259,7 +259,7 @@ window.tooltipAccessKeyRegexp = /\[(ctrl-)?(alt-)?(shift-)?(esc-)?(.)\]$/;
  * otherwise, all the nodes that will probably have accesskeys by
  * default are updated.
  *
- * @param Array nodeList -- list of elements to update
+ * @param nodeList Array list of elements to update
  */
 window.updateTooltipAccessKeys = function( nodeList ) {
        if ( !nodeList ) {
@@ -311,13 +311,13 @@ window.updateTooltipAccessKeys = function( nodeList ) {
  * nextnode parameter; to add the link _after_ an existing item, pass
  * the node's nextSibling instead.
  *
- * @param String portlet -- id of the target portlet ("p-cactions", "p-personal", "p-navigation" or "p-tb")
- * @param String href -- link URL
- * @param String text -- link text (will be automatically lowercased by CSS for p-cactions in Monobook)
- * @param String id -- id of the new item, should be unique and preferably have the appropriate prefix ("ca-", "pt-", "n-" or "t-")
- * @param String tooltip -- text to show when hovering over the link, without accesskey suffix
- * @param String accesskey -- accesskey to activate this link (one character, try to avoid conflicts)
- * @param Node nextnode -- the DOM node before which the new item should be added, should be another item in the same list
+ * @param portlet String id of the target portlet ("p-cactions", "p-personal", "p-navigation" or "p-tb")
+ * @param href String link URL
+ * @param text String link text (will be automatically lowercased by CSS for p-cactions in Monobook)
+ * @param id String id of the new item, should be unique and preferably have the appropriate prefix ("ca-", "pt-", "n-" or "t-")
+ * @param tooltip String text to show when hovering over the link, without accesskey suffix
+ * @param accesskey String accesskey to activate this link (one character, try to avoid conflicts)
+ * @param nextnode Node the DOM node before which the new item should be added, should be another item in the same list
  *
  * @return Node -- the DOM node of the new item (an LI element) or null
  */
@@ -948,8 +948,8 @@ window.ts_alternate = function( table ) {
  * Add a cute little box at the top of the screen to inform the user of
  * something, replacing any preexisting message.
  *
- * @param String -or- Dom Object message HTML to be put inside the right div
- * @param String className   Used in adding a class; should be different for each
+ * @param message String -or- Dom Object  HTML to be put inside the right div
+ * @param className String   Used in adding a class; should be different for each
  *   call to allow CSS/JS to hide different boxes.  null = no class used.
  * @return Boolean       True on success, false on failure
  */
@@ -1052,9 +1052,9 @@ window.runOnloadHook = function() {
 /**
  * Add an event handler to an element
  *
- * @param Element element Element to add handler to
- * @param String attach Event to attach to
- * @param callable handler Event handler callback
+ * @param element Element to add handler to
+ * @param attach String Event to attach to
+ * @param handler callable Event handler callback
  */
 window.addHandler = function( element, attach, handler ) {
        if( element.addEventListener ) {
@@ -1071,8 +1071,8 @@ window.hookEvent = function( hookName, hookFunct ) {
 /**
  * Add a click event handler to an element
  *
- * @param Element element Element to add handler to
- * @param callable handler Event handler callback
+ * @param element Element to add handler to
+ * @param handler callable Event handler callback
  */
 window.addClickHandler = function( element, handler ) {
        addHandler( element, 'click', handler );
@@ -1081,9 +1081,9 @@ window.addClickHandler = function( element, handler ) {
 /**
  * Removes an event handler from an element
  *
- * @param Element element Element to remove handler from
- * @param String remove Event to remove
- * @param callable handler Event handler callback to remove
+ * @param element Element to remove handler from
+ * @param remove String Event to remove
+ * @param handler callable Event handler callback to remove
  */
 window.removeHandler = function( element, remove, handler ) {
        if( window.removeEventListener ) {