Make WordPress Core

Ticket #27941: 27941.patch

File 27941.patch, 1.8 KB (added by iseulde, 11 years ago)
  • src/wp-includes/css/editor.css

     
    17821782        height: 30px;
    17831783}
    17841784
     1785/* Resize helper. */
     1786
     1787.mce-resize-helper {
     1788        background-color: rgba( 0, 0, 0, 0.75 );
     1789        border-radius: 3px;
     1790        color: white;
     1791        margin: 5px;
     1792        padding: 5px;
     1793        position: absolute;
     1794}
     1795
    17851796@media screen and ( max-width: 782px ) {
    17861797        #wp-fullscreen-close,
    17871798        #wp-fullscreen-central-toolbar,
  • src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js

     
    963963                }
    964964        });
    965965
     966        // Resize helper.
     967
     968        editor.on( 'init', function() {
     969                var ghostObject, iFramePos, resizeHelper;
     970
     971                editor.on( 'ObjectResizeStart', function( event ) {
     972                        resizeHelper = tinymce.DOM.create( 'DIV', { 'class': 'mce-resize-helper' }, event.width + ' × ' + event.height );
     973                        ghostObject = editor.dom.select( '.mce-clonedresizable' )[0];
     974                        iFramePos = tinymce.DOM.getPos( editor.getContentAreaContainer().querySelector( 'iframe' ) );
     975                        document.body.appendChild( resizeHelper );
     976                        editor.on( 'mousemove', resizing );
     977                } );
     978
     979                editor.on( 'ObjectResized', function() {
     980                        editor.off( 'mousemove', resizing );
     981                        tinymce.DOM.remove( resizeHelper );
     982                } );
     983
     984                function resizing( event ) {
     985                        tinymce.DOM.setStyles( resizeHelper, { 'top': event.clientY + iFramePos.y, 'left': event.clientX + iFramePos.x } );
     986                        tinymce.DOM.setHTML( resizeHelper, ghostObject.width + ' × ' + ghostObject.height );
     987                }
     988        } );
     989
    966990        return {
    967991                _do_shcode: parseShortcode,
    968992                _get_shcode: getShortcode