Make WordPress Core

Ticket #27941: 27941.3.patch

File 27941.3.patch, 2.2 KB (added by azaozz, 11 years ago)
  • src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js

     
    11/* global tinymce */
    22tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
    3         var toolbarActive = false;
     3        var ghostObject, resizeHelper,
     4                toolbarActive = false;
    45
    56        function parseShortcode( content ) {
    67                return content.replace( /(?:<p>)?\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\](?:<\/p>)?/g, function( a, b, c ) {
     
    963964                }
    964965        });
    965966
     967        // Resize helper. Note: not used in IE < 11
     968        function resizing( event ) {
     969                editor.dom.setStyles( resizeHelper, { top: event.pageY, left: event.pageX, display: 'block' } );
     970                editor.dom.setHTML( resizeHelper, ghostObject.clientWidth + ' &times; ' + ghostObject.clientHeight );
     971        }
     972
     973        editor.on( 'ObjectResizeStart', function( event ) {
     974                resizeHelper = editor.dom.create( 'DIV', { 'class': 'mce-resize-helper', 'data-mce-bogus': 1 }, event.width + ' &times; ' + event.height );
     975                ghostObject = editor.dom.select( '.mce-clonedresizable' )[0];
     976                editor.getBody().appendChild( resizeHelper );
     977                editor.on( 'mousemove', resizing );
     978        });
     979
     980        editor.on( 'ObjectResized', function( event ) {
     981                editor.off( 'mousemove', resizing );
     982                editor.dom.remove( resizeHelper );
     983                resizeHelper = null;
     984        });
     985
    966986        return {
    967987                _do_shcode: parseShortcode,
    968988                _get_shcode: getShortcode
  • src/wp-includes/js/tinymce/skins/wordpress/wp-content.css

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