<!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 &amp;&amp; e.target.nodeName == 'IMG' &amp;&amp; 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' &amp;&amp; (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 &amp;&amp; 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 &amp;&amp; (p = ed.dom.getParent(e.target, 'dl.wp-caption')) &amp;&amp; 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 '&lt;div class=&quot;'+div_cls+'&quot;&gt;&lt;dl id=&quot;'+id+'&quot; class=&quot;wp-caption '+cls+'&quot; style=&quot;width: '+(10+parseInt(w))+
</del><ins>+                                return '&lt;div class=&quot;'+div_cls+'&quot; draggable&gt;&lt;dl id=&quot;'+id+'&quot; class=&quot;wp-caption '+cls+'&quot; style=&quot;width: '+(10+parseInt(w))+
</ins><span class="cx">                                 'px&quot;&gt;&lt;dt class=&quot;wp-caption-dt&quot;&gt;'+c+'&lt;/dt&gt;&lt;dd class=&quot;wp-caption-dd&quot;&gt;'+cap+'&lt;/dd&gt;&lt;/dl&gt;&lt;/div&gt;';
</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(&quot;WP_EditImage&quot;);
</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' &amp;&amp; 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')) &amp;&amp; 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(&quot;tinymce.plugins.wpEditImage&quot;,{init:function(a,b){var c=this;c.url=b;c._createButtons();a.addCommand(&quot;WP_EditImage&quot;,function(){var h=a.selection.getNode(),f=tinymce.DOM.getViewPort(),g=f.h,d=(720&lt;f.w)?720:f.w,e=a.dom.getAttrib(h,&quot;class&quot;);if(e.indexOf(&quot;mceItem&quot;)!=-1||e.indexOf(&quot;wpGallery&quot;)!=-1||h.nodeName!=&quot;IMG&quot;){return}tb_show(&quot;&quot;,b+&quot;/editimage.html?ver=321&amp;TB_iframe=true&quot;);tinymce.DOM.setStyles(&quot;TB_window&quot;,{width:(d-50)+&quot;px&quot;,height:(g-45)+&quot;px&quot;,&quot;margin-left&quot;:&quot;-&quot;+parseInt(((d-50)/2),10)+&quot;px&quot;});if(!tinymce.isIE6){tinymce.DOM.setStyles(&quot;TB_window&quot;,{top:&quot;20px&quot;,marginTop:&quot;0&quot;})}tinymce.DOM.setStyles(&quot;TB_iframeContent&quot;,{width:(d-50)+&quot;px&quot;,height:(g-75)+&quot;px&quot;});tinymce.DOM.setStyle([&quot;TB_overlay&quot;,&quot;TB_window&quot;,&quot;TB_load&quot;],&quot;z-index&quot;,&quot;999999&quot;)});a.onInit.add(function(d){tinymce.dom.Event.add(d.getWin(),&quot;scroll&quot;,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==&quot;IMG&quot;){d.plugins.wpeditimage.showButtons(g.target)}}else{if(!tinymce.isWebKit){h=d.selection.getNode();if(h.nodeName==&quot;IMG&quot;&amp;&amp;(f=d.dom.getParent(h,&quot;DL&quot;))){window.setTimeout(function(){var e=tinyMCE.activeEditor,j=e.selection.getNode(),i=e.dom.getParent(j,&quot;DL&quot;);if(j.width!=(parseInt(e.dom.getStyle(i,&quot;width&quot;))-10)){e.dom.setStyle(i,&quot;width&quot;,parseInt(j.width)+10);e.execCommand(&quot;mceRepaint&quot;)}},100)}}}});a.onMouseDown.add(function(d,f){if(tinymce.isOpera||f.target.nodeName!=&quot;IMG&quot;){c.hideButtons();return}d.plugins.wpeditimage.showButtons(f.target)});a.onKeyPress.add(function(d,i){var f,h,g;if(i.keyCode==13&amp;&amp;(f=d.dom.getParent(d.selection.getNode(),&quot;DL&quot;))){g=d.dom.create(&quot;p&quot;,{},&quot;&amp;nbsp;&quot;);if((h=f.parentNode)&amp;&amp;h.nodeName==&quot;DIV&quot;){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(/\\'|\\&amp;#39;|\\&amp;#039;/g,&quot;&amp;#39;&quot;).replace(/\\&quot;|\\&amp;quot;/g,&quot;&amp;quot;&quot;);k=k.replace(/\\&amp;#39;|\\&amp;#039;/g,&quot;&amp;#39;&quot;).replace(/\\&amp;quot;/g,&quot;&amp;quot;&quot;);j=d.match(/id=['&quot;]([^'&quot;]+)/i);f=d.match(/align=['&quot;]([^'&quot;]+)/i);e=d.match(/width=['&quot;]([0-9]+)/);h=d.match(/caption=['&quot;]([^'&quot;]+)/i);j=(j&amp;&amp;j[1])?j[1]:&quot;&quot;;f=(f&amp;&amp;f[1])?f[1]:&quot;alignnone&quot;;e=(e&amp;&amp;e[1])?e[1]:&quot;&quot;;h=(h&amp;&amp;h[1])?h[1]:&quot;&quot;;if(!e||!h){return k}i=(f==&quot;aligncenter&quot;)?&quot;mceTemp mceIEcenter&quot;:&quot;mceTemp&quot;;return'&lt;div class=&quot;'+i+'&quot;&gt;&lt;dl id=&quot;'+j+'&quot; class=&quot;wp-caption '+f+'&quot; style=&quot;width: '+(10+parseInt(e))+'px&quot;&gt;&lt;dt class=&quot;wp-caption-dt&quot;&gt;'+k+'&lt;/dt&gt;&lt;dd class=&quot;wp-caption-dd&quot;&gt;'+h+&quot;&lt;/dd&gt;&lt;/dl&gt;&lt;/div&gt;&quot;})},_get_shcode:function(a){return a.replace(/&lt;div class=&quot;mceTemp[^&quot;]*&quot;&gt;\s*&lt;dl([^&gt;]+)&gt;\s*&lt;dt[^&gt;]+&gt;([\s\S]+?)&lt;\/dt&gt;\s*&lt;dd[^&gt;]+&gt;(.+?)&lt;\/dd&gt;\s*&lt;\/dl&gt;\s*&lt;\/div&gt;\s*/gi,function(g,d,j,h){var i,f,e;i=d.match(/id=['&quot;]([^'&quot;]+)/i);f=d.match(/class=['&quot;]([^'&quot;]+)/i);e=j.match(/width=['&quot;]([0-9]+)/);i=(i&amp;&amp;i[1])?i[1]:&quot;&quot;;f=(f&amp;&amp;f[1])?f[1]:&quot;alignnone&quot;;e=(e&amp;&amp;e[1])?e[1]:&quot;&quot;;if(!e||!h){return j}f=f.match(/align[^ '&quot;]+/)||&quot;alignnone&quot;;h=h.replace(/&lt;\S[^&lt;&gt;]*&gt;/gi,&quot;&quot;).replace(/'/g,&quot;&amp;#39;&quot;).replace(/&quot;/g,&quot;&amp;quot;&quot;);return'[caption id=&quot;'+i+'&quot; align=&quot;'+f+'&quot; width=&quot;'+e+'&quot; caption=&quot;'+h+'&quot;]'+j+&quot;[/caption]&quot;})},showButtons:function(d){var j=this,e=tinyMCE.activeEditor,g,f,a,i=tinymce.DOM,c,b,h=e.dom.getAttrib(d,&quot;class&quot;);if(h.indexOf(&quot;mceItem&quot;)!=-1||h.indexOf(&quot;wpGallery&quot;)!=-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(&quot;wp_editbtns&quot;,{top:b+5+&quot;px&quot;,left:c+5+&quot;px&quot;,display:&quot;block&quot;});j.btnsTout=window.setTimeout(function(){e.plugins.wpeditimage.hideButtons()},5000)},hideButtons:function(){if(tinymce.DOM.isHidden(&quot;wp_editbtns&quot;)){return}tinymce.DOM.hide(&quot;wp_editbtns&quot;);window.clearTimeout(this.btnsTout)},_createButtons:function(){var d=this,b=tinyMCE.activeEditor,e=tinymce.DOM,a,c,f;e.remove(&quot;wp_editbtns&quot;);a=e.add(document.body,&quot;div&quot;,{id:&quot;wp_editbtns&quot;,style:&quot;display:none;&quot;});c=e.add(&quot;wp_editbtns&quot;,&quot;img&quot;,{src:d.url+&quot;/img/image.png&quot;,id:&quot;wp_editimgbtn&quot;,width:&quot;24&quot;,height:&quot;24&quot;,title:b.getLang(&quot;wpeditimage.edit_img&quot;)});c.onmousedown=function(h){var g=tinyMCE.activeEditor;g.windowManager.bookmark=g.selection.getBookmark(&quot;simple&quot;);g.execCommand(&quot;WP_EditImage&quot;);this.parentNode.style.display=&quot;none&quot;};f=e.add(&quot;wp_editbtns&quot;,&quot;img&quot;,{src:d.url+&quot;/img/delete.png&quot;,id:&quot;wp_delimgbtn&quot;,width:&quot;24&quot;,height:&quot;24&quot;,title:b.getLang(&quot;wpeditimage.del_img&quot;)});f.onmousedown=function(j){var g=tinyMCE.activeEditor,h=g.selection.getNode(),i;if(h.nodeName==&quot;IMG&quot;&amp;&amp;g.dom.getAttrib(h,&quot;class&quot;).indexOf(&quot;mceItem&quot;)==-1){if((i=g.dom.getParent(h,&quot;div&quot;))&amp;&amp;g.dom.hasClass(i,&quot;mceTemp&quot;)){g.dom.remove(i)}else{if((i=g.dom.getParent(h,&quot;A&quot;))&amp;&amp;i.childNodes.length==1){g.dom.remove(i)}else{g.dom.remove(h)}}this.parentNode.style.display=&quot;none&quot;;g.execCommand(&quot;mceRepaint&quot;);return false}}},getInfo:function(){return{longname:&quot;Edit Image&quot;,author:&quot;WordPress&quot;,authorurl:&quot;http://wordpress.org&quot;,infourl:&quot;&quot;,version:&quot;1.0&quot;}}});tinymce.PluginManager.add(&quot;wpeditimage&quot;,tinymce.plugins.wpEditImage)})();
</del><span class="cx">\ No newline at end of file
</span><ins>+(function(){tinymce.create(&quot;tinymce.plugins.wpEditImage&quot;,{init:function(a,b){var c=this;c.url=b;c._createButtons();a.addCommand(&quot;WP_EditImage&quot;,function(){var h=a.selection.getNode(),f=tinymce.DOM.getViewPort(),g=f.h,d=(720&lt;f.w)?720:f.w,e=a.dom.getAttrib(h,&quot;class&quot;);if(e.indexOf(&quot;mceItem&quot;)!=-1||e.indexOf(&quot;wpGallery&quot;)!=-1||h.nodeName!=&quot;IMG&quot;){return}tb_show(&quot;&quot;,b+&quot;/editimage.html?ver=321&amp;TB_iframe=true&quot;);tinymce.DOM.setStyles(&quot;TB_window&quot;,{width:(d-50)+&quot;px&quot;,height:(g-45)+&quot;px&quot;,&quot;margin-left&quot;:&quot;-&quot;+parseInt(((d-50)/2),10)+&quot;px&quot;});if(!tinymce.isIE6){tinymce.DOM.setStyles(&quot;TB_window&quot;,{top:&quot;20px&quot;,marginTop:&quot;0&quot;})}tinymce.DOM.setStyles(&quot;TB_iframeContent&quot;,{width:(d-50)+&quot;px&quot;,height:(g-75)+&quot;px&quot;});tinymce.DOM.setStyle([&quot;TB_overlay&quot;,&quot;TB_window&quot;,&quot;TB_load&quot;],&quot;z-index&quot;,&quot;999999&quot;)});a.onInit.add(function(d){tinymce.dom.Event.add(d.getWin(),&quot;scroll&quot;,function(f){d.plugins.wpeditimage.hideButtons()});tinymce.dom.Event.add(d.getBody(),&quot;dragstart&quot;,function(f){d.plugins.wpeditimage.hideButtons();if(!tinymce.isGecko&amp;&amp;f.target.nodeName==&quot;IMG&quot;&amp;&amp;d.dom.getParent(f.target,&quot;dl.wp-caption&quot;)){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,&quot;div.mceTemp&quot;)||d.dom.is(f.target,&quot;div.mceTemp&quot;)){window.setTimeout(function(){var e=tinyMCE.activeEditor,h=e.selection.getNode(),g=e.dom.getParent(h,&quot;dl.wp-caption&quot;);if(g&amp;&amp;h.width!=(parseInt(e.dom.getStyle(g,&quot;width&quot;),10)-10)){e.dom.setStyle(g,&quot;width&quot;,parseInt(h.width,10)+10);e.execCommand(&quot;mceRepaint&quot;)}},100)}});a.onMouseDown.add(function(d,g){var f;if(g.target.nodeName!=&quot;IMG&quot;){c.hideButtons();return}d.plugins.wpeditimage.showButtons(g.target);if(tinymce.isGecko&amp;&amp;(f=d.dom.getParent(g.target,&quot;dl.wp-caption&quot;))&amp;&amp;d.dom.hasClass(f.parentNode,&quot;mceTemp&quot;)){d.selection.select(f.parentNode)}});a.onKeyPress.add(function(d,i){var f,h,g;if(i.keyCode==13&amp;&amp;(f=d.dom.getParent(d.selection.getNode(),&quot;DL&quot;))){g=d.dom.create(&quot;p&quot;,{},&quot;&amp;nbsp;&quot;);if((h=f.parentNode)&amp;&amp;h.nodeName==&quot;DIV&quot;){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(/\\'|\\&amp;#39;|\\&amp;#039;/g,&quot;&amp;#39;&quot;).replace(/\\&quot;|\\&amp;quot;/g,&quot;&amp;quot;&quot;);k=k.replace(/\\&amp;#39;|\\&amp;#039;/g,&quot;&amp;#39;&quot;).replace(/\\&amp;quot;/g,&quot;&amp;quot;&quot;);j=d.match(/id=['&quot;]([^'&quot;]+)/i);f=d.match(/align=['&quot;]([^'&quot;]+)/i);e=d.match(/width=['&quot;]([0-9]+)/);h=d.match(/caption=['&quot;]([^'&quot;]+)/i);j=(j&amp;&amp;j[1])?j[1]:&quot;&quot;;f=(f&amp;&amp;f[1])?f[1]:&quot;alignnone&quot;;e=(e&amp;&amp;e[1])?e[1]:&quot;&quot;;h=(h&amp;&amp;h[1])?h[1]:&quot;&quot;;if(!e||!h){return k}i=(f==&quot;aligncenter&quot;)?&quot;mceTemp mceIEcenter&quot;:&quot;mceTemp&quot;;return'&lt;div class=&quot;'+i+'&quot; draggable&gt;&lt;dl id=&quot;'+j+'&quot; class=&quot;wp-caption '+f+'&quot; style=&quot;width: '+(10+parseInt(e))+'px&quot;&gt;&lt;dt class=&quot;wp-caption-dt&quot;&gt;'+k+'&lt;/dt&gt;&lt;dd class=&quot;wp-caption-dd&quot;&gt;'+h+&quot;&lt;/dd&gt;&lt;/dl&gt;&lt;/div&gt;&quot;})},_get_shcode:function(a){return a.replace(/&lt;div class=&quot;mceTemp[^&quot;]*&quot;&gt;\s*&lt;dl([^&gt;]+)&gt;\s*&lt;dt[^&gt;]+&gt;([\s\S]+?)&lt;\/dt&gt;\s*&lt;dd[^&gt;]+&gt;(.+?)&lt;\/dd&gt;\s*&lt;\/dl&gt;\s*&lt;\/div&gt;\s*/gi,function(g,d,j,h){var i,f,e;i=d.match(/id=['&quot;]([^'&quot;]+)/i);f=d.match(/class=['&quot;]([^'&quot;]+)/i);e=j.match(/width=['&quot;]([0-9]+)/);i=(i&amp;&amp;i[1])?i[1]:&quot;&quot;;f=(f&amp;&amp;f[1])?f[1]:&quot;alignnone&quot;;e=(e&amp;&amp;e[1])?e[1]:&quot;&quot;;if(!e||!h){return j}f=f.match(/align[^ '&quot;]+/)||&quot;alignnone&quot;;h=h.replace(/&lt;\S[^&lt;&gt;]*&gt;/gi,&quot;&quot;).replace(/'/g,&quot;&amp;#39;&quot;).replace(/&quot;/g,&quot;&amp;quot;&quot;);return'[caption id=&quot;'+i+'&quot; align=&quot;'+f+'&quot; width=&quot;'+e+'&quot; caption=&quot;'+h+'&quot;]'+j+&quot;[/caption]&quot;})},showButtons:function(d){var j=this,e=tinyMCE.activeEditor,g,f,a,i=tinymce.DOM,c,b,h=e.dom.getAttrib(d,&quot;class&quot;);if(h.indexOf(&quot;mceItem&quot;)!=-1||h.indexOf(&quot;wpGallery&quot;)!=-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(&quot;wp_editbtns&quot;,{top:b+5+&quot;px&quot;,left:c+5+&quot;px&quot;,display:&quot;block&quot;});j.btnsTout=window.setTimeout(function(){e.plugins.wpeditimage.hideButtons()},5000)},hideButtons:function(){if(tinymce.DOM.isHidden(&quot;wp_editbtns&quot;)){return}tinymce.DOM.hide(&quot;wp_editbtns&quot;);window.clearTimeout(this.btnsTout)},_createButtons:function(){var d=this,b=tinyMCE.activeEditor,e=tinymce.DOM,a,c,f;e.remove(&quot;wp_editbtns&quot;);a=e.add(document.body,&quot;div&quot;,{id:&quot;wp_editbtns&quot;,style:&quot;display:none;&quot;});c=e.add(&quot;wp_editbtns&quot;,&quot;img&quot;,{src:d.url+&quot;/img/image.png&quot;,id:&quot;wp_editimgbtn&quot;,width:&quot;24&quot;,height:&quot;24&quot;,title:b.getLang(&quot;wpeditimage.edit_img&quot;)});tinymce.dom.Event.add(c,&quot;mousedown&quot;,function(g){b.windowManager.bookmark=b.selection.getBookmark(&quot;simple&quot;);b.execCommand(&quot;WP_EditImage&quot;)});f=e.add(&quot;wp_editbtns&quot;,&quot;img&quot;,{src:d.url+&quot;/img/delete.png&quot;,id:&quot;wp_delimgbtn&quot;,width:&quot;24&quot;,height:&quot;24&quot;,title:b.getLang(&quot;wpeditimage.del_img&quot;)});tinymce.dom.Event.add(f,&quot;mousedown&quot;,function(j){var g=tinyMCE.activeEditor,h=g.selection.getNode(),i;if(h.nodeName==&quot;IMG&quot;&amp;&amp;g.dom.getAttrib(h,&quot;class&quot;).indexOf(&quot;mceItem&quot;)==-1){if((i=g.dom.getParent(h,&quot;div&quot;))&amp;&amp;g.dom.hasClass(i,&quot;mceTemp&quot;)){g.dom.remove(i)}else{if((i=g.dom.getParent(h,&quot;A&quot;))&amp;&amp;i.childNodes.length==1){g.dom.remove(i)}else{g.dom.remove(h)}}g.execCommand(&quot;mceRepaint&quot;);return false}})},getInfo:function(){return{longname:&quot;Edit Image&quot;,author:&quot;WordPress&quot;,authorurl:&quot;http://wordpress.org&quot;,infourl:&quot;&quot;,version:&quot;1.0&quot;}}});tinymce.PluginManager.add(&quot;wpeditimage&quot;,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>