r77489 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77488‎ | r77489 | r77490 >
Date:18:26, 30 November 2010
Author:reedy
Status:ok
Tags:
Comment:
More JS documentation fixups
Modified paths:
  • /trunk/phase3/resources/jquery/jquery.suggestions.js (modified) (history)
  • /trunk/phase3/resources/mediawiki/mediawiki.js (modified) (history)
  • /trunk/phase3/skins/common/protect.js (modified) (history)
  • /trunk/phase3/skins/common/wikibits.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/protect.js
@@ -263,7 +263,7 @@
264264 /**
265265 * Apply a callback to each expiry input
266266 *
267 - * @param callable func Callback function
 267+ * @param func callable Callback function
268268 */
269269 'forEachExpiryInput': function(func) {
270270 var inputs = this.getExpiryInputs();
@@ -291,7 +291,7 @@
292292
293293 /**
294294 * Apply a callback to each expiry selector list
295 - * @param callable func Callback function
 295+ * @param func callable Callback function
296296 */
297297 'forEachExpirySelector': function(func) {
298298 var inputs = this.getExpirySelectors();
@@ -320,7 +320,7 @@
321321 /**
322322 * Enable/disable protection selectors and expiry inputs
323323 *
324 - * @param boolean val Enable?
 324+ * @param val boolean Enable?
325325 */
326326 'enableUnchainedInputs': function(val) {
327327 var first = true;
Index: trunk/phase3/skins/common/wikibits.js
@@ -259,7 +259,7 @@
260260 * otherwise, all the nodes that will probably have accesskeys by
261261 * default are updated.
262262 *
263 - * @param Array nodeList -- list of elements to update
 263+ * @param nodeList Array list of elements to update
264264 */
265265 window.updateTooltipAccessKeys = function( nodeList ) {
266266 if ( !nodeList ) {
@@ -311,13 +311,13 @@
312312 * nextnode parameter; to add the link _after_ an existing item, pass
313313 * the node's nextSibling instead.
314314 *
315 - * @param String portlet -- id of the target portlet ("p-cactions", "p-personal", "p-navigation" or "p-tb")
316 - * @param String href -- link URL
317 - * @param String text -- link text (will be automatically lowercased by CSS for p-cactions in Monobook)
318 - * @param String id -- id of the new item, should be unique and preferably have the appropriate prefix ("ca-", "pt-", "n-" or "t-")
319 - * @param String tooltip -- text to show when hovering over the link, without accesskey suffix
320 - * @param String accesskey -- accesskey to activate this link (one character, try to avoid conflicts)
321 - * @param Node nextnode -- the DOM node before which the new item should be added, should be another item in the same list
 315+ * @param portlet String id of the target portlet ("p-cactions", "p-personal", "p-navigation" or "p-tb")
 316+ * @param href String link URL
 317+ * @param text String link text (will be automatically lowercased by CSS for p-cactions in Monobook)
 318+ * @param id String id of the new item, should be unique and preferably have the appropriate prefix ("ca-", "pt-", "n-" or "t-")
 319+ * @param tooltip String text to show when hovering over the link, without accesskey suffix
 320+ * @param accesskey String accesskey to activate this link (one character, try to avoid conflicts)
 321+ * @param nextnode Node the DOM node before which the new item should be added, should be another item in the same list
322322 *
323323 * @return Node -- the DOM node of the new item (an LI element) or null
324324 */
@@ -948,8 +948,8 @@
949949 * Add a cute little box at the top of the screen to inform the user of
950950 * something, replacing any preexisting message.
951951 *
952 - * @param String -or- Dom Object message HTML to be put inside the right div
953 - * @param String className Used in adding a class; should be different for each
 952+ * @param message String -or- Dom Object HTML to be put inside the right div
 953+ * @param className String Used in adding a class; should be different for each
954954 * call to allow CSS/JS to hide different boxes. null = no class used.
955955 * @return Boolean True on success, false on failure
956956 */
@@ -1052,9 +1052,9 @@
10531053 /**
10541054 * Add an event handler to an element
10551055 *
1056 - * @param Element element Element to add handler to
1057 - * @param String attach Event to attach to
1058 - * @param callable handler Event handler callback
 1056+ * @param element Element to add handler to
 1057+ * @param attach String Event to attach to
 1058+ * @param handler callable Event handler callback
10591059 */
10601060 window.addHandler = function( element, attach, handler ) {
10611061 if( element.addEventListener ) {
@@ -1071,8 +1071,8 @@
10721072 /**
10731073 * Add a click event handler to an element
10741074 *
1075 - * @param Element element Element to add handler to
1076 - * @param callable handler Event handler callback
 1075+ * @param element Element to add handler to
 1076+ * @param handler callable Event handler callback
10771077 */
10781078 window.addClickHandler = function( element, handler ) {
10791079 addHandler( element, 'click', handler );
@@ -1081,9 +1081,9 @@
10821082 /**
10831083 * Removes an event handler from an element
10841084 *
1085 - * @param Element element Element to remove handler from
1086 - * @param String remove Event to remove
1087 - * @param callable handler Event handler callback to remove
 1085+ * @param element Element to remove handler from
 1086+ * @param remove String Event to remove
 1087+ * @param handler callable Event handler callback to remove
10881088 */
10891089 window.removeHandler = function( element, remove, handler ) {
10901090 if( window.removeEventListener ) {
Index: trunk/phase3/resources/jquery/jquery.suggestions.js
@@ -270,7 +270,7 @@
271271 },
272272 /**
273273 * Respond to keypress event
274 - * @param {Integer} key Code of key pressed
 274+ * @param key Integer Code of key pressed
275275 */
276276 keypress: function( e, context, key ) {
277277 var wasVisible = context.data.$container.is( ':visible' );
Index: trunk/phase3/resources/mediawiki/mediawiki.js
@@ -276,8 +276,8 @@
277277 /**
278278 * Gets a message string, similar to wfMsg()
279279 *
280 - * @param {string} key Key of message to get
281 - * @param {mixed} params First argument in a list of variadic arguments, each a parameter for $
 280+ * @param key string Key of message to get
 281+ * @param parameters mixed First argument in a list of variadic arguments, each a parameter for $
282282 * replacement
283283 */
284284 this.msg = function( key, parameters ) {
@@ -392,7 +392,7 @@
393393 /**
394394 * Gets a list of module names that a module depends on in their proper dependency order
395395 *
396 - * @param mixed string module name or array of string module names
 396+ * @param module string module name or array of string module names
397397 * @return list of dependencies
398398 * @throws Error if circular reference is detected
399399 */
@@ -424,8 +424,8 @@
425425 * state. Possible states are 'undefined', 'registered', 'loading',
426426 * 'loaded', or 'ready'
427427 *
428 - * @param mixed string or array of strings of module states to filter by
429 - * @param array list of module names to filter (optional, all modules
 428+ * @param states string or array of strings of module states to filter by
 429+ * @param modules array list of module names to filter (optional, all modules
430430 * will be used by default)
431431 * @return array list of filtered module names
432432 */
@@ -466,7 +466,7 @@
467467 /**
468468 * Executes a loaded module, making it ready to use
469469 *
470 - * @param string module name to execute
 470+ * @param module string module name to execute
471471 */
472472 function execute( module ) {
473473 if ( typeof registry[module] === 'undefined' ) {
@@ -548,9 +548,9 @@
549549 * Adds a dependencies to the queue with optional callbacks to be run
550550 * when the dependencies are ready or fail
551551 *
552 - * @param mixed string moulde name or array of string module names
553 - * @param function ready callback to execute when all dependencies are ready
554 - * @param function error callback to execute when any dependency fails
 552+ * @param dependencies string module name or array of string module names
 553+ * @param ready function callback to execute when all dependencies are ready
 554+ * @param error function callback to execute when any dependency fails
555555 */
556556 function request( dependencies, ready, error ) {
557557 // Allow calling by single module name
@@ -777,11 +777,11 @@
778778 /**
779779 * Executes a function as soon as one or more required modules are ready
780780 *
781 - * @param mixed string or array of strings of modules names the callback
 781+ * @param dependencies string or array of strings of modules names the callback
782782 * dependencies to be ready before
783783 * executing
784 - * @param function callback to execute when all dependencies are ready (optional)
785 - * @param function callback to execute when if dependencies have a errors (optional)
 784+ * @param ready function callback to execute when all dependencies are ready (optional)
 785+ * @param error function callback to execute when if dependencies have a errors (optional)
786786 */
787787 this.using = function( dependencies, ready, error ) {
788788 // Validate input
@@ -816,9 +816,9 @@
817817 /**
818818 * Loads an external script or one or more modules for future use
819819 *
820 - * @param {mixed} modules either the name of a module, array of modules,
 820+ * @param modules mixed either the name of a module, array of modules,
821821 * or a URL of an external script or style
822 - * @param {string} type mime-type to use if calling with a URL of an
 822+ * @param type string mime-type to use if calling with a URL of an
823823 * external script or style; acceptable values are "text/css" and
824824 * "text/javascript"; if no type is provided, text/javascript is
825825 * assumed
@@ -884,8 +884,8 @@
885885 /**
886886 * Changes the state of a module
887887 *
888 - * @param mixed module string module name or object of module name/state pairs
889 - * @param string state string state name
 888+ * @param module string module name or object of module name/state pairs
 889+ * @param state string state name
890890 */
891891 this.state = function( module, state ) {
892892 if ( typeof module === 'object' ) {
@@ -903,7 +903,7 @@
904904 /**
905905 * Gets the version of a module
906906 *
907 - * @param string module name of module to get version for
 907+ * @param module string name of module to get version for
908908 */
909909 this.version = function( module ) {
910910 if ( module in registry && 'version' in registry[module] ) {

Status & tagging log