<!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, #msg p { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul { 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>[11879] trunk:
  Fix race condition with autosave when clicking Publish immediately after entering post title
 , fixes #6728</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/11879">11879</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2009-08-26 04:11:16 +0000 (Wed, 26 Aug 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fix race condition with autosave when clicking Publish immediately after entering post title, fixes <a href="http://trac.wordpress.org/ticket/6728">#6728</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminjspagedevjs">trunk/wp-admin/js/page.dev.js</a></li>
<li><a href="#trunkwpadminjspagejs">trunk/wp-admin/js/page.js</a></li>
<li><a href="#trunkwpadminjspostdevjs">trunk/wp-admin/js/post.dev.js</a></li>
<li><a href="#trunkwpadminjspostjs">trunk/wp-admin/js/post.js</a></li>
<li><a href="#trunkwpincludesjsautosavedevjs">trunk/wp-includes/js/autosave.dev.js</a></li>
<li><a href="#trunkwpincludesjsautosavejs">trunk/wp-includes/js/autosave.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="trunkwpadminjspagedevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/page.dev.js (11878 => 11879)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/page.dev.js        2009-08-25 22:05:15 UTC (rev 11878)
+++ trunk/wp-admin/js/page.dev.js        2009-08-26 04:11:16 UTC (rev 11879)
</span><span class="lines">@@ -2,8 +2,6 @@
</span><span class="cx">         postboxes.add_postbox_toggles('page');
</span><span class="cx">         make_slugedit_clickable();
</span><span class="cx"> 
</span><del>-        $('#title').blur( function() { if ( ($(&quot;#post_ID&quot;).val() &gt; 0) || ($(&quot;#title&quot;).val().length == 0) ) return; autosave(); } );
-
</del><span class="cx">         var stamp = $('#timestamp').html(), visibility = $('#post-visibility-display').html();
</span><span class="cx"> 
</span><span class="cx">         function updateVisibility() {
</span></span></pre></div>
<a id="trunkwpadminjspagejs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/page.js (11878 => 11879)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/page.js        2009-08-25 22:05:15 UTC (rev 11878)
+++ trunk/wp-admin/js/page.js        2009-08-26 04:11:16 UTC (rev 11879)
</span><span class="lines">@@ -1 +1 @@
</span><del>-jQuery(document).ready(function(e){postboxes.add_postbox_toggles(&quot;page&quot;);make_slugedit_clickable();e(&quot;#title&quot;).blur(function(){if((e(&quot;#post_ID&quot;).val()&gt;0)||(e(&quot;#title&quot;).val().length==0)){return}autosave()});var b=e(&quot;#timestamp&quot;).html(),a=e(&quot;#post-visibility-display&quot;).html();function d(){if(e(&quot;#post-visibility-select input:radio:checked&quot;).val()!=&quot;public&quot;){e(&quot;#sticky&quot;).attr(&quot;checked&quot;,false);e(&quot;#sticky-span&quot;).hide()}else{e(&quot;#sticky-span&quot;).show()}if(e(&quot;#post-visibility-select input:radio:checked&quot;).val()!=&quot;password&quot;){e(&quot;#password-span&quot;).hide()}else{e(&quot;#password-span&quot;).show()}}function c(){var f,h,g,i;f=new Date(e(&quot;#aa&quot;).val(),e(&quot;#mm&quot;).val()-1,e(&quot;#jj&quot;).val(),e(&quot;#hh&quot;).val(),e(&quot;#mn&quot;).val());h=new Date(e(&quot;#hidden_aa&quot;).val(),e(&quot;#hidden_mm&quot;).val()-1,e(&quot;#hidden_jj&quot;).val(),e(&quot;#hidden_hh&quot;).val(),e(&quot;#hidden_mn&quot;).val());g=new Date(e(&quot;#cur_aa&quot;).val(),e(&quot;#cur_mm&quot;).val()-1,e(&quot;#cur_jj&quot;).val(),e(&quot;#cur_hh&quot;).val(),e(&quot;#cur_mn&quot;).val());if(f&gt;g&amp;&amp;e(&quot;#original_post_status&quot;).val()!=&quot;future&quot;){i=postL10n.publishOnFuture;e(&quot;#publish&quot;).val(postL10n.schedule)}else{if(f&lt;=g&amp;&amp;e(&quot;#original_post_status&quot;).val()!=&quot;publish&quot;){i=postL10n.publishOn;e(&quot;#publish&quot;).val(postL10n.publish)}else{i=postL10n.publishOnPast;e(&quot;#publish&quot;).val(postL10n.update)}}if(h.toUTCString()==f.toUTCString()){e(&quot;#timestamp&quot;).html(b)}else{e(&quot;#timestamp&quot;).html(i+&quot; &lt;b&gt;&quot;+e(&quot;#mm option[value=&quot;+e(&quot;#mm&quot;).val()+&quot;]&quot;).text()+&quot; &quot;+e(&quot;#jj&quot;).val()+&quot;, &quot;+e(&quot;#aa&quot;).val()+&quot; @ &quot;+e(&quot;#hh&quot;).val()+&quot;:&quot;+e(&quot;#mn&quot;).val()+&quot;&lt;/b&gt; &quot;)}if(e(&quot;#post-visibility-select input:radio:checked&quot;).val()==&quot;private&quot;){e(&quot;#publish&quot;).val(postL10n.update);if(e(&quot;#post_status option[value=publish]&quot;).length==0){e(&quot;#post_status&quot;).append('&lt;option value=&quot;publish&quot;&gt;'+postL10n.privatelyPublished+&quot;&lt;/option&gt;&quot;)}e(&quot;#post_status option[value=publish]&quot;).html(postL10n.privatelyPublished);e(&quot;#post_status option[value=publish]&quot;).attr(&quot;selected&quot;,true);e(&quot;.edit-post-status&quot;).hide()}else{if(e(&quot;#original_post_status&quot;).val()==&quot;future&quot;||e(&quot;#original_post_status&quot;).val()==&quot;draft&quot;){if(e(&quot;#post_status option[value=publish]&quot;).length!=0){e(&quot;#post_status option[value=publish]&quot;).remove();e(&quot;#post_status&quot;).val(e(&quot;#hidden_post_status&quot;).val())}}else{e(&quot;#post_status option[value=publish]&quot;).html(postL10n.published)}e(&quot;.edit-post-status&quot;).show()}e(&quot;#post-status-display&quot;).html(e(&quot;#post_status :selected&quot;).text());if(e(&quot;#post_status :selected&quot;).val()==&quot;private&quot;||e(&quot;#post_status :selected&quot;).val()==&quot;publish&quot;){e(&quot;#save-post&quot;).hide()}else{e(&quot;#save-post&quot;).show();if(e(&quot;#post_status :selected&quot;).val()==&quot;pending&quot;){e(&quot;#save-post&quot;).show().val(postL10n.savePending)}else{e(&quot;#save-post&quot;).show().val(postL10n.saveDraft)}}}e(&quot;.edit-visibility&quot;).click(function(){if(e(&quot;#post-visibility-select&quot;).is(&quot;:hidden&quot;)){d();e(&quot;#post-visibility-select&quot;).slideDown(&quot;normal&quot;);e(&quot;.edit-visibility&quot;).hide()}return false});e(&quot;.cancel-post-visibility&quot;).click(function(){e(&quot;#post-visibility-select&quot;).slideUp(&quot;normal&quot;);e(&quot;#visibility-radio-&quot;+e(&quot;#hidden-post-visibility&quot;).val()).attr(&quot;checked&quot;,true);e(&quot;#post_password&quot;).val(e(&quot;#hidden_post_password&quot;).val());e(&quot;#post-visibility-display&quot;).html(a);e(&quot;.edit-visibility&quot;).show();c();return false});e(&quot;.save-post-visibility&quot;).click(function(){e(&quot;#post-visibility-select&quot;).slideUp(&quot;normal&quot;);e(&quot;.edit-visibility&quot;).show();c();e(&quot;#post-visibility-display&quot;).html(postL10n[e(&quot;#post-visibility-select input:radio:checked&quot;).val()]);return false});e(&quot;#post-visibility-select input:radio&quot;).change(function(){d()});e(&quot;.edit-timestamp&quot;).click(function(){if(e(&quot;#timestampdiv&quot;).is(&quot;:hidden&quot;)){e(&quot;#timestampdiv&quot;).slideDown(&quot;normal&quot;);e(&quot;.edit-timestamp&quot;).hide()}return false});e(&quot;.cancel-timestamp&quot;).click(function(){e(&quot;#timestampdiv&quot;).slideUp(&quot;normal&quot;);e(&quot;#mm&quot;).val(e(&quot;#hidden_mm&quot;).val());e(&quot;#jj&quot;).val(e(&quot;#hidden_jj&quot;).val());e(&quot;#aa&quot;).val(e(&quot;#hidden_aa&quot;).val());e(&quot;#hh&quot;).val(e(&quot;#hidden_hh&quot;).val());e(&quot;#mn&quot;).val(e(&quot;#hidden_mn&quot;).val());e(&quot;.edit-timestamp&quot;).show();c();return false});e(&quot;.save-timestamp&quot;).click(function(){e(&quot;#timestampdiv&quot;).slideUp(&quot;normal&quot;);e(&quot;.edit-timestamp&quot;).show();c();return false});e(&quot;.edit-post-status&quot;).click(function(){if(e(&quot;#post-status-select&quot;).is(&quot;:hidden&quot;)){e(&quot;#post-status-select&quot;).slideDown(&quot;normal&quot;);e(this).hide()}return false});e(&quot;.save-post-status&quot;).click(function(){e(&quot;#post-status-select&quot;).slideUp(&quot;normal&quot;);e(&quot;.edit-post-status&quot;).show();c();return false});e(&quot;.cancel-post-status&quot;).click(function(){e(&quot;#post-status-select&quot;).slideUp(&quot;normal&quot;);e(&quot;#post_status&quot;).val(e(&quot;#hidden_post_status&quot;).val());e(&quot;.edit-post-status&quot;).show();c();return false});e(&quot;#the-list&quot;).wpList({addAfter:function(f,g){e(&quot;table#list-table&quot;).show();if(e.isFunction(autosave_update_post_ID)){autosave_update_post_ID(g.parsed.responses[0].supplemental.postid)}},addBefore:function(f){f.data+=&quot;&amp;post_id=&quot;+e(&quot;#post_ID&quot;).val();return f}})});
</del><span class="cx">\ No newline at end of file
</span><ins>+jQuery(document).ready(function(e){postboxes.add_postbox_toggles(&quot;page&quot;);make_slugedit_clickable();var b=e(&quot;#timestamp&quot;).html(),a=e(&quot;#post-visibility-display&quot;).html();function d(){if(e(&quot;#post-visibility-select input:radio:checked&quot;).val()!=&quot;public&quot;){e(&quot;#sticky&quot;).attr(&quot;checked&quot;,false);e(&quot;#sticky-span&quot;).hide()}else{e(&quot;#sticky-span&quot;).show()}if(e(&quot;#post-visibility-select input:radio:checked&quot;).val()!=&quot;password&quot;){e(&quot;#password-span&quot;).hide()}else{e(&quot;#password-span&quot;).show()}}function c(){var f,h,g,i;f=new Date(e(&quot;#aa&quot;).val(),e(&quot;#mm&quot;).val()-1,e(&quot;#jj&quot;).val(),e(&quot;#hh&quot;).val(),e(&quot;#mn&quot;).val());h=new Date(e(&quot;#hidden_aa&quot;).val(),e(&quot;#hidden_mm&quot;).val()-1,e(&quot;#hidden_jj&quot;).val(),e(&quot;#hidden_hh&quot;).val(),e(&quot;#hidden_mn&quot;).val());g=new Date(e(&quot;#cur_aa&quot;).val(),e(&quot;#cur_mm&quot;).val()-1,e(&quot;#cur_jj&quot;).val(),e(&quot;#cur_hh&quot;).val(),e(&quot;#cur_mn&quot;).val());if(f&gt;g&amp;&amp;e(&quot;#original_post_status&quot;).val()!=&quot;future&quot;){i=postL10n.publishOnFuture;e(&quot;#publish&quot;).val(postL10n.schedule)}else{if(f&lt;=g&amp;&amp;e(&quot;#original_post_status&quot;).val()!=&quot;publish&quot;){i=postL10n.publishOn;e(&quot;#publish&quot;).val(postL10n.publish)}else{i=postL10n.publishOnPast;e(&quot;#publish&quot;).val(postL10n.update)}}if(h.toUTCString()==f.toUTCString()){e(&quot;#timestamp&quot;).html(b)}else{e(&quot;#timestamp&quot;).html(i+&quot; &lt;b&gt;&quot;+e(&quot;#mm option[value=&quot;+e(&quot;#mm&quot;).val()+&quot;]&quot;).text()+&quot; &quot;+e(&quot;#jj&quot;).val()+&quot;, &quot;+e(&quot;#aa&quot;).val()+&quot; @ &quot;+e(&quot;#hh&quot;).val()+&quot;:&quot;+e(&quot;#mn&quot;).val()+&quot;&lt;/b&gt; &quot;)}if(e(&quot;#post-visibility-select input:radio:checked&quot;).val()==&quot;private&quot;){e(&quot;#publish&quot;).val(postL10n.update);if(e(&quot;#post_status option[value=publish]&quot;).length==0){e(&quot;#post_status&quot;).append('&lt;option value=&quot;publish&quot;&gt;'+postL10n.privatelyPublished+&quot;&lt;/option&gt;&quot;)}e(&quot;#post_status option[value=publish]&quot;).html(postL10n.privatelyPublished);e(&quot;#post_status option[value=publish]&quot;).attr(&quot;selected&quot;,true);e(&quot;.edit-post-status&quot;).hide()}else{if(e(&quot;#original_post_status&quot;).val()==&quot;future&quot;||e(&quot;#original_post_status&quot;).val()==&quot;draft&quot;){if(e(&quot;#post_status option[value=publish]&quot;).length!=0){e(&quot;#post_status option[value=publish]&quot;).remove();e(&quot;#post_status&quot;).val(e(&quot;#hidden_post_status&quot;).val())}}else{e(&quot;#post_status option[value=publish]&quot;).html(postL10n.published)}e(&quot;.edit-post-status&quot;).show()}e(&quot;#post-status-display&quot;).html(e(&quot;#post_status :selected&quot;).text());if(e(&quot;#post_status :selected&quot;).val()==&quot;private&quot;||e(&quot;#post_status :selected&quot;).val()==&quot;publish&quot;){e(&quot;#save-post&quot;).hide()}else{e(&quot;#save-post&quot;).show();if(e(&quot;#post_status :selected&quot;).val()==&quot;pending&quot;){e(&quot;#save-post&quot;).show().val(postL10n.savePending)}else{e(&quot;#save-post&quot;).show().val(postL10n.saveDraft)}}}e(&quot;.edit-visibility&quot;).click(function(){if(e(&quot;#post-visibility-select&quot;).is(&quot;:hidden&quot;)){d();e(&quot;#post-visibility-select&quot;).slideDown(&quot;normal&quot;);e(&quot;.edit-visibility&quot;).hide()}return false});e(&quot;.cancel-post-visibility&quot;).click(function(){e(&quot;#post-visibility-select&quot;).slideUp(&quot;normal&quot;);e(&quot;#visibility-radio-&quot;+e(&quot;#hidden-post-visibility&quot;).val()).attr(&quot;checked&quot;,true);e(&quot;#post_password&quot;).val(e(&quot;#hidden_post_password&quot;).val());e(&quot;#post-visibility-display&quot;).html(a);e(&quot;.edit-visibility&quot;).show();c();return false});e(&quot;.save-post-visibility&quot;).click(function(){e(&quot;#post-visibility-select&quot;).slideUp(&quot;normal&quot;);e(&quot;.edit-visibility&quot;).show();c();e(&quot;#post-visibility-display&quot;).html(postL10n[e(&quot;#post-visibility-select input:radio:checked&quot;).val()]);return false});e(&quot;#post-visibility-select input:radio&quot;).change(function(){d()});e(&quot;.edit-timestamp&quot;).click(function(){if(e(&quot;#timestampdiv&quot;).is(&quot;:hidden&quot;)){e(&quot;#timestampdiv&quot;).slideDown(&quot;normal&quot;);e(&quot;.edit-timestamp&quot;).hide()}return false});e(&quot;.cancel-timestamp&quot;).click(function(){e(&quot;#timestampdiv&quot;).slideUp(&quot;normal&quot;);e(&quot;#mm&quot;).val(e(&quot;#hidden_mm&quot;).val());e(&quot;#jj&quot;).val(e(&quot;#hidden_jj&quot;).val());e(&quot;#aa&quot;).val(e(&quot;#hidden_aa&quot;).val());e(&quot;#hh&quot;).val(e(&quot;#hidden_hh&quot;).val());e(&quot;#mn&quot;).val(e(&quot;#hidden_mn&quot;).val());e(&quot;.edit-timestamp&quot;).show();c();return false});e(&quot;.save-timestamp&quot;).click(function(){e(&quot;#timestampdiv&quot;).slideUp(&quot;normal&quot;);e(&quot;.edit-timestamp&quot;).show();c();return false});e(&quot;.edit-post-status&quot;).click(function(){if(e(&quot;#post-status-select&quot;).is(&quot;:hidden&quot;)){e(&quot;#post-status-select&quot;).slideDown(&quot;normal&quot;);e(this).hide()}return false});e(&quot;.save-post-status&quot;).click(function(){e(&quot;#post-status-select&quot;).slideUp(&quot;normal&quot;);e(&quot;.edit-post-status&quot;).show();c();return false});e(&quot;.cancel-post-status&quot;).click(function(){e(&quot;#post-status-select&quot;).slideUp(&quot;normal&quot;);e(&quot;#post_status&quot;).val(e(&quot;#hidden_post_status&quot;).val());e(&quot;.edit-post-status&quot;).show();c();return false});e(&quot;#the-list&quot;).wpList({addAfter:function(f,g){e(&quot;table#list-table&quot;).show();if(e.isFunction(autosave_update_post_ID)){autosave_update_post_ID(g.parsed.responses[0].supplemental.postid)}},addBefore:function(f){f.data+=&quot;&amp;post_id=&quot;+e(&quot;#post_ID&quot;).val();return f}})});
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminjspostdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/post.dev.js (11878 => 11879)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/post.dev.js        2009-08-25 22:05:15 UTC (rev 11878)
+++ trunk/wp-admin/js/post.dev.js        2009-08-26 04:11:16 UTC (rev 11879)
</span><span class="lines">@@ -221,14 +221,6 @@
</span><span class="cx">         // prepare the tag UI
</span><span class="cx">         tag_init();
</span><span class="cx"> 
</span><del>-        $('#title').blur( function() {
-                if ( ($(&quot;#post_ID&quot;).val() &gt; 0) || ($(&quot;#title&quot;).val().length == 0) )
-                        return;
-
-                if ( typeof(autosave) != 'undefined' )
-                        autosave();
-        });
-
</del><span class="cx">         // auto-suggest stuff
</span><span class="cx">         $('.newtag').each(function(){
</span><span class="cx">                 var tax = $(this).parents('div.tagsdiv').attr('id');
</span></span></pre></div>
<a id="trunkwpadminjspostjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/post.js (11878 => 11879)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/post.js        2009-08-25 22:05:15 UTC (rev 11878)
+++ trunk/wp-admin/js/post.js        2009-08-26 04:11:16 UTC (rev 11879)
</span><span class="lines">@@ -1 +1 @@
</span><del>-function array_unique_noempty(b){var c=[];jQuery.each(b,function(a,d){d=jQuery.trim(d);if(d&amp;&amp;jQuery.inArray(d,c)==-1){c.push(d)}});return c}function new_tag_remove_tag(){var e=jQuery(this).attr(&quot;id&quot;),a=e.split(&quot;-check-num-&quot;)[1],c=jQuery(this).parents(&quot;.tagsdiv&quot;),b=c.find(&quot;.the-tags&quot;).val().split(&quot;,&quot;),d=[];delete b[a];jQuery.each(b,function(f,g){g=jQuery.trim(g);if(g){d.push(g)}});c.find(&quot;.the-tags&quot;).val(d.join(&quot;,&quot;).replace(/\s*,+\s*/,&quot;,&quot;).replace(/,+/,&quot;,&quot;).replace(/,+\s+,+/,&quot;,&quot;).replace(/,+\s*$/,&quot;&quot;).replace(/^\s*,+/,&quot;&quot;));tag_update_quickclicks(c);return false}function tag_update_quickclicks(b){if(jQuery(b).find(&quot;.the-tags&quot;).length==0){return}var a=jQuery(b).find(&quot;.the-tags&quot;).val().split(&quot;,&quot;);jQuery(b).find(&quot;.tagchecklist&quot;).empty();shown=false;jQuery.each(a,function(e,f){var c,d;f=jQuery.trim(f);if(!f.match(/^\s+$/)&amp;&amp;&quot;&quot;!=f){d=jQuery(b).attr(&quot;id&quot;)+&quot;-check-num-&quot;+e;c='&lt;span&gt;&lt;a id=&quot;'+d+'&quot; class=&quot;ntdelbutton&quot;&gt;X&lt;/a&gt;&amp;nbsp;'+f+&quot;&lt;/span&gt; &quot;;jQuery(b).find(&quot;.tagchecklist&quot;).append(c);jQuery(&quot;#&quot;+d).click(new_tag_remove_tag)}});if(shown){jQuery(b).find(&quot;.tagchecklist&quot;).prepend(&quot;&lt;strong&gt;&quot;+postL10n.tagsUsed+&quot;&lt;/strong&gt;&lt;br /&gt;&quot;)}}function tag_flush_to_text(g,b){b=b||false;var e,f,c,d;e=jQuery(&quot;#&quot;+g);f=b?jQuery(b).text():e.find(&quot;input.newtag&quot;).val();if(e.find(&quot;input.newtag&quot;).hasClass(&quot;form-input-tip&quot;)&amp;&amp;!b){return false}c=e.find(&quot;.the-tags&quot;).val();d=c?c+&quot;,&quot;+f:f;d=d.replace(/\s+,+\s*/g,&quot;,&quot;).replace(/,+/g,&quot;,&quot;).replace(/,+\s+,+/g,&quot;,&quot;).replace(/,+\s*$/g,&quot;&quot;).replace(/^\s*,+/g,&quot;&quot;);d=array_unique_noempty(d.split(&quot;,&quot;)).join(&quot;,&quot;);e.find(&quot;.the-tags&quot;).val(d);tag_update_quickclicks(e);if(!b){e.find(&quot;input.newtag&quot;).val(&quot;&quot;).focus()}return false}function tag_save_on_publish(){jQuery(&quot;.tagsdiv&quot;).each(function(a){if(!jQuery(this).find(&quot;input.newtag&quot;).hasClass(&quot;form-input-tip&quot;)){tag_flush_to_text(jQuery(this).parents(&quot;.tagsdiv&quot;).attr(&quot;id&quot;))}})}function tag_press_key(a){if(13==a.which){tag_flush_to_text(jQuery(a.target).parents(&quot;.tagsdiv&quot;).attr(&quot;id&quot;));return false}}function tag_init(){jQuery(&quot;.ajaxtag&quot;).show();jQuery(&quot;.tagsdiv&quot;).each(function(a){tag_update_quickclicks(this)});jQuery(&quot;.ajaxtag input.tagadd&quot;).click(function(){tag_flush_to_text(jQuery(this).parents(&quot;.tagsdiv&quot;).attr(&quot;id&quot;))});jQuery(&quot;.ajaxtag input.newtag&quot;).focus(function(){if(!this.cleared){this.cleared=true;jQuery(this).val(&quot;&quot;).removeClass(&quot;form-input-tip&quot;)}});jQuery(&quot;.ajaxtag input.newtag&quot;).blur(function(){if(this.value==&quot;&quot;){this.cleared=false;jQuery(this).val(postL10n.addTag).addClass(&quot;form-input-tip&quot;)}});jQuery(&quot;#publish&quot;).click(tag_save_on_publish);jQuery(&quot;#save-post&quot;).click(tag_save_on_publish);jQuery(&quot;.ajaxtag input.newtag&quot;).keypress(tag_press_key)}var commentsBox,tagCloud;(function(a){commentsBox={st:0,get:function(d,c){var b=this.st,e;if(!c){c=20}this.st+=c;this.total=d;a(&quot;#commentsdiv img.waiting&quot;).show();e={action:&quot;get-comments&quot;,mode:&quot;single&quot;,_ajax_nonce:a(&quot;#add_comment_nonce&quot;).val(),post_ID:a(&quot;#post_ID&quot;).val(),start:b,num:c};a.post(ajaxurl,e,function(f){f=wpAjax.parseAjaxResponse(f);a(&quot;#commentsdiv .widefat&quot;).show();a(&quot;#commentsdiv img.waiting&quot;).hide();if(&quot;object&quot;==typeof f&amp;&amp;f.responses[0]){a(&quot;#the-comment-list&quot;).append(f.responses[0].data);theList=theExtraList=null;a(&quot;a[className*=':']&quot;).unbind();setCommentsList();if(commentsBox.st&gt;commentsBox.total){a(&quot;#show-comments&quot;).hide()}else{a(&quot;#show-comments&quot;).html(postL10n.showcomm)}return}else{if(1==f){a(&quot;#show-comments&quot;).parent().html(postL10n.endcomm);return}}a(&quot;#the-comment-list&quot;).append('&lt;tr&gt;&lt;td colspan=&quot;5&quot;&gt;'+wpAjax.broken+&quot;&lt;/td&gt;&lt;/tr&gt;&quot;)});return false}};tagCloud={init:function(){a(&quot;.tagcloud-link&quot;).click(function(){tagCloud.get(a(this).attr(&quot;id&quot;));a(this).unbind().click(function(){a(this).siblings(&quot;.the-tagcloud&quot;).toggle();return false});return false})},get:function(c){var b=c.substr(c.indexOf(&quot;-&quot;)+1);a.post(ajaxurl,{action:&quot;get-tagcloud&quot;,tax:b},function(e,d){if(0==e||&quot;success&quot;!=d){e=wpAjax.broken}e=a('&lt;p id=&quot;tagcloud-'+b+'&quot; class=&quot;the-tagcloud&quot;&gt;'+e+&quot;&lt;/p&gt;&quot;);a(&quot;a&quot;,e).click(function(){var f=a(this).parents(&quot;p&quot;).attr(&quot;id&quot;);tag_flush_to_text(f.substr(f.indexOf(&quot;-&quot;)+1),this);return false});a(&quot;#&quot;+c).after(e)})}};a(document).ready(function(){tagCloud.init()})})(jQuery);jQuery(document).ready(function(g){var d=false,i,e,a=g(&quot;#timestamp&quot;).html(),b=g(&quot;#post-visibility-display&quot;).html(),h=&quot;&quot;;postboxes.add_postbox_toggles(&quot;post&quot;);make_slugedit_clickable();tag_init();g(&quot;#title&quot;).blur(function(){if((g(&quot;#post_ID&quot;).val()&gt;0)||(g(&quot;#title&quot;).val().length==0)){return}if(typeof(autosave)!=&quot;undefined&quot;){autosave()}});g(&quot;.newtag&quot;).each(function(){var j=g(this).parents(&quot;div.tagsdiv&quot;).attr(&quot;id&quot;);g(this).suggest(&quot;admin-ajax.php?action=ajax-tag-search&amp;tax=&quot;+j,{delay:500,minchars:2,multiple:true,multipleSep:&quot;, &quot;})});g(&quot;#category-tabs a&quot;).click(function(){var j=g(this).attr(&quot;href&quot;);g(this).parent().addClass(&quot;tabs&quot;).siblings(&quot;li&quot;).removeClass(&quot;tabs&quot;);g(&quot;.tabs-panel&quot;).hide();g(j).show();if(&quot;#categories-all&quot;==j){deleteUserSetting(&quot;cats&quot;)}else{setUserSetting(&quot;cats&quot;,&quot;pop&quot;)}return false});if(getUserSetting(&quot;cats&quot;)){g('#category-tabs a[href=&quot;#categories-pop&quot;]').click()}g(&quot;#newcat&quot;).one(&quot;focus&quot;,function(){g(this).val(&quot;&quot;).removeClass(&quot;form-input-tip&quot;)});g(&quot;#category-add-sumbit&quot;).click(function(){g(&quot;#newcat&quot;).focus()});i=function(){if(d){return}d=true;var j=jQuery(this),l=j.is(&quot;:checked&quot;),k=j.val().toString();g(&quot;#in-category-&quot;+k+&quot;, #in-popular-category-&quot;+k).attr(&quot;checked&quot;,l);d=false};popularCats=g(&quot;#categorychecklist-pop :checkbox&quot;).map(function(){return parseInt(jQuery(this).val(),10)}).get().join(&quot;,&quot;);catAddBefore=function(j){if(!g(&quot;#newcat&quot;).val()){return false}j.data+=&quot;&amp;popular_ids=&quot;+popularCats+&quot;&amp;&quot;+jQuery(&quot;#categorychecklist :checked&quot;).serialize();return j};e=function(m,k){var j=jQuery(&quot;#newcat_parent&quot;),l=j.find('option[value=&quot;-1&quot;]');g(k.what+&quot; response_data&quot;,m).each(function(){var n=g(g(this).text());n.find(&quot;label&quot;).each(function(){var q=g(this),s=q.find(&quot;input&quot;).val(),t=q.find(&quot;input&quot;)[0].id,p,r;g(&quot;#&quot;+t).change(i).change();if(j.find('option[value=&quot;'+s+'&quot;]').size()){return}p=g.trim(q.text());r=g('&lt;option value=&quot;'+parseInt(s,10)+'&quot;&gt;&lt;/option&gt;').text(p);j.prepend(r)});l.attr(&quot;selected&quot;,&quot;selected&quot;)})};g(&quot;#categorychecklist&quot;).wpList({alt:&quot;&quot;,response:&quot;category-ajax-response&quot;,addBefore:catAddBefore,addAfter:e});g(&quot;#category-add-toggle&quot;).click(function(){g(&quot;#category-adder&quot;).toggleClass(&quot;wp-hidden-children&quot;);g('#category-tabs a[href=&quot;#categories-all&quot;]').click();return false});g(&quot;.categorychecklist .popular-category :checkbox&quot;).change(i).filter(&quot;:checked&quot;).change(),h=&quot;&quot;;function f(){if(g(&quot;#post-visibility-select input:radio:checked&quot;).val()!=&quot;public&quot;){g(&quot;#sticky&quot;).attr(&quot;checked&quot;,false);g(&quot;#sticky-span&quot;).hide()}else{g(&quot;#sticky-span&quot;).show()}if(g(&quot;#post-visibility-select input:radio:checked&quot;).val()!=&quot;password&quot;){g(&quot;#password-span&quot;).hide()}else{g(&quot;#password-span&quot;).show()}}function c(){var j,l,k,m;j=new Date(g(&quot;#aa&quot;).val(),g(&quot;#mm&quot;).val()-1,g(&quot;#jj&quot;).val(),g(&quot;#hh&quot;).val(),g(&quot;#mn&quot;).val());l=new Date(g(&quot;#hidden_aa&quot;).val(),g(&quot;#hidden_mm&quot;).val()-1,g(&quot;#hidden_jj&quot;).val(),g(&quot;#hidden_hh&quot;).val(),g(&quot;#hidden_mn&quot;).val());k=new Date(g(&quot;#cur_aa&quot;).val(),g(&quot;#cur_mm&quot;).val()-1,g(&quot;#cur_jj&quot;).val(),g(&quot;#cur_hh&quot;).val(),g(&quot;#cur_mn&quot;).val());if(j&gt;k&amp;&amp;g(&quot;#original_post_status&quot;).val()!=&quot;future&quot;){m=postL10n.publishOnFuture;g(&quot;#publish&quot;).val(postL10n.schedule)}else{if(j&lt;=k&amp;&amp;g(&quot;#original_post_status&quot;).val()!=&quot;publish&quot;){m=postL10n.publishOn;g(&quot;#publish&quot;).val(postL10n.publish)}else{m=postL10n.publishOnPast;g(&quot;#publish&quot;).val(postL10n.update)}}if(l.toUTCString()==j.toUTCString()){g(&quot;#timestamp&quot;).html(a)}else{g(&quot;#timestamp&quot;).html(m+&quot; &lt;b&gt;&quot;+g(&quot;#mm option[value=&quot;+g(&quot;#mm&quot;).val()+&quot;]&quot;).text()+&quot; &quot;+g(&quot;#jj&quot;).val()+&quot;, &quot;+g(&quot;#aa&quot;).val()+&quot; @ &quot;+g(&quot;#hh&quot;).val()+&quot;:&quot;+g(&quot;#mn&quot;).val()+&quot;&lt;/b&gt; &quot;)}if(g(&quot;#post-visibility-select input:radio:checked&quot;).val()==&quot;private&quot;){g(&quot;#publish&quot;).val(postL10n.update);if(g(&quot;#post_status option[value=publish]&quot;).length==0){g(&quot;#post_status&quot;).append('&lt;option value=&quot;publish&quot;&gt;'+postL10n.privatelyPublished+&quot;&lt;/option&gt;&quot;)}g(&quot;#post_status option[value=publish]&quot;).html(postL10n.privatelyPublished);g(&quot;#post_status option[value=publish]&quot;).attr(&quot;selected&quot;,true);g(&quot;.edit-post-status&quot;).hide()}else{if(g(&quot;#original_post_status&quot;).val()==&quot;future&quot;||g(&quot;#original_post_status&quot;).val()==&quot;draft&quot;){if(g(&quot;#post_status option[value=publish]&quot;).length!=0){g(&quot;#post_status option[value=publish]&quot;).remove();g(&quot;#post_status&quot;).val(g(&quot;#hidden_post_status&quot;).val())}}else{g(&quot;#post_status option[value=publish]&quot;).html(postL10n.published)}g(&quot;.edit-post-status&quot;).show()}g(&quot;#post-status-display&quot;).html(g(&quot;#post_status :selected&quot;).text());if(g(&quot;#post_status :selected&quot;).val()==&quot;private&quot;||g(&quot;#post_status :selected&quot;).val()==&quot;publish&quot;){g(&quot;#save-post&quot;).hide()}else{g(&quot;#save-post&quot;).show();if(g(&quot;#post_status :selected&quot;).val()==&quot;pending&quot;){g(&quot;#save-post&quot;).show().val(postL10n.savePending)}else{g(&quot;#save-post&quot;).show().val(postL10n.saveDraft)}}}g(&quot;.edit-visibility&quot;).click(function(){if(g(&quot;#post-visibility-select&quot;).is(&quot;:hidden&quot;)){f();g(&quot;#post-visibility-select&quot;).slideDown(&quot;normal&quot;);g(&quot;.edit-visibility&quot;).hide()}return false});g(&quot;.cancel-post-visibility&quot;).click(function(){g(&quot;#post-visibility-select&quot;).slideUp(&quot;normal&quot;);g(&quot;#visibility-radio-&quot;+g(&quot;#hidden-post-visibility&quot;).val()).attr(&quot;checked&quot;,true);g(&quot;#post_password&quot;).val(g(&quot;#hidden_post_password&quot;).val());g(&quot;#sticky&quot;).attr(&quot;checked&quot;,g(&quot;#hidden-post-sticky&quot;).attr(&quot;checked&quot;));g(&quot;#post-visibility-display&quot;).html(b);g(&quot;.edit-visibility&quot;).show();c();return false});g(&quot;.save-post-visibility&quot;).click(function(){g(&quot;#post-visibility-select&quot;).slideUp(&quot;normal&quot;);g(&quot;.edit-visibility&quot;).show();c();if(g(&quot;#post-visibility-select input:radio:checked&quot;).val()!=&quot;public&quot;){g(&quot;#sticky&quot;).attr(&quot;checked&quot;,false)}if(true==g(&quot;#sticky&quot;).attr(&quot;checked&quot;)){h=&quot;Sticky&quot;}else{h=&quot;&quot;}g(&quot;#post-visibility-display&quot;).html(postL10n[g(&quot;#post-visibility-select input:radio:checked&quot;).val()+h]);return false});g(&quot;#post-visibility-select input:radio&quot;).change(function(){f()});g(&quot;.edit-timestamp&quot;).click(function(){if(g(&quot;#timestampdiv&quot;).is(&quot;:hidden&quot;)){g(&quot;#timestampdiv&quot;).slideDown(&quot;normal&quot;);g(&quot;.edit-timestamp&quot;).hide()}return false});g(&quot;.cancel-timestamp&quot;).click(function(){g(&quot;#timestampdiv&quot;).slideUp(&quot;normal&quot;);g(&quot;#mm&quot;).val(g(&quot;#hidden_mm&quot;).val());g(&quot;#jj&quot;).val(g(&quot;#hidden_jj&quot;).val());g(&quot;#aa&quot;).val(g(&quot;#hidden_aa&quot;).val());g(&quot;#hh&quot;).val(g(&quot;#hidden_hh&quot;).val());g(&quot;#mn&quot;).val(g(&quot;#hidden_mn&quot;).val());g(&quot;.edit-timestamp&quot;).show();c();return false});g(&quot;.save-timestamp&quot;).click(function(){g(&quot;#timestampdiv&quot;).slideUp(&quot;normal&quot;);g(&quot;.edit-timestamp&quot;).show();c();return false});g(&quot;.edit-post-status&quot;).click(function(){if(g(&quot;#post-status-select&quot;).is(&quot;:hidden&quot;)){g(&quot;#post-status-select&quot;).slideDown(&quot;normal&quot;);g(this).hide()}return false});g(&quot;.save-post-status&quot;).click(function(){g(&quot;#post-status-select&quot;).slideUp(&quot;normal&quot;);g(&quot;.edit-post-status&quot;).show();c();return false});g(&quot;.cancel-post-status&quot;).click(function(){g(&quot;#post-status-select&quot;).slideUp(&quot;normal&quot;);g(&quot;#post_status&quot;).val(g(&quot;#hidden_post_status&quot;).val());g(&quot;.edit-post-status&quot;).show();c();return false});g(&quot;#the-list&quot;).wpList({addAfter:function(j,k){g(&quot;table#list-table&quot;).show();if(typeof(autosave_update_post_ID)!=&quot;undefined&quot;){autosave_update_post_ID(k.parsed.responses[0].supplemental.postid)}},addBefore:function(j){j.data+=&quot;&amp;post_id=&quot;+g(&quot;#post_ID&quot;).val();return j}})});
</del><span class="cx">\ No newline at end of file
</span><ins>+function array_unique_noempty(b){var c=[];jQuery.each(b,function(a,d){d=jQuery.trim(d);if(d&amp;&amp;jQuery.inArray(d,c)==-1){c.push(d)}});return c}function new_tag_remove_tag(){var e=jQuery(this).attr(&quot;id&quot;),a=e.split(&quot;-check-num-&quot;)[1],c=jQuery(this).parents(&quot;.tagsdiv&quot;),b=c.find(&quot;.the-tags&quot;).val().split(&quot;,&quot;),d=[];delete b[a];jQuery.each(b,function(f,g){g=jQuery.trim(g);if(g){d.push(g)}});c.find(&quot;.the-tags&quot;).val(d.join(&quot;,&quot;).replace(/\s*,+\s*/,&quot;,&quot;).replace(/,+/,&quot;,&quot;).replace(/,+\s+,+/,&quot;,&quot;).replace(/,+\s*$/,&quot;&quot;).replace(/^\s*,+/,&quot;&quot;));tag_update_quickclicks(c);return false}function tag_update_quickclicks(b){if(jQuery(b).find(&quot;.the-tags&quot;).length==0){return}var a=jQuery(b).find(&quot;.the-tags&quot;).val().split(&quot;,&quot;);jQuery(b).find(&quot;.tagchecklist&quot;).empty();shown=false;jQuery.each(a,function(e,f){var c,d;f=jQuery.trim(f);if(!f.match(/^\s+$/)&amp;&amp;&quot;&quot;!=f){d=jQuery(b).attr(&quot;id&quot;)+&quot;-check-num-&quot;+e;c='&lt;span&gt;&lt;a id=&quot;'+d+'&quot; class=&quot;ntdelbutton&quot;&gt;X&lt;/a&gt;&amp;nbsp;'+f+&quot;&lt;/span&gt; &quot;;jQuery(b).find(&quot;.tagchecklist&quot;).append(c);jQuery(&quot;#&quot;+d).click(new_tag_remove_tag)}});if(shown){jQuery(b).find(&quot;.tagchecklist&quot;).prepend(&quot;&lt;strong&gt;&quot;+postL10n.tagsUsed+&quot;&lt;/strong&gt;&lt;br /&gt;&quot;)}}function tag_flush_to_text(g,b){b=b||false;var e,f,c,d;e=jQuery(&quot;#&quot;+g);f=b?jQuery(b).text():e.find(&quot;input.newtag&quot;).val();if(e.find(&quot;input.newtag&quot;).hasClass(&quot;form-input-tip&quot;)&amp;&amp;!b){return false}c=e.find(&quot;.the-tags&quot;).val();d=c?c+&quot;,&quot;+f:f;d=d.replace(/\s+,+\s*/g,&quot;,&quot;).replace(/,+/g,&quot;,&quot;).replace(/,+\s+,+/g,&quot;,&quot;).replace(/,+\s*$/g,&quot;&quot;).replace(/^\s*,+/g,&quot;&quot;);d=array_unique_noempty(d.split(&quot;,&quot;)).join(&quot;,&quot;);e.find(&quot;.the-tags&quot;).val(d);tag_update_quickclicks(e);if(!b){e.find(&quot;input.newtag&quot;).val(&quot;&quot;).focus()}return false}function tag_save_on_publish(){jQuery(&quot;.tagsdiv&quot;).each(function(a){if(!jQuery(this).find(&quot;input.newtag&quot;).hasClass(&quot;form-input-tip&quot;)){tag_flush_to_text(jQuery(this).parents(&quot;.tagsdiv&quot;).attr(&quot;id&quot;))}})}function tag_press_key(a){if(13==a.which){tag_flush_to_text(jQuery(a.target).parents(&quot;.tagsdiv&quot;).attr(&quot;id&quot;));return false}}function tag_init(){jQuery(&quot;.ajaxtag&quot;).show();jQuery(&quot;.tagsdiv&quot;).each(function(a){tag_update_quickclicks(this)});jQuery(&quot;.ajaxtag input.tagadd&quot;).click(function(){tag_flush_to_text(jQuery(this).parents(&quot;.tagsdiv&quot;).attr(&quot;id&quot;))});jQuery(&quot;.ajaxtag input.newtag&quot;).focus(function(){if(!this.cleared){this.cleared=true;jQuery(this).val(&quot;&quot;).removeClass(&quot;form-input-tip&quot;)}});jQuery(&quot;.ajaxtag input.newtag&quot;).blur(function(){if(this.value==&quot;&quot;){this.cleared=false;jQuery(this).val(postL10n.addTag).addClass(&quot;form-input-tip&quot;)}});jQuery(&quot;#publish&quot;).click(tag_save_on_publish);jQuery(&quot;#save-post&quot;).click(tag_save_on_publish);jQuery(&quot;.ajaxtag input.newtag&quot;).keypress(tag_press_key)}var commentsBox,tagCloud;(function(a){commentsBox={st:0,get:function(d,c){var b=this.st,e;if(!c){c=20}this.st+=c;this.total=d;a(&quot;#commentsdiv img.waiting&quot;).show();e={action:&quot;get-comments&quot;,mode:&quot;single&quot;,_ajax_nonce:a(&quot;#add_comment_nonce&quot;).val(),post_ID:a(&quot;#post_ID&quot;).val(),start:b,num:c};a.post(ajaxurl,e,function(f){f=wpAjax.parseAjaxResponse(f);a(&quot;#commentsdiv .widefat&quot;).show();a(&quot;#commentsdiv img.waiting&quot;).hide();if(&quot;object&quot;==typeof f&amp;&amp;f.responses[0]){a(&quot;#the-comment-list&quot;).append(f.responses[0].data);theList=theExtraList=null;a(&quot;a[className*=':']&quot;).unbind();setCommentsList();if(commentsBox.st&gt;commentsBox.total){a(&quot;#show-comments&quot;).hide()}else{a(&quot;#show-comments&quot;).html(postL10n.showcomm)}return}else{if(1==f){a(&quot;#show-comments&quot;).parent().html(postL10n.endcomm);return}}a(&quot;#the-comment-list&quot;).append('&lt;tr&gt;&lt;td colspan=&quot;5&quot;&gt;'+wpAjax.broken+&quot;&lt;/td&gt;&lt;/tr&gt;&quot;)});return false}};tagCloud={init:function(){a(&quot;.tagcloud-link&quot;).click(function(){tagCloud.get(a(this).attr(&quot;id&quot;));a(this).unbind().click(function(){a(this).siblings(&quot;.the-tagcloud&quot;).toggle();return false});return false})},get:function(c){var b=c.substr(c.indexOf(&quot;-&quot;)+1);a.post(ajaxurl,{action:&quot;get-tagcloud&quot;,tax:b},function(e,d){if(0==e||&quot;success&quot;!=d){e=wpAjax.broken}e=a('&lt;p id=&quot;tagcloud-'+b+'&quot; class=&quot;the-tagcloud&quot;&gt;'+e+&quot;&lt;/p&gt;&quot;);a(&quot;a&quot;,e).click(function(){var f=a(this).parents(&quot;p&quot;).attr(&quot;id&quot;);tag_flush_to_text(f.substr(f.indexOf(&quot;-&quot;)+1),this);return false});a(&quot;#&quot;+c).after(e)})}};a(document).ready(function(){tagCloud.init()})})(jQuery);jQuery(document).ready(function(g){var d=false,i,e,a=g(&quot;#timestamp&quot;).html(),b=g(&quot;#post-visibility-display&quot;).html(),h=&quot;&quot;;postboxes.add_postbox_toggles(&quot;post&quot;);make_slugedit_clickable();tag_init();g(&quot;.newtag&quot;).each(function(){var j=g(this).parents(&quot;div.tagsdiv&quot;).attr(&quot;id&quot;);g(this).suggest(&quot;admin-ajax.php?action=ajax-tag-search&amp;tax=&quot;+j,{delay:500,minchars:2,multiple:true,multipleSep:&quot;, &quot;})});g(&quot;#category-tabs a&quot;).click(function(){var j=g(this).attr(&quot;href&quot;);g(this).parent().addClass(&quot;tabs&quot;).siblings(&quot;li&quot;).removeClass(&quot;tabs&quot;);g(&quot;.tabs-panel&quot;).hide();g(j).show();if(&quot;#categories-all&quot;==j){deleteUserSetting(&quot;cats&quot;)}else{setUserSetting(&quot;cats&quot;,&quot;pop&quot;)}return false});if(getUserSetting(&quot;cats&quot;)){g('#category-tabs a[href=&quot;#categories-pop&quot;]').click()}g(&quot;#newcat&quot;).one(&quot;focus&quot;,function(){g(this).val(&quot;&quot;).removeClass(&quot;form-input-tip&quot;)});g(&quot;#category-add-sumbit&quot;).click(function(){g(&quot;#newcat&quot;).focus()});i=function(){if(d){return}d=true;var j=jQuery(this),l=j.is(&quot;:checked&quot;),k=j.val().toString();g(&quot;#in-category-&quot;+k+&quot;, #in-popular-category-&quot;+k).attr(&quot;checked&quot;,l);d=false};popularCats=g(&quot;#categorychecklist-pop :checkbox&quot;).map(function(){return parseInt(jQuery(this).val(),10)}).get().join(&quot;,&quot;);catAddBefore=function(j){if(!g(&quot;#newcat&quot;).val()){return false}j.data+=&quot;&amp;popular_ids=&quot;+popularCats+&quot;&amp;&quot;+jQuery(&quot;#categorychecklist :checked&quot;).serialize();return j};e=function(m,k){var j=jQuery(&quot;#newcat_parent&quot;),l=j.find('option[value=&quot;-1&quot;]');g(k.what+&quot; response_data&quot;,m).each(function(){var n=g(g(this).text());n.find(&quot;label&quot;).each(function(){var q=g(this),s=q.find(&quot;input&quot;).val(),t=q.find(&quot;input&quot;)[0].id,p,r;g(&quot;#&quot;+t).change(i).change();if(j.find('option[value=&quot;'+s+'&quot;]').size()){return}p=g.trim(q.text());r=g('&lt;option value=&quot;'+parseInt(s,10)+'&quot;&gt;&lt;/option&gt;').text(p);j.prepend(r)});l.attr(&quot;selected&quot;,&quot;selected&quot;)})};g(&quot;#categorychecklist&quot;).wpList({alt:&quot;&quot;,response:&quot;category-ajax-response&quot;,addBefore:catAddBefore,addAfter:e});g(&quot;#category-add-toggle&quot;).click(function(){g(&quot;#category-adder&quot;).toggleClass(&quot;wp-hidden-children&quot;);g('#category-tabs a[href=&quot;#categories-all&quot;]').click();return false});g(&quot;.categorychecklist .popular-category :checkbox&quot;).change(i).filter(&quot;:checked&quot;).change(),h=&quot;&quot;;function f(){if(g(&quot;#post-visibility-select input:radio:checked&quot;).val()!=&quot;public&quot;){g(&quot;#sticky&quot;).attr(&quot;checked&quot;,false);g(&quot;#sticky-span&quot;).hide()}else{g(&quot;#sticky-span&quot;).show()}if(g(&quot;#post-visibility-select input:radio:checked&quot;).val()!=&quot;password&quot;){g(&quot;#password-span&quot;).hide()}else{g(&quot;#password-span&quot;).show()}}function c(){var j,l,k,m;j=new Date(g(&quot;#aa&quot;).val(),g(&quot;#mm&quot;).val()-1,g(&quot;#jj&quot;).val(),g(&quot;#hh&quot;).val(),g(&quot;#mn&quot;).val());l=new Date(g(&quot;#hidden_aa&quot;).val(),g(&quot;#hidden_mm&quot;).val()-1,g(&quot;#hidden_jj&quot;).val(),g(&quot;#hidden_hh&quot;).val(),g(&quot;#hidden_mn&quot;).val());k=new Date(g(&quot;#cur_aa&quot;).val(),g(&quot;#cur_mm&quot;).val()-1,g(&quot;#cur_jj&quot;).val(),g(&quot;#cur_hh&quot;).val(),g(&quot;#cur_mn&quot;).val());if(j&gt;k&amp;&amp;g(&quot;#original_post_status&quot;).val()!=&quot;future&quot;){m=postL10n.publishOnFuture;g(&quot;#publish&quot;).val(postL10n.schedule)}else{if(j&lt;=k&amp;&amp;g(&quot;#original_post_status&quot;).val()!=&quot;publish&quot;){m=postL10n.publishOn;g(&quot;#publish&quot;).val(postL10n.publish)}else{m=postL10n.publishOnPast;g(&quot;#publish&quot;).val(postL10n.update)}}if(l.toUTCString()==j.toUTCString()){g(&quot;#timestamp&quot;).html(a)}else{g(&quot;#timestamp&quot;).html(m+&quot; &lt;b&gt;&quot;+g(&quot;#mm option[value=&quot;+g(&quot;#mm&quot;).val()+&quot;]&quot;).text()+&quot; &quot;+g(&quot;#jj&quot;).val()+&quot;, &quot;+g(&quot;#aa&quot;).val()+&quot; @ &quot;+g(&quot;#hh&quot;).val()+&quot;:&quot;+g(&quot;#mn&quot;).val()+&quot;&lt;/b&gt; &quot;)}if(g(&quot;#post-visibility-select input:radio:checked&quot;).val()==&quot;private&quot;){g(&quot;#publish&quot;).val(postL10n.update);if(g(&quot;#post_status option[value=publish]&quot;).length==0){g(&quot;#post_status&quot;).append('&lt;option value=&quot;publish&quot;&gt;'+postL10n.privatelyPublished+&quot;&lt;/option&gt;&quot;)}g(&quot;#post_status option[value=publish]&quot;).html(postL10n.privatelyPublished);g(&quot;#post_status option[value=publish]&quot;).attr(&quot;selected&quot;,true);g(&quot;.edit-post-status&quot;).hide()}else{if(g(&quot;#original_post_status&quot;).val()==&quot;future&quot;||g(&quot;#original_post_status&quot;).val()==&quot;draft&quot;){if(g(&quot;#post_status option[value=publish]&quot;).length!=0){g(&quot;#post_status option[value=publish]&quot;).remove();g(&quot;#post_status&quot;).val(g(&quot;#hidden_post_status&quot;).val())}}else{g(&quot;#post_status option[value=publish]&quot;).html(postL10n.published)}g(&quot;.edit-post-status&quot;).show()}g(&quot;#post-status-display&quot;).html(g(&quot;#post_status :selected&quot;).text());if(g(&quot;#post_status :selected&quot;).val()==&quot;private&quot;||g(&quot;#post_status :selected&quot;).val()==&quot;publish&quot;){g(&quot;#save-post&quot;).hide()}else{g(&quot;#save-post&quot;).show();if(g(&quot;#post_status :selected&quot;).val()==&quot;pending&quot;){g(&quot;#save-post&quot;).show().val(postL10n.savePending)}else{g(&quot;#save-post&quot;).show().val(postL10n.saveDraft)}}}g(&quot;.edit-visibility&quot;).click(function(){if(g(&quot;#post-visibility-select&quot;).is(&quot;:hidden&quot;)){f();g(&quot;#post-visibility-select&quot;).slideDown(&quot;normal&quot;);g(&quot;.edit-visibility&quot;).hide()}return false});g(&quot;.cancel-post-visibility&quot;).click(function(){g(&quot;#post-visibility-select&quot;).slideUp(&quot;normal&quot;);g(&quot;#visibility-radio-&quot;+g(&quot;#hidden-post-visibility&quot;).val()).attr(&quot;checked&quot;,true);g(&quot;#post_password&quot;).val(g(&quot;#hidden_post_password&quot;).val());g(&quot;#sticky&quot;).attr(&quot;checked&quot;,g(&quot;#hidden-post-sticky&quot;).attr(&quot;checked&quot;));g(&quot;#post-visibility-display&quot;).html(b);g(&quot;.edit-visibility&quot;).show();c();return false});g(&quot;.save-post-visibility&quot;).click(function(){g(&quot;#post-visibility-select&quot;).slideUp(&quot;normal&quot;);g(&quot;.edit-visibility&quot;).show();c();if(g(&quot;#post-visibility-select input:radio:checked&quot;).val()!=&quot;public&quot;){g(&quot;#sticky&quot;).attr(&quot;checked&quot;,false)}if(true==g(&quot;#sticky&quot;).attr(&quot;checked&quot;)){h=&quot;Sticky&quot;}else{h=&quot;&quot;}g(&quot;#post-visibility-display&quot;).html(postL10n[g(&quot;#post-visibility-select input:radio:checked&quot;).val()+h]);return false});g(&quot;#post-visibility-select input:radio&quot;).change(function(){f()});g(&quot;.edit-timestamp&quot;).click(function(){if(g(&quot;#timestampdiv&quot;).is(&quot;:hidden&quot;)){g(&quot;#timestampdiv&quot;).slideDown(&quot;normal&quot;);g(&quot;.edit-timestamp&quot;).hide()}return false});g(&quot;.cancel-timestamp&quot;).click(function(){g(&quot;#timestampdiv&quot;).slideUp(&quot;normal&quot;);g(&quot;#mm&quot;).val(g(&quot;#hidden_mm&quot;).val());g(&quot;#jj&quot;).val(g(&quot;#hidden_jj&quot;).val());g(&quot;#aa&quot;).val(g(&quot;#hidden_aa&quot;).val());g(&quot;#hh&quot;).val(g(&quot;#hidden_hh&quot;).val());g(&quot;#mn&quot;).val(g(&quot;#hidden_mn&quot;).val());g(&quot;.edit-timestamp&quot;).show();c();return false});g(&quot;.save-timestamp&quot;).click(function(){g(&quot;#timestampdiv&quot;).slideUp(&quot;normal&quot;);g(&quot;.edit-timestamp&quot;).show();c();return false});g(&quot;.edit-post-status&quot;).click(function(){if(g(&quot;#post-status-select&quot;).is(&quot;:hidden&quot;)){g(&quot;#post-status-select&quot;).slideDown(&quot;normal&quot;);g(this).hide()}return false});g(&quot;.save-post-status&quot;).click(function(){g(&quot;#post-status-select&quot;).slideUp(&quot;normal&quot;);g(&quot;.edit-post-status&quot;).show();c();return false});g(&quot;.cancel-post-status&quot;).click(function(){g(&quot;#post-status-select&quot;).slideUp(&quot;normal&quot;);g(&quot;#post_status&quot;).val(g(&quot;#hidden_post_status&quot;).val());g(&quot;.edit-post-status&quot;).show();c();return false});g(&quot;#the-list&quot;).wpList({addAfter:function(j,k){g(&quot;table#list-table&quot;).show();if(typeof(autosave_update_post_ID)!=&quot;undefined&quot;){autosave_update_post_ID(k.parsed.responses[0].supplemental.postid)}},addBefore:function(j){j.data+=&quot;&amp;post_id=&quot;+g(&quot;#post_ID&quot;).val();return j}})});
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjsautosavedevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/autosave.dev.js (11878 => 11879)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/autosave.dev.js        2009-08-25 22:05:15 UTC (rev 11878)
+++ trunk/wp-includes/js/autosave.dev.js        2009-08-26 04:11:16 UTC (rev 11879)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-var autosave, autosaveLast = '', autosavePeriodical, autosaveOldMessage = '', autosaveDelayPreview = false, notSaved = true;
</del><ins>+var autosave, autosaveLast = '', autosavePeriodical, autosaveOldMessage = '', autosaveDelayPreview = false, notSaved = true, blockSave = false;
</ins><span class="cx"> 
</span><span class="cx"> jQuery(document).ready( function($) {
</span><span class="cx">         var dotabkey = true;
</span><span class="lines">@@ -12,6 +12,7 @@
</span><span class="cx">         });
</span><span class="cx"> 
</span><span class="cx">         $('input[type=&quot;submit&quot;], a.submitdelete', '#submitpost').click(function(){
</span><ins>+                blockSave = true;
</ins><span class="cx">                 window.onbeforeunload = null;
</span><span class="cx">                 $(':button, :submit', '#submitpost').each(function(){
</span><span class="cx">                         var t = $(this);
</span><span class="lines">@@ -67,6 +68,16 @@
</span><span class="cx">                         }
</span><span class="cx">                 });
</span><span class="cx">         }
</span><ins>+
+        // autosave new posts after a title is typed but not if Publish or Save Draft is clicked
+        if ( 0 &gt; $('#post_ID').val() ) {
+                $('#title').blur( function() {
+                        if ( !this.value || 0 &lt; $('#post_ID').val() )
+                                return;
+
+                        delayed_autosave();
+                });
+        }
</ins><span class="cx"> });
</span><span class="cx"> 
</span><span class="cx"> function autosave_parse_response(response) {
</span><span class="lines">@@ -183,6 +194,14 @@
</span><span class="cx">         setTimeout(autosave_enable_buttons, 5000);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function delayed_autosave() {
+        setTimeout(function(){
+                if ( blockSave )
+                        return;
+                autosave();
+        }, 200);
+}
+
</ins><span class="cx"> autosave = function() {
</span><span class="cx">         // (bool) is rich editor enabled and active
</span><span class="cx">         var rich = (typeof tinyMCE != &quot;undefined&quot;) &amp;&amp; tinyMCE.activeEditor &amp;&amp; !tinyMCE.activeEditor.isHidden(), post_data, doAutoSave, ed, origStatus, successCallback;
</span></span></pre></div>
<a id="trunkwpincludesjsautosavejs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/autosave.js (11878 => 11879)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/autosave.js        2009-08-25 22:05:15 UTC (rev 11878)
+++ trunk/wp-includes/js/autosave.js        2009-08-26 04:11:16 UTC (rev 11879)
</span><span class="lines">@@ -1 +1 @@
</span><del>-var autosave,autosaveLast=&quot;&quot;,autosavePeriodical,autosaveOldMessage=&quot;&quot;,autosaveDelayPreview=false,notSaved=true;jQuery(document).ready(function(b){var a=true;autosaveLast=b(&quot;#post #title&quot;).val()+b(&quot;#post #content&quot;).val();autosavePeriodical=b.schedule({time:autosaveL10n.autosaveInterval*1000,func:function(){autosave()},repeat:true,protect:true});b(&quot;#post&quot;).submit(function(){b.cancel(autosavePeriodical)});b('input[type=&quot;submit&quot;], a.submitdelete',&quot;#submitpost&quot;).click(function(){window.onbeforeunload=null;b(&quot;:button, :submit&quot;,&quot;#submitpost&quot;).each(function(){var c=b(this);if(c.hasClass(&quot;button-primary&quot;)){c.addClass(&quot;button-primary-disabled&quot;)}else{c.addClass(&quot;button-disabled&quot;)}});b(&quot;#ajax-loading&quot;).css(&quot;visibility&quot;,&quot;visible&quot;)});window.onbeforeunload=function(){var c=typeof(tinyMCE)!=&quot;undefined&quot;?tinyMCE.activeEditor:false,e,d;if(c&amp;&amp;!c.isHidden()){if(c.isDirty()){return autosaveL10n.saveAlert}}else{e=b(&quot;#post #title&quot;).val(),d=b(&quot;#post #content&quot;).val();if((e||d)&amp;&amp;e+d!=autosaveLast){return autosaveL10n.saveAlert}}};b(&quot;#post-preview&quot;).click(function(){if(1&gt;b(&quot;#post_ID&quot;).val()&amp;&amp;notSaved){autosaveDelayPreview=true;autosave();return false}doPreview();return false});doPreview=function(){b(&quot;input#wp-preview&quot;).val(&quot;dopreview&quot;);b(&quot;form#post&quot;).attr(&quot;target&quot;,&quot;wp-preview&quot;).submit().attr(&quot;target&quot;,&quot;&quot;);b(&quot;input#wp-preview&quot;).val(&quot;&quot;)};if(typeof tinyMCE!=&quot;undefined&quot;){b(&quot;#title&quot;)[b.browser.opera?&quot;keypress&quot;:&quot;keydown&quot;](function(c){if(c.which==9&amp;&amp;!c.shiftKey&amp;&amp;!c.controlKey&amp;&amp;!c.altKey){if((b(&quot;#post_ID&quot;).val()&lt;1)&amp;&amp;(b(&quot;#title&quot;).val().length&gt;0)){autosave()}if(tinyMCE.activeEditor&amp;&amp;!tinyMCE.activeEditor.isHidden()&amp;&amp;a){c.preventDefault();a=false;tinyMCE.activeEditor.focus();return false}}})}});function autosave_parse_response(b){var c=wpAjax.parseAjaxResponse(b,&quot;autosave&quot;),d=&quot;&quot;,a;if(c&amp;&amp;c.responses&amp;&amp;c.responses.length){d=c.responses[0].data;if(c.responses[0].supplemental){if(&quot;disable&quot;==c.responses[0].supplemental.disable_autosave){autosave=function(){};c={errors:true}}jQuery.each(c.responses[0].supplemental,function(e,f){if(e.match(/^replace-/)){jQuery(&quot;#&quot;+e.replace(&quot;replace-&quot;,&quot;&quot;)).val(f)}})}if(!c.errors){a=parseInt(c.responses[0].id,10);if(!isNaN(a)&amp;&amp;a&gt;0){autosave_update_slug(a)}}}if(d){jQuery(&quot;#autosave&quot;).html(d)}else{if(autosaveOldMessage&amp;&amp;c){jQuery(&quot;#autosave&quot;).html(autosaveOldMessage)}}return c}function autosave_saved(a){autosave_parse_response(a);autosave_enable_buttons()}function autosave_saved_new(b){var d=autosave_parse_response(b),c,a;if(d&amp;&amp;d.responses.length&amp;&amp;!d.errors){c=jQuery(&quot;#post_ID&quot;).val();a=parseInt(d.responses[0].id,10);autosave_update_post_ID(a);if(c&lt;0&amp;&amp;a&gt;0){notSaved=false;jQuery(&quot;#media-buttons a&quot;).each(function(){this.href=this.href.replace(c,a)})}if(autosaveDelayPreview){autosaveDelayPreview=false;doPreview()}}else{autosave_enable_buttons()}}function autosave_update_post_ID(a){if(!isNaN(a)&amp;&amp;a&gt;0){if(a==parseInt(jQuery(&quot;#post_ID&quot;).val(),10)){return}jQuery(&quot;#post_ID&quot;).attr({name:&quot;post_ID&quot;});jQuery(&quot;#post_ID&quot;).val(a);jQuery.post(autosaveL10n.requestFile,{action:&quot;autosave-generate-nonces&quot;,post_ID:a,autosavenonce:jQuery(&quot;#autosavenonce&quot;).val(),post_type:jQuery(&quot;#post_type&quot;).val()},function(b){jQuery(&quot;#_wpnonce&quot;).val(b);autosave_enable_buttons()});jQuery(&quot;#hiddenaction&quot;).val(&quot;editpost&quot;)}}function autosave_update_slug(a){if(jQuery.isFunction(make_slugedit_clickable)&amp;&amp;!jQuery(&quot;#edit-slug-box &gt; *&quot;).size()){jQuery.post(slugL10n.requestFile,{action:&quot;sample-permalink&quot;,post_id:a,new_title:jQuery(&quot;#title&quot;).val(),samplepermalinknonce:jQuery(&quot;#samplepermalinknonce&quot;).val()},function(b){jQuery(&quot;#edit-slug-box&quot;).html(b);make_slugedit_clickable()})}}function autosave_loading(){jQuery(&quot;#autosave&quot;).html(autosaveL10n.savingText)}function autosave_enable_buttons(){jQuery(&quot;:button, :submit&quot;,&quot;#submitpost&quot;).removeAttr(&quot;disabled&quot;);jQuery(&quot;#ajax-loading&quot;).css(&quot;visibility&quot;,&quot;hidden&quot;)}function autosave_disable_buttons(){jQuery(&quot;:button, :submit&quot;,&quot;#submitpost&quot;).attr(&quot;disabled&quot;,&quot;disabled&quot;);setTimeout(autosave_enable_buttons,5000)}autosave=function(){var c=(typeof tinyMCE!=&quot;undefined&quot;)&amp;&amp;tinyMCE.activeEditor&amp;&amp;!tinyMCE.activeEditor.isHidden(),d,f,b,e,a;autosave_disable_buttons();d={action:&quot;autosave&quot;,post_ID:jQuery(&quot;#post_ID&quot;).val()||0,post_title:jQuery(&quot;#title&quot;).val()||&quot;&quot;,autosavenonce:jQuery(&quot;#autosavenonce&quot;).val(),post_type:jQuery(&quot;#post_type&quot;).val()||&quot;&quot;,autosave:1};jQuery(&quot;.tags-input&quot;).each(function(){d[this.name]=this.value});f=true;if(jQuery(&quot;#TB_window&quot;).css(&quot;display&quot;)==&quot;block&quot;){f=false}if(c&amp;&amp;f){b=tinyMCE.activeEditor;if(b.plugins.spellchecker&amp;&amp;b.plugins.spellchecker.active){f=false}else{if(&quot;mce_fullscreen&quot;==b.id){tinyMCE.get(&quot;content&quot;).setContent(b.getContent({format:&quot;raw&quot;}),{format:&quot;raw&quot;})}tinyMCE.get(&quot;content&quot;).save()}}d.content=jQuery(&quot;#content&quot;).val();if(jQuery(&quot;#post_name&quot;).val()){d.post_name=jQuery(&quot;#post_name&quot;).val()}if((d.post_title.length==0&amp;&amp;d.content.length==0)||d.post_title+d.content==autosaveLast){f=false}e=jQuery(&quot;#original_post_status&quot;).val();goodcats=([]);jQuery(&quot;[name='post_category[]']:checked&quot;).each(function(g){goodcats.push(this.value)});d.catslist=goodcats.join(&quot;,&quot;);if(jQuery(&quot;#comment_status&quot;).attr(&quot;checked&quot;)){d.comment_status=&quot;open&quot;}if(jQuery(&quot;#ping_status&quot;).attr(&quot;checked&quot;)){d.ping_status=&quot;open&quot;}if(jQuery(&quot;#excerpt&quot;).size()){d.excerpt=jQuery(&quot;#excerpt&quot;).val()}if(jQuery(&quot;#post_author&quot;).size()){d.post_author=jQuery(&quot;#post_author&quot;).val()}d.user_ID=jQuery(&quot;#user-id&quot;).val();if(f){autosaveLast=jQuery(&quot;#title&quot;).val()+jQuery(&quot;#content&quot;).val()}else{d.autosave=0}if(parseInt(d.post_ID,10)&lt;1){d.temp_ID=d.post_ID;a=autosave_saved_new}else{a=autosave_saved}autosaveOldMessage=jQuery(&quot;#autosave&quot;).html();jQuery.ajax({data:d,beforeSend:f?autosave_loading:null,type:&quot;POST&quot;,url:autosaveL10n.requestFile,success:a})};
</del><span class="cx">\ No newline at end of file
</span><ins>+var autosave,autosaveLast=&quot;&quot;,autosavePeriodical,autosaveOldMessage=&quot;&quot;,autosaveDelayPreview=false,notSaved=true,blockSave=false;jQuery(document).ready(function(b){var a=true;autosaveLast=b(&quot;#post #title&quot;).val()+b(&quot;#post #content&quot;).val();autosavePeriodical=b.schedule({time:autosaveL10n.autosaveInterval*1000,func:function(){autosave()},repeat:true,protect:true});b(&quot;#post&quot;).submit(function(){b.cancel(autosavePeriodical)});b('input[type=&quot;submit&quot;], a.submitdelete',&quot;#submitpost&quot;).click(function(){blockSave=true;window.onbeforeunload=null;b(&quot;:button, :submit&quot;,&quot;#submitpost&quot;).each(function(){var c=b(this);if(c.hasClass(&quot;button-primary&quot;)){c.addClass(&quot;button-primary-disabled&quot;)}else{c.addClass(&quot;button-disabled&quot;)}});b(&quot;#ajax-loading&quot;).css(&quot;visibility&quot;,&quot;visible&quot;)});window.onbeforeunload=function(){var c=typeof(tinyMCE)!=&quot;undefined&quot;?tinyMCE.activeEditor:false,e,d;if(c&amp;&amp;!c.isHidden()){if(c.isDirty()){return autosaveL10n.saveAlert}}else{e=b(&quot;#post #title&quot;).val(),d=b(&quot;#post #content&quot;).val();if((e||d)&amp;&amp;e+d!=autosaveLast){return autosaveL10n.saveAlert}}};b(&quot;#post-preview&quot;).click(function(){if(1&gt;b(&quot;#post_ID&quot;).val()&amp;&amp;notSaved){autosaveDelayPreview=true;autosave();return false}doPreview();return false});doPreview=function(){b(&quot;input#wp-preview&quot;).val(&quot;dopreview&quot;);b(&quot;form#post&quot;).attr(&quot;target&quot;,&quot;wp-preview&quot;).submit().attr(&quot;target&quot;,&quot;&quot;);b(&quot;input#wp-preview&quot;).val(&quot;&quot;)};if(typeof tinyMCE!=&quot;undefined&quot;){b(&quot;#title&quot;)[b.browser.opera?&quot;keypress&quot;:&quot;keydown&quot;](function(c){if(c.which==9&amp;&amp;!c.shiftKey&amp;&amp;!c.controlKey&amp;&amp;!c.altKey){if((b(&quot;#post_ID&quot;).val()&lt;1)&amp;&amp;(b(&quot;#title&quot;).val().length&gt;0)){autosave()}if(tinyMCE.activeEditor&amp;&amp;!tinyMCE.activeEditor.isHidden()&amp;&amp;a){c.preventDefault();a=false;tinyMCE.activeEditor.focus();return false}}})}if(0&gt;b(&quot;#post_ID&quot;).val()){b(&quot;#title&quot;).blur(function(){if(!this.value||0&lt;b(&quot;#post_ID&quot;).val()){return}delayed_autosave()})}});function autosave_parse_response(b){var c=wpAjax.parseAjaxResponse(b,&quot;autosave&quot;),d=&quot;&quot;,a;if(c&amp;&amp;c.responses&amp;&amp;c.responses.length){d=c.responses[0].data;if(c.responses[0].supplemental){if(&quot;disable&quot;==c.responses[0].supplemental.disable_autosave){autosave=function(){};c={errors:true}}jQuery.each(c.responses[0].supplemental,function(e,f){if(e.match(/^replace-/)){jQuery(&quot;#&quot;+e.replace(&quot;replace-&quot;,&quot;&quot;)).val(f)}})}if(!c.errors){a=parseInt(c.responses[0].id,10);if(!isNaN(a)&amp;&amp;a&gt;0){autosave_update_slug(a)}}}if(d){jQuery(&quot;#autosave&quot;).html(d)}else{if(autosaveOldMessage&amp;&amp;c){jQuery(&quot;#autosave&quot;).html(autosaveOldMessage)}}return c}function autosave_saved(a){autosave_parse_response(a);autosave_enable_buttons()}function autosave_saved_new(b){var d=autosave_parse_response(b),c,a;if(d&amp;&amp;d.responses.length&amp;&amp;!d.errors){c=jQuery(&quot;#post_ID&quot;).val();a=parseInt(d.responses[0].id,10);autosave_update_post_ID(a);if(c&lt;0&amp;&amp;a&gt;0){notSaved=false;jQuery(&quot;#media-buttons a&quot;).each(function(){this.href=this.href.replace(c,a)})}if(autosaveDelayPreview){autosaveDelayPreview=false;doPreview()}}else{autosave_enable_buttons()}}function autosave_update_post_ID(a){if(!isNaN(a)&amp;&amp;a&gt;0){if(a==parseInt(jQuery(&quot;#post_ID&quot;).val(),10)){return}jQuery(&quot;#post_ID&quot;).attr({name:&quot;post_ID&quot;});jQuery(&quot;#post_ID&quot;).val(a);jQuery.post(autosaveL10n.requestFile,{action:&quot;autosave-generate-nonces&quot;,post_ID:a,autosavenonce:jQuery(&quot;#autosavenonce&quot;).val(),post_type:jQuery(&quot;#post_type&quot;).val()},function(b){jQuery(&quot;#_wpnonce&quot;).val(b);autosave_enable_buttons()});jQuery(&quot;#hiddenaction&quot;).val(&quot;editpost&quot;)}}function autosave_update_slug(a){if(jQuery.isFunction(make_slugedit_clickable)&amp;&amp;!jQuery(&quot;#edit-slug-box &gt; *&quot;).size()){jQuery.post(slugL10n.requestFile,{action:&quot;sample-permalink&quot;,post_id:a,new_title:jQuery(&quot;#title&quot;).val(),samplepermalinknonce:jQuery(&quot;#samplepermalinknonce&quot;).val()},function(b){jQuery(&quot;#edit-slug-box&quot;).html(b);make_slugedit_clickable()})}}function autosave_loading(){jQuery(&quot;#autosave&quot;).html(autosaveL10n.savingText)}function autosave_enable_buttons(){jQuery(&quot;:button, :submit&quot;,&quot;#submitpost&quot;).removeAttr(&quot;disabled&quot;);jQuery(&quot;#ajax-loading&quot;).css(&quot;visibility&quot;,&quot;hidden&quot;)}function autosave_disable_buttons(){jQuery(&quot;:button, :submit&quot;,&quot;#submitpost&quot;).attr(&quot;disabled&quot;,&quot;disabled&quot;);setTimeout(autosave_enable_buttons,5000)}function delayed_autosave(){setTimeout(function(){if(blockSave){return}autosave()},200)}autosave=function(){var c=(typeof tinyMCE!=&quot;undefined&quot;)&amp;&amp;tinyMCE.activeEditor&amp;&amp;!tinyMCE.activeEditor.isHidden(),d,f,b,e,a;autosave_disable_buttons();d={action:&quot;autosave&quot;,post_ID:jQuery(&quot;#post_ID&quot;).val()||0,post_title:jQuery(&quot;#title&quot;).val()||&quot;&quot;,autosavenonce:jQuery(&quot;#autosavenonce&quot;).val(),post_type:jQuery(&quot;#post_type&quot;).val()||&quot;&quot;,autosave:1};jQuery(&quot;.tags-input&quot;).each(function(){d[this.name]=this.value});f=true;if(jQuery(&quot;#TB_window&quot;).css(&quot;display&quot;)==&quot;block&quot;){f=false}if(c&amp;&amp;f){b=tinyMCE.activeEditor;if(b.plugins.spellchecker&amp;&amp;b.plugins.spellchecker.active){f=false}else{if(&quot;mce_fullscreen&quot;==b.id){tinyMCE.get(&quot;content&quot;).setContent(b.getContent({format:&quot;raw&quot;}),{format:&quot;raw&quot;})}tinyMCE.get(&quot;content&quot;).save()}}d.content=jQuery(&quot;#content&quot;).val();if(jQuery(&quot;#post_name&quot;).val()){d.post_name=jQuery(&quot;#post_name&quot;).val()}if((d.post_title.length==0&amp;&amp;d.content.length==0)||d.post_title+d.content==autosaveLast){f=false}e=jQuery(&quot;#original_post_status&quot;).val();goodcats=([]);jQuery(&quot;[name='post_category[]']:checked&quot;).each(function(g){goodcats.push(this.value)});d.catslist=goodcats.join(&quot;,&quot;);if(jQuery(&quot;#comment_status&quot;).attr(&quot;checked&quot;)){d.comment_status=&quot;open&quot;}if(jQuery(&quot;#ping_status&quot;).attr(&quot;checked&quot;)){d.ping_status=&quot;open&quot;}if(jQuery(&quot;#excerpt&quot;).size()){d.excerpt=jQuery(&quot;#excerpt&quot;).val()}if(jQuery(&quot;#post_author&quot;).size()){d.post_author=jQuery(&quot;#post_author&quot;).val()}d.user_ID=jQuery(&quot;#user-id&quot;).val();if(f){autosaveLast=jQuery(&quot;#title&quot;).val()+jQuery(&quot;#content&quot;).val()}else{d.autosave=0}if(parseInt(d.post_ID,10)&lt;1){d.temp_ID=d.post_ID;a=autosave_saved_new}else{a=autosave_saved}autosaveOldMessage=jQuery(&quot;#autosave&quot;).html();jQuery.ajax({data:d,beforeSend:f?autosave_loading:null,type:&quot;POST&quot;,url:autosaveL10n.requestFile,success:a})};
</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 (11878 => 11879)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2009-08-25 22:05:15 UTC (rev 11878)
+++ trunk/wp-includes/script-loader.php        2009-08-26 04:11:16 UTC (rev 11879)
</span><span class="lines">@@ -98,7 +98,7 @@
</span><span class="cx">                 'l10n_print_after' =&gt; 'try{convertEntities(wpAjax);}catch(e){};'
</span><span class="cx">         ) );
</span><span class="cx"> 
</span><del>-        $scripts-&gt;add( 'autosave', &quot;/wp-includes/js/autosave$suffix.js&quot;, array('schedule', 'wp-ajax-response'), '20090823' );
</del><ins>+        $scripts-&gt;add( 'autosave', &quot;/wp-includes/js/autosave$suffix.js&quot;, array('schedule', 'wp-ajax-response'), '20090825' );
</ins><span class="cx">         $scripts-&gt;add_data( 'autosave', 'group', 1 );
</span><span class="cx"> 
</span><span class="cx">         $scripts-&gt;add( 'wp-lists', &quot;/wp-includes/js/wp-lists$suffix.js&quot;, array('wp-ajax-response'), '20090504' );
</span><span class="lines">@@ -275,7 +275,7 @@
</span><span class="cx">                         'l10n_print_after' =&gt; 'try{convertEntities(slugL10n);}catch(e){};'
</span><span class="cx">                 ) );
</span><span class="cx"> 
</span><del>-                $scripts-&gt;add( 'post', &quot;/wp-admin/js/post$suffix.js&quot;, array('suggest', 'wp-lists', 'postbox', 'slug'), '20090624' );
</del><ins>+                $scripts-&gt;add( 'post', &quot;/wp-admin/js/post$suffix.js&quot;, array('suggest', 'wp-lists', 'postbox', 'slug'), '20090825' );
</ins><span class="cx">                 $scripts-&gt;add_data( 'post', 'group', 1 );
</span><span class="cx">                 $scripts-&gt;localize( 'post', 'postL10n', array(
</span><span class="cx">                         'tagsUsed' =&gt;  __('Tags used on this post:'),
</span><span class="lines">@@ -303,7 +303,7 @@
</span><span class="cx">                         'l10n_print_after' =&gt; 'try{convertEntities(postL10n);}catch(e){};'
</span><span class="cx">                 ) );
</span><span class="cx"> 
</span><del>-                $scripts-&gt;add( 'page', &quot;/wp-admin/js/page$suffix.js&quot;, array('jquery', 'slug', 'wp-lists', 'postbox'), '20090526' );
</del><ins>+                $scripts-&gt;add( 'page', &quot;/wp-admin/js/page$suffix.js&quot;, array('jquery', 'slug', 'wp-lists', 'postbox'), '20090825' );
</ins><span class="cx">                 $scripts-&gt;add_data( 'page', 'group', 1 );
</span><span class="cx">                 $scripts-&gt;localize( 'page', 'postL10n', array(
</span><span class="cx">                         'cancel' =&gt; __('Cancel'),
</span></span></pre>
</div>
</div>

</body>
</html>