Changeset 27321
- Timestamp:
- 02/27/2014 09:50:40 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/media-editor.js
r27320 r27321 279 279 280 280 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 */ 281 290 coerce: function ( attrs, key ) { 282 291 if ( _.isUndefined( attrs[ key ] ) && ! _.isUndefined( this.defaults[ key ] ) ) { … … 289 298 return attrs[ key ]; 290 299 }, 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 */ 292 311 attachments: function( shortcode ) { 293 312 var shortcodeString = shortcode.string(), … … 347 366 return query; 348 367 }, 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 */ 350 380 shortcode: function( attachments ) { 351 381 var props = attachments.props.toJSON(), … … 406 436 return shortcode; 407 437 }, 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 */ 409 453 edit: function( content ) { 410 454 var shortcode = wp.shortcode.next( this.tag, content ),
Note: See TracChangeset
for help on using the changeset viewer.