diff --git a/wp-includes/class-wp-editor.php b/wp-includes/class-wp-editor.php index bcbc631835..a8299451c2 100644 --- a/wp-includes/class-wp-editor.php +++ b/wp-includes/class-wp-editor.php @@ -207,7 +207,7 @@ final class _WP_Editors { $ext_plugins = ''; if ( $set['teeny'] ) { - self::$plugins = $plugins = apply_filters( 'teeny_mce_plugins', array( 'fullscreen', 'link', 'image', 'wordpress', 'wplink' ), $editor_id ); + self::$plugins = $plugins = apply_filters( 'teeny_mce_plugins', array( 'fullscreen', 'link', 'image', 'wordpress', 'wpeditimage', 'wplink' ), $editor_id ); } else { /** * TinyMCE external plugins filter @@ -335,8 +335,12 @@ final class _WP_Editors { self::$first_init['external_plugins'] = json_encode( $mce_external_plugins ); } - // WordPress default stylesheet - $mce_css = array( self::$baseurl . '/skins/wordpress/wp-content.css' ); + $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + $version = 'ver=' . $GLOBALS['wp_version']; + $dashicons = includes_url( "css/dashicons$suffix.css?$version" ); + + // WordPress default stylesheet and dashicons + $mce_css = array( $dashicons, self::$baseurl . '/skins/wordpress/wp-content.css' ); // load editor_style.css if the current theme supports it if ( ! empty( $GLOBALS['editor_styles'] ) && is_array( $GLOBALS['editor_styles'] ) ) { diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js b/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js index 6681eda11c..f62509779b 100644 --- a/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js +++ b/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js @@ -42,7 +42,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { width = parseInt( w, 10 ) + 10; - return '
' + + return '
' + '
'+ img +'
'+ cap +'
'; }); } @@ -102,7 +102,8 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { } function extractImageData( imageNode ) { - var classes, metadata, captionBlock, caption; + var classes, metadata, captionBlock, caption, + dom = editor.dom; // default attributes metadata = { @@ -118,12 +119,13 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { linkUrl: '' }; - metadata.url = editor.dom.getAttrib( imageNode, 'src' ); - metadata.alt = editor.dom.getAttrib( imageNode, 'alt' ); - metadata.width = parseInt( editor.dom.getAttrib( imageNode, 'width' ), 10 ); - metadata.height = parseInt( editor.dom.getAttrib( imageNode, 'height' ), 10 ); + metadata.url = dom.getAttrib( imageNode, 'src' ); + metadata.alt = dom.getAttrib( imageNode, 'alt' ); + metadata.width = parseInt( dom.getAttrib( imageNode, 'width' ), 10 ); + metadata.height = parseInt( dom.getAttrib( imageNode, 'height' ), 10 ); - //TODO: probably should capture attributes on both the and the so that they can be restored when the image and/or caption are updated + //TODO: probably should capture attributes on both the and the so that they can be restored + // when the image and/or caption are updated // maybe use getAttribs() // extract meta data from classes (candidate for turning into a method) @@ -144,7 +146,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { } ); // extract caption - captionBlock = editor.dom.getParents( imageNode, '.wp-caption' ); + captionBlock = dom.getParents( imageNode, '.wp-caption' ); if ( captionBlock.length ) { captionBlock = captionBlock[0]; @@ -155,26 +157,26 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { metadata.align = name.replace( 'align', '' ); } } ); - caption = editor.dom.select( 'dd.wp-caption-dd', captionBlock ); + + caption = dom.select( 'dd.wp-caption-dd', captionBlock ); if ( caption.length ) { caption = caption[0]; // need to do some more thinking about this metadata.caption = editor.serializer.serialize( caption ) .replace( /]*>/g, '$&\n' ).replace( /^

/, '' ).replace( /<\/p>$/, '' ); - } } // extract linkTo - if ( imageNode.parentNode.nodeName === 'A' ) { - metadata.linkUrl = editor.dom.getAttrib( imageNode.parentNode, 'href' ); + if ( imageNode.parentNode && imageNode.parentNode.nodeName === 'A' ) { + metadata.linkUrl = dom.getAttrib( imageNode.parentNode, 'href' ); } return metadata; } function updateImage( imageNode, imageData ) { - var className, width, node, html, captionNode, nodeToReplace, uid; + var className, width, node, html, captionNode, nodeToReplace, uid, editedImg; if ( imageData.caption ) { @@ -185,11 +187,11 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { //TODO: shouldn't add the id attribute if it isn't an attachment - // should create a new function for genrating the caption markup + // should create a new function for generating the caption markup html = '

' + '
'+ html + '
'+ imageData.caption +'
'; - node = editor.dom.create( 'div', { 'class': 'mceTemp', draggable: 'true' }, html ); + node = editor.dom.create( 'div', { 'class': 'mceTemp' }, html ); } else { node = createImageAndLink( imageData, 'node' ); } @@ -215,12 +217,15 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { editor.dom.setAttrib( node, 'data-wp-replace-id', '' ); - if ( node.nodeName === 'IMG' ) { - editor.selection.select( node ); - } else { - editor.selection.select( editor.dom.select( 'img', node )[0] ); - } editor.nodeChanged(); + + editedImg = node.nodeName === 'IMG' ? node : editor.dom.select( 'img', node )[0]; + + if ( editedImg ) { + editor.selection.select( editedImg ); + // refresh toolbar + addToolbar( editedImg ); + } } function createImageAndLink( imageData, mode ) { @@ -264,11 +269,124 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { } } + function editImage( img ) { + var frame, callback; + + if ( typeof wp === 'undefined' || ! wp.media ) { + editor.execCommand( 'mceImage' ); + return; + } + + editor.undoManager.add(); + + frame = wp.media({ + frame: 'image', + state: 'image-details', + metadata: extractImageData( img ) + } ); + + callback = function( imageData ) { + updateImage( img, imageData ); + editor.focus(); + }; + + frame.state('image-details').on( 'update', callback ); + frame.state('replace-image').on( 'replace', callback ); + frame.on( 'close', function() { + editor.focus(); + // editor.selection.select( img ); + // editor.nodeChanged(); + }); + + frame.open(); + } + + function removeImage( node ) { + var wrap; + + if ( node.nodeName === 'DIV' && editor.dom.hasClass( node, 'mceTemp' ) ) { + wrap = node; + } else if ( node.nodeName === 'IMG' || node.nodeName === 'DT' || node.nodeName === 'A' ) { + wrap = editor.dom.getParent( node, 'div.mceTemp' ); + } + + if ( wrap ) { + if ( wrap.nextSibling ) { + editor.selection.select( wrap.nextSibling ); + } else if ( wrap.previousSibling ) { + editor.selection.select( wrap.previousSibling ); + } else { + editor.selection.select( wrap.parentNode ); + } + + editor.selection.collapse( true ); + editor.nodeChanged(); + editor.dom.remove( wrap ); + } else { + editor.dom.remove( node ); + } + } + + function addToolbar( node ) { + var position, toolbarHtml, toolbar, + dom = editor.dom; + + removeToolbar(); + + // Don't add to placeholders + if ( ! node || node.nodeName !== 'IMG' || isPlaceholder( node ) ) { + return; + } + + dom.setAttrib( node, 'data-wp-imgselect', 1 ); + position = dom.getPos( node, editor.getBody() ); + + toolbarHtml = '
' + + '
' + + '
'; + + toolbar = dom.create( 'div', { + 'id': 'wp-image-toolbar', + 'data-mce-bogus': '1', + 'contenteditable': false + }, toolbarHtml ); + + editor.getBody().appendChild( toolbar ); + + dom.setStyles( toolbar, { + top: position.y, + left: position.x, + width: node.width + }); + } + + function removeToolbar() { + var toolbar = editor.dom.get( 'wp-image-toolbar' ); + + if ( toolbar ) { + editor.dom.remove( toolbar ); + } + + editor.dom.setAttrib( editor.dom.select( 'img[data-wp-imgselect]' ), 'data-wp-imgselect', null ); + } + + function isPlaceholder( node ) { + var dom = editor.dom; + + if ( dom.hasClass( node, 'mceItem' ) || dom.getAttrib( node, 'data-mce-placeholder' ) || + dom.getAttrib( node, 'data-mce-object' ) ) { + + return true; + } + + return false; + } + editor.on( 'init', function() { var dom = editor.dom; // Add caption field to the default image dialog - editor.on( 'wpLoadImageForm', function( e ) { + editor.on( 'wpLoadImageForm', function( event ) { if ( editor.getParam( 'wpeditimage_disable_captions' ) ) { return; } @@ -283,26 +401,26 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { label: 'Image caption' }; - e.data.splice( e.data.length - 1, 0, captionField ); + event.data.splice( event.data.length - 1, 0, captionField ); }); // Fix caption parent width for images added from URL - editor.on( 'wpNewImageRefresh', function( e ) { + editor.on( 'wpNewImageRefresh', function( event ) { var parent, captionWidth; - if ( parent = dom.getParent( e.node, 'dl.wp-caption' ) ) { + if ( parent = dom.getParent( event.node, 'dl.wp-caption' ) ) { if ( ! parent.style.width ) { - captionWidth = parseInt( e.node.clientWidth, 10 ) + 10; + captionWidth = parseInt( event.node.clientWidth, 10 ) + 10; captionWidth = captionWidth ? captionWidth + 'px' : '50%'; dom.setStyle( parent, 'width', captionWidth ); } } }); - editor.on( 'wpImageFormSubmit', function( e ) { - var data = e.imgData.data, - imgNode = e.imgData.node, - caption = e.imgData.caption, + editor.on( 'wpImageFormSubmit', function( event ) { + var data = event.imgData.data, + imgNode = event.imgData.node, + caption = event.imgData.caption, captionId = '', captionAlign = '', captionWidth = '', @@ -311,7 +429,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { // Temp image id so we can find the node later data.id = '__wp-temp-img-id'; // Cancel the original callback - e.imgData.cancel = true; + event.imgData.cancel = true; if ( ! data.style ) { data.style = null; @@ -365,7 +483,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { } if ( parent && parent.nodeName === 'P' ) { - wrap = dom.create( 'div', { 'class': 'mceTemp', 'draggable': 'true' }, html ); + wrap = dom.create( 'div', { 'class': 'mceTemp' }, html ); dom.insertAfter( wrap, parent ); editor.selection.select( wrap ); editor.nodeChanged(); @@ -374,7 +492,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { dom.remove( parent ); } } else { - editor.selection.setContent( '
' + html + '
' ); + editor.selection.setContent( '
' + html + '
' ); } } else { editor.selection.setContent( html ); @@ -431,7 +549,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { '
'+ html +'
'+ caption +'
'; if ( parent = dom.getParent( imgNode, 'p' ) ) { - wrap = dom.create( 'div', { 'class': 'mceTemp', 'draggable': 'true' }, html ); + wrap = dom.create( 'div', { 'class': 'mceTemp' }, html ); dom.insertAfter( wrap, parent ); editor.selection.select( wrap ); editor.nodeChanged(); @@ -443,7 +561,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { dom.remove( parent ); } } else { - editor.selection.setContent( '
' + html + '
' ); + editor.selection.setContent( '
' + html + '
' ); } } } else { @@ -466,13 +584,13 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { imgNode = dom.get('__wp-temp-img-id'); dom.setAttrib( imgNode, 'id', imgId ); - e.imgData.node = imgNode; + event.imgData.node = imgNode; }); - editor.on( 'wpLoadImageData', function( e ) { + editor.on( 'wpLoadImageData', function( event ) { var parent, - data = e.imgData.data, - imgNode = e.imgData.node; + data = event.imgData.data, + imgNode = event.imgData.node; if ( parent = dom.getParent( imgNode, 'dl.wp-caption' ) ) { parent = dom.select( 'dd.wp-caption-dd', parent )[0]; @@ -484,33 +602,64 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { } }); - // Prevent dragging images out of the caption elements dom.bind( editor.getDoc(), 'dragstart', function( event ) { var node = editor.selection.getNode(); + // Prevent dragging images out of the caption elements if ( node.nodeName === 'IMG' && dom.getParent( node, '.wp-caption' ) ) { event.preventDefault(); } + + // Remove toolbar to avoid an orphaned toolbar when dragging an image to a new location + removeToolbar(); + }); + + // Prevent IE11 from making dl.wp-caption resizable + if ( tinymce.Env.ie && tinymce.Env.ie > 10 ) { + // The 'mscontrolselect' event is supported only in IE11+ + dom.bind( editor.getBody(), 'mscontrolselect', function( event ) { + if ( event.target.nodeName === 'IMG' && dom.getParent( event.target, '.wp-caption' ) ) { + // Hide the thick border with resize handles around dl.wp-caption + editor.getBody().focus(); // :( + } else if ( event.target.nodeName === 'DL' && dom.hasClass( event.target, 'wp-caption' ) ) { + // Trigger the thick border with resize handles... + // This will make the caption text editable. + event.target.focus(); + } + }); + + editor.on( 'click', function( event ) { + if ( event.target.nodeName === 'IMG' && dom.getAttrib( event.target, 'data-wp-imgselect' ) && + dom.getParent( event.target, 'dl.wp-caption' ) ) { + + editor.getBody().focus(); + } + }); + } }); editor.on( 'ObjectResized', function( event ) { var parent, width, node = event.target; - if ( node.nodeName === 'IMG' && ( parent = editor.dom.getParent( node, '.wp-caption' ) ) ) { - width = event.width || editor.dom.getAttrib( node, 'width' ); + if ( node.nodeName === 'IMG' ) { + if ( parent = editor.dom.getParent( node, '.wp-caption' ) ) { + width = event.width || editor.dom.getAttrib( node, 'width' ); - if ( width ) { - width = parseInt( width, 10 ) + 10; - editor.dom.setStyle( parent, 'width', width + 'px' ); + if ( width ) { + width = parseInt( width, 10 ) + 10; + editor.dom.setStyle( parent, 'width', width + 'px' ); + } } + // refresh toolbar + addToolbar( node ); } }); - editor.on( 'BeforeExecCommand', function( e ) { + editor.on( 'BeforeExecCommand', function( event ) { var node, p, DL, align, - cmd = e.command, + cmd = event.command, dom = editor.dom; if ( cmd === 'mceInsertContent' ) { @@ -525,7 +674,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { if ( tinymce.Env.ie > 8 ) { setTimeout( function() { editor.selection.setCursorLocation( p, 0 ); - editor.selection.setContent( e.value ); + editor.selection.setContent( event.value ); }, 500 ); return false; @@ -536,6 +685,8 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { align = cmd.substr(7).toLowerCase(); align = 'align' + align; + removeToolbar(); + if ( dom.is( node, 'dl.wp-caption' ) ) { DL = node; } else { @@ -566,17 +717,18 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { } }); - editor.on( 'keydown', function( e ) { + editor.on( 'keydown', function( event ) { var node, wrap, P, spacer, selection = editor.selection, dom = editor.dom; - if ( e.keyCode === tinymce.util.VK.ENTER ) { + if ( event.keyCode === tinymce.util.VK.ENTER ) { // When pressing Enter inside a caption move the caret to a new parapraph under it - wrap = dom.getParent( editor.selection.getNode(), 'div.mceTemp' ); + node = selection.getNode(); + wrap = dom.getParent( node, 'div.mceTemp' ); if ( wrap ) { - dom.events.cancel(e); // Doesn't cancel all :( + dom.events.cancel( event ); // Doesn't cancel all :( // Remove any extra dt and dd cleated on pressing Enter... tinymce.each( dom.select( 'dt, dd', wrap ), function( element ) { @@ -585,13 +737,19 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { } }); - spacer = tinymce.Env.ie ? '' : '
'; + spacer = tinymce.Env.ie && tinymce.Env.ie < 11 ? '' : '
'; P = dom.create( 'p', null, spacer ); - dom.insertAfter( P, wrap ); - selection.setCursorLocation( P, 0 ); + + if ( node.nodeName === 'DD' ) { + dom.insertAfter( P, wrap ); + } else { + wrap.parentNode.insertBefore( P, wrap ); + } + editor.nodeChanged(); + selection.setCursorLocation( P, 0 ); } - } else if ( e.keyCode === tinymce.util.VK.DELETE || e.keyCode === tinymce.util.VK.BACKSPACE ) { + } else if ( event.keyCode === tinymce.util.VK.DELETE || event.keyCode === tinymce.util.VK.BACKSPACE ) { node = selection.getNode(); if ( node.nodeName === 'DIV' && dom.hasClass( node, 'mceTemp' ) ) { @@ -601,56 +759,57 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { } if ( wrap ) { - dom.events.cancel(e); - - if ( wrap.nextSibling ) { - selection.select( wrap.nextSibling ); - } else if ( wrap.previousSibling ) { - selection.select( wrap.previousSibling ); - } else { - selection.select( wrap.parentNode ); - } - - selection.collapse( true ); - editor.nodeChanged(); - dom.remove( wrap ); - wrap = null; + dom.events.cancel( event ); + removeImage( node ); return false; } } }); - editor.on( 'mousedown', function( e ) { - var imageNode, frame, callback; - if ( e.target.nodeName === 'IMG' && editor.selection.getNode() === e.target ) { - // Don't trigger on right-click - if ( e.button !== 2 ) { + editor.on( 'mousedown', function( event ) { + var node = event.target; - // Don't attempt to edit placeholders - if ( editor.dom.hasClass( e.target, 'mceItem' ) || '1' === editor.dom.getAttrib( e.target, 'data-mce-placeholder' ) ) { - return; - } - - imageNode = e.target; - - frame = wp.media({ - frame: 'image', - state: 'image-details', - metadata: extractImageData( imageNode ) - } ); - - callback = function( imageData ) { - updateImage( imageNode, imageData ); - editor.focus(); - }; - - frame.state('image-details').on( 'update', callback ); - frame.state('replace-image').on( 'replace', callback ); - - frame.open(); - } + if ( tinymce.Env.ie && editor.dom.getParent( node, '#wp-image-toolbar' ) ) { + // Stop IE > 8 from making the wrapper resizable on mousedown + event.preventDefault(); } - } ); + + if ( node.nodeName === 'IMG' && ! editor.dom.getAttrib( node, 'data-wp-imgselect' ) && ! isPlaceholder( node ) ) { + addToolbar( node ); + } + }); + + editor.on( 'mouseup', function( event ) { + var image, + node = event.target, + dom = editor.dom; + + // Don't trigger on right-click + if ( event.button && event.button > 1 ) { + return; + } + + if ( node.nodeName === 'DIV' && dom.getParent( node, '#wp-image-toolbar' ) ) { + image = dom.select( 'img[data-wp-imgselect]' )[0]; + + if ( image ) { + editor.selection.select( image ); + + if ( dom.hasClass( node, 'remove' ) ) { + removeImage( image ); + removeToolbar(); + } else if ( dom.hasClass( node, 'edit' ) ) { + editImage( image ); + } + } + } else if ( node.nodeName !== 'IMG' ) { + removeToolbar(); + } + }); + + editor.on( 'cut', function() { + removeToolbar(); + }); editor.wpSetImgCaption = function( content ) { return parseShortcode( content ); @@ -660,13 +819,14 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { return getShortcode( content ); }; - editor.on( 'BeforeSetContent', function( e ) { - e.content = editor.wpSetImgCaption( e.content ); + editor.on( 'BeforeSetContent', function( event ) { + event.content = editor.wpSetImgCaption( event.content ); }); - editor.on( 'PostProcess', function( e ) { - if ( e.get ) { - e.content = editor.wpGetImgCaption( e.content ); + editor.on( 'PostProcess', function( event ) { + if ( event.get ) { + event.content = editor.wpGetImgCaption( event.content ); + event.content = event.content.replace( / data-wp-imgselect="1"/g, '' ); } }); diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/plugin.min.js b/wp-includes/js/tinymce/plugins/wpeditimage/plugin.min.js index 6d9c1f477c..7b6b1c04aa 100644 --- a/wp-includes/js/tinymce/plugins/wpeditimage/plugin.min.js +++ b/wp-includes/js/tinymce/plugins/wpeditimage/plugin.min.js @@ -1 +1 @@ -tinymce.PluginManager.add("wpeditimage",function(a){function b(a){return a.replace(/(?:

)?\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\](?:<\/p>)?/g,function(a,b,c){var d,e,f,g,h,i,j=tinymce.trim;return d=b.match(/id=['"]([^'"]*)['"] ?/),d&&(b=b.replace(d[0],"")),e=b.match(/align=['"]([^'"]*)['"] ?/),e&&(b=b.replace(e[0],"")),f=b.match(/width=['"]([0-9]*)['"] ?/),f&&(b=b.replace(f[0],"")),c=j(c),h=c.match(/((?:]+>)?]+>(?:<\/a>)?)([\s\S]*)/i),h&&h[2]?(g=j(h[2]),h=j(h[1])):(g=j(b).replace(/caption=['"]/,"").replace(/['"]$/,""),h=c),d=d&&d[1]?d[1]:"",e=e&&e[1]?e[1]:"alignnone",f=f&&f[1]?f[1]:"",f&&g?(i=parseInt(f,10)+10,'

'+h+'
'+g+"
"):c})}function c(a){return a.replace(/
]*>([\s\S]+?)<\/div>/g,function(a,b){var c="";return-1===b.indexOf("]+>([\s\S]+?)<\/dd>/i),c&&c[1]?"

"+c[1]+"

":""):(c=b.replace(/
]+)>\s*
]+>([\s\S]+?)<\/dt>\s*
]+>([\s\S]*?)<\/dd>\s*<\/dl>/gi,function(a,b,c,d){var e,f,g;return g=c.match(/width="([0-9]*)"/),g=g&&g[1]?g[1]:"",g&&d?(e=b.match(/id="([^"]*)"/),e=e&&e[1]?e[1]:"",f=b.match(/class="([^"]*)"/),f=f&&f[1]?f[1]:"",f=f.match(/align[a-z]+/)||"alignnone",d=d.replace(/\r\n|\r/g,"\n").replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g,function(a){return a.replace(/[\r\n\t]+/," ")}),d=d.replace(/\s*\n\s*/g,"
"),'[caption id="'+e+'" align="'+f+'" width="'+g+'"]'+c+" "+d+"[/caption]"):c}),0!==c.indexOf("[caption")&&(c=b.replace(/[\s\S]*?((?:
]+>)?]+>(?:<\/a>)?)(

[\s\S]*<\/p>)?[\s\S]*/gi,"

$1

$2")),c)})}function d(b){var c,d,e,f;return d={attachment_id:!1,url:!1,height:"",width:"",size:"none",caption:"",alt:"",align:"none",link:!1,linkUrl:""},d.url=a.dom.getAttrib(b,"src"),d.alt=a.dom.getAttrib(b,"alt"),d.width=parseInt(a.dom.getAttrib(b,"width"),10),d.height=parseInt(a.dom.getAttrib(b,"height"),10),c=b.className.split(" "),tinymce.each(c,function(a){/^wp-image/.test(a)&&(d.attachment_id=parseInt(a.replace("wp-image-",""),10)),/^align/.test(a)&&(d.align=a.replace("align","")),/^size/.test(a)&&(d.size=a.replace("size-",""))}),e=a.dom.getParents(b,".wp-caption"),e.length&&(e=e[0],c=e.className.split(" "),tinymce.each(c,function(a){/^align/.test(a)&&(d.align=a.replace("align",""))}),f=a.dom.select("dd.wp-caption-dd",e),f.length&&(f=f[0],d.caption=a.serializer.serialize(f).replace(/]*>/g,"$&\n").replace(/^

/,"").replace(/<\/p>$/,""))),"A"===b.parentNode.nodeName&&(d.linkUrl=a.dom.getAttrib(b.parentNode,"href")),d}function e(b,c){var d,e,g,h,i,j,k;c.caption?(h=f(c,"html"),e=c.width+10,d="align"+c.align,h='

'+h+'
'+c.caption+"
",g=a.dom.create("div",{"class":"mceTemp",draggable:"true"},h)):g=f(c,"node"),j=b,i=a.dom.getParent(b,".mceTemp"),i?j=i:"A"===b.parentNode.nodeName&&(j=b.parentNode),k=a.dom.uniqueId("wp_"),a.dom.setAttrib(g,"data-wp-replace-id",k),a.dom.replace(g,j),g=a.dom.select('[data-wp-replace-id="'+k+'"]')[0],a.dom.setAttrib(g,"data-wp-replace-id",""),a.selection.select("IMG"===g.nodeName?g:a.dom.select("img",g)[0]),a.nodeChanged()}function f(b,c){var d,e=[];if(c=c?c:"node",b.caption||e.push("align"+b.align),b.attachment_id&&(e.push("wp-image-"+b.attachment_id),b.size&&e.push("size-"+b.size)),d={src:b.url,width:b.width,height:b.height,alt:b.alt},e.length&&(d["class"]=e.join(" ")),b.linkUrl){if("node"===c)return a.dom.create("a",{href:b.linkUrl},a.dom.createHTML("img",d));if("html"===c)return a.dom.createHTML("a",{href:b.linkUrl},a.dom.createHTML("img",d))}else{if("node"===c)return a.dom.create("img",d);if("html"===c)return a.dom.createHTML("img",d)}}return a.on("init",function(){var b=a.dom;a.on("wpLoadImageForm",function(b){if(!a.getParam("wpeditimage_disable_captions")){var c={type:"textbox",flex:1,name:"caption",minHeight:60,multiline:!0,scroll:!0,label:"Image caption"};b.data.splice(b.data.length-1,0,c)}}),a.on("wpNewImageRefresh",function(a){var c,d;(c=b.getParent(a.node,"dl.wp-caption"))&&(c.style.width||(d=parseInt(a.node.clientWidth,10)+10,d=d?d+"px":"50%",b.setStyle(c,"width",d)))}),a.on("wpImageFormSubmit",function(c){var d,e,f,g,h,i=c.imgData.data,j=c.imgData.node,k=c.imgData.caption,l="",m="",n="";return i.id="__wp-temp-img-id",c.imgData.cancel=!0,i.style||(i.style=null),i.src?(k&&(k=k.replace(/\r\n|\r/g,"\n").replace(/<\/?[a-zA-Z0-9]+( [^<>]+)?>/g,function(a){return a.replace(/[\r\n\t]+/," ")}),k=k.replace(/(]*>)\s*\n\s*/g,"$1").replace(/\s*\n\s*/g,"
")),j?(h=j.id||null,b.setAttribs(j,i),d=b.getParent(j,"dl.wp-caption"),k?d?(e=b.select("dd.wp-caption-dd",d)[0])&&(e.innerHTML=k):(j.className&&(l=j.className.match(/wp-image-([0-9]+)/),m=j.className.match(/align(left|right|center|none)/)),m?(m=m[0],j.className=j.className.replace(/align(left|right|center|none)/g,"")):m="alignnone",m=' class="wp-caption '+m+'"',l&&(l=' id="attachment_'+l[1]+'"'),n=i.width||j.clientWidth,n&&(n=parseInt(n,10)+10,n=' style="width: '+n+'px"'),j.parentNode&&"A"===j.parentNode.nodeName?(g=b.getOuterHTML(j.parentNode),f=j.parentNode):(g=b.getOuterHTML(j),f=j),g="
'+g+'
'+k+"
",(e=b.getParent(j,"p"))?(d=b.create("div",{"class":"mceTemp",draggable:"true"},g),b.insertAfter(d,e),a.selection.select(d),a.nodeChanged(),b.remove(f),b.isEmpty(e)&&b.remove(e)):a.selection.setContent('
'+g+"
")):d&&(g=b.getOuterHTML("A"===j.parentNode.nodeName?j.parentNode:j),e=b.create("p",{},g),b.insertAfter(e,d.parentNode),a.selection.select(e),a.nodeChanged(),b.remove(d.parentNode))):(g=b.createHTML("img",i),k?(f=a.selection.getNode(),i.width&&(n=parseInt(i.width,10)+10,n=' style="width: '+n+'px"'),g='
'+g+'
'+k+"
",e="P"===f.nodeName?f:b.getParent(f,"p"),e&&"P"===e.nodeName?(d=b.create("div",{"class":"mceTemp",draggable:"true"},g),b.insertAfter(d,e),a.selection.select(d),a.nodeChanged(),b.isEmpty(e)&&b.remove(e)):a.selection.setContent('
'+g+"
")):a.selection.setContent(g)),j=b.get("__wp-temp-img-id"),b.setAttrib(j,"id",h),void(c.imgData.node=j)):void(j&&(b.remove((d=b.getParent(j,"div.mceTemp"))?d:"A"===j.parentNode.nodeName?j.parentNode:j),a.nodeChanged()))}),a.on("wpLoadImageData",function(c){var d,e=c.imgData.data,f=c.imgData.node;(d=b.getParent(f,"dl.wp-caption"))&&(d=b.select("dd.wp-caption-dd",d)[0],d&&(e.caption=a.serializer.serialize(d).replace(/]*>/g,"$&\n").replace(/^

/,"").replace(/<\/p>$/,"")))}),b.bind(a.getDoc(),"dragstart",function(c){var d=a.selection.getNode();"IMG"===d.nodeName&&b.getParent(d,".wp-caption")&&c.preventDefault()})}),a.on("ObjectResized",function(b){var c,d,e=b.target;"IMG"===e.nodeName&&(c=a.dom.getParent(e,".wp-caption"))&&(d=b.width||a.dom.getAttrib(e,"width"),d&&(d=parseInt(d,10)+10,a.dom.setStyle(c,"width",d+"px")))}),a.on("BeforeExecCommand",function(b){var c,d,e,f,g=b.command,h=a.dom;if("mceInsertContent"===g){if((c=h.getParent(a.selection.getNode(),"div.mceTemp"))&&(d=h.create("p"),h.insertAfter(d,c),a.selection.setCursorLocation(d,0),a.nodeChanged(),tinymce.Env.ie>8))return setTimeout(function(){a.selection.setCursorLocation(d,0),a.selection.setContent(b.value)},500),!1}else if("JustifyLeft"===g||"JustifyRight"===g||"JustifyCenter"===g){if(c=a.selection.getNode(),f=g.substr(7).toLowerCase(),f="align"+f,e=h.is(c,"dl.wp-caption")?c:h.getParent(c,"dl.wp-caption"))return h.hasClass(e,f)?(h.removeClass(e,f),h.addClass(e,"alignnone")):(e.className=e.className.replace(/align[^ ]+/g,""),h.addClass(e,f)),!1;"IMG"===c.nodeName&&(h.hasClass(c,f)?h.addClass(c,"alignnone"):h.removeClass(c,"alignnone"))}}),a.on("keydown",function(b){var c,d,e,f,g=a.selection,h=a.dom;if(b.keyCode===tinymce.util.VK.ENTER)d=h.getParent(a.selection.getNode(),"div.mceTemp"),d&&(h.events.cancel(b),tinymce.each(h.select("dt, dd",d),function(a){h.isEmpty(a)&&h.remove(a)}),f=tinymce.Env.ie?"":'
',e=h.create("p",null,f),h.insertAfter(e,d),g.setCursorLocation(e,0),a.nodeChanged());else if((b.keyCode===tinymce.util.VK.DELETE||b.keyCode===tinymce.util.VK.BACKSPACE)&&(c=g.getNode(),"DIV"===c.nodeName&&h.hasClass(c,"mceTemp")?d=c:("IMG"===c.nodeName||"DT"===c.nodeName||"A"===c.nodeName)&&(d=h.getParent(c,"div.mceTemp")),d))return h.events.cancel(b),g.select(d.nextSibling?d.nextSibling:d.previousSibling?d.previousSibling:d.parentNode),g.collapse(!0),a.nodeChanged(),h.remove(d),d=null,!1}),a.on("mousedown",function(b){var c,f,g;if("IMG"===b.target.nodeName&&a.selection.getNode()===b.target&&2!==b.button){if(a.dom.hasClass(b.target,"mceItem")||"1"===a.dom.getAttrib(b.target,"data-mce-placeholder"))return;c=b.target,f=wp.media({frame:"image",state:"image-details",metadata:d(c)}),g=function(b){e(c,b),a.focus()},f.state("image-details").on("update",g),f.state("replace-image").on("replace",g),f.open()}}),a.wpSetImgCaption=function(a){return b(a)},a.wpGetImgCaption=function(a){return c(a)},a.on("BeforeSetContent",function(b){b.content=a.wpSetImgCaption(b.content)}),a.on("PostProcess",function(b){b.get&&(b.content=a.wpGetImgCaption(b.content))}),{_do_shcode:b,_get_shcode:c}}); \ No newline at end of file +tinymce.PluginManager.add("wpeditimage",function(a){function b(a){return a.replace(/(?:

)?\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\](?:<\/p>)?/g,function(a,b,c){var d,e,f,g,h,i,j=tinymce.trim;return d=b.match(/id=['"]([^'"]*)['"] ?/),d&&(b=b.replace(d[0],"")),e=b.match(/align=['"]([^'"]*)['"] ?/),e&&(b=b.replace(e[0],"")),f=b.match(/width=['"]([0-9]*)['"] ?/),f&&(b=b.replace(f[0],"")),c=j(c),h=c.match(/((?:]+>)?]+>(?:<\/a>)?)([\s\S]*)/i),h&&h[2]?(g=j(h[2]),h=j(h[1])):(g=j(b).replace(/caption=['"]/,"").replace(/['"]$/,""),h=c),d=d&&d[1]?d[1]:"",e=e&&e[1]?e[1]:"alignnone",f=f&&f[1]?f[1]:"",f&&g?(i=parseInt(f,10)+10,'

"):c})}function c(a){return a.replace(/
]*>([\s\S]+?)<\/div>/g,function(a,b){var c="";return-1===b.indexOf("]+>([\s\S]+?)<\/dd>/i),c&&c[1]?"

"+c[1]+"

":""):(c=b.replace(/
]+)>\s*
]+>([\s\S]+?)<\/dt>\s*
]+>([\s\S]*?)<\/dd>\s*<\/dl>/gi,function(a,b,c,d){var e,f,g;return g=c.match(/width="([0-9]*)"/),g=g&&g[1]?g[1]:"",g&&d?(e=b.match(/id="([^"]*)"/),e=e&&e[1]?e[1]:"",f=b.match(/class="([^"]*)"/),f=f&&f[1]?f[1]:"",f=f.match(/align[a-z]+/)||"alignnone",d=d.replace(/\r\n|\r/g,"\n").replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g,function(a){return a.replace(/[\r\n\t]+/," ")}),d=d.replace(/\s*\n\s*/g,"
"),'[caption id="'+e+'" align="'+f+'" width="'+g+'"]'+c+" "+d+"[/caption]"):c}),0!==c.indexOf("[caption")&&(c=b.replace(/[\s\S]*?((?:
]+>)?]+>(?:<\/a>)?)(

[\s\S]*<\/p>)?[\s\S]*/gi,"

$1

$2")),c)})}function d(b){var c,d,e,f,g=a.dom;return d={attachment_id:!1,url:!1,height:"",width:"",size:"none",caption:"",alt:"",align:"none",link:!1,linkUrl:""},d.url=g.getAttrib(b,"src"),d.alt=g.getAttrib(b,"alt"),d.width=parseInt(g.getAttrib(b,"width"),10),d.height=parseInt(g.getAttrib(b,"height"),10),c=b.className.split(" "),tinymce.each(c,function(a){/^wp-image/.test(a)&&(d.attachment_id=parseInt(a.replace("wp-image-",""),10)),/^align/.test(a)&&(d.align=a.replace("align","")),/^size/.test(a)&&(d.size=a.replace("size-",""))}),e=g.getParents(b,".wp-caption"),e.length&&(e=e[0],c=e.className.split(" "),tinymce.each(c,function(a){/^align/.test(a)&&(d.align=a.replace("align",""))}),f=g.select("dd.wp-caption-dd",e),f.length&&(f=f[0],d.caption=a.serializer.serialize(f).replace(/]*>/g,"$&\n").replace(/^

/,"").replace(/<\/p>$/,""))),b.parentNode&&"A"===b.parentNode.nodeName&&(d.linkUrl=g.getAttrib(b.parentNode,"href")),d}function e(b,c){var d,e,g,h,j,k,l,m;c.caption?(h=f(c,"html"),e=c.width+10,d="align"+c.align,h='

'+h+'
'+c.caption+"
",g=a.dom.create("div",{"class":"mceTemp"},h)):g=f(c,"node"),k=b,j=a.dom.getParent(b,".mceTemp"),j?k=j:"A"===b.parentNode.nodeName&&(k=b.parentNode),l=a.dom.uniqueId("wp_"),a.dom.setAttrib(g,"data-wp-replace-id",l),a.dom.replace(g,k),g=a.dom.select('[data-wp-replace-id="'+l+'"]')[0],a.dom.setAttrib(g,"data-wp-replace-id",""),a.nodeChanged(),m="IMG"===g.nodeName?g:a.dom.select("img",g)[0],m&&(a.selection.select(m),i(m))}function f(b,c){var d,e=[];if(c=c?c:"node",b.caption||e.push("align"+b.align),b.attachment_id&&(e.push("wp-image-"+b.attachment_id),b.size&&e.push("size-"+b.size)),d={src:b.url,width:b.width,height:b.height,alt:b.alt},e.length&&(d["class"]=e.join(" ")),b.linkUrl){if("node"===c)return a.dom.create("a",{href:b.linkUrl},a.dom.createHTML("img",d));if("html"===c)return a.dom.createHTML("a",{href:b.linkUrl},a.dom.createHTML("img",d))}else{if("node"===c)return a.dom.create("img",d);if("html"===c)return a.dom.createHTML("img",d)}}function g(b){var c,f;return"undefined"!=typeof wp&&wp.media?(a.undoManager.add(),c=wp.media({frame:"image",state:"image-details",metadata:d(b)}),f=function(c){e(b,c),a.focus()},c.state("image-details").on("update",f),c.state("replace-image").on("replace",f),c.on("close",function(){a.focus()}),void c.open()):void a.execCommand("mceImage")}function h(b){var c;"DIV"===b.nodeName&&a.dom.hasClass(b,"mceTemp")?c=b:("IMG"===b.nodeName||"DT"===b.nodeName||"A"===b.nodeName)&&(c=a.dom.getParent(b,"div.mceTemp")),c?(a.selection.select(c.nextSibling?c.nextSibling:c.previousSibling?c.previousSibling:c.parentNode),a.selection.collapse(!0),a.nodeChanged(),a.dom.remove(c)):a.dom.remove(b)}function i(b){var c,d,e,f=a.dom;j(),b&&"IMG"===b.nodeName&&!k(b)&&(f.setAttrib(b,"data-wp-imgselect",1),c=f.getPos(b,a.getBody()),d='
',e=f.create("div",{id:"wp-image-toolbar","data-mce-bogus":"1",contenteditable:!1},d),a.getBody().appendChild(e),f.setStyles(e,{top:c.y,left:c.x,width:b.width}))}function j(){var b=a.dom.get("wp-image-toolbar");b&&a.dom.remove(b),a.dom.setAttrib(a.dom.select("img[data-wp-imgselect]"),"data-wp-imgselect",null)}function k(b){var c=a.dom;return c.hasClass(b,"mceItem")||c.getAttrib(b,"data-mce-placeholder")||c.getAttrib(b,"data-mce-object")?!0:!1}return a.on("init",function(){var b=a.dom;a.on("wpLoadImageForm",function(b){if(!a.getParam("wpeditimage_disable_captions")){var c={type:"textbox",flex:1,name:"caption",minHeight:60,multiline:!0,scroll:!0,label:"Image caption"};b.data.splice(b.data.length-1,0,c)}}),a.on("wpNewImageRefresh",function(a){var c,d;(c=b.getParent(a.node,"dl.wp-caption"))&&(c.style.width||(d=parseInt(a.node.clientWidth,10)+10,d=d?d+"px":"50%",b.setStyle(c,"width",d)))}),a.on("wpImageFormSubmit",function(c){var d,e,f,g,h,i=c.imgData.data,j=c.imgData.node,k=c.imgData.caption,l="",m="",n="";return i.id="__wp-temp-img-id",c.imgData.cancel=!0,i.style||(i.style=null),i.src?(k&&(k=k.replace(/\r\n|\r/g,"\n").replace(/<\/?[a-zA-Z0-9]+( [^<>]+)?>/g,function(a){return a.replace(/[\r\n\t]+/," ")}),k=k.replace(/(]*>)\s*\n\s*/g,"$1").replace(/\s*\n\s*/g,"
")),j?(h=j.id||null,b.setAttribs(j,i),d=b.getParent(j,"dl.wp-caption"),k?d?(e=b.select("dd.wp-caption-dd",d)[0])&&(e.innerHTML=k):(j.className&&(l=j.className.match(/wp-image-([0-9]+)/),m=j.className.match(/align(left|right|center|none)/)),m?(m=m[0],j.className=j.className.replace(/align(left|right|center|none)/g,"")):m="alignnone",m=' class="wp-caption '+m+'"',l&&(l=' id="attachment_'+l[1]+'"'),n=i.width||j.clientWidth,n&&(n=parseInt(n,10)+10,n=' style="width: '+n+'px"'),j.parentNode&&"A"===j.parentNode.nodeName?(g=b.getOuterHTML(j.parentNode),f=j.parentNode):(g=b.getOuterHTML(j),f=j),g="
'+g+'
'+k+"
",(e=b.getParent(j,"p"))?(d=b.create("div",{"class":"mceTemp"},g),b.insertAfter(d,e),a.selection.select(d),a.nodeChanged(),b.remove(f),b.isEmpty(e)&&b.remove(e)):a.selection.setContent('
'+g+"
")):d&&(g=b.getOuterHTML("A"===j.parentNode.nodeName?j.parentNode:j),e=b.create("p",{},g),b.insertAfter(e,d.parentNode),a.selection.select(e),a.nodeChanged(),b.remove(d.parentNode))):(g=b.createHTML("img",i),k?(f=a.selection.getNode(),i.width&&(n=parseInt(i.width,10)+10,n=' style="width: '+n+'px"'),g='
'+g+'
'+k+"
",e="P"===f.nodeName?f:b.getParent(f,"p"),e&&"P"===e.nodeName?(d=b.create("div",{"class":"mceTemp"},g),b.insertAfter(d,e),a.selection.select(d),a.nodeChanged(),b.isEmpty(e)&&b.remove(e)):a.selection.setContent('
'+g+"
")):a.selection.setContent(g)),j=b.get("__wp-temp-img-id"),b.setAttrib(j,"id",h),void(c.imgData.node=j)):void(j&&(b.remove((d=b.getParent(j,"div.mceTemp"))?d:"A"===j.parentNode.nodeName?j.parentNode:j),a.nodeChanged()))}),a.on("wpLoadImageData",function(c){var d,e=c.imgData.data,f=c.imgData.node;(d=b.getParent(f,"dl.wp-caption"))&&(d=b.select("dd.wp-caption-dd",d)[0],d&&(e.caption=a.serializer.serialize(d).replace(/]*>/g,"$&\n").replace(/^

/,"").replace(/<\/p>$/,"")))}),b.bind(a.getDoc(),"dragstart",function(c){var d=a.selection.getNode();"IMG"===d.nodeName&&b.getParent(d,".wp-caption")&&c.preventDefault(),j()}),tinymce.Env.ie&&tinymce.Env.ie>10&&(b.bind(a.getBody(),"mscontrolselect",function(c){"IMG"===c.target.nodeName&&b.getParent(c.target,".wp-caption")?a.getBody().focus():"DL"===c.target.nodeName&&b.hasClass(c.target,"wp-caption")&&c.target.focus()}),a.on("click",function(c){"IMG"===c.target.nodeName&&b.getAttrib(c.target,"data-wp-imgselect")&&b.getParent(c.target,"dl.wp-caption")&&a.getBody().focus()}))}),a.on("ObjectResized",function(b){var c,d,e=b.target;"IMG"===e.nodeName&&((c=a.dom.getParent(e,".wp-caption"))&&(d=b.width||a.dom.getAttrib(e,"width"),d&&(d=parseInt(d,10)+10,a.dom.setStyle(c,"width",d+"px"))),i(e))}),a.on("BeforeExecCommand",function(b){var c,d,e,f,g=b.command,h=a.dom;if("mceInsertContent"===g){if((c=h.getParent(a.selection.getNode(),"div.mceTemp"))&&(d=h.create("p"),h.insertAfter(d,c),a.selection.setCursorLocation(d,0),a.nodeChanged(),tinymce.Env.ie>8))return setTimeout(function(){a.selection.setCursorLocation(d,0),a.selection.setContent(b.value)},500),!1}else if("JustifyLeft"===g||"JustifyRight"===g||"JustifyCenter"===g){if(c=a.selection.getNode(),f=g.substr(7).toLowerCase(),f="align"+f,j(),e=h.is(c,"dl.wp-caption")?c:h.getParent(c,"dl.wp-caption"))return h.hasClass(e,f)?(h.removeClass(e,f),h.addClass(e,"alignnone")):(e.className=e.className.replace(/align[^ ]+/g,""),h.addClass(e,f)),!1;"IMG"===c.nodeName&&(h.hasClass(c,f)?h.addClass(c,"alignnone"):h.removeClass(c,"alignnone"))}}),a.on("keydown",function(b){var c,d,e,f,g=a.selection,i=a.dom;if(b.keyCode===tinymce.util.VK.ENTER)c=g.getNode(),d=i.getParent(c,"div.mceTemp"),d&&(i.events.cancel(b),tinymce.each(i.select("dt, dd",d),function(a){i.isEmpty(a)&&i.remove(a)}),f=tinymce.Env.ie&&tinymce.Env.ie<11?"":'
',e=i.create("p",null,f),"DD"===c.nodeName?i.insertAfter(e,d):d.parentNode.insertBefore(e,d),a.nodeChanged(),g.setCursorLocation(e,0));else if((b.keyCode===tinymce.util.VK.DELETE||b.keyCode===tinymce.util.VK.BACKSPACE)&&(c=g.getNode(),"DIV"===c.nodeName&&i.hasClass(c,"mceTemp")?d=c:("IMG"===c.nodeName||"DT"===c.nodeName||"A"===c.nodeName)&&(d=i.getParent(c,"div.mceTemp")),d))return i.events.cancel(b),h(c),!1}),a.on("mousedown",function(b){var c=b.target;tinymce.Env.ie&&a.dom.getParent(c,"#wp-image-toolbar")&&b.preventDefault(),"IMG"!==c.nodeName||a.dom.getAttrib(c,"data-wp-imgselect")||k(c)||i(c)}),a.on("mouseup",function(b){var c,d=b.target,e=a.dom;b.button&&b.button>1||("DIV"===d.nodeName&&e.getParent(d,"#wp-image-toolbar")?(c=e.select("img[data-wp-imgselect]")[0],c&&(a.selection.select(c),e.hasClass(d,"remove")?(h(c),j()):e.hasClass(d,"edit")&&g(c))):"IMG"!==d.nodeName&&j())}),a.on("cut",function(){j()}),a.wpSetImgCaption=function(a){return b(a)},a.wpGetImgCaption=function(a){return c(a)},a.on("BeforeSetContent",function(b){b.content=a.wpSetImgCaption(b.content)}),a.on("PostProcess",function(b){b.get&&(b.content=a.wpGetImgCaption(b.content),b.content=b.content.replace(/ data-wp-imgselect="1"/g,""))}),{_do_shcode:b,_get_shcode:c}}); \ No newline at end of file diff --git a/wp-includes/js/tinymce/skins/wordpress/wp-content.css b/wp-includes/js/tinymce/skins/wordpress/wp-content.css index 92e1f35369..f9537a2932 100644 --- a/wp-includes/js/tinymce/skins/wordpress/wp-content.css +++ b/wp-includes/js/tinymce/skins/wordpress/wp-content.css @@ -117,6 +117,46 @@ img::selection { cursor: pointer; } +#wp-image-toolbar { + position: absolute; +} + +#wp-image-toolbar .wrapper { + position: relative; + height: 33px; + background-color: rgba(0,0,0,0.3); +} + +#wp-image-toolbar .dashicons { + position: absolute; + color: white; + width: 36px; + height: 32px; + line-height: 32px; + cursor: pointer; +} + +#wp-image-toolbar div.dashicons-no-alt { + top: 0; + right: 0; +} + +#wp-image-toolbar div.dashicons-format-image { + top: 0; + left: 0; +} + +/* Image resize handles */ +.mce-content-body div.mce-resizehandle { + border-color: #777; + width: 7px; + height: 7px; +} + +.mce-content-body img[data-mce-selected] { + outline: 1px solid #777; +} + .mce-content-body img.wp-gallery:hover { background-color: #ededed; border-style: solid; diff --git a/wp-includes/js/tinymce/wp-tinymce.js.gz b/wp-includes/js/tinymce/wp-tinymce.js.gz index 0d2364dbcd..50c674c927 100644 Binary files a/wp-includes/js/tinymce/wp-tinymce.js.gz and b/wp-includes/js/tinymce/wp-tinymce.js.gz differ