Make WordPress Core

Ticket #27941: 27941.2.patch

File 27941.2.patch, 1.8 KB (added by iseulde, 11 years ago)
  • src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js

     
    963963                }
    964964        });
    965965
     966        // Resize helper.
     967
     968        editor.on( 'init', function() {
     969                var ghostObject, resizeHelper;
     970
     971                editor.on( 'ObjectResizeStart', function( event ) {
     972                        resizeHelper = editor.dom.create( 'DIV', { 'class': 'mce-resize-helper' }, event.width + ' × ' + event.height );
     973                        ghostObject = editor.dom.select( '.mce-clonedresizable' )[0];
     974                        editor.getBody().appendChild( resizeHelper );
     975                        editor.on( 'mousemove', resizing );
     976                } );
     977
     978                editor.on( 'ObjectResized', function() {
     979                        editor.off( 'mousemove', resizing );
     980                        editor.dom.remove( resizeHelper );
     981                } );
     982
     983                function resizing( event ) {
     984                        editor.dom.setStyles( resizeHelper, { 'top': event.clientY, 'left': event.clientX } );
     985                        editor.dom.setHTML( resizeHelper, ghostObject.width + ' × ' + ghostObject.height );
     986                }
     987        } );
     988
    966989        return {
    967990                _do_shcode: parseShortcode,
    968991                _get_shcode: getShortcode
  • src/wp-includes/js/tinymce/skins/wordpress/wp-content.css

     
    476476        margin-right: 7px;
    477477}
    478478
     479/* Resize helper. */
     480
     481.mce-resize-helper {
     482        background-color: rgba( 0, 0, 0, 0.75 );
     483        border-radius: 3px;
     484        color: white;
     485        margin: 5px;
     486        padding: 5px;
     487        position: absolute;
     488}
     489
    479490@media print,
    480491        (-o-min-device-pixel-ratio: 5/4),
    481492        (-webkit-min-device-pixel-ratio: 1.25),