<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[12085] trunk/wp-includes: TinyMCE in Firefox:
fix crash when dragging images with caption,
drag the image together with the caption (only in Firefox 3.5+)</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12085">12085</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2009-10-22 05:30:29 +0000 (Thu, 22 Oct 2009)</dd>
</dl>
<h3>Log Message</h3>
<pre>TinyMCE in Firefox: fix crash when dragging images with caption, drag the image together with the caption (only in Firefox 3.5+)</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesjstinymcepluginswpeditimageeditor_plugindevjs">trunk/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.dev.js</a></li>
<li><a href="#trunkwpincludesjstinymcepluginswpeditimageeditor_pluginjs">trunk/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js</a></li>
<li><a href="#trunkwpincludesversionphp">trunk/wp-includes/version.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesjstinymcepluginswpeditimageeditor_plugindevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.dev.js (12084 => 12085)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.dev.js        2009-10-21 21:57:27 UTC (rev 12084)
+++ trunk/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.dev.js        2009-10-22 05:30:29 UTC (rev 12085)
</span><span class="lines">@@ -40,6 +40,13 @@
</span><span class="cx">                                 tinymce.dom.Event.add(ed.getWin(), 'scroll', function(e) {
</span><span class="cx">                                         ed.plugins.wpeditimage.hideButtons();
</span><span class="cx">                                 });
</span><ins>+
+                                tinymce.dom.Event.add(ed.getBody(), 'dragstart', function(e) {
+                                        ed.plugins.wpeditimage.hideButtons();
+
+                                        if ( !tinymce.isGecko && e.target.nodeName == 'IMG' && ed.dom.getParent(e.target, 'dl.wp-caption') )
+                                                return tinymce.dom.Event.cancel(e);
+                                });
</ins><span class="cx">                         });
</span><span class="cx">
</span><span class="cx">                         ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) {
</span><span class="lines">@@ -51,33 +58,32 @@
</span><span class="cx">                         });
</span><span class="cx">
</span><span class="cx">                         ed.onMouseUp.add(function(ed, e) {
</span><del>-                                var n, DL;
-                                
-                                if ( tinymce.isOpera ) {
-                                        if ( e.target.nodeName == 'IMG' )
-                                                ed.plugins.wpeditimage.showButtons(e.target);
-                                } else if ( ! tinymce.isWebKit ) {
-                                        n = ed.selection.getNode();
-                                        
-                                        if ( n.nodeName == 'IMG' && (DL = ed.dom.getParent(n, 'DL')) ) {                                        
-                                                window.setTimeout(function(){
-                                                        var ed = tinyMCE.activeEditor, n = ed.selection.getNode(), DL = ed.dom.getParent(n, 'DL');
-                                                
-                                                        if ( n.width != (parseInt(ed.dom.getStyle(DL, 'width')) - 10) ) {
-                                                                ed.dom.setStyle(DL, 'width', parseInt(n.width)+10);
-                                                                ed.execCommand('mceRepaint');
-                                                        }
-                                                }, 100);
-                                        }
</del><ins>+                                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 = ed.dom.getParent(n, 'dl.wp-caption');
+
+                                                if ( DL && n.width != ( parseInt(ed.dom.getStyle(DL, 'width'), 10) - 10 ) ) {
+                                                        ed.dom.setStyle(DL, 'width', parseInt(n.width, 10) + 10);
+                                                        ed.execCommand('mceRepaint');
+                                                }
+                                        }, 100);
</ins><span class="cx">                                 }
</span><span class="cx">                         });
</span><span class="cx">
</span><span class="cx">                         ed.onMouseDown.add(function(ed, e) {
</span><del>-                                if ( tinymce.isOpera || e.target.nodeName != 'IMG' ) {
</del><ins>+                                var p;
+
+                                if ( e.target.nodeName != 'IMG' ) {
</ins><span class="cx">                                         t.hideButtons();
</span><span class="cx">                                         return;
</span><span class="cx">                                 }
</span><span class="cx">                                 ed.plugins.wpeditimage.showButtons(e.target);
</span><ins>+
+                                if ( tinymce.isGecko && (p = ed.dom.getParent(e.target, 'dl.wp-caption')) && ed.dom.hasClass(p.parentNode, 'mceTemp') )
+                                        ed.selection.select(p.parentNode);
</ins><span class="cx">                         });
</span><span class="cx">
</span><span class="cx">                         ed.onKeyPress.add(function(ed, e) {
</span><span class="lines">@@ -124,7 +130,7 @@
</span><span class="cx">                                 
</span><span class="cx">                                 div_cls = (cls == 'aligncenter') ? 'mceTemp mceIEcenter' : 'mceTemp';
</span><span class="cx">
</span><del>-                                return '<div class="'+div_cls+'"><dl id="'+id+'" class="wp-caption '+cls+'" style="width: '+(10+parseInt(w))+
</del><ins>+                                return '<div class="'+div_cls+'" draggable><dl id="'+id+'" class="wp-caption '+cls+'" style="width: '+(10+parseInt(w))+
</ins><span class="cx">                                 'px"><dt class="wp-caption-dt">'+c+'</dt><dd class="wp-caption-dd">'+cap+'</dd></dl></div>';
</span><span class="cx">                         });
</span><span class="cx">                 },
</span><span class="lines">@@ -196,12 +202,10 @@
</span><span class="cx">                                 title : ed.getLang('wpeditimage.edit_img')
</span><span class="cx">                         });
</span><span class="cx">
</span><del>-                        wp_editimgbtn.onmousedown = function(e) {
-                                var ed = tinyMCE.activeEditor;
</del><ins>+                        tinymce.dom.Event.add(wp_editimgbtn, 'mousedown', function(e) {
</ins><span class="cx">                                 ed.windowManager.bookmark = ed.selection.getBookmark('simple');
</span><span class="cx">                                 ed.execCommand("WP_EditImage");
</span><del>-                                this.parentNode.style.display = 'none';
-                        };
</del><ins>+                        });
</ins><span class="cx">
</span><span class="cx">                         wp_delimgbtn = DOM.add('wp_editbtns', 'img', {
</span><span class="cx">                                 src : t.url+'/img/delete.png',
</span><span class="lines">@@ -211,7 +215,7 @@
</span><span class="cx">                                 title : ed.getLang('wpeditimage.del_img')
</span><span class="cx">                         });
</span><span class="cx">
</span><del>-                        wp_delimgbtn.onmousedown = function(e) {
</del><ins>+                        tinymce.dom.Event.add(wp_delimgbtn, 'mousedown', function(e) {
</ins><span class="cx">                                 var ed = tinyMCE.activeEditor, el = ed.selection.getNode(), p;
</span><span class="cx">
</span><span class="cx">                                 if ( el.nodeName == 'IMG' && ed.dom.getAttrib(el, 'class').indexOf('mceItem') == -1 ) {
</span><span class="lines">@@ -219,13 +223,13 @@
</span><span class="cx">                                                 ed.dom.remove(p);
</span><span class="cx">                                         else if ( (p = ed.dom.getParent(el, 'A')) && p.childNodes.length == 1 )
</span><span class="cx">                                                 ed.dom.remove(p);
</span><del>-                                        else ed.dom.remove(el);
</del><ins>+                                        else
+                                                ed.dom.remove(el);
</ins><span class="cx">
</span><del>-                                        this.parentNode.style.display = 'none';
</del><span class="cx">                                         ed.execCommand('mceRepaint');
</span><span class="cx">                                         return false;
</span><span class="cx">                                 }
</span><del>-                        };
</del><ins>+                        });
</ins><span class="cx">                 },
</span><span class="cx">
</span><span class="cx">                 getInfo : function() {
</span></span></pre></div>
<a id="trunkwpincludesjstinymcepluginswpeditimageeditor_pluginjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js (12084 => 12085)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js        2009-10-21 21:57:27 UTC (rev 12084)
+++ trunk/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js        2009-10-22 05:30:29 UTC (rev 12085)
</span><span class="lines">@@ -1 +1 @@
</span><del>-(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<f.w)?720:f.w,e=a.dom.getAttrib(h,"class");if(e.indexOf("mceItem")!=-1||e.indexOf("wpGallery")!=-1||h.nodeName!="IMG"){return}tb_show("",b+"/editimage.html?ver=321&TB_iframe=true");tinymce.DOM.setStyles("TB_window",{width:(d-50)+"px",height:(g-45)+"px","margin-left":"-"+parseInt(((d-50)/2),10)+"px"});if(!tinymce.isIE6){tinymce.DOM.setStyles("TB_window",{top:"20px",marginTop:"0"})}tinymce.DOM.setStyles("TB_iframeContent",{width:(d-50)+"px",height:(g-75)+"px"});tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")});a.onInit.add(function(d){tinymce.dom.Event.add(d.getWin(),"scroll",function(f){d.plugins.wpeditimage.hideButtons()})});a.onBeforeExecCommand.add(function(d,f,e,g){d.plugins.wpeditimage.hideButtons()});a.onSaveContent.add(function(d,e){d.plugins.wpeditimage.hideButtons()});a.onMouseUp.add(function(d,g){var h,f;if(tinymce.isOpera){if(g.target.nodeName=="IMG"){d.plugins.wpeditimage.showButtons(g.target)}}else{if(!tinymce.isWebKit){h=d.selection.getNode();if(h.nodeName=="IMG"&&(f=d.dom.getParent(h,"DL"))){window.setTimeout(function(){var e=tinyMCE.activeEditor,j=e.selection.getNode(),i=e.dom.getParent(j,"DL");if(j.width!=(parseInt(e.dom.getStyle(i,"width"))-10)){e.dom.setStyle(i,"width",parseInt(j.width)+10);e.execCommand("mceRepaint")}},100)}}}});a.onMouseDown.add(function(d,f){if(tinymce.isOpera||f.target.nodeName!="IMG"){c.hideButtons();return}d.plugins.wpeditimage.showButtons(f.target)});a.onKeyPress.add(function(d,i){var f,h,g;if(i.keyCode==13&&(f=d.dom.getParent(d.selection.getNode(),"DL"))){g=d.dom.create("p",{},"&nbsp;");if((h=f.parentNode)&&h.nodeName=="DIV"){d.dom.insertAfter(g,h)}else{d.dom.insertAfter(g,f)}tinymce.dom.Event.cancel(i);d.selection.select(g);return false}});a.onBeforeSetContent.add(function(d,e){e.content=c._do_shcode(e.content)});a.onPostProcess.add(function(d,e){if(e.get){e.content=c._get_shcode(e.content)}})},_do_shcode:function(a){return a.replace(/\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\][\s\u00a0]*/g,function(g,d,k){var j,f,e,h,i;d=d.replace(/\\'|\\&#39;|\\&#039;/g,"&#39;").replace(/\\"|\\&quot;/g,"&quot;");k=k.replace(/\\&#39;|\\&#039;/g,"&#39;").replace(/\\&quot;/g,"&quot;");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'<div class="'+i+'"><dl id="'+j+'" class="wp-caption '+f+'" style="width: '+(10+parseInt(e))+'px"><dt class="wp-caption-dt">'+k+'</dt><dd class="wp-caption-dd">'+h+"</dd></dl></div>"})},_get_shcode:function(a){return a.replace(/<div class="mceTemp[^"]*">\s*<dl([^>]+)>\s*<dt[^>]+>([\s\S]+?)<\/dt>\s*<dd[^>]+>(.+?)<\/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,"&#39;").replace(/"/g,"&quot;");return'[caption id="'+i+'" align="'+f+'" width="'+e+'" caption="'+h+'"]'+j+"[/caption]"})},showButtons:function(d){var j=this,e=tinyMCE.activeEditor,g,f,a,i=tinymce.DOM,c,b,h=e.dom.getAttrib(d,"class");if(h.indexOf("mceItem")!=-1||h.indexOf("wpGallery")!=-1){return}a=e.dom.getViewPort(e.getWin());g=i.getPos(e.getContentAreaContainer());f=e.dom.getPos(d);c=Math.max(f.x-a.x,0)+g.x;b=Math.max(f.y-a.y,0)+g.y;i.setStyles("wp_editbtns",{top:b+5+"px",left:c+5+"px",display:"block"});j.btnsTout=window.setTimeout(function(){e.plugins.wpeditimage.hideButtons()},5000)},hideButtons:function(){if(tinymce.DOM.isHidden("wp_editbtns")){return}tinymce.DOM.hide("wp_editbtns");window.clearTimeout(this.btnsTout)},_createButtons:function(){var d=this,b=tinyMCE.activeEditor,e=tinymce.DOM,a,c,f;e.remove("wp_editbtns");a=e.add(document.body,"div",{id:"wp_editbtns",style:"display:none;"});c=e.add("wp_editbtns","img",{src:d.url+"/img/image.png",id:"wp_editimgbtn",width:"24",height:"24",title:b.getLang("wpeditimage.edit_img")});c.onmousedown=function(h){var g=tinyMCE.activeEditor;g.windowManager.bookmark=g.selection.getBookmark("simple");g.execCommand("WP_EditImage");this.parentNode.style.display="none"};f=e.add("wp_editbtns","img",{src:d.url+"/img/delete.png",id:"wp_delimgbtn",width:"24",height:"24",title:b.getLang("wpeditimage.del_img")});f.onmousedown=function(j){var g=tinyMCE.activeEditor,h=g.selection.getNode(),i;if(h.nodeName=="IMG"&&g.dom.getAttrib(h,"class").indexOf("mceItem")==-1){if((i=g.dom.getParent(h,"div"))&&g.dom.hasClass(i,"mceTemp")){g.dom.remove(i)}else{if((i=g.dom.getParent(h,"A"))&&i.childNodes.length==1){g.dom.remove(i)}else{g.dom.remove(h)}}this.parentNode.style.display="none";g.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)})();
</del><span class="cx">\ No newline at end of file
</span><ins>+(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<f.w)?720:f.w,e=a.dom.getAttrib(h,"class");if(e.indexOf("mceItem")!=-1||e.indexOf("wpGallery")!=-1||h.nodeName!="IMG"){return}tb_show("",b+"/editimage.html?ver=321&TB_iframe=true");tinymce.DOM.setStyles("TB_window",{width:(d-50)+"px",height:(g-45)+"px","margin-left":"-"+parseInt(((d-50)/2),10)+"px"});if(!tinymce.isIE6){tinymce.DOM.setStyles("TB_window",{top:"20px",marginTop:"0"})}tinymce.DOM.setStyles("TB_iframeContent",{width:(d-50)+"px",height:(g-75)+"px"});tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")});a.onInit.add(function(d){tinymce.dom.Event.add(d.getWin(),"scroll",function(f){d.plugins.wpeditimage.hideButtons()});tinymce.dom.Event.add(d.getBody(),"dragstart",function(f){d.plugins.wpeditimage.hideButtons();if(!tinymce.isGecko&&f.target.nodeName=="IMG"&&d.dom.getParent(f.target,"dl.wp-caption")){return tinymce.dom.Event.cancel(f)}})});a.onBeforeExecCommand.add(function(d,f,e,g){d.plugins.wpeditimage.hideButtons()});a.onSaveContent.add(function(d,e){d.plugins.wpeditimage.hideButtons()});a.onMouseUp.add(function(d,f){if(tinymce.isWebKit||tinymce.isOpera){return}if(d.dom.getParent(f.target,"div.mceTemp")||d.dom.is(f.target,"div.mceTemp")){window.setTimeout(function(){var e=tinyMCE.activeEditor,h=e.selection.getNode(),g=e.dom.getParent(h,"dl.wp-caption");if(g&&h.width!=(parseInt(e.dom.getStyle(g,"width"),10)-10)){e.dom.setStyle(g,"width",parseInt(h.width,10)+10);e.execCommand("mceRepaint")}},100)}});a.onMouseDown.add(function(d,g){var f;if(g.target.nodeName!="IMG"){c.hideButtons();return}d.plugins.wpeditimage.showButtons(g.target);if(tinymce.isGecko&&(f=d.dom.getParent(g.target,"dl.wp-caption"))&&d.dom.hasClass(f.parentNode,"mceTemp")){d.selection.select(f.parentNode)}});a.onKeyPress.add(function(d,i){var f,h,g;if(i.keyCode==13&&(f=d.dom.getParent(d.selection.getNode(),"DL"))){g=d.dom.create("p",{},"&nbsp;");if((h=f.parentNode)&&h.nodeName=="DIV"){d.dom.insertAfter(g,h)}else{d.dom.insertAfter(g,f)}tinymce.dom.Event.cancel(i);d.selection.select(g);return false}});a.onBeforeSetContent.add(function(d,e){e.content=c._do_shcode(e.content)});a.onPostProcess.add(function(d,e){if(e.get){e.content=c._get_shcode(e.content)}})},_do_shcode:function(a){return a.replace(/\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\][\s\u00a0]*/g,function(g,d,k){var j,f,e,h,i;d=d.replace(/\\'|\\&#39;|\\&#039;/g,"&#39;").replace(/\\"|\\&quot;/g,"&quot;");k=k.replace(/\\&#39;|\\&#039;/g,"&#39;").replace(/\\&quot;/g,"&quot;");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'<div class="'+i+'" draggable><dl id="'+j+'" class="wp-caption '+f+'" style="width: '+(10+parseInt(e))+'px"><dt class="wp-caption-dt">'+k+'</dt><dd class="wp-caption-dd">'+h+"</dd></dl></div>"})},_get_shcode:function(a){return a.replace(/<div class="mceTemp[^"]*">\s*<dl([^>]+)>\s*<dt[^>]+>([\s\S]+?)<\/dt>\s*<dd[^>]+>(.+?)<\/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,"&#39;").replace(/"/g,"&quot;");return'[caption id="'+i+'" align="'+f+'" width="'+e+'" caption="'+h+'"]'+j+"[/caption]"})},showButtons:function(d){var j=this,e=tinyMCE.activeEditor,g,f,a,i=tinymce.DOM,c,b,h=e.dom.getAttrib(d,"class");if(h.indexOf("mceItem")!=-1||h.indexOf("wpGallery")!=-1){return}a=e.dom.getViewPort(e.getWin());g=i.getPos(e.getContentAreaContainer());f=e.dom.getPos(d);c=Math.max(f.x-a.x,0)+g.x;b=Math.max(f.y-a.y,0)+g.y;i.setStyles("wp_editbtns",{top:b+5+"px",left:c+5+"px",display:"block"});j.btnsTout=window.setTimeout(function(){e.plugins.wpeditimage.hideButtons()},5000)},hideButtons:function(){if(tinymce.DOM.isHidden("wp_editbtns")){return}tinymce.DOM.hide("wp_editbtns");window.clearTimeout(this.btnsTout)},_createButtons:function(){var d=this,b=tinyMCE.activeEditor,e=tinymce.DOM,a,c,f;e.remove("wp_editbtns");a=e.add(document.body,"div",{id:"wp_editbtns",style:"display:none;"});c=e.add("wp_editbtns","img",{src:d.url+"/img/image.png",id:"wp_editimgbtn",width:"24",height:"24",title:b.getLang("wpeditimage.edit_img")});tinymce.dom.Event.add(c,"mousedown",function(g){b.windowManager.bookmark=b.selection.getBookmark("simple");b.execCommand("WP_EditImage")});f=e.add("wp_editbtns","img",{src:d.url+"/img/delete.png",id:"wp_delimgbtn",width:"24",height:"24",title:b.getLang("wpeditimage.del_img")});tinymce.dom.Event.add(f,"mousedown",function(j){var g=tinyMCE.activeEditor,h=g.selection.getNode(),i;if(h.nodeName=="IMG"&&g.dom.getAttrib(h,"class").indexOf("mceItem")==-1){if((i=g.dom.getParent(h,"div"))&&g.dom.hasClass(i,"mceTemp")){g.dom.remove(i)}else{if((i=g.dom.getParent(h,"A"))&&i.childNodes.length==1){g.dom.remove(i)}else{g.dom.remove(h)}}g.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)})();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesversionphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/version.php (12084 => 12085)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/version.php        2009-10-21 21:57:27 UTC (rev 12084)
+++ trunk/wp-includes/version.php        2009-10-22 05:30:29 UTC (rev 12085)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @global string $tinymce_version
</span><span class="cx"> */
</span><del>-$tinymce_version = '327-1235a';
</del><ins>+$tinymce_version = '327-1235';
</ins><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * Holds the cache manifest version
</span></span></pre>
</div>
</div>
</body>
</html>