Changeset 27005
- Timestamp:
- 01/22/2014 06:37:08 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/media-editor.js
r27000 r27005 22 22 * 23 23 * @global wp.media.view.settings 24 * @global getUserSetting() 24 25 * 25 26 * @param {Object} [props={}] Attachment details (align, link, size, etc). … … 98 99 return fallbacks( props ); 99 100 }, 100 101 /** 102 * Create the markup for a link 101 /** 102 * Create link markup that is suitable for passing to the editor 103 103 * 104 104 * @global wp.html.string … … 128 128 }, 129 129 /** 130 * Create an Audio shortcode 130 * Create an Audio shortcode string that is suitable for passing to the editor 131 131 * 132 132 * @param {Object} props Attachment details (align, link, size, etc). … … 138 138 }, 139 139 /** 140 * Create a Video shortcode 140 * Create a Video shortcode string that is suitable for passing to the editor 141 141 * 142 142 * @param {Object} props Attachment details (align, link, size, etc). … … 148 148 }, 149 149 /** 150 * Helper function to create a media shortcode 150 * Helper function to create a media shortcode string 151 151 * 152 152 * @access private … … 196 196 }, 197 197 /** 198 * Create image markup, optionally with a link and/or wrapped in a caption shortcode 198 * Create image markup, optionally with a link and/or wrapped in a caption shortcode, 199 * that is suitable for passing to the editor 199 200 * 200 201 * @global wp.html … … 288 289 return { 289 290 /** 291 * Default gallery properties 292 * 290 293 * @global wp.media.view.settings 294 * @readonly 291 295 */ 292 296 defaults: { … … 301 305 orderby: 'menu_order ID' 302 306 }, 303 304 307 /** 308 * Retrieve attachments based on the properties of the passed shortcode 309 * 305 310 * @global wp.media.query 306 311 * 307 * @param {wp.shortcode} shortcode 312 * @param {wp.shortcode} shortcode An instance of wp.shortcode(). 308 313 * @returns {wp.media.model.Attachments} A Backbone.Collection containing 309 314 * the images belonging to a gallery. The 'gallery' prop is a Backbone.Model … … 364 369 return query; 365 370 }, 366 367 371 /** 368 372 * Triggered when clicking 'Insert Gallery' or 'Update Gallery' … … 442 446 * @global wp.media.view.l10n 443 447 * 444 * @param {string} content 448 * @param {string} content Content that is searched for possible 449 * shortcode markup matching the passed tag name, 445 450 * @returns {wp.media.view.MediaFrame.Select} A media workflow. 446 451 */ … … 515 520 return wp.media.view.settings.post.featuredImageId; 516 521 }, 517 518 522 /** 519 523 * Set the featured image id, save the post thumbnail data and … … 523 527 * @global wp.media.post 524 528 * 525 * @param {number} id 529 * @param {number} id The post ID of the featured image, or -1 to unset it. 526 530 */ 527 531 set: function( id ) { … … 572 576 }, 573 577 /** 578 * 'select' callback for Featured Image workflow, triggered when 579 * the 'Set Featured Image' button is clicked in the media modal. 580 * 574 581 * @global wp.media.view.settings 575 582 * … … 577 584 */ 578 585 select: function() { 579 var settings = wp.media.view.settings, 580 selection = this.get('selection').single(); 581 582 if ( ! settings.post.featuredImageId ) { 586 var selection = this.get('selection').single(); 587 588 if ( ! wp.media.view.settings.post.featuredImageId ) { 583 589 return; 584 590 } … … 586 592 wp.media.featuredImage.set( selection ? selection.id : -1 ); 587 593 }, 588 589 594 /** 590 595 * Open the content media manager to the 'featured image' tab when … … 616 621 wp.media.editor = { 617 622 /** 623 * Send content to the editor 624 * 618 625 * @global tinymce 619 626 * @global QTags 620 627 * @global wpActiveEditor 621 * 622 * @param {string} html 628 * @global tb_remove() - Possibly overloaded by legacy plugins 629 * 630 * @param {string} html Content to send to the editor 623 631 */ 624 632 insert: function( html ) { … … 662 670 663 671 /** 672 * Setup 'workflow' and add to the 'workflows' cache. 'open' can 673 * subsequently be called upon it. 674 * 664 675 * @global wp.media.view.l10n 665 676 * … … 754 765 return workflow; 755 766 }, 756 757 767 /** 758 768 * Determines the proper current workflow id … … 761 771 * @global tinymce 762 772 * 763 * @param {string} [id=''] 773 * @param {string} [id=''] A slug used to identify the workflow. 774 * 764 775 * @returns {wpActiveEditor|string|tinymce.activeEditor.id} 765 776 */ … … 784 795 * Return the workflow specified by id 785 796 * 786 * @param {string} id 797 * @param {string} id A slug used to identify the workflow. 787 798 * 788 799 * @this wp.media.editor … … 797 808 * Remove the workflow represented by id from the workflow cache 798 809 * 799 * @param {string} id 810 * @param {string} id A slug used to identify the workflow. 800 811 * 801 812 * @this wp.media.editor … … 805 816 delete workflows[ id ]; 806 817 }, 807 818 /** 819 * @namespace 820 */ 808 821 send: { 809 822 /** … … 885 898 }, 886 899 /** 887 * @param {string} id 900 * Open a workflow 901 * 902 * @param {string} [id=undefined] Optional. A slug used to identify the workflow. 888 903 * @param {Object} [options={}] 889 904 *
Note: See TracChangeset
for help on using the changeset viewer.