Make WordPress Core

Changeset 27321


Ignore:
Timestamp:
02/27/2014 09:50:40 PM (11 years ago)
Author:
wonderboymusic
Message:

Restore / re-tools some docs after [27313].

See #26631.

File:
1 edited

Legend:

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

    r27320 r27321  
    279279
    280280        return _.extend( attributes, {
     281            /**
     282             * A helper function to avoid truthy and falsey values being
     283             *   passed as an input that expects booleans. If key is undefined in the map,
     284             *   but has a default value, set it.
     285             *
     286             * @param {object} attrs Map of props from a shortcode or settings.
     287             * @param {string} key The key within the passed map to check for a value.
     288             * @returns {mixed|undefined} The original or coerced value of key within attrs
     289             */
    281290            coerce: function ( attrs, key ) {
    282291                if ( _.isUndefined( attrs[ key ] ) && ! _.isUndefined( this.defaults[ key ] ) ) {
     
    289298                return attrs[ key ];
    290299            },
    291 
     300            /**
     301             * Retrieve attachments based on the properties of the passed shortcode
     302             *
     303             * @global wp.media.query
     304             *
     305             * @param {wp.shortcode} shortcode An instance of wp.shortcode().
     306             * @returns {wp.media.model.Attachments} A Backbone.Collection containing
     307             *      the media items belonging to a collection.
     308             *      The query[ this.tag ] property is a Backbone.Model
     309             *          containing the 'props' for the collection.
     310             */
    292311            attachments: function( shortcode ) {
    293312                var shortcodeString = shortcode.string(),
     
    347366                return query;
    348367            },
    349 
     368            /**
     369             * Triggered when clicking 'Insert {label}' or 'Update {label}'
     370             *
     371             * @global wp.shortcode
     372             * @global wp.media.model.Attachments
     373             *
     374             * @param {wp.media.model.Attachments} attachments A Backbone.Collection containing
     375             *      the media items belonging to a collection.
     376             *      The query[ this.tag ] property is a Backbone.Model
     377             *          containing the 'props' for the collection.
     378             * @returns {wp.shortcode}
     379             */
    350380            shortcode: function( attachments ) {
    351381                var props = attachments.props.toJSON(),
     
    406436                return shortcode;
    407437            },
    408 
     438            /**
     439             * Triggered when double-clicking a collection shortcode placeholder
     440             *   in the editor
     441             *
     442             * @global wp.shortcode
     443             * @global wp.media.model.Selection
     444             * @global wp.media.view.l10n
     445             *
     446             * @param {string} content Content that is searched for possible
     447             *    shortcode markup matching the passed tag name,
     448             *
     449             * @this wp.media.{prop}
     450             *
     451             * @returns {wp.media.view.MediaFrame.Select} A media workflow.
     452             */
    409453            edit: function( content ) {
    410454                var shortcode = wp.shortcode.next( this.tag, content ),
Note: See TracChangeset for help on using the changeset viewer.