|
296 | 296 | */
|
297 | 297 |
|
298 | 298 | /**
|
299 |
| - * function: removeType |
300 |
| - * |
301 | 299 | * Delete an element type.
|
302 | 300 | *
|
303 |
| - * Parameters: |
304 |
| - * name - The name of the type to delete |
| 301 | + * @param {String} name The name of the type to delete |
305 | 302 | */
|
306 | 303 | removeType : function(name)
|
307 | 304 | {
|
308 | 305 | delete _types[name];
|
309 | 306 | },
|
310 | 307 | /**
|
311 |
| - * function: typeNames |
312 |
| - * |
313 | 308 | * Returns the names of all types registered
|
| 309 | + * @return {Array} Names of all registered types |
314 | 310 | */
|
315 | 311 | typeNames : function()
|
316 | 312 | {
|
317 | 313 | return $.keyset(_types);
|
318 | 314 | },
|
319 | 315 | /**
|
320 |
| - * function: addType |
321 |
| - * |
322 | 316 | * Register a element type function.
|
323 | 317 | *
|
324 |
| - * Parameters: |
325 |
| - * data - Can either be the name of the type |
326 |
| - * function or an object that contains name : type function |
327 |
| - * pairs |
328 |
| - * fn - The function that creates a new type element |
| 318 | + * @param {String|Array} data Can either be the name of the type |
| 319 | + * function or an object that contains name : type function pairs |
| 320 | + * @param {Function} fn The function that creates a new type element |
329 | 321 | */
|
330 | 322 | addType : function(data, fn)
|
331 | 323 | {
|
332 | 324 | _addToObject(_types, data, fn);
|
333 | 325 | },
|
334 | 326 | /**
|
335 |
| - * function: addTypeIf |
336 |
| - * |
337 |
| - * Register a element type function. |
338 |
| - * |
339 |
| - * Parameters: |
340 |
| - * condition - The condition under which to subscribe |
341 |
| - * data - Can either be the name of the type builder |
342 |
| - * function or an object that contains name : type function |
343 |
| - * pairs |
344 |
| - * fn - The function to subscribe or nothing if an object is passed for data |
| 327 | + * Register a element type function if a condition is true. |
| 328 | + * See also: [addType] |
345 | 329 | *
|
346 |
| - * See also: |
347 |
| - * <addType> |
| 330 | + * @param {Boolean} condition The condition under which to subscribe |
| 331 | + * @param {String|Object} data Can be either the name of the type builder |
| 332 | + * function or an object that contains name : type function pairs |
| 333 | + * @param {Function} fn The function to subscribe or nothing if an object is passed for data |
348 | 334 | */
|
349 | 335 | addTypeIf : function(condition, data, fn)
|
350 | 336 | {
|
351 | 337 | condition && $.dform.addType(data, fn);
|
352 | 338 | },
|
353 | 339 | /**
|
354 |
| - * function: subscriberNames |
355 |
| - * |
356 | 340 | * Returns the names of all subscriber functions registered
|
| 341 | + * |
| 342 | + * @return {Array} The names of all registered subscribers |
357 | 343 | */
|
358 | 344 | subscriberNames : function()
|
359 | 345 | {
|
360 | 346 | return $.keyset(_subscriptions);
|
361 | 347 | },
|
362 | 348 | /**
|
363 |
| - * function: subscribe |
364 |
| - * |
365 | 349 | * Register a subscriber function.
|
366 | 350 | *
|
367 |
| - * Parameters: |
368 |
| - * data - Can either be the name of the subscriber |
369 |
| - * function or an object that contains name : subscriber function |
370 |
| - * pairs |
371 |
| - * fn - The function to subscribe or nothing if an object is passed for data |
| 351 | + * @param {String|Object} data Can either be the name of the subscriber |
| 352 | + * function or an object that contains name : subscriber function pairs |
| 353 | + * @param {Function} fn The function to subscribe or nothing if an object is passed for data |
372 | 354 | */
|
373 | 355 | subscribe : function(data, fn)
|
374 | 356 | {
|
375 | 357 | _addToObject(_subscriptions, data, fn);
|
376 | 358 | },
|
377 | 359 | /**
|
378 |
| - * function: subscribeIf |
379 |
| - * |
380 | 360 | * Register a subscriber if a given condition is true.
|
381 | 361 | * Use it if you want to subscribe only, if e.g. a required plugin
|
382 | 362 | * is installed (pass $.isFunction($.fn.pluginName)).
|
383 | 363 | *
|
384 |
| - * Parameters: |
385 |
| - * condition - The condition under which to subscribe |
386 |
| - * data - Can either be the name of the subscriber |
387 |
| - * function or an object that contains name : subscriber function |
388 |
| - * pairs |
389 |
| - * fn - The function to subscribe or nothing if an object is passed for data |
| 364 | + * See also: [subscribe] |
390 | 365 | *
|
391 |
| - * See also: |
392 |
| - * <subscribe> |
| 366 | + * @param {Boolean} condition The condition under which to subscribe |
| 367 | + * @param {String|Object} data Can either be the name of the subscriber |
| 368 | + * function or an object that contains name : subscriber function pairs |
| 369 | + * @param {Function} fn The function to subscribe or nothing if an object is passed for data |
393 | 370 | */
|
394 | 371 | subscribeIf : function(condition, data, fn)
|
395 | 372 | {
|
396 | 373 | condition && $.dform.subscribe(data, fn);
|
397 | 374 | },
|
398 | 375 | /**
|
399 |
| - * function: removeSubscription |
400 |
| - * |
401 | 376 | * Delete all subscriptions for a given name.
|
402 | 377 | *
|
403 |
| - * Parameters: |
404 |
| - * name - The name of the subscriber to delete |
| 378 | + * @param {String} name The name of the subscriber to delete |
405 | 379 | */
|
406 | 380 | removeSubscription : function(name)
|
407 | 381 | {
|
408 | 382 | delete _subscriptions[name];
|
409 | 383 | },
|
410 | 384 | /**
|
411 |
| - * function: hasSubscription |
412 |
| - * |
413 | 385 | * Returns if a subscriber function with the given name
|
414 | 386 | * has been registered.
|
415 | 387 | *
|
416 |
| - * Parameters: |
417 |
| - * name - The subscriber name |
418 |
| - * |
419 |
| - * Returns: |
420 |
| - * True if the given name has at least one subscriber registered, |
| 388 | + * @param {String} name The subscriber name |
| 389 | + * @return {Boolean} True if the given name has at least one subscriber registered, |
421 | 390 | * false otherwise
|
422 | 391 | */
|
423 | 392 | hasSubscription : function(name)
|
424 | 393 | {
|
425 | 394 | return _subscriptions[name] ? true : false;
|
426 | 395 | },
|
427 | 396 | /**
|
428 |
| - * function: createElement |
429 |
| - * |
430 | 397 | * Create a new element.
|
431 | 398 | *
|
432 |
| - * Parameters: |
433 |
| - * options - The options to use |
434 |
| - * |
435 |
| - * Returns: |
436 |
| - * The element as created by the builder function specified |
437 |
| - * or returned by the <defaultType> function. |
| 399 | + * @param {Object} options - The options to use |
| 400 | + * @return {Object} The element as created by the builder function specified |
| 401 | + * or returned by the defaultType function. |
438 | 402 | */
|
439 | 403 | createElement : function(options)
|
440 | 404 | {
|
|
0 commit comments