Changeset 31689
- Timestamp:
- 03/09/2015 07:08:05 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/mce-view.js
r31667 r31689 92 92 var pieces = [ { content: content } ], 93 93 self = this, 94 instance, 94 95 current; 95 96 … … 116 117 } 117 118 118 self.createInstance( type, result.content, result.options );119 instance = self.createInstance( type, result.content, result.options ); 119 120 120 121 // Add the processed piece for the match. 121 122 pieces.push( { 122 content: '<p data-wpview-marker="' + encodeURIComponent( result.content ) + '">' + result.content + '</p>',123 content: '<p data-wpview-marker="' + instance.encodedText + '">' + instance.text + '</p>', 123 124 processed: true 124 125 } ); … … 150 151 createInstance: function( type, text, options ) { 151 152 var View = this.get( type ), 152 encodedText = encodeURIComponent( text ), 153 instance = this.getInstance( encodedText ); 153 encodedText, 154 instance; 155 156 text = tinymce.DOM.decode( text ), 157 encodedText = encodeURIComponent( text ), 158 instance = this.getInstance( encodedText ); 154 159 155 160 if ( instance ) { … … 755 760 this.loader = false; 756 761 this.shortcode = wp.media.embed.shortcode( { 757 url: this. url762 url: this.text 758 763 } ); 759 764 } … … 805 810 edit: function( text, update ) { 806 811 var media = wp.media.embed, 807 frame = media.edit( text, !!this.url ),812 frame = media.edit( text, this.url ), 808 813 self = this, 809 814 events = 'change:url change:width change:height'; … … 820 825 var data = frame.state( 'embed' ).metadata; 821 826 822 if ( data.width ) { 823 delete self.url; 824 } else { 825 self.url = data.url; 826 } 827 828 if ( self.url ) { 827 if ( self.url && ! data.width ) { 829 828 update( data.url ); 830 829 } else { … … 867 866 content: match[2], 868 867 options: { 869 url: match[2]868 url: true 870 869 } 871 870 };
Note: See TracChangeset
for help on using the changeset viewer.