Changeset 33426
- Timestamp:
- 07/26/2015 10:10:31 AM (10 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/mce-view.js
r33338 r33426 1 1 /* global tinymce */ 2 3 window.wp = window.wp || {};4 2 5 3 /* … … 25 23 * | |- ... 26 24 */ 27 ( function( window, wp, $ ) {25 ( function( window, wp, shortcode, $ ) { 28 26 'use strict'; 29 27 … … 672 670 */ 673 671 match: function( content ) { 674 var match = wp.shortcode.next( this.type, content );672 var match = shortcode.next( this.type, content ); 675 673 676 674 if ( match ) { … … 721 719 } 722 720 } ); 723 } )( window, window.wp, window. jQuery );721 } )( window, window.wp, window.wp.shortcode, window.jQuery ); 724 722 725 723 /* … … 728 726 * and a view for embeddable URLs. 729 727 */ 730 ( function( window, views, $ ) { 731 var postID = $( '#post_ID' ).val() || 0, 732 media, gallery, av, embed; 733 734 media = { 728 ( function( window, views, media ) { 729 var base, gallery, av, embed; 730 731 base = { 735 732 state: [], 736 733 737 734 edit: function( text, update ) { 738 735 var type = this.type, 739 media = wp.media[ type ], 740 frame = media.edit( text ); 736 frame = media[ type ].edit( text ); 741 737 742 738 this.pausePlayers && this.pausePlayers(); … … 744 740 _.each( this.state, function( state ) { 745 741 frame.state( state ).on( 'update', function( selection ) { 746 update( media .shortcode( selection ).string(), type === 'gallery' );742 update( media[ type ].shortcode( selection ).string(), type === 'gallery' ); 747 743 } ); 748 744 } ); … … 756 752 }; 757 753 758 gallery = _.extend( {}, media, {754 gallery = _.extend( {}, base, { 759 755 state: [ 'gallery-edit' ], 760 template: wp.media.template( 'editor-gallery' ),756 template: media.template( 'editor-gallery' ), 761 757 762 758 initialize: function() { 763 var attachments = wp.media.gallery.attachments( this.shortcode, postID),759 var attachments = media.gallery.attachments( this.shortcode, media.view.settings.post.id ), 764 760 attrs = this.shortcode.attrs.named, 765 761 self = this; … … 783 779 self.render( self.template( { 784 780 attachments: attachments, 785 columns: attrs.columns ? parseInt( attrs.columns, 10 ) : wp.media.galleryDefaults.columns781 columns: attrs.columns ? parseInt( attrs.columns, 10 ) : media.galleryDefaults.columns 786 782 } ) ); 787 783 } ) … … 792 788 } ); 793 789 794 av = _.extend( {}, media, {790 av = _.extend( {}, base, { 795 791 action: 'parse-media-shortcode', 796 792 … … 800 796 if ( this.url ) { 801 797 this.loader = false; 802 this.shortcode = wp.media.embed.shortcode( {798 this.shortcode = media.embed.shortcode( { 803 799 url: this.text 804 800 } ); … … 806 802 807 803 wp.ajax.post( this.action, { 808 post_ID: postID,804 post_ID: media.view.settings.post.id, 809 805 type: this.shortcode.tag, 810 806 shortcode: this.shortcode.string() … … 847 843 848 844 edit: function( text, update ) { 849 var media = wp.media.embed, 850 frame = media.edit( text, this.url ), 845 var frame = media.embed.edit( text, this.url ), 851 846 self = this; 852 847 … … 865 860 update( data.url ); 866 861 } else { 867 update( media. shortcode( data ).string() );862 update( media.embed.shortcode( data ).string() ); 868 863 } 869 864 } ); … … 909 904 } 910 905 } ) ); 911 } )( window, window.wp.mce.views, window. jQuery);906 } )( window, window.wp.mce.views, window.wp.media ); -
trunk/src/wp-includes/script-loader.php
r33364 r33426 457 457 $scripts->add( 'media-editor', "/wp-includes/js/media-editor$suffix.js", array( 'shortcode', 'media-views' ), false, 1 ); 458 458 $scripts->add( 'media-audiovideo', "/wp-includes/js/media-audiovideo$suffix.js", array( 'media-editor' ), false, 1 ); 459 $scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', ' media-models', 'media-audiovideo', 'wp-playlist' ), false, 1 );459 $scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', 'jquery', 'media-views', 'media-audiovideo' ), false, 1 ); 460 460 461 461 if ( is_admin() ) {
Note: See TracChangeset
for help on using the changeset viewer.