Make WordPress Core

Changeset 27032


Ignore:
Timestamp:
01/25/2014 08:55:47 AM (13 years ago)
Author:
wonderboymusic
Message:

Add some inline docs to methods in media-models.js - particularly around @param and @returns.

See #26870.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/media-models.js

    r27031 r27032  
    153153                 * @param {Number} [length=30]
    154154                 * @param {String} [replacement=…]
    155                  * @returns {String}
     155                 * @returns {String} The string, unless length is greater than string.length.
    156156                 */
    157157                truncate: function( string, length, replacement ) {
     
    176176         *
    177177         * @static
    178          * @param {String} id
     178         * @param {String} id A string used to identify a model.
    179179         * @returns {wp.media.model.Attachment}
    180180         */
     
    318318        }, {
    319319                /**
     320                 * Add a model to the end of the static 'all' collection and return it.
     321                 *
    320322                 * @static
    321323                 * @param {Object} attrs
     
    326328                },
    327329                /**
     330                 * Retrieve a model, or add it to the end of the static 'all' collection before returning it.
     331                 *
    328332                 * @static
    329                  * @param {string} id
     333                 * @param {string} id A string used to identify a model.
    330334                 * @param {Backbone.Model|undefined} attachment
    331335                 * @returns {wp.media.model.Attachment}
     
    348352                model: Attachment,
    349353                /**
    350                  * @param {Array|Object} models
     354                 * @param {Array} [models=[]] Array of models used to populate the collection.
    351355                 * @param {Object} [options={}]
    352356                 */
     
    499503                 * @param {wp.media.model.Attachments} attachments
    500504                 * @param {object} [options={}]
     505                 *
     506                 * @fires wp.media.model.Attachments#reset
     507                 *
    501508                 * @returns {wp.media.model.Attachments} Returns itself to allow chaining
    502509                 */
     
    704711                /**
    705712                 * @static
     713                 * Overrides Backbone.Collection.comparator
     714                 *
    706715                 * @param {Backbone.Model} a
    707716                 * @param {Backbone.Model} b
    708717                 * @param {Object} options
    709                  * @returns {Number}
     718                 * @returns {Number} -1 if the first model should come before the second,
     719                 *    0 if they are of the same rank and
     720                 *    1 if the first model should come after.
    710721                 */
    711722                comparator: function( a, b, options ) {
     
    821832                 * @global wp.Uploader
    822833                 *
    823                  * @param {Array} models
     834                 * @param {Array} [models=[]] Array of models used to populate the collection.
    824835                 * @param {Object} [options={}]
    825836                 */
     
    983994                /**
    984995                 * @static
     996                 * @method
     997                 *
     998                 * @returns {wp.media.model.Query} A new query.
    985999                 */
    9861000                // Caches query objects so queries can be easily reused.
     
    10721086                 * it receives no parameters.
    10731087                 *
    1074                  * @param {Array} models
    1075                  * @param {Object} options
     1088                 * @param {Array} [models=[]] Array of models used to populate the collection.
     1089                 * @param {Object} [options={}]
    10761090                 */
    10771091                initialize: function( models, options ) {
Note: See TracChangeset for help on using the changeset viewer.