<!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" />
<title>[18609] trunk: Fix TimyMCE init when launching DFW and respect wpautop setting there, see #17144</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { 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 #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#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>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/18609">18609</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2011-08-26 19:33:14 +0000 (Fri, 26 Aug 2011)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fix TimyMCE init when launching DFW and respect wpautop setting there, see <a href="http://core.trac.wordpress.org/ticket/17144">#17144</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminjswpfullscreendevjs">trunk/wp-admin/js/wp-fullscreen.dev.js</a></li>
<li><a href="#trunkwpadminjswpfullscreenjs">trunk/wp-admin/js/wp-fullscreen.js</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminjswpfullscreendevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/wp-fullscreen.dev.js (18608 => 18609)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/wp-fullscreen.dev.js        2011-08-26 19:00:07 UTC (rev 18608)
+++ trunk/wp-admin/js/wp-fullscreen.dev.js        2011-08-26 19:33:14 UTC (rev 18609)
</span><span class="lines">@@ -335,33 +335,39 @@
</span><span class="cx">         });
</span><span class="cx"> 
</span><span class="cx">         ps.subscribe( 'shown', function() { // This event occurs after the DFW overlay is shown
</span><ins>+                var interim_init;
+
</ins><span class="cx">                 s.visible = true;
</span><span class="cx"> 
</span><span class="cx">                 // init the standard TinyMCE instance if missing
</span><span class="cx">                 if ( s.has_tinymce &amp;&amp; ! s.is_mce_on ) {
</span><del>-                        htmled = document.getElementById(s.editor_id), old_val = htmled.value;
</del><span class="cx"> 
</span><del>-                        htmled.value = switchEditors.wpautop( old_val );
</del><ins>+                        interim_init = function(mce, ed) {
+                                var el = ed.getElement(), old_val = el.value, settings = tinyMCEPreInit.mceInit[s.editor_id];
</ins><span class="cx"> 
</span><del>-                        tinyMCE.settings.setup = function(ed) {
</del><ins>+                                if ( settings &amp;&amp; settings.wpautop &amp;&amp; typeof(switchEditors) != 'undefined' )
+                                        el.value = switchEditors.wpautop( el.value );
+
</ins><span class="cx">                                 ed.onInit.add(function(ed) {
</span><span class="cx">                                         ed.hide();
</span><del>-                                        delete tinyMCE.settings.setup;
</del><span class="cx">                                         ed.getElement().value = old_val;
</span><ins>+                                        tinymce.onAddEditor.remove(interim_init);
</ins><span class="cx">                                 });
</span><del>-                        }
</del><ins>+                        };
</ins><span class="cx"> 
</span><ins>+                        tinymce.onAddEditor.add(interim_init);
</ins><span class="cx">                         tinyMCE.init(tinyMCEPreInit.mceInit[s.editor_id]);
</span><ins>+
</ins><span class="cx">                         s.is_mce_on = true;
</span><span class="cx">                 }
</span><span class="cx">         });
</span><span class="cx"> 
</span><span class="cx">         ps.subscribe( 'hide', function() { // This event occurs before the overlay blocks DFW.
</span><del>-
</del><ins>+                var htmled_is_hidden = $('#' + s.editor_id).is(':hidden');
</ins><span class="cx">                 // Make sure the correct editor is displaying.
</span><del>-                if ( s.has_tinymce &amp;&amp; s.mode === 'tinymce' &amp;&amp; $('#' + s.editor_id).is(':visible') ) {
</del><ins>+                if ( s.has_tinymce &amp;&amp; s.mode === 'tinymce' &amp;&amp; !htmled_is_hidden ) {
</ins><span class="cx">                         switchEditors.go( $('#'+s.editor_id+'-tmce').get(0) );
</span><del>-                } else if ( s.mode === 'html' &amp;&amp; $('#' + s.editor_id).is(':hidden') ) {
</del><ins>+                } else if ( s.mode === 'html' &amp;&amp; htmled_is_hidden ) {
</ins><span class="cx">                         switchEditors.go( $('#'+s.editor_id+'-html').get(0) );
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="lines">@@ -407,8 +413,10 @@
</span><span class="cx">                 ed = tinyMCE.get('wp_mce_fullscreen');
</span><span class="cx"> 
</span><span class="cx">                 if ( from === 'html' &amp;&amp; to === 'tinymce' ) {
</span><del>-                        s.textarea_obj.value = switchEditors.wpautop( s.textarea_obj.value );
</del><span class="cx"> 
</span><ins>+                        if ( tinyMCE.get(s.editor_id).getParam('wpautop') &amp;&amp; typeof(switchEditors) != 'undefined' )
+                                s.textarea_obj.value = switchEditors.wpautop( s.textarea_obj.value );
+
</ins><span class="cx">                         if ( 'undefined' == typeof(ed) )
</span><span class="cx">                                 tinyMCE.execCommand('wpFullScreenInit');
</span><span class="cx">                         else
</span></span></pre></div>
<a id="trunkwpadminjswpfullscreenjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/wp-fullscreen.js (18608 => 18609)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/wp-fullscreen.js        2011-08-26 19:00:07 UTC (rev 18608)
+++ trunk/wp-admin/js/wp-fullscreen.js        2011-08-26 19:33:14 UTC (rev 18609)
</span><span class="lines">@@ -1 +1 @@
</span><del>-var PubSub,fullscreen,wptitlehint;PubSub=function(){this.topics={}};PubSub.prototype.subscribe=function(a,b){if(!this.topics[a]){this.topics[a]=[]}this.topics[a].push(b);return b};PubSub.prototype.unsubscribe=function(b,e){var c,a,d=this.topics[b];if(!d){return e||[]}if(e){for(c=0,a=d.length;c&lt;a;c++){if(e==d[c]){d.splice(c,1)}}return e}else{this.topics[b]=[];return d}};PubSub.prototype.publish=function(c,b){var d,a,e,f=this.topics[c];if(!f){return}b=b||[];for(d=0,a=f.length;d&lt;a;d++){e=(f[d].apply(null,b)===false||e)}return !e};(function(c){var b,e,d,a;fullscreen=b={};e=b.pubsub=new PubSub();timer=0;block=false;a=b.settings={visible:false,mode:&quot;tinymce&quot;,editor_id:&quot;content&quot;,title_id:&quot;&quot;,timer:0,toolbar_shown:false};d=b.bounder=function(l,h,g,j){var k,i;g=g||1250;if(j){k=j.pageY||j.clientY||j.offsetY;i=c(document).scrollTop();if(!j.isDefaultPrevented){k=135+k}if(k-i&gt;120){return}}if(block){return}block=true;setTimeout(function(){
 block=false},400);if(a.timer){clearTimeout(a.timer)}else{e.publish(l)}function f(){e.publish(h);a.timer=0}a.timer=setTimeout(f,g)};b.on=function(){if(a.visible){return}if(typeof(wp_fullscreen_settings)!=&quot;undefined&quot;){c.extend(a,wp_fullscreen_settings)}a.editor_id=&quot;content&quot;;a.title_id=&quot;title&quot;;a.mode=c(&quot;#&quot;+a.editor_id).is(&quot;:hidden&quot;)?&quot;tinymce&quot;:&quot;html&quot;;a.qt_canvas=c(&quot;#&quot;+a.editor_id).get(0);if(!a.element){b.ui.init()}a.is_mce_on=a.has_tinymce&amp;&amp;typeof(tinyMCE.get(a.editor_id))!=&quot;undefined&quot;;b.ui.fade(&quot;show&quot;,&quot;showing&quot;,&quot;shown&quot;)};b.off=function(){if(!a.visible){return}b.ui.fade(&quot;hide&quot;,&quot;hiding&quot;,&quot;hidden&quot;)};b.switchmode=function(g){var f=a.mode;if(!g||!a.visible||!a.has_tinymce){return f}if(f==g){return f}e.publish(&quot;switchMode&quot;,[f,g]);a.mode=g;e.publish(&quot;switchedMode&quot;,[f,g]);return g};b.save=function(){var h=c(&quo
 t;#hiddenaction&quot;),f=h.val(),i=c(&quot;#wp-fullscreen-save img&quot;),g=c(&quot;#wp-fullscreen-save span&quot;);i.show();b.savecontent();h.val(&quot;wp-fullscreen-save-post&quot;);c.post(ajaxurl,c(&quot;form#post&quot;).serialize(),function(j){i.hide();g.show();setTimeout(function(){g.fadeOut(1000)},3000);if(j.last_edited){c(&quot;#wp-fullscreen-save input&quot;).attr(&quot;title&quot;,j.last_edited)}},&quot;json&quot;);h.val(f)};b.savecontent=function(){var f,g;if(a.title_id){c(&quot;#&quot;+a.title_id).val(c(&quot;#wp-fullscreen-title&quot;).val())}if(a.mode===&quot;tinymce&quot;&amp;&amp;(f=tinyMCE.get(&quot;wp_mce_fullscreen&quot;))){g=f.save()}else{g=c(&quot;#wp_mce_fullscreen&quot;).val()}c(&quot;#&quot;+a.editor_id).val(g);c(document).triggerHandler(&quot;wpcountwords&quot;,[g])};set_title_hint=function(f){if(!f.val().length){f.siblings(&quot;label&quot;).css(&quot;visibility&quot;,&quot;&quot;)}else{f.siblings(&quot;label&quot;).css(&quot;visibility&quot;,&quot;h
 idden&quot;)}};b.dfw_width=function(h){var g=c(&quot;#wp-fullscreen-wrap&quot;),f=g.width();if(!h){g.width(c(&quot;#wp-fullscreen-central-toolbar&quot;).width());deleteUserSetting(&quot;dfw_width&quot;);return}f=h+f;if(f&lt;200||f&gt;1200){return}g.width(f);setUserSetting(&quot;dfw_width&quot;,f)};e.subscribe(&quot;showToolbar&quot;,function(){a.toolbars.removeClass(&quot;fade-1000&quot;).addClass(&quot;fade-300&quot;);b.fade.In(a.toolbars,300,function(){e.publish(&quot;toolbarShown&quot;)},true);c(&quot;#wp-fullscreen-body&quot;).addClass(&quot;wp-fullscreen-focus&quot;);a.toolbar_shown=true});e.subscribe(&quot;hideToolbar&quot;,function(){a.toolbars.removeClass(&quot;fade-300&quot;).addClass(&quot;fade-1000&quot;);b.fade.Out(a.toolbars,1000,function(){e.publish(&quot;toolbarHidden&quot;)},true);c(&quot;#wp-fullscreen-body&quot;).removeClass(&quot;wp-fullscreen-focus&quot;)});e.subscribe(&quot;toolbarShown&quot;,function(){a.toolbars.removeClass(&quot;fade-300&quot;)});e.su
 bscribe(&quot;toolbarHidden&quot;,function(){a.toolbars.removeClass(&quot;fade-1000&quot;);a.toolbar_shown=false});e.subscribe(&quot;show&quot;,function(){var f;if(a.title_id){f=c(&quot;#wp-fullscreen-title&quot;).val(c(&quot;#&quot;+a.title_id).val());set_title_hint(f)}c(&quot;#wp-fullscreen-save input&quot;).attr(&quot;title&quot;,c(&quot;#last-edit&quot;).text());a.textarea_obj.value=a.qt_canvas.value;if(a.has_tinymce&amp;&amp;a.mode===&quot;tinymce&quot;){tinyMCE.execCommand(&quot;wpFullScreenInit&quot;)}a.orig_y=c(window).scrollTop()});e.subscribe(&quot;showing&quot;,function(){c(document.body).addClass(&quot;fullscreen-active&quot;);b.refresh_buttons();c(document).bind(&quot;mousemove.fullscreen&quot;,function(f){d(&quot;showToolbar&quot;,&quot;hideToolbar&quot;,2000,f)});d(&quot;showToolbar&quot;,&quot;hideToolbar&quot;,2000);b.bind_resize();setTimeout(b.resize_textarea,200);scrollTo(0,0);c(&quot;#wpadminbar&quot;).hide()});e.subscribe(&quot;shown&quot;,function(){a.v
 isible=true;if(a.has_tinymce&amp;&amp;!a.is_mce_on){htmled=document.getElementById(a.editor_id),old_val=htmled.value;htmled.value=switchEditors.wpautop(old_val);tinyMCE.settings.setup=function(f){f.onInit.add(function(g){g.hide();delete tinyMCE.settings.setup;g.getElement().value=old_val})};tinyMCE.init(tinyMCEPreInit.mceInit[a.editor_id]);a.is_mce_on=true}});e.subscribe(&quot;hide&quot;,function(){if(a.has_tinymce&amp;&amp;a.mode===&quot;tinymce&quot;&amp;&amp;c(&quot;#&quot;+a.editor_id).is(&quot;:visible&quot;)){switchEditors.go(c(&quot;#&quot;+a.editor_id+&quot;-tmce&quot;).get(0))}else{if(a.mode===&quot;html&quot;&amp;&amp;c(&quot;#&quot;+a.editor_id).is(&quot;:hidden&quot;)){switchEditors.go(c(&quot;#&quot;+a.editor_id+&quot;-html&quot;).get(0))}}b.savecontent();c(document).unbind(&quot;.fullscreen&quot;);c(a.textarea_obj).unbind(&quot;.grow&quot;);if(a.has_tinymce&amp;&amp;a.mode===&quot;tinymce&quot;){tinyMCE.execCommand(&quot;wpFullScreenSave&quot;)}if(a.title_id){s
 et_title_hint(c(&quot;#&quot;+a.title_id))}a.qt_canvas.value=a.textarea_obj.value});e.subscribe(&quot;hiding&quot;,function(){c(document.body).removeClass(&quot;fullscreen-active&quot;);scrollTo(0,a.orig_y);c(&quot;#wpadminbar&quot;).show()});e.subscribe(&quot;hidden&quot;,function(){a.visible=false;c(&quot;#wp_mce_fullscreen, #wp-fullscreen-title&quot;).removeAttr(&quot;style&quot;);if(a.has_tinymce&amp;&amp;a.is_mce_on){tinyMCE.execCommand(&quot;wpFullScreenClose&quot;)}a.textarea_obj.value=&quot;&quot;;b.oldheight=0});e.subscribe(&quot;switchMode&quot;,function(h,g){var f;if(!a.has_tinymce||!a.is_mce_on){return}f=tinyMCE.get(&quot;wp_mce_fullscreen&quot;);if(h===&quot;html&quot;&amp;&amp;g===&quot;tinymce&quot;){a.textarea_obj.value=switchEditors.wpautop(a.textarea_obj.value);if(&quot;undefined&quot;==typeof(f)){tinyMCE.execCommand(&quot;wpFullScreenInit&quot;)}else{f.show()}}else{if(h===&quot;tinymce&quot;&amp;&amp;g===&quot;html&quot;){if(f){f.hide()}}}});e.subscribe(&q
 uot;switchedMode&quot;,function(g,f){b.refresh_buttons(true);if(f===&quot;html&quot;){setTimeout(b.resize_textarea,200)}});b.b=function(){if(a.has_tinymce&amp;&amp;&quot;tinymce&quot;===a.mode){tinyMCE.execCommand(&quot;Bold&quot;)}};b.i=function(){if(a.has_tinymce&amp;&amp;&quot;tinymce&quot;===a.mode){tinyMCE.execCommand(&quot;Italic&quot;)}};b.ul=function(){if(a.has_tinymce&amp;&amp;&quot;tinymce&quot;===a.mode){tinyMCE.execCommand(&quot;InsertUnorderedList&quot;)}};b.ol=function(){if(a.has_tinymce&amp;&amp;&quot;tinymce&quot;===a.mode){tinyMCE.execCommand(&quot;InsertOrderedList&quot;)}};b.link=function(){if(a.has_tinymce&amp;&amp;&quot;tinymce&quot;===a.mode){tinyMCE.execCommand(&quot;WP_Link&quot;)}else{wpLink.open()}};b.unlink=function(){if(a.has_tinymce&amp;&amp;&quot;tinymce&quot;===a.mode){tinyMCE.execCommand(&quot;unlink&quot;)}};b.atd=function(){if(a.has_tinymce&amp;&amp;&quot;tinymce&quot;===a.mode){tinyMCE.execCommand(&quot;mceWritingImprovementTool&quot;)}};b.
 help=function(){if(a.has_tinymce&amp;&amp;&quot;tinymce&quot;===a.mode){tinyMCE.execCommand(&quot;WP_Help&quot;)}};b.blockquote=function(){if(a.has_tinymce&amp;&amp;&quot;tinymce&quot;===a.mode){tinyMCE.execCommand(&quot;mceBlockQuote&quot;)}};b.refresh_buttons=function(f){f=f||false;if(a.mode===&quot;html&quot;){c(&quot;#wp-fullscreen-mode-bar&quot;).removeClass(&quot;wp-tmce-mode&quot;).addClass(&quot;wp-html-mode&quot;);if(f){c(&quot;#wp-fullscreen-button-bar&quot;).fadeOut(150,function(){c(this).addClass(&quot;wp-html-mode&quot;).fadeIn(150)})}else{c(&quot;#wp-fullscreen-button-bar&quot;).addClass(&quot;wp-html-mode&quot;)}}else{if(a.mode===&quot;tinymce&quot;){c(&quot;#wp-fullscreen-mode-bar&quot;).removeClass(&quot;wp-html-mode&quot;).addClass(&quot;wp-tmce-mode&quot;);if(f){c(&quot;#wp-fullscreen-button-bar&quot;).fadeOut(150,function(){c(this).removeClass(&quot;wp-html-mode&quot;).fadeIn(150)})}else{c(&quot;#wp-fullscreen-button-bar&quot;).removeClass(&quot;wp-html-m
 ode&quot;)}}}};b.ui={init:function(){var f=c(&quot;#fullscreen-topbar&quot;),h=c(&quot;#wp_mce_fullscreen&quot;),g=0;a.toolbars=f.add(c(&quot;#wp-fullscreen-status&quot;));a.element=c(&quot;#fullscreen-fader&quot;);a.textarea_obj=h[0];a.has_tinymce=typeof(tinymce)!=&quot;undefined&quot;;if(!a.has_tinymce){c(&quot;#wp-fullscreen-mode-bar&quot;).hide()}if(wptitlehint){wptitlehint(&quot;wp-fullscreen-title&quot;)}c(document).keyup(function(k){var l=k.keyCode||k.charCode,i,j;if(!fullscreen.settings.visible){return true}if(navigator.platform&amp;&amp;navigator.platform.indexOf(&quot;Mac&quot;)!=-1){i=k.ctrlKey}else{i=k.altKey}if(27==l){j={event:k,what:&quot;dfw&quot;,cb:fullscreen.off,condition:function(){if(c(&quot;#TB_window&quot;).is(&quot;:visible&quot;)||c(&quot;.wp-dialog&quot;).is(&quot;:visible&quot;)){return false}return true}};if(!jQuery(document).triggerHandler(&quot;wp_CloseOnEscape&quot;,[j])){fullscreen.off()}}if(i&amp;&amp;(61==l||107==l||187==l)){b.dfw_width(25)}i
 f(i&amp;&amp;(45==l||109==l||189==l)){b.dfw_width(-25)}if(i&amp;&amp;48==l){b.dfw_width(0)}return false});if(typeof(wpWordCount)!=&quot;undefined&quot;){h.keyup(function(j){var i=j.keyCode||j.charCode;if(i==g){return true}if(13==i||8==g||46==g){c(document).triggerHandler(&quot;wpcountwords&quot;,[h.val()])}g=i;return true})}f.mouseenter(function(i){a.toolbars.addClass(&quot;fullscreen-make-sticky&quot;);c(document).unbind(&quot;.fullscreen&quot;);clearTimeout(a.timer);a.timer=0}).mouseleave(function(i){a.toolbars.removeClass(&quot;fullscreen-make-sticky&quot;);if(a.visible){c(document).bind(&quot;mousemove.fullscreen&quot;,function(j){d(&quot;showToolbar&quot;,&quot;hideToolbar&quot;,2000,j)})}})},fade:function(g,f,h){if(!a.element){b.ui.init()}if(g&amp;&amp;!e.publish(g)){return}b.fade.In(a.element,600,function(){if(f){e.publish(f)}b.fade.Out(a.element,600,function(){if(h){e.publish(h)}})})}};b.fade={transitionend:&quot;transitionend webkitTransitionEnd oTransitionEnd&quot;
 ,sensitivity:100,In:function(g,h,i,f){i=i||c.noop;h=h||400;f=f||false;if(b.fade.transitions){if(g.is(&quot;:visible&quot;)){g.addClass(&quot;fade-trigger&quot;);return g}g.show();g.first().one(this.transitionend,function(){i()});setTimeout(function(){g.addClass(&quot;fade-trigger&quot;)},this.sensitivity)}else{if(f){g.stop()}g.css(&quot;opacity&quot;,1);g.first().fadeIn(h,i);if(g.length&gt;1){g.not(&quot;:first&quot;).fadeIn(h)}}return g},Out:function(g,h,i,f){i=i||c.noop;h=h||400;f=f||false;if(!g.is(&quot;:visible&quot;)){return g}if(b.fade.transitions){g.first().one(b.fade.transitionend,function(){if(g.hasClass(&quot;fade-trigger&quot;)){return}g.hide();i()});setTimeout(function(){g.removeClass(&quot;fade-trigger&quot;)},this.sensitivity)}else{if(f){g.stop()}g.first().fadeOut(h,i);if(g.length&gt;1){g.not(&quot;:first&quot;).fadeOut(h)}}return g},transitions:(function(){var f=document.documentElement.style;return(typeof(f.WebkitTransition)==&quot;string&quot;||typeof(f.MozT
 ransition)==&quot;string&quot;||typeof(f.OTransition)==&quot;string&quot;||typeof(f.transition)==&quot;string&quot;)})()};b.bind_resize=function(){c(a.textarea_obj).bind(&quot;keypress.grow click.grow paste.grow&quot;,function(){setTimeout(b.resize_textarea,200)})};b.oldheight=0;b.resize_textarea=function(){var f=a.textarea_obj,g;g=f.scrollHeight&gt;300?f.scrollHeight:300;if(g!=b.oldheight){f.style.height=g+&quot;px&quot;;b.oldheight=g}}})(jQuery);
</del><span class="cx">\ No newline at end of file
</span><ins>+var PubSub,fullscreen,wptitlehint;PubSub=function(){this.topics={}};PubSub.prototype.subscribe=function(a,b){if(!this.topics[a]){this.topics[a]=[]}this.topics[a].push(b);return b};PubSub.prototype.unsubscribe=function(b,e){var c,a,d=this.topics[b];if(!d){return e||[]}if(e){for(c=0,a=d.length;c&lt;a;c++){if(e==d[c]){d.splice(c,1)}}return e}else{this.topics[b]=[];return d}};PubSub.prototype.publish=function(c,b){var d,a,e,f=this.topics[c];if(!f){return}b=b||[];for(d=0,a=f.length;d&lt;a;d++){e=(f[d].apply(null,b)===false||e)}return !e};(function(c){var b,e,d,a;fullscreen=b={};e=b.pubsub=new PubSub();timer=0;block=false;a=b.settings={visible:false,mode:&quot;tinymce&quot;,editor_id:&quot;content&quot;,title_id:&quot;&quot;,timer:0,toolbar_shown:false};d=b.bounder=function(l,h,g,j){var k,i;g=g||1250;if(j){k=j.pageY||j.clientY||j.offsetY;i=c(document).scrollTop();if(!j.isDefaultPrevented){k=135+k}if(k-i&gt;120){return}}if(block){return}block=true;setTimeout(function(){
 block=false},400);if(a.timer){clearTimeout(a.timer)}else{e.publish(l)}function f(){e.publish(h);a.timer=0}a.timer=setTimeout(f,g)};b.on=function(){if(a.visible){return}if(typeof(wp_fullscreen_settings)!=&quot;undefined&quot;){c.extend(a,wp_fullscreen_settings)}a.editor_id=&quot;content&quot;;a.title_id=&quot;title&quot;;a.mode=c(&quot;#&quot;+a.editor_id).is(&quot;:hidden&quot;)?&quot;tinymce&quot;:&quot;html&quot;;a.qt_canvas=c(&quot;#&quot;+a.editor_id).get(0);if(!a.element){b.ui.init()}a.is_mce_on=a.has_tinymce&amp;&amp;typeof(tinyMCE.get(a.editor_id))!=&quot;undefined&quot;;b.ui.fade(&quot;show&quot;,&quot;showing&quot;,&quot;shown&quot;)};b.off=function(){if(!a.visible){return}b.ui.fade(&quot;hide&quot;,&quot;hiding&quot;,&quot;hidden&quot;)};b.switchmode=function(g){var f=a.mode;if(!g||!a.visible||!a.has_tinymce){return f}if(f==g){return f}e.publish(&quot;switchMode&quot;,[f,g]);a.mode=g;e.publish(&quot;switchedMode&quot;,[f,g]);return g};b.save=function(){var h=c(&quo
 t;#hiddenaction&quot;),f=h.val(),i=c(&quot;#wp-fullscreen-save img&quot;),g=c(&quot;#wp-fullscreen-save span&quot;);i.show();b.savecontent();h.val(&quot;wp-fullscreen-save-post&quot;);c.post(ajaxurl,c(&quot;form#post&quot;).serialize(),function(j){i.hide();g.show();setTimeout(function(){g.fadeOut(1000)},3000);if(j.last_edited){c(&quot;#wp-fullscreen-save input&quot;).attr(&quot;title&quot;,j.last_edited)}},&quot;json&quot;);h.val(f)};b.savecontent=function(){var f,g;if(a.title_id){c(&quot;#&quot;+a.title_id).val(c(&quot;#wp-fullscreen-title&quot;).val())}if(a.mode===&quot;tinymce&quot;&amp;&amp;(f=tinyMCE.get(&quot;wp_mce_fullscreen&quot;))){g=f.save()}else{g=c(&quot;#wp_mce_fullscreen&quot;).val()}c(&quot;#&quot;+a.editor_id).val(g);c(document).triggerHandler(&quot;wpcountwords&quot;,[g])};set_title_hint=function(f){if(!f.val().length){f.siblings(&quot;label&quot;).css(&quot;visibility&quot;,&quot;&quot;)}else{f.siblings(&quot;label&quot;).css(&quot;visibility&quot;,&quot;h
 idden&quot;)}};b.dfw_width=function(h){var g=c(&quot;#wp-fullscreen-wrap&quot;),f=g.width();if(!h){g.width(c(&quot;#wp-fullscreen-central-toolbar&quot;).width());deleteUserSetting(&quot;dfw_width&quot;);return}f=h+f;if(f&lt;200||f&gt;1200){return}g.width(f);setUserSetting(&quot;dfw_width&quot;,f)};e.subscribe(&quot;showToolbar&quot;,function(){a.toolbars.removeClass(&quot;fade-1000&quot;).addClass(&quot;fade-300&quot;);b.fade.In(a.toolbars,300,function(){e.publish(&quot;toolbarShown&quot;)},true);c(&quot;#wp-fullscreen-body&quot;).addClass(&quot;wp-fullscreen-focus&quot;);a.toolbar_shown=true});e.subscribe(&quot;hideToolbar&quot;,function(){a.toolbars.removeClass(&quot;fade-300&quot;).addClass(&quot;fade-1000&quot;);b.fade.Out(a.toolbars,1000,function(){e.publish(&quot;toolbarHidden&quot;)},true);c(&quot;#wp-fullscreen-body&quot;).removeClass(&quot;wp-fullscreen-focus&quot;)});e.subscribe(&quot;toolbarShown&quot;,function(){a.toolbars.removeClass(&quot;fade-300&quot;)});e.su
 bscribe(&quot;toolbarHidden&quot;,function(){a.toolbars.removeClass(&quot;fade-1000&quot;);a.toolbar_shown=false});e.subscribe(&quot;show&quot;,function(){var f;if(a.title_id){f=c(&quot;#wp-fullscreen-title&quot;).val(c(&quot;#&quot;+a.title_id).val());set_title_hint(f)}c(&quot;#wp-fullscreen-save input&quot;).attr(&quot;title&quot;,c(&quot;#last-edit&quot;).text());a.textarea_obj.value=a.qt_canvas.value;if(a.has_tinymce&amp;&amp;a.mode===&quot;tinymce&quot;){tinyMCE.execCommand(&quot;wpFullScreenInit&quot;)}a.orig_y=c(window).scrollTop()});e.subscribe(&quot;showing&quot;,function(){c(document.body).addClass(&quot;fullscreen-active&quot;);b.refresh_buttons();c(document).bind(&quot;mousemove.fullscreen&quot;,function(f){d(&quot;showToolbar&quot;,&quot;hideToolbar&quot;,2000,f)});d(&quot;showToolbar&quot;,&quot;hideToolbar&quot;,2000);b.bind_resize();setTimeout(b.resize_textarea,200);scrollTo(0,0);c(&quot;#wpadminbar&quot;).hide()});e.subscribe(&quot;shown&quot;,function(){var
  f;a.visible=true;if(a.has_tinymce&amp;&amp;!a.is_mce_on){f=function(g,h){var k=h.getElement(),i=k.value,j=tinyMCEPreInit.mceInit[a.editor_id];if(j&amp;&amp;j.wpautop&amp;&amp;typeof(switchEditors)!=&quot;undefined&quot;){k.value=switchEditors.wpautop(k.value)}h.onInit.add(function(l){l.hide();l.getElement().value=i;tinymce.onAddEditor.remove(f)})};tinymce.onAddEditor.add(f);tinyMCE.init(tinyMCEPreInit.mceInit[a.editor_id]);a.is_mce_on=true}});e.subscribe(&quot;hide&quot;,function(){var f=c(&quot;#&quot;+a.editor_id).is(&quot;:hidden&quot;);if(a.has_tinymce&amp;&amp;a.mode===&quot;tinymce&quot;&amp;&amp;!f){switchEditors.go(c(&quot;#&quot;+a.editor_id+&quot;-tmce&quot;).get(0))}else{if(a.mode===&quot;html&quot;&amp;&amp;f){switchEditors.go(c(&quot;#&quot;+a.editor_id+&quot;-html&quot;).get(0))}}b.savecontent();c(document).unbind(&quot;.fullscreen&quot;);c(a.textarea_obj).unbind(&quot;.grow&quot;);if(a.has_tinymce&amp;&amp;a.mode===&quot;tinymce&quot;){tinyMCE.execCommand(&qu
 ot;wpFullScreenSave&quot;)}if(a.title_id){set_title_hint(c(&quot;#&quot;+a.title_id))}a.qt_canvas.value=a.textarea_obj.value});e.subscribe(&quot;hiding&quot;,function(){c(document.body).removeClass(&quot;fullscreen-active&quot;);scrollTo(0,a.orig_y);c(&quot;#wpadminbar&quot;).show()});e.subscribe(&quot;hidden&quot;,function(){a.visible=false;c(&quot;#wp_mce_fullscreen, #wp-fullscreen-title&quot;).removeAttr(&quot;style&quot;);if(a.has_tinymce&amp;&amp;a.is_mce_on){tinyMCE.execCommand(&quot;wpFullScreenClose&quot;)}a.textarea_obj.value=&quot;&quot;;b.oldheight=0});e.subscribe(&quot;switchMode&quot;,function(h,g){var f;if(!a.has_tinymce||!a.is_mce_on){return}f=tinyMCE.get(&quot;wp_mce_fullscreen&quot;);if(h===&quot;html&quot;&amp;&amp;g===&quot;tinymce&quot;){if(tinyMCE.get(a.editor_id).getParam(&quot;wpautop&quot;)&amp;&amp;typeof(switchEditors)!=&quot;undefined&quot;){a.textarea_obj.value=switchEditors.wpautop(a.textarea_obj.value)}if(&quot;undefined&quot;==typeof(f)){tinyMC
 E.execCommand(&quot;wpFullScreenInit&quot;)}else{f.show()}}else{if(h===&quot;tinymce&quot;&amp;&amp;g===&quot;html&quot;){if(f){f.hide()}}}});e.subscribe(&quot;switchedMode&quot;,function(g,f){b.refresh_buttons(true);if(f===&quot;html&quot;){setTimeout(b.resize_textarea,200)}});b.b=function(){if(a.has_tinymce&amp;&amp;&quot;tinymce&quot;===a.mode){tinyMCE.execCommand(&quot;Bold&quot;)}};b.i=function(){if(a.has_tinymce&amp;&amp;&quot;tinymce&quot;===a.mode){tinyMCE.execCommand(&quot;Italic&quot;)}};b.ul=function(){if(a.has_tinymce&amp;&amp;&quot;tinymce&quot;===a.mode){tinyMCE.execCommand(&quot;InsertUnorderedList&quot;)}};b.ol=function(){if(a.has_tinymce&amp;&amp;&quot;tinymce&quot;===a.mode){tinyMCE.execCommand(&quot;InsertOrderedList&quot;)}};b.link=function(){if(a.has_tinymce&amp;&amp;&quot;tinymce&quot;===a.mode){tinyMCE.execCommand(&quot;WP_Link&quot;)}else{wpLink.open()}};b.unlink=function(){if(a.has_tinymce&amp;&amp;&quot;tinymce&quot;===a.mode){tinyMCE.execCommand(&q
 uot;unlink&quot;)}};b.atd=function(){if(a.has_tinymce&amp;&amp;&quot;tinymce&quot;===a.mode){tinyMCE.execCommand(&quot;mceWritingImprovementTool&quot;)}};b.help=function(){if(a.has_tinymce&amp;&amp;&quot;tinymce&quot;===a.mode){tinyMCE.execCommand(&quot;WP_Help&quot;)}};b.blockquote=function(){if(a.has_tinymce&amp;&amp;&quot;tinymce&quot;===a.mode){tinyMCE.execCommand(&quot;mceBlockQuote&quot;)}};b.refresh_buttons=function(f){f=f||false;if(a.mode===&quot;html&quot;){c(&quot;#wp-fullscreen-mode-bar&quot;).removeClass(&quot;wp-tmce-mode&quot;).addClass(&quot;wp-html-mode&quot;);if(f){c(&quot;#wp-fullscreen-button-bar&quot;).fadeOut(150,function(){c(this).addClass(&quot;wp-html-mode&quot;).fadeIn(150)})}else{c(&quot;#wp-fullscreen-button-bar&quot;).addClass(&quot;wp-html-mode&quot;)}}else{if(a.mode===&quot;tinymce&quot;){c(&quot;#wp-fullscreen-mode-bar&quot;).removeClass(&quot;wp-html-mode&quot;).addClass(&quot;wp-tmce-mode&quot;);if(f){c(&quot;#wp-fullscreen-button-bar&quot;).
 fadeOut(150,function(){c(this).removeClass(&quot;wp-html-mode&quot;).fadeIn(150)})}else{c(&quot;#wp-fullscreen-button-bar&quot;).removeClass(&quot;wp-html-mode&quot;)}}}};b.ui={init:function(){var f=c(&quot;#fullscreen-topbar&quot;),h=c(&quot;#wp_mce_fullscreen&quot;),g=0;a.toolbars=f.add(c(&quot;#wp-fullscreen-status&quot;));a.element=c(&quot;#fullscreen-fader&quot;);a.textarea_obj=h[0];a.has_tinymce=typeof(tinymce)!=&quot;undefined&quot;;if(!a.has_tinymce){c(&quot;#wp-fullscreen-mode-bar&quot;).hide()}if(wptitlehint){wptitlehint(&quot;wp-fullscreen-title&quot;)}c(document).keyup(function(k){var l=k.keyCode||k.charCode,i,j;if(!fullscreen.settings.visible){return true}if(navigator.platform&amp;&amp;navigator.platform.indexOf(&quot;Mac&quot;)!=-1){i=k.ctrlKey}else{i=k.altKey}if(27==l){j={event:k,what:&quot;dfw&quot;,cb:fullscreen.off,condition:function(){if(c(&quot;#TB_window&quot;).is(&quot;:visible&quot;)||c(&quot;.wp-dialog&quot;).is(&quot;:visible&quot;)){return false}ret
 urn true}};if(!jQuery(document).triggerHandler(&quot;wp_CloseOnEscape&quot;,[j])){fullscreen.off()}}if(i&amp;&amp;(61==l||107==l||187==l)){b.dfw_width(25)}if(i&amp;&amp;(45==l||109==l||189==l)){b.dfw_width(-25)}if(i&amp;&amp;48==l){b.dfw_width(0)}return false});if(typeof(wpWordCount)!=&quot;undefined&quot;){h.keyup(function(j){var i=j.keyCode||j.charCode;if(i==g){return true}if(13==i||8==g||46==g){c(document).triggerHandler(&quot;wpcountwords&quot;,[h.val()])}g=i;return true})}f.mouseenter(function(i){a.toolbars.addClass(&quot;fullscreen-make-sticky&quot;);c(document).unbind(&quot;.fullscreen&quot;);clearTimeout(a.timer);a.timer=0}).mouseleave(function(i){a.toolbars.removeClass(&quot;fullscreen-make-sticky&quot;);if(a.visible){c(document).bind(&quot;mousemove.fullscreen&quot;,function(j){d(&quot;showToolbar&quot;,&quot;hideToolbar&quot;,2000,j)})}})},fade:function(g,f,h){if(!a.element){b.ui.init()}if(g&amp;&amp;!e.publish(g)){return}b.fade.In(a.element,600,function(){if(f){e
 .publish(f)}b.fade.Out(a.element,600,function(){if(h){e.publish(h)}})})}};b.fade={transitionend:&quot;transitionend webkitTransitionEnd oTransitionEnd&quot;,sensitivity:100,In:function(g,h,i,f){i=i||c.noop;h=h||400;f=f||false;if(b.fade.transitions){if(g.is(&quot;:visible&quot;)){g.addClass(&quot;fade-trigger&quot;);return g}g.show();g.first().one(this.transitionend,function(){i()});setTimeout(function(){g.addClass(&quot;fade-trigger&quot;)},this.sensitivity)}else{if(f){g.stop()}g.css(&quot;opacity&quot;,1);g.first().fadeIn(h,i);if(g.length&gt;1){g.not(&quot;:first&quot;).fadeIn(h)}}return g},Out:function(g,h,i,f){i=i||c.noop;h=h||400;f=f||false;if(!g.is(&quot;:visible&quot;)){return g}if(b.fade.transitions){g.first().one(b.fade.transitionend,function(){if(g.hasClass(&quot;fade-trigger&quot;)){return}g.hide();i()});setTimeout(function(){g.removeClass(&quot;fade-trigger&quot;)},this.sensitivity)}else{if(f){g.stop()}g.first().fadeOut(h,i);if(g.length&gt;1){g.not(&quot;:first&qu
 ot;).fadeOut(h)}}return g},transitions:(function(){var f=document.documentElement.style;return(typeof(f.WebkitTransition)==&quot;string&quot;||typeof(f.MozTransition)==&quot;string&quot;||typeof(f.OTransition)==&quot;string&quot;||typeof(f.transition)==&quot;string&quot;)})()};b.bind_resize=function(){c(a.textarea_obj).bind(&quot;keypress.grow click.grow paste.grow&quot;,function(){setTimeout(b.resize_textarea,200)})};b.oldheight=0;b.resize_textarea=function(){var f=a.textarea_obj,g;g=f.scrollHeight&gt;300?f.scrollHeight:300;if(g!=b.oldheight){f.style.height=g+&quot;px&quot;;b.oldheight=g}}})(jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (18608 => 18609)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2011-08-26 19:00:07 UTC (rev 18608)
+++ trunk/wp-includes/script-loader.php        2011-08-26 19:33:14 UTC (rev 18609)
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx"> 
</span><span class="cx">         $scripts-&gt;add( 'editor', &quot;/wp-admin/js/editor$suffix.js&quot;, array('utils','jquery'), '20110820', 1 );
</span><span class="cx"> 
</span><del>-        $scripts-&gt;add( 'wp-fullscreen', &quot;/wp-admin/js/wp-fullscreen$suffix.js&quot;, array('jquery'), '20110802', 1 );
</del><ins>+        $scripts-&gt;add( 'wp-fullscreen', &quot;/wp-admin/js/wp-fullscreen$suffix.js&quot;, array('jquery'), '20110826', 1 );
</ins><span class="cx"> 
</span><span class="cx">         $scripts-&gt;add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6.1');
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>