Changeset 28183
- Timestamp:
- 04/22/2014 06:20:54 PM (10 years ago)
- Location:
- trunk/src/wp-includes/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/mce-view.js
r28182 r28183 484 484 */ 485 485 getHtml: function() { 486 var attrs = _.defaults( 487 this.shortcode.attrs.named, 488 wp.media[ this.shortcode.tag ].defaults 489 ); 490 return this.template({ model: attrs }); 486 var attrs = this.shortcode.attrs.named; 487 attrs.content = this.shortcode.content; 488 489 return this.template({ model: _.defaults( 490 attrs, 491 wp.media[ this.shortcode.tag ].defaults ) 492 }); 491 493 }, 492 494 -
trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js
r28084 r28183 333 333 // Empty the wrap node 334 334 if ( 'textContent' in node ) { 335 node.textContent = ' ';335 node.textContent = '\u00a0'; 336 336 } else { 337 node.innerText = ''; 338 } 339 340 // This makes all views into block tags (as we use <div>). 341 // Can use 'PostProcess' and a regex instead. 342 dom.replace( dom.create( 'p', null, window.decodeURIComponent( dom.getAttrib( node, 'data-wpview-text' ) ) ), node ); 337 node.innerText = '\u00a0'; 338 } 343 339 }); 344 340 }); 341 342 editor.on( 'PostProcess', function( event ) { 343 if ( event.content ) { 344 event.content = event.content.replace( /<div [^>]*?data-wpview-text="([^"]*)"[^>]*>[\s\S]*?<\/div>/g, function( match, shortcode ) { 345 if ( shortcode ) { 346 return '<p>' + window.decodeURIComponent( shortcode ) + '</p>'; 347 } 348 return ''; // If error, remove the view wrapper 349 }); 350 } 351 }); 345 352 346 353 editor.on( 'keydown', function( event ) {
Note: See TracChangeset
for help on using the changeset viewer.