From 4428b4c4353f577dd95359b24d2f84c2a3327056 Mon Sep 17 00:00:00 2001 From: azaozz Date: Sun, 18 Sep 2011 03:00:13 +0000 Subject: [PATCH] Improve the image drag-resize detection in the visual editor (supported in FF and IE only), remove the size-* class if the image is soft-resized, see #18107 git-svn-id: http://svn.automattic.com/wordpress/trunk@18702 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../plugins/wpeditimage/editor_plugin.dev.js | 50 +++++++++++------- .../plugins/wpeditimage/editor_plugin.js | 2 +- .../plugins/wpeditimage/js/editimage.dev.js | 3 ++ .../plugins/wpeditimage/js/editimage.js | 2 +- wp-includes/js/tinymce/wp-tinymce.js.gz | Bin 95732 -> 95814 bytes wp-includes/version.php | 2 +- 6 files changed, 38 insertions(+), 21 deletions(-) diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.dev.js b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.dev.js index ff3cb47977..4cd4310a91 100644 --- a/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.dev.js +++ b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.dev.js @@ -3,7 +3,7 @@ tinymce.create('tinymce.plugins.wpEditImage', { init : function(ed, url) { - var t = this; + var t = this, mouse = {}; t.url = url; t._createButtons(); @@ -48,32 +48,46 @@ if ( tinymce.isWebKit || tinymce.isOpera ) return; - if ( ed.dom.getParent(e.target, 'div.mceTemp') || ed.dom.is(e.target, 'div.mceTemp') ) { - window.setTimeout(function(){ - var ed = tinyMCE.activeEditor, n = ed.selection.getNode(), DL, width; + if ( mouse.x && (e.clientX != mouse.x || e.clientY != mouse.y) ) { + var n = ed.selection.getNode(); - if ( 'IMG' == n.nodeName ) { - DL = ed.dom.getParent(n, 'dl.wp-caption'); - width = ed.dom.getAttrib(n, 'width') || n.width; - width = parseInt(width, 10); + if ( 'IMG' == n.nodeName ) { + window.setTimeout(function(){ + var DL, width; + + if ( n.width != mouse.img_w || n.height != mouse.img_h ) + n.className = n.className.replace(/size-[^ "']+/, ''); + + if ( ed.dom.getParent(n, 'div.mceTemp') ) { + DL = ed.dom.getParent(n, 'dl.wp-caption'); + + if ( DL ) { + width = ed.dom.getAttrib(n, 'width') || n.width; + width = parseInt(width, 10); + ed.dom.setStyle(DL, 'width', 10 + width); + ed.execCommand('mceRepaint'); + } - if ( DL && width != ( parseInt(ed.dom.getStyle(DL, 'width'), 10) - 10 ) ) { - ed.dom.setStyle(DL, 'width', 10 + width); - ed.execCommand('mceRepaint'); } - } - }, 100); + }, 100); + } } + mouse = {}; }); // show editimage buttons ed.onMouseDown.add(function(ed, e) { - var p; - if ( e.target.nodeName == 'IMG' && ed.dom.getAttrib(e.target, 'class').indexOf('mceItem') == -1 ) { - ed.plugins.wordpress._showButtons(e.target, 'wp_editbtns'); - if ( tinymce.isGecko && (p = ed.dom.getParent(e.target, 'dl.wp-caption')) && ed.dom.hasClass(p.parentNode, 'mceTemp') ) - ed.selection.select(p.parentNode); + if ( e.target && (e.target.nodeName == 'IMG' || e.target.firstChild.nodeName == 'IMG') ) { + mouse = { + x: e.clientX, + y: e.clientY, + img_w: e.target.clientWidth, + img_h: e.target.clientHeight + }; + + if ( ed.dom.getAttrib(e.target, 'class').indexOf('mceItem') == -1 ) + ed.plugins.wordpress._showButtons(e.target, 'wp_editbtns'); } }); diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js index ece134b1c7..4892663091 100644 --- a/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js @@ -1 +1 @@ -(function(){tinymce.create("tinymce.plugins.wpEditImage",{init:function(a,b){var c=this;c.url=b;c._createButtons();a.addCommand("WP_EditImage",function(){var h=a.selection.getNode(),f=tinymce.DOM.getViewPort(),g=f.h,d=(720)?\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\](?:<\/p>)?[\s\u00a0]*/g,function(g,d,k){var j,f,e,h,i;d=d.replace(/\\'|\\'|\\'/g,"'").replace(/\\"|\\"/g,""");k=k.replace(/\\'|\\'/g,"'").replace(/\\"/g,""");j=d.match(/id=['"]([^'"]+)/i);f=d.match(/align=['"]([^'"]+)/i);e=d.match(/width=['"]([0-9]+)/);h=d.match(/caption=['"]([^'"]+)/i);j=(j&&j[1])?j[1]:"";f=(f&&f[1])?f[1]:"alignnone";e=(e&&e[1])?e[1]:"";h=(h&&h[1])?h[1]:"";if(!e||!h){return k}i=(f=="aligncenter")?"mceTemp mceIEcenter":"mceTemp";return'
'+k+'
'+h+"
"})},_get_shcode:function(a){return a.replace(/
\s*]+)>\s*]+>([\s\S]+?)<\/dt>\s*]+>(.+?)<\/dd>\s*<\/dl>\s*<\/div>\s*/gi,function(g,d,j,h){var i,f,e;i=d.match(/id=['"]([^'"]+)/i);f=d.match(/class=['"]([^'"]+)/i);e=j.match(/width=['"]([0-9]+)/);i=(i&&i[1])?i[1]:"";f=(f&&f[1])?f[1]:"alignnone";e=(e&&e[1])?e[1]:"";if(!e||!h){return j}f=f.match(/align[^ '"]+/)||"alignnone";h=h.replace(/<\S[^<>]*>/gi,"").replace(/'/g,"'").replace(/"/g,""");return'[caption id="'+i+'" align="'+f+'" width="'+e+'" caption="'+h+'"]'+j+"[/caption]"})},_createButtons:function(){var b=this,a=tinyMCE.activeEditor,d=tinymce.DOM,e,c;d.remove("wp_editbtns");d.add(document.body,"div",{id:"wp_editbtns",style:"display:none;"});e=d.add("wp_editbtns","img",{src:b.url+"/img/image.png",id:"wp_editimgbtn",width:"24",height:"24",title:a.getLang("wpeditimage.edit_img")});tinymce.dom.Event.add(e,"mousedown",function(g){var f=tinyMCE.activeEditor;f.windowManager.bookmark=f.selection.getBookmark("simple");f.execCommand("WP_EditImage")});c=d.add("wp_editbtns","img",{src:b.url+"/img/delete.png",id:"wp_delimgbtn",width:"24",height:"24",title:a.getLang("wpeditimage.del_img")});tinymce.dom.Event.add(c,"mousedown",function(i){var f=tinyMCE.activeEditor,g=f.selection.getNode(),h;if(g.nodeName=="IMG"&&f.dom.getAttrib(g,"class").indexOf("mceItem")==-1){if((h=f.dom.getParent(g,"div"))&&f.dom.hasClass(h,"mceTemp")){f.dom.remove(h)}else{if((h=f.dom.getParent(g,"A"))&&h.childNodes.length==1){f.dom.remove(h)}else{f.dom.remove(g)}}f.execCommand("mceRepaint");return false}})},getInfo:function(){return{longname:"Edit Image",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("wpeditimage",tinymce.plugins.wpEditImage)})(); \ No newline at end of file +(function(){tinymce.create("tinymce.plugins.wpEditImage",{init:function(a,c){var d=this,b={};d.url=c;d._createButtons();a.addCommand("WP_EditImage",function(){var i=a.selection.getNode(),g=tinymce.DOM.getViewPort(),h=g.h,e=(720)?\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\](?:<\/p>)?[\s\u00a0]*/g,function(g,d,k){var j,f,e,h,i;d=d.replace(/\\'|\\'|\\'/g,"'").replace(/\\"|\\"/g,""");k=k.replace(/\\'|\\'/g,"'").replace(/\\"/g,""");j=d.match(/id=['"]([^'"]+)/i);f=d.match(/align=['"]([^'"]+)/i);e=d.match(/width=['"]([0-9]+)/);h=d.match(/caption=['"]([^'"]+)/i);j=(j&&j[1])?j[1]:"";f=(f&&f[1])?f[1]:"alignnone";e=(e&&e[1])?e[1]:"";h=(h&&h[1])?h[1]:"";if(!e||!h){return k}i=(f=="aligncenter")?"mceTemp mceIEcenter":"mceTemp";return'
'+k+'
'+h+"
"})},_get_shcode:function(a){return a.replace(/
\s*]+)>\s*]+>([\s\S]+?)<\/dt>\s*]+>(.+?)<\/dd>\s*<\/dl>\s*<\/div>\s*/gi,function(g,d,j,h){var i,f,e;i=d.match(/id=['"]([^'"]+)/i);f=d.match(/class=['"]([^'"]+)/i);e=j.match(/width=['"]([0-9]+)/);i=(i&&i[1])?i[1]:"";f=(f&&f[1])?f[1]:"alignnone";e=(e&&e[1])?e[1]:"";if(!e||!h){return j}f=f.match(/align[^ '"]+/)||"alignnone";h=h.replace(/<\S[^<>]*>/gi,"").replace(/'/g,"'").replace(/"/g,""");return'[caption id="'+i+'" align="'+f+'" width="'+e+'" caption="'+h+'"]'+j+"[/caption]"})},_createButtons:function(){var b=this,a=tinyMCE.activeEditor,d=tinymce.DOM,e,c;d.remove("wp_editbtns");d.add(document.body,"div",{id:"wp_editbtns",style:"display:none;"});e=d.add("wp_editbtns","img",{src:b.url+"/img/image.png",id:"wp_editimgbtn",width:"24",height:"24",title:a.getLang("wpeditimage.edit_img")});tinymce.dom.Event.add(e,"mousedown",function(g){var f=tinyMCE.activeEditor;f.windowManager.bookmark=f.selection.getBookmark("simple");f.execCommand("WP_EditImage")});c=d.add("wp_editbtns","img",{src:b.url+"/img/delete.png",id:"wp_delimgbtn",width:"24",height:"24",title:a.getLang("wpeditimage.del_img")});tinymce.dom.Event.add(c,"mousedown",function(i){var f=tinyMCE.activeEditor,g=f.selection.getNode(),h;if(g.nodeName=="IMG"&&f.dom.getAttrib(g,"class").indexOf("mceItem")==-1){if((h=f.dom.getParent(g,"div"))&&f.dom.hasClass(h,"mceTemp")){f.dom.remove(h)}else{if((h=f.dom.getParent(g,"A"))&&h.childNodes.length==1){f.dom.remove(h)}else{f.dom.remove(g)}}f.execCommand("mceRepaint");return false}})},getInfo:function(){return{longname:"Edit Image",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("wpeditimage",tinymce.plugins.wpEditImage)})(); \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.dev.js b/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.dev.js index 1acf9f046d..2d7e38e49a 100644 --- a/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.dev.js +++ b/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.dev.js @@ -374,6 +374,9 @@ wpImage = { tinyMCEPopup.execCommand("mceBeginUndoLevel"); + if ( f.width.value != el.width || f.height.value != el.height ) + img_class = img_class.replace(/size-[^ "']+/, ''); + ed.dom.setAttribs(el, { src : f.img_src.value, title : f.img_title.value, diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js b/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js index 0a801bd550..ef628ed102 100644 --- a/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js +++ b/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js @@ -1 +1 @@ -var tinymce=null,tinyMCEPopup,tinyMCE,wpImage;tinyMCEPopup={init:function(){var d=this,b,a,f,c,e;a=(""+document.location.search).replace(/^\?/,"").split("&");f={};for(c=0;c')}}},I:function(a){return document.getElementById(a)},current:"",link:"",link_rel:"",target_value:"",current_size_sel:"s100",width:"",height:"",align:"",img_alt:"",setTabs:function(b){var a=this;if("current"==b.className){return false}a.I("div_advanced").style.display=("tab_advanced"==b.id)?"block":"none";a.I("div_basic").style.display=("tab_basic"==b.id)?"block":"none";a.I("tab_basic").className=a.I("tab_advanced").className="";b.className="current";return false},img_seturl:function(b){var c=this,a=c.I("link_rel").value;if("current"==b){c.I("link_href").value=c.current;c.I("link_rel").value=c.link_rel}else{c.I("link_href").value=c.link;if(a){a=a.replace(/attachment|wp-att-[0-9]+/gi,"");c.I("link_rel").value=tinymce.trim(a)}}},imgAlignCls:function(b){var c=this,a=c.I("img_classes").value;c.I("img_demo").className=c.align=b;a=a.replace(/align[^ "']+/gi,"");a+=(" "+b);a=a.replace(/\s+/g," ").replace(/^\s/,"");if("aligncenter"==b){c.I("hspace").value="";c.updateStyle("hspace")}c.I("img_classes").value=a},showSize:function(e){var c=this,f=c.I("img_demo"),a=c.width,d=c.height,g=e.id||"s100",b;b=parseInt(g.substring(1))/200;f.width=Math.round(a*b);f.height=Math.round(d*b);c.showSizeClear();e.style.borderColor="#A3A3A3";e.style.backgroundColor="#E5E5E5"},showSizeSet:function(){var b=this,d,c,a;if((b.width*1.3)>parseInt(b.preloadImg.width)){d=b.I("s130"),c=b.I("s120"),a=b.I("s110");d.onclick=c.onclick=a.onclick=null;d.onmouseover=c.onmouseover=a.onmouseover=null;d.style.color=c.style.color=a.style.color="#aaa"}},showSizeRem:function(){var a=this,c=a.I("img_demo"),b=document.forms[0];c.width=Math.round(b.width.value*0.5);c.height=Math.round(b.height.value*0.5);a.showSizeClear();a.I(a.current_size_sel).style.borderColor="#A3A3A3";a.I(a.current_size_sel).style.backgroundColor="#E5E5E5";return false},showSizeClear:function(){var b=this.I("img_size").getElementsByTagName("div"),a;for(a=0;a]+>/i);l=l+g.dom.getOuterHTML(e)+""}}else{l=g.dom.getOuterHTML(e)}l='
'+l+'
'+v.img_cap.value+"
";j=g.dom.create("div",{"class":z},l);if(h){h.parentNode.insertBefore(j,h);if(h.childNodes.length==1){g.dom.remove(h)}else{if(w&&w.childNodes.length==1){g.dom.remove(w)}else{g.dom.remove(e)}}}else{if(c=g.dom.getParent(e,"TD,TH,LI")){c.appendChild(j);if(w&&w.childNodes.length==1){g.dom.remove(w)}else{g.dom.remove(e)}}}}}else{if(n&&r){if(v.link_href.value&&(y=g.dom.getParent(e,"a"))){l=g.dom.getOuterHTML(y)}else{l=g.dom.getOuterHTML(e)}h=g.dom.create("p",{},l);r.parentNode.insertBefore(h,r);g.dom.remove(r)}}if(v.img_classes.value.indexOf("aligncenter")!=-1){if(h&&(!h.style||h.style.textAlign!="center")){g.dom.setStyle(h,"textAlign","center")}}else{if(h&&h.style&&h.style.textAlign=="center"){g.dom.setStyle(h,"textAlign","")}}if(!v.link_href.value&&p){x=g.selection.getBookmark();g.dom.remove(p,1);g.selection.moveToBookmark(x)}tinyMCEPopup.execCommand("mceEndUndoLevel");g.execCommand("mceRepaint");tinyMCEPopup.close()},updateStyle:function(a){var e=tinyMCEPopup.dom,c,d=document.forms[0],b=e.create("img",{style:d.img_style.value});if(tinyMCEPopup.editor.settings.inline_styles){if(a=="align"){e.setStyle(b,"float","");e.setStyle(b,"vertical-align","");c=d.align.value;if(c){if(c=="left"||c=="right"){e.setStyle(b,"float",c)}else{b.style.verticalAlign=c}}}if(a=="border"){e.setStyle(b,"border","");c=d.border.value;if(c||c=="0"){if(c=="0"){b.style.border="0"}else{b.style.border=c+"px solid black"}}}if(a=="hspace"){e.setStyle(b,"marginLeft","");e.setStyle(b,"marginRight","");c=d.hspace.value;if(c){b.style.marginLeft=c+"px";b.style.marginRight=c+"px"}}if(a=="vspace"){e.setStyle(b,"marginTop","");e.setStyle(b,"marginBottom","");c=d.vspace.value;if(c){b.style.marginTop=c+"px";b.style.marginBottom=c+"px"}}d.img_style.value=e.serializeStyle(e.parseStyle(b.style.cssText));this.demoSetStyle()}},checkVal:function(a){if(a.value==""){if(a.id=="img_src"){a.value=this.I("img_demo").src||this.preloadImg.src}}},resetImageData:function(){var a=document.forms[0];a.width.value=a.height.value=""},updateImageData:function(){var d=document.forms[0],b=wpImage,a=d.width.value,c=d.height.value;if(!a&&c){a=d.width.value=b.width=Math.round(b.preloadImg.width/(b.preloadImg.height/c))}else{if(a&&!c){c=d.height.value=b.height=Math.round(b.preloadImg.height/(b.preloadImg.width/a))}}if(!a){d.width.value=b.width=b.preloadImg.width}if(!c){d.height.value=b.height=b.preloadImg.height}b.showSizeSet();b.demoSetSize();if(d.img_style.value){b.demoSetStyle()}},getImageData:function(){var a=wpImage,b=document.forms[0];a.preloadImg=new Image();a.preloadImg.onload=a.updateImageData;a.preloadImg.onerror=a.resetImageData;a.preloadImg.src=tinyMCEPopup.editor.documentBaseURI.toAbsolute(b.img_src.value)}};window.onload=function(){wpImage.init()};wpImage.preInit(); \ No newline at end of file +var tinymce=null,tinyMCEPopup,tinyMCE,wpImage;tinyMCEPopup={init:function(){var d=this,b,a,f,c,e;a=(""+document.location.search).replace(/^\?/,"").split("&");f={};for(c=0;c')}}},I:function(a){return document.getElementById(a)},current:"",link:"",link_rel:"",target_value:"",current_size_sel:"s100",width:"",height:"",align:"",img_alt:"",setTabs:function(b){var a=this;if("current"==b.className){return false}a.I("div_advanced").style.display=("tab_advanced"==b.id)?"block":"none";a.I("div_basic").style.display=("tab_basic"==b.id)?"block":"none";a.I("tab_basic").className=a.I("tab_advanced").className="";b.className="current";return false},img_seturl:function(b){var c=this,a=c.I("link_rel").value;if("current"==b){c.I("link_href").value=c.current;c.I("link_rel").value=c.link_rel}else{c.I("link_href").value=c.link;if(a){a=a.replace(/attachment|wp-att-[0-9]+/gi,"");c.I("link_rel").value=tinymce.trim(a)}}},imgAlignCls:function(b){var c=this,a=c.I("img_classes").value;c.I("img_demo").className=c.align=b;a=a.replace(/align[^ "']+/gi,"");a+=(" "+b);a=a.replace(/\s+/g," ").replace(/^\s/,"");if("aligncenter"==b){c.I("hspace").value="";c.updateStyle("hspace")}c.I("img_classes").value=a},showSize:function(e){var c=this,f=c.I("img_demo"),a=c.width,d=c.height,g=e.id||"s100",b;b=parseInt(g.substring(1))/200;f.width=Math.round(a*b);f.height=Math.round(d*b);c.showSizeClear();e.style.borderColor="#A3A3A3";e.style.backgroundColor="#E5E5E5"},showSizeSet:function(){var b=this,d,c,a;if((b.width*1.3)>parseInt(b.preloadImg.width)){d=b.I("s130"),c=b.I("s120"),a=b.I("s110");d.onclick=c.onclick=a.onclick=null;d.onmouseover=c.onmouseover=a.onmouseover=null;d.style.color=c.style.color=a.style.color="#aaa"}},showSizeRem:function(){var a=this,c=a.I("img_demo"),b=document.forms[0];c.width=Math.round(b.width.value*0.5);c.height=Math.round(b.height.value*0.5);a.showSizeClear();a.I(a.current_size_sel).style.borderColor="#A3A3A3";a.I(a.current_size_sel).style.backgroundColor="#E5E5E5";return false},showSizeClear:function(){var b=this.I("img_size").getElementsByTagName("div"),a;for(a=0;a]+>/i);l=l+g.dom.getOuterHTML(e)+""}}else{l=g.dom.getOuterHTML(e)}l='
'+l+'
'+v.img_cap.value+"
";j=g.dom.create("div",{"class":z},l);if(h){h.parentNode.insertBefore(j,h);if(h.childNodes.length==1){g.dom.remove(h)}else{if(w&&w.childNodes.length==1){g.dom.remove(w)}else{g.dom.remove(e)}}}else{if(c=g.dom.getParent(e,"TD,TH,LI")){c.appendChild(j);if(w&&w.childNodes.length==1){g.dom.remove(w)}else{g.dom.remove(e)}}}}}else{if(n&&r){if(v.link_href.value&&(y=g.dom.getParent(e,"a"))){l=g.dom.getOuterHTML(y)}else{l=g.dom.getOuterHTML(e)}h=g.dom.create("p",{},l);r.parentNode.insertBefore(h,r);g.dom.remove(r)}}if(v.img_classes.value.indexOf("aligncenter")!=-1){if(h&&(!h.style||h.style.textAlign!="center")){g.dom.setStyle(h,"textAlign","center")}}else{if(h&&h.style&&h.style.textAlign=="center"){g.dom.setStyle(h,"textAlign","")}}if(!v.link_href.value&&p){x=g.selection.getBookmark();g.dom.remove(p,1);g.selection.moveToBookmark(x)}tinyMCEPopup.execCommand("mceEndUndoLevel");g.execCommand("mceRepaint");tinyMCEPopup.close()},updateStyle:function(a){var e=tinyMCEPopup.dom,c,d=document.forms[0],b=e.create("img",{style:d.img_style.value});if(tinyMCEPopup.editor.settings.inline_styles){if(a=="align"){e.setStyle(b,"float","");e.setStyle(b,"vertical-align","");c=d.align.value;if(c){if(c=="left"||c=="right"){e.setStyle(b,"float",c)}else{b.style.verticalAlign=c}}}if(a=="border"){e.setStyle(b,"border","");c=d.border.value;if(c||c=="0"){if(c=="0"){b.style.border="0"}else{b.style.border=c+"px solid black"}}}if(a=="hspace"){e.setStyle(b,"marginLeft","");e.setStyle(b,"marginRight","");c=d.hspace.value;if(c){b.style.marginLeft=c+"px";b.style.marginRight=c+"px"}}if(a=="vspace"){e.setStyle(b,"marginTop","");e.setStyle(b,"marginBottom","");c=d.vspace.value;if(c){b.style.marginTop=c+"px";b.style.marginBottom=c+"px"}}d.img_style.value=e.serializeStyle(e.parseStyle(b.style.cssText));this.demoSetStyle()}},checkVal:function(a){if(a.value==""){if(a.id=="img_src"){a.value=this.I("img_demo").src||this.preloadImg.src}}},resetImageData:function(){var a=document.forms[0];a.width.value=a.height.value=""},updateImageData:function(){var d=document.forms[0],b=wpImage,a=d.width.value,c=d.height.value;if(!a&&c){a=d.width.value=b.width=Math.round(b.preloadImg.width/(b.preloadImg.height/c))}else{if(a&&!c){c=d.height.value=b.height=Math.round(b.preloadImg.height/(b.preloadImg.width/a))}}if(!a){d.width.value=b.width=b.preloadImg.width}if(!c){d.height.value=b.height=b.preloadImg.height}b.showSizeSet();b.demoSetSize();if(d.img_style.value){b.demoSetStyle()}},getImageData:function(){var a=wpImage,b=document.forms[0];a.preloadImg=new Image();a.preloadImg.onload=a.updateImageData;a.preloadImg.onerror=a.resetImageData;a.preloadImg.src=tinyMCEPopup.editor.documentBaseURI.toAbsolute(b.img_src.value)}};window.onload=function(){wpImage.init()};wpImage.preInit(); \ No newline at end of file diff --git a/wp-includes/js/tinymce/wp-tinymce.js.gz b/wp-includes/js/tinymce/wp-tinymce.js.gz index d81c88c6b85d99f550f0a08a4e227b3091438bec..1b6c8ace22355f44ee83f5ba6e34b0c882fd5069 100644 GIT binary patch delta 6938 zcmV+#8|CEm>jlQ_1qUCC2ndT^b%6)92LW+ge@TrZ3jdXLv|NzhU5GbivgK_okEpTK z%0>zp1_owwBhWV6$pjT4k2$z$*hL(|aJY zu;gmVQTN1~5CnsjvL*br6OzSKe?mk;m_Cc=N#Js6fJ6?g_qE)VWitAoqZ>xlxVoJqSsb^?86>&V-TZ&@CnzPna-_joIFjFq82DOHWC{_vu)8tE~-lA8J}v1W{$ z7B^mojc1-V4i#FAUmIt7_a*q*zeH(~i+Ma%N7LN1tDIW9O6=CzDa0B`fRLume=?AS zG!mu-;}|trpF`P!`r_XK)LvmVzF$5hIRGKG>QJ1peS$r%(&}T)2COE3T{!-$Daz-A zY;!w;GIQSbbkbb20S@Ms-u9XQwx4U9NS$NzX-VH=-1Ga(JIcQMYr4O_p4_hY2$^0F4U&l<}_A32*1@5r{K1O+KuC^o|4o0 zL{Q1YdzaW-XdtRZ3{{kQu;ppddNR(s_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