diff --git src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js
index 97810b6..f27b742 100644
|
|
tinymce.PluginManager.add( 'wpeditimage', function( editor ) { |
201 | 201 | metadata.linkClassName = link.className; |
202 | 202 | } |
203 | 203 | |
204 | | editor.fire( 'WPImageData', { metadata: metadata, image: imageNode } ); |
205 | 204 | |
206 | 205 | return metadata; |
207 | 206 | } |
… |
… |
tinymce.PluginManager.add( 'wpeditimage', function( editor ) { |
340 | 339 | dom.remove( captionNode ); |
341 | 340 | } |
342 | 341 | |
343 | | editor.fire( 'WPImageUpdate', { metadata: imageData, image: imageNode } ); |
| 342 | if ( typeof window.jQuery !== 'undefined' ) { |
| 343 | window.jQuery( document ).triggerHandler( { |
| 344 | type: 'image-update', |
| 345 | namespace: 'editor', |
| 346 | editor: editor, |
| 347 | metadata: imageData, |
| 348 | image: imageNode |
| 349 | } ); |
| 350 | } |
344 | 351 | |
345 | 352 | editor.nodeChanged(); |
346 | 353 | // Refresh the toolbar |
… |
… |
tinymce.PluginManager.add( 'wpeditimage', function( editor ) { |
348 | 355 | } |
349 | 356 | |
350 | 357 | function editImage( img ) { |
351 | | var frame, callback; |
| 358 | var frame, callback, metadata; |
352 | 359 | |
353 | 360 | if ( typeof wp === 'undefined' || ! wp.media ) { |
354 | 361 | editor.execCommand( 'mceImage' ); |
355 | 362 | return; |
356 | 363 | } |
357 | 364 | |
| 365 | metadata = extractImageData( img ); |
| 366 | |
358 | 367 | frame = wp.media({ |
359 | 368 | frame: 'image', |
360 | 369 | state: 'image-details', |
361 | | metadata: extractImageData( img ) |
| 370 | metadata: metadata |
362 | 371 | } ); |
363 | 372 | |
| 373 | if ( typeof window.jQuery !== 'undefined' ) { |
| 374 | window.jQuery( document ).triggerHandler( { |
| 375 | type: 'image-edit', |
| 376 | namespace: 'editor', |
| 377 | editor: editor, |
| 378 | metadata: metadata, |
| 379 | frame: frame, |
| 380 | image: img |
| 381 | } ); |
| 382 | } |
| 383 | |
364 | 384 | callback = function( imageData ) { |
365 | 385 | editor.focus(); |
366 | 386 | editor.undoManager.transact( function() { |