<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[14387] trunk: Handle &quot;, &quot; and &quot;,&quot; in non-hierarchical term suggestion.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/14387">14387</a></dd>
<dt>Author</dt> <dd>dd32</dd>
<dt>Date</dt> <dd>2010-05-03 19:23:44 +0000 (Mon, 03 May 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Handle &quot;, &quot; and &quot;,&quot; in non-hierarchical term suggestion. Props ocean90. Fixes <a href="http://trac.wordpress.org/ticket/12152">#12152</a></pre>

<h3>Modified Paths</h3>
<ul>
<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="#trunkwpincludesjsjquerysuggestdevjs">trunk/wp-includes/js/jquery/suggest.dev.js</a></li>
<li><a href="#trunkwpincludesjsjquerysuggestjs">trunk/wp-includes/js/jquery/suggest.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminjspostdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/post.dev.js (14386 => 14387)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/post.dev.js        2010-05-03 19:23:37 UTC (rev 14386)
+++ trunk/wp-admin/js/post.dev.js        2010-05-03 19:23:44 UTC (rev 14387)
</span><span class="lines">@@ -133,7 +133,7 @@
</span><span class="cx">                         }
</span><span class="cx">                 }).each(function(){
</span><span class="cx">                         var tax = $(this).closest('div.tagsdiv').attr('id');
</span><del>-                        $(this).suggest( ajaxurl + '?action=ajax-tag-search&amp;tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: &quot;, &quot; } );
</del><ins>+                        $(this).suggest( ajaxurl + '?action=ajax-tag-search&amp;tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: &quot;,&quot; } );
</ins><span class="cx">                 });
</span><span class="cx"> 
</span><span class="cx">             // save tags on post save/publish
</span></span></pre></div>
<a id="trunkwpadminjspostjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/post.js (14386 => 14387)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/post.js        2010-05-03 19:23:37 UTC (rev 14386)
+++ trunk/wp-admin/js/post.js        2010-05-03 19:23:44 UTC (rev 14387)
</span><span class="lines">@@ -1 +1 @@
</span><del>-var tagBox,commentsBox,editPermalink,makeSlugeditClickable,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail;function array_unique_noempty(a){var out=[];jQuery.each(a,function(key,val){val=jQuery.trim(val);if(val&amp;&amp;jQuery.inArray(val,out)==-1){out.push(val)}});return out}(function($){tagBox={clean:function(tags){return tags.replace(/\s*,\s*/g,&quot;,&quot;).replace(/,+/g,&quot;,&quot;).replace(/[,\s]+$/,&quot;&quot;).replace(/^[,\s]+/,&quot;&quot;)},parseTags:function(el){var id=el.id,num=id.split(&quot;-check-num-&quot;)[1],taxbox=$(el).closest(&quot;.tagsdiv&quot;),thetags=taxbox.find(&quot;.the-tags&quot;),current_tags=thetags.val().split(&quot;,&quot;),new_tags=[];delete current_tags[num];$.each(current_tags,function(key,val){val=$.trim(val);if(val){new_tags.push(val)}});thetags.val(this.clean(new_tags.join(&quot;,&quot;)));this.quickClicks(taxbox);return false},quickClicks:function(el){var thetags=$(&quot;.the-tags&quot;,el),tagchecklist=$(&quot;.tagchecklist&quot;,el),current_tags;if(!thetags.length){return}var disabled=thetags.attr(&quot;disabled&quot;);current_tags=thetags.val().split(&quot;,&quot;);tagchecklist.empty();$.each(current_tags,function(key,val){var txt,button_id,id=$(el).attr(&quot;id&quot;);val=$.trim(val);if(!val.match(/^\s+$/)&amp;&amp;&quot;&quot;!=val){button_id=id+&quot;-check-num-&quot;+key;if(disabled){txt=&quot;&lt;span&gt;&quot;+val+&quot;&lt;/span&gt; &quot;}else{txt='&lt;span&gt;&lt;a id=&quot;'+button_id+'&quot; class=&quot;ntdelbutton&quot;&gt;X&lt;/a&gt;&amp;nbsp;'+val+&quot;&lt;/span&gt; &quot;}tagchecklist.append(txt);if(!disabled){$(&quot;#&quot;+button_id).click(function(){tagBox.parseTags(this)})}}})},flushTags:function(el,a,f){a=a||false;var text,tags=$(&quot;.the-tags&quot;,el),newtag=$(&quot;input.newtag&quot;,el),newtags;text=a?$(a).text():newtag.val();tagsval=tags.val();newtags=tagsval?tagsval+&quot;,&quot;+text:text;newtags=this.clean(newtags);newtags=array_unique_noempty(newtags.split(&quot;,&quot;)).join(&quot;,&quot;);tags.val(newtags);this.quickClicks(el);if(!a){newtag.val(&quot;&quot;)}if(&quot;undefined&quot;==typeof(f)){newtag.focus()}return false},get:function(id){var tax=id.substr(id.indexOf(&quot;-&quot;)+1);$.post(ajaxurl,{action:&quot;get-tagcloud&quot;,tax:tax},function(r,stat){if(0==r||&quot;success&quot;!=stat){r=wpAjax.broken}r=$('&lt;p id=&quot;tagcloud-'+tax+'&quot; class=&quot;the-tagcloud&quot;&gt;'+r+&quot;&lt;/p&gt;&quot;);$(&quot;a&quot;,r).click(function(){tagBox.flushTags($(this).closest(&quot;.inside&quot;).children(&quot;.tagsdiv&quot;),this);return false});$(&quot;#&quot;+id).after(r)})},init:function(){var t=this,ajaxtag=$(&quot;div.ajaxtag&quot;);$(&quot;.tagsdiv&quot;).each(function(){tagBox.quickClicks(this)});$(&quot;input.tagadd&quot;,ajaxtag).click(function(){t.flushTags($(this).closest(&quot;.tagsdiv&quot;))});$(&quot;div.taghint&quot;,ajaxtag).click(function(){$(this).css(&quot;visibility&quot;,&quot;hidden&quot;).siblings(&quot;.newtag&quot;).focus()});$(&quot;input.newtag&quot;,ajaxtag).blur(function(){if(this.value==&quot;&quot;){$(this).siblings(&quot;.taghint&quot;).css(&quot;visibility&quot;,&quot;&quot;)}}).focus(function(){$(this).siblings(&quot;.taghint&quot;).css(&quot;visibility&quot;,&quot;hidden&quot;)}).keyup(function(e){if(13==e.which){tagBox.flushTags($(this).closest(&quot;.tagsdiv&quot;));return false}}).keypress(function(e){if(13==e.which){e.preventDefault();return false}}).each(function(){var tax=$(this).closest(&quot;div.tagsdiv&quot;).attr(&quot;id&quot;);$(this).suggest(ajaxurl+&quot;?action=ajax-tag-search&amp;tax=&quot;+tax,{delay:500,minchars:2,multiple:true,multipleSep:&quot;, &quot;})});$(&quot;#post&quot;).submit(function(){$(&quot;div.tagsdiv&quot;).each(function(){tagBox.flushTags(this,false,1)})});$(&quot;a.tagcloud-link&quot;).click(function(){tagBox.get($(this).attr(&quot;id&quot;));$(this).unbind().click(function(){$(this).siblings(&quot;.the-tagcloud&quot;).toggle();return false});return false})}};commentsBox={st:0,get:function(total,num){var st=this.st,data;if(!num){num=20}this.st+=num;this.total=total;$(&quot;#commentsdiv img.waiting&quot;).show();data={action:&quot;get-comments&quot;,mode:&quot;single&quot;,_ajax_nonce:$(&quot;#add_comment_nonce&quot;).val(),post_ID:$(&quot;#post_ID&quot;).val(),start:st,num:num};$.post(ajaxurl,data,function(r){r=wpAjax.parseAjaxResponse(r);$(&quot;#commentsdiv .widefat&quot;).show();$(&quot;#commentsdiv img.waiting&quot;).hide();if(&quot;object&quot;==typeof r&amp;&amp;r.responses[0]){$(&quot;#the-comment-list&quot;).append(r.responses[0].data);theList=theExtraList=null;$(&quot;a[className*=':']&quot;).unbind();setCommentsList();if(commentsBox.st&gt;commentsBox.total){$(&quot;#show-comments&quot;).hide()}else{$(&quot;#show-comments&quot;).html(postL10n.showcomm)}return}else{if(1==r){$(&quot;#show-comments&quot;).parent().html(postL10n.endcomm);return}}$(&quot;#the-comment-list&quot;).append('&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;'+wpAjax.broken+&quot;&lt;/td&gt;&lt;/tr&gt;&quot;)});return false}};WPSetThumbnailHTML=function(html){$(&quot;.inside&quot;,&quot;#postimagediv&quot;).html(html)};WPSetThumbnailID=function(id){var field=$(&quot;input[value=_thumbnail_id]&quot;,&quot;#list-table&quot;);if(field.size()&gt;0){$(&quot;#meta\\[&quot;+field.attr(&quot;id&quot;).match(/[0-9]+/)+&quot;\\]\\[value\\]&quot;).text(id)}};WPRemoveThumbnail=function(){$.post(ajaxurl,{action:&quot;set-post-thumbnail&quot;,post_id:$(&quot;#post_ID&quot;).val(),thumbnail_id:-1,cookie:encodeURIComponent(document.cookie)},function(str){if(str==&quot;0&quot;){alert(setPostThumbnailL10n.error)}else{WPSetThumbnailHTML(str)}})}})(jQuery);jQuery(document).ready(function($){var stamp,visibility,sticky=&quot;&quot;;postboxes.add_postbox_toggles(pagenow);if($(&quot;#tagsdiv-post_tag&quot;).length){tagBox.init()}else{$(&quot;#side-sortables, #normal-sortables, #advanced-sortables&quot;).children(&quot;div.postbox&quot;).each(function(){if(this.id.indexOf(&quot;tagsdiv-&quot;)===0){tagBox.init();return false}})}$(&quot;.categorydiv&quot;).each(function(){var this_id=$(this).attr(&quot;id&quot;),noSyncChecks=false,syncChecks,catAddAfter,taxonomyParts,taxonomy,settingName;taxonomyParts=this_id.split(&quot;-&quot;);taxonomyParts.shift();taxonomy=taxonomyParts.join(&quot;-&quot;);settingName=taxonomy+&quot;_tab&quot;;if(taxonomy==&quot;category&quot;){settingName=&quot;cats&quot;}$(&quot;a&quot;,&quot;#&quot;+taxonomy+&quot;-tabs&quot;).click(function(){var t=$(this).attr(&quot;href&quot;);$(this).parent().addClass(&quot;tabs&quot;).siblings(&quot;li&quot;).removeClass(&quot;tabs&quot;);$(&quot;#&quot;+taxonomy+&quot;-tabs&quot;).siblings(&quot;.tabs-panel&quot;).hide();$(t).show();if(&quot;#&quot;+taxonomy+&quot;-all&quot;==t){deleteUserSetting(settingName)}else{setUserSetting(settingName,&quot;pop&quot;)}return false});if(getUserSetting(settingName)){$('a[href=&quot;#'+taxonomy+'-pop&quot;]',&quot;#&quot;+taxonomy+&quot;-tabs&quot;).click()}$(&quot;#new&quot;+taxonomy).one(&quot;focus&quot;,function(){$(this).val(&quot;&quot;).removeClass(&quot;form-input-tip&quot;)});$(&quot;#&quot;+taxonomy+&quot;-add-submit&quot;).click(function(){$(&quot;#new&quot;+taxonomy).focus()});syncChecks=function(){if(noSyncChecks){return}noSyncChecks=true;var th=jQuery(this),c=th.is(&quot;:checked&quot;),id=th.val().toString();$(&quot;#in-&quot;+taxonomy+&quot;-&quot;+id+&quot;, #in-&quot;+taxonomy+&quot;-category-&quot;+id).attr(&quot;checked&quot;,c);noSyncChecks=false};catAddBefore=function(s){if(!$(&quot;#new&quot;+taxonomy).val()){return false}s.data+=&quot;&amp;&quot;+$(&quot;:checked&quot;,&quot;#&quot;+taxonomy+&quot;checklist&quot;).serialize();return s};catAddAfter=function(r,s){var sup,drop=$(&quot;#new&quot;+taxonomy+&quot;_parent&quot;);if(&quot;undefined&quot;!=s.parsed.responses[0]&amp;&amp;(sup=s.parsed.responses[0].supplemental.newcat_parent)){drop.before(sup);drop.remove()}};$(&quot;#&quot;+taxonomy+&quot;checklist&quot;).wpList({alt:&quot;&quot;,response:taxonomy+&quot;-ajax-response&quot;,addBefore:catAddBefore,addAfter:catAddAfter});$(&quot;#&quot;+taxonomy+&quot;-add-toggle&quot;).click(function(){$(&quot;#&quot;+taxonomy+&quot;-adder&quot;).toggleClass(&quot;wp-hidden-children&quot;);$('a[href=&quot;#'+taxonomy+'-all&quot;]',&quot;#&quot;+taxonomy+&quot;-tabs&quot;).click();return false});$(&quot;#&quot;+taxonomy+&quot;checklist li.popular-category :checkbox, #&quot;+taxonomy+&quot;checklist-pop :checkbox&quot;).live(&quot;click&quot;,function(){var t=$(this),c=t.is(&quot;:checked&quot;),id=t.val();if(id&amp;&amp;t.parents(&quot;#taxonomy-&quot;+taxonomy).length){$(&quot;#in-&quot;+taxonomy+&quot;-&quot;+id+&quot;, #in-popular-&quot;+taxonomy+&quot;-&quot;+id).attr(&quot;checked&quot;,c)}})});if($(&quot;#postcustom&quot;).length){$(&quot;#the-list&quot;).wpList({addAfter:function(xml,s){$(&quot;table#list-table&quot;).show();if(typeof(autosave_update_post_ID)!=&quot;undefined&quot;){autosave_update_post_ID(s.parsed.responses[0].supplemental.postid)}},addBefore:function(s){s.data+=&quot;&amp;post_id=&quot;+$(&quot;#post_ID&quot;).val();return s}})}if($(&quot;#submitdiv&quot;).length){stamp=$(&quot;#timestamp&quot;).html();visibility=$(&quot;#post-visibility-display&quot;).html();function updateVisibility(){var pvSelect=$(&quot;#post-visibility-select&quot;);if($(&quot;input:radio:checked&quot;,pvSelect).val()!=&quot;public&quot;){$(&quot;#sticky&quot;).attr(&quot;checked&quot;,false);$(&quot;#sticky-span&quot;).hide()}else{$(&quot;#sticky-span&quot;).show()}if($(&quot;input:radio:checked&quot;,pvSelect).val()!=&quot;password&quot;){$(&quot;#password-span&quot;).hide()}else{$(&quot;#password-span&quot;).show()}}function updateText(){var attemptedDate,originalDate,currentDate,publishOn,page=&quot;page&quot;==pagenow||&quot;page-new&quot;==pagenow,postStatus=$(&quot;#post_status&quot;),optPublish=$(&quot;option[value=publish]&quot;,postStatus),aa=$(&quot;#aa&quot;).val(),mm=$(&quot;#mm&quot;).val(),jj=$(&quot;#jj&quot;).val(),hh=$(&quot;#hh&quot;).val(),mn=$(&quot;#mn&quot;).val();attemptedDate=new Date(aa,mm-1,jj,hh,mn);originalDate=new Date($(&quot;#hidden_aa&quot;).val(),$(&quot;#hidden_mm&quot;).val()-1,$(&quot;#hidden_jj&quot;).val(),$(&quot;#hidden_hh&quot;).val(),$(&quot;#hidden_mn&quot;).val());currentDate=new Date($(&quot;#cur_aa&quot;).val(),$(&quot;#cur_mm&quot;).val()-1,$(&quot;#cur_jj&quot;).val(),$(&quot;#cur_hh&quot;).val(),$(&quot;#cur_mn&quot;).val());if(attemptedDate.getFullYear()!=aa||(1+attemptedDate.getMonth())!=mm||attemptedDate.getDate()!=jj||attemptedDate.getMinutes()!=mn){$(&quot;.timestamp-wrap&quot;,&quot;#timestampdiv&quot;).addClass(&quot;form-invalid&quot;);return false}else{$(&quot;.timestamp-wrap&quot;,&quot;#timestampdiv&quot;).removeClass(&quot;form-invalid&quot;)}if(attemptedDate&gt;currentDate&amp;&amp;$(&quot;#original_post_status&quot;).val()!=&quot;future&quot;){publishOn=postL10n.publishOnFuture;$(&quot;#publish&quot;).val(postL10n.schedule)}else{if(attemptedDate&lt;=currentDate&amp;&amp;$(&quot;#original_post_status&quot;).val()!=&quot;publish&quot;){publishOn=postL10n.publishOn;$(&quot;#publish&quot;).val(postL10n.publish)}else{publishOn=postL10n.publishOnPast;if(page){$(&quot;#publish&quot;).val(postL10n.updatePage)}else{$(&quot;#publish&quot;).val(postL10n.updatePost)}}}if(originalDate.toUTCString()==attemptedDate.toUTCString()){$(&quot;#timestamp&quot;).html(stamp)}else{$(&quot;#timestamp&quot;).html(publishOn+&quot; &lt;b&gt;&quot;+$(&quot;option[value=&quot;+$(&quot;#mm&quot;).val()+&quot;]&quot;,&quot;#mm&quot;).text()+&quot; &quot;+jj+&quot;, &quot;+aa+&quot; @ &quot;+hh+&quot;:&quot;+mn+&quot;&lt;/b&gt; &quot;)}if($(&quot;input:radio:checked&quot;,&quot;#post-visibility-select&quot;).val()==&quot;private&quot;){if(page){$(&quot;#publish&quot;).val(postL10n.updatePage)}else{$(&quot;#publish&quot;).val(postL10n.updatePost)}if(optPublish.length==0){postStatus.append('&lt;option value=&quot;publish&quot;&gt;'+postL10n.privatelyPublished+&quot;&lt;/option&gt;&quot;)}else{optPublish.html(postL10n.privatelyPublished)}$(&quot;option[value=publish]&quot;,postStatus).attr(&quot;selected&quot;,true);$(&quot;.edit-post-status&quot;,&quot;#misc-publishing-actions&quot;).hide()}else{if($(&quot;#original_post_status&quot;).val()==&quot;future&quot;||$(&quot;#original_post_status&quot;).val()==&quot;draft&quot;){if(optPublish.length){optPublish.remove();postStatus.val($(&quot;#hidden_post_status&quot;).val())}}else{optPublish.html(postL10n.published)}if(postStatus.is(&quot;:hidden&quot;)){$(&quot;.edit-post-status&quot;,&quot;#misc-publishing-actions&quot;).show()}}$(&quot;#post-status-display&quot;).html($(&quot;option:selected&quot;,postStatus).text());if($(&quot;option:selected&quot;,postStatus).val()==&quot;private&quot;||$(&quot;option:selected&quot;,postStatus).val()==&quot;publish&quot;){$(&quot;#save-post&quot;).hide()}else{$(&quot;#save-post&quot;).show();if($(&quot;option:selected&quot;,postStatus).val()==&quot;pending&quot;){$(&quot;#save-post&quot;).show().val(postL10n.savePending)}else{$(&quot;#save-post&quot;).show().val(postL10n.saveDraft)}}return true}$(&quot;.edit-visibility&quot;,&quot;#visibility&quot;).click(function(){if($(&quot;#post-visibility-select&quot;).is(&quot;:hidden&quot;)){updateVisibility();$(&quot;#post-visibility-select&quot;).slideDown(&quot;normal&quot;);$(this).hide()}return false});$(&quot;.cancel-post-visibility&quot;,&quot;#post-visibility-select&quot;).click(function(){$(&quot;#post-visibility-select&quot;).slideUp(&quot;normal&quot;);$(&quot;#visibility-radio-&quot;+$(&quot;#hidden-post-visibility&quot;).val()).attr(&quot;checked&quot;,true);$(&quot;#post_password&quot;).val($(&quot;#hidden_post_password&quot;).val());$(&quot;#sticky&quot;).attr(&quot;checked&quot;,$(&quot;#hidden-post-sticky&quot;).attr(&quot;checked&quot;));$(&quot;#post-visibility-display&quot;).html(visibility);$(&quot;.edit-visibility&quot;,&quot;#visibility&quot;).show();updateText();return false});$(&quot;.save-post-visibility&quot;,&quot;#post-visibility-select&quot;).click(function(){var pvSelect=$(&quot;#post-visibility-select&quot;);pvSelect.slideUp(&quot;normal&quot;);$(&quot;.edit-visibility&quot;,&quot;#visibility&quot;).show();updateText();if($(&quot;input:radio:checked&quot;,pvSelect).val()!=&quot;public&quot;){$(&quot;#sticky&quot;).attr(&quot;checked&quot;,false)}if(true==$(&quot;#sticky&quot;).attr(&quot;checked&quot;)){sticky=&quot;Sticky&quot;}else{sticky=&quot;&quot;}$(&quot;#post-visibility-display&quot;).html(postL10n[$(&quot;input:radio:checked&quot;,pvSelect).val()+sticky]);return false});$(&quot;input:radio&quot;,&quot;#post-visibility-select&quot;).change(function(){updateVisibility()});$(&quot;#timestampdiv&quot;).siblings(&quot;a.edit-timestamp&quot;).click(function(){if($(&quot;#timestampdiv&quot;).is(&quot;:hidden&quot;)){$(&quot;#timestampdiv&quot;).slideDown(&quot;normal&quot;);$(this).hide()}return false});$(&quot;.cancel-timestamp&quot;,&quot;#timestampdiv&quot;).click(function(){$(&quot;#timestampdiv&quot;).slideUp(&quot;normal&quot;);$(&quot;#mm&quot;).val($(&quot;#hidden_mm&quot;).val());$(&quot;#jj&quot;).val($(&quot;#hidden_jj&quot;).val());$(&quot;#aa&quot;).val($(&quot;#hidden_aa&quot;).val());$(&quot;#hh&quot;).val($(&quot;#hidden_hh&quot;).val());$(&quot;#mn&quot;).val($(&quot;#hidden_mn&quot;).val());$(&quot;#timestampdiv&quot;).siblings(&quot;a.edit-timestamp&quot;).show();updateText();return false});$(&quot;.save-timestamp&quot;,&quot;#timestampdiv&quot;).click(function(){if(updateText()){$(&quot;#timestampdiv&quot;).slideUp(&quot;normal&quot;);$(&quot;#timestampdiv&quot;).siblings(&quot;a.edit-timestamp&quot;).show()}return false});$(&quot;#post-status-select&quot;).siblings(&quot;a.edit-post-status&quot;).click(function(){if($(&quot;#post-status-select&quot;).is(&quot;:hidden&quot;)){$(&quot;#post-status-select&quot;).slideDown(&quot;normal&quot;);$(this).hide()}return false});$(&quot;.save-post-status&quot;,&quot;#post-status-select&quot;).click(function(){$(&quot;#post-status-select&quot;).slideUp(&quot;normal&quot;);$(&quot;#post-status-select&quot;).siblings(&quot;a.edit-post-status&quot;).show();updateText();return false});$(&quot;.cancel-post-status&quot;,&quot;#post-status-select&quot;).click(function(){$(&quot;#post-status-select&quot;).slideUp(&quot;normal&quot;);$(&quot;#post_status&quot;).val($(&quot;#hidden_post_status&quot;).val());$(&quot;#post-status-select&quot;).siblings(&quot;a.edit-post-status&quot;).show();updateText();return false})}if($(&quot;#edit-slug-box&quot;).length){editPermalink=function(post_id){var i,c=0,e=$(&quot;#editable-post-name&quot;),revert_e=e.html(),real_slug=$(&quot;#post_name&quot;),revert_slug=real_slug.val(),b=$(&quot;#edit-slug-buttons&quot;),revert_b=b.html(),full=$(&quot;#editable-post-name-full&quot;).html();$(&quot;#view-post-btn&quot;).hide();b.html('&lt;a href=&quot;#&quot; class=&quot;save button&quot;&gt;'+postL10n.ok+'&lt;/a&gt; &lt;a class=&quot;cancel&quot; href=&quot;#&quot;&gt;'+postL10n.cancel+&quot;&lt;/a&gt;&quot;);b.children(&quot;.save&quot;).click(function(){var new_slug=e.children(&quot;input&quot;).val();$.post(ajaxurl,{action:&quot;sample-permalink&quot;,post_id:post_id,new_slug:new_slug,new_title:$(&quot;#title&quot;).val(),samplepermalinknonce:$(&quot;#samplepermalinknonce&quot;).val()},function(data){$(&quot;#edit-slug-box&quot;).html(data);b.html(revert_b);real_slug.attr(&quot;value&quot;,new_slug);makeSlugeditClickable();$(&quot;#view-post-btn&quot;).show()});return false});$(&quot;.cancel&quot;,&quot;#edit-slug-buttons&quot;).click(function(){$(&quot;#view-post-btn&quot;).show();e.html(revert_e);b.html(revert_b);real_slug.attr(&quot;value&quot;,revert_slug);return false});for(i=0;i&lt;full.length;++i){if(&quot;%&quot;==full.charAt(i)){c++}}slug_value=(c&gt;full.length/4)?&quot;&quot;:full;e.html('&lt;input type=&quot;text&quot; id=&quot;new-post-slug&quot; value=&quot;'+slug_value+'&quot; /&gt;').children(&quot;input&quot;).keypress(function(e){var key=e.keyCode||0;if(13==key){b.children(&quot;.save&quot;).click();return false}if(27==key){b.children(&quot;.cancel&quot;).click();return false}real_slug.attr(&quot;value&quot;,this.value)}).focus()};makeSlugeditClickable=function(){$(&quot;#editable-post-name&quot;).click(function(){$(&quot;#edit-slug-buttons&quot;).children(&quot;.edit-slug&quot;).click()})};makeSlugeditClickable()}if($(&quot;#title&quot;).val()==&quot;&quot;){$(&quot;#title&quot;).siblings(&quot;#title-prompt-text&quot;).css(&quot;visibility&quot;,&quot;&quot;)}$(&quot;#title-prompt-text&quot;).click(function(){$(this).css(&quot;visibility&quot;,&quot;hidden&quot;).siblings(&quot;#title&quot;).focus()});$(&quot;#title&quot;).blur(function(){if(this.value==&quot;&quot;){$(this).siblings(&quot;#title-prompt-text&quot;).css(&quot;visibility&quot;,&quot;&quot;)}}).focus(function(){$(this).siblings(&quot;#title-prompt-text&quot;).css(&quot;visibility&quot;,&quot;hidden&quot;)}).keydown(function(e){$(this).siblings(&quot;#title-prompt-text&quot;).css(&quot;visibility&quot;,&quot;hidden&quot;);$(this).unbind(e)})});
</del><span class="cx">\ No newline at end of file
</span><ins>+var tagBox,commentsBox,editPermalink,makeSlugeditClickable,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail;function array_unique_noempty(a){var out=[];jQuery.each(a,function(key,val){val=jQuery.trim(val);if(val&amp;&amp;jQuery.inArray(val,out)==-1){out.push(val)}});return out}(function($){tagBox={clean:function(tags){return tags.replace(/\s*,\s*/g,&quot;,&quot;).replace(/,+/g,&quot;,&quot;).replace(/[,\s]+$/,&quot;&quot;).replace(/^[,\s]+/,&quot;&quot;)},parseTags:function(el){var id=el.id,num=id.split(&quot;-check-num-&quot;)[1],taxbox=$(el).closest(&quot;.tagsdiv&quot;),thetags=taxbox.find(&quot;.the-tags&quot;),current_tags=thetags.val().split(&quot;,&quot;),new_tags=[];delete current_tags[num];$.each(current_tags,function(key,val){val=$.trim(val);if(val){new_tags.push(val)}});thetags.val(this.clean(new_tags.join(&quot;,&quot;)));this.quickClicks(taxbox);return false},quickClicks:function(el){var thetags=$(&quot;.the-tags&quot;,el),tagchecklist=$(&quot;.tagchecklist&quot;,el),current_tags;if(!thetags.length){return}var disabled=thetags.attr(&quot;disabled&quot;);current_tags=thetags.val().split(&quot;,&quot;);tagchecklist.empty();$.each(current_tags,function(key,val){var txt,button_id,id=$(el).attr(&quot;id&quot;);val=$.trim(val);if(!val.match(/^\s+$/)&amp;&amp;&quot;&quot;!=val){button_id=id+&quot;-check-num-&quot;+key;if(disabled){txt=&quot;&lt;span&gt;&quot;+val+&quot;&lt;/span&gt; &quot;}else{txt='&lt;span&gt;&lt;a id=&quot;'+button_id+'&quot; class=&quot;ntdelbutton&quot;&gt;X&lt;/a&gt;&amp;nbsp;'+val+&quot;&lt;/span&gt; &quot;}tagchecklist.append(txt);if(!disabled){$(&quot;#&quot;+button_id).click(function(){tagBox.parseTags(this)})}}})},flushTags:function(el,a,f){a=a||false;var text,tags=$(&quot;.the-tags&quot;,el),newtag=$(&quot;input.newtag&quot;,el),newtags;text=a?$(a).text():newtag.val();tagsval=tags.val();newtags=tagsval?tagsval+&quot;,&quot;+text:text;newtags=this.clean(newtags);newtags=array_unique_noempty(newtags.split(&quot;,&quot;)).join(&quot;,&quot;);tags.val(newtags);this.quickClicks(el);if(!a){newtag.val(&quot;&quot;)}if(&quot;undefined&quot;==typeof(f)){newtag.focus()}return false},get:function(id){var tax=id.substr(id.indexOf(&quot;-&quot;)+1);$.post(ajaxurl,{action:&quot;get-tagcloud&quot;,tax:tax},function(r,stat){if(0==r||&quot;success&quot;!=stat){r=wpAjax.broken}r=$('&lt;p id=&quot;tagcloud-'+tax+'&quot; class=&quot;the-tagcloud&quot;&gt;'+r+&quot;&lt;/p&gt;&quot;);$(&quot;a&quot;,r).click(function(){tagBox.flushTags($(this).closest(&quot;.inside&quot;).children(&quot;.tagsdiv&quot;),this);return false});$(&quot;#&quot;+id).after(r)})},init:function(){var t=this,ajaxtag=$(&quot;div.ajaxtag&quot;);$(&quot;.tagsdiv&quot;).each(function(){tagBox.quickClicks(this)});$(&quot;input.tagadd&quot;,ajaxtag).click(function(){t.flushTags($(this).closest(&quot;.tagsdiv&quot;))});$(&quot;div.taghint&quot;,ajaxtag).click(function(){$(this).css(&quot;visibility&quot;,&quot;hidden&quot;).siblings(&quot;.newtag&quot;).focus()});$(&quot;input.newtag&quot;,ajaxtag).blur(function(){if(this.value==&quot;&quot;){$(this).siblings(&quot;.taghint&quot;).css(&quot;visibility&quot;,&quot;&quot;)}}).focus(function(){$(this).siblings(&quot;.taghint&quot;).css(&quot;visibility&quot;,&quot;hidden&quot;)}).keyup(function(e){if(13==e.which){tagBox.flushTags($(this).closest(&quot;.tagsdiv&quot;));return false}}).keypress(function(e){if(13==e.which){e.preventDefault();return false}}).each(function(){var tax=$(this).closest(&quot;div.tagsdiv&quot;).attr(&quot;id&quot;);$(this).suggest(ajaxurl+&quot;?action=ajax-tag-search&amp;tax=&quot;+tax,{delay:500,minchars:2,multiple:true,multipleSep:&quot;,&quot;})});$(&quot;#post&quot;).submit(function(){$(&quot;div.tagsdiv&quot;).each(function(){tagBox.flushTags(this,false,1)})});$(&quot;a.tagcloud-link&quot;).click(function(){tagBox.get($(this).attr(&quot;id&quot;));$(this).unbind().click(function(){$(this).siblings(&quot;.the-tagcloud&quot;).toggle();return false});return false})}};commentsBox={st:0,get:function(total,num){var st=this.st,data;if(!num){num=20}this.st+=num;this.total=total;$(&quot;#commentsdiv img.waiting&quot;).show();data={action:&quot;get-comments&quot;,mode:&quot;single&quot;,_ajax_nonce:$(&quot;#add_comment_nonce&quot;).val(),post_ID:$(&quot;#post_ID&quot;).val(),start:st,num:num};$.post(ajaxurl,data,function(r){r=wpAjax.parseAjaxResponse(r);$(&quot;#commentsdiv .widefat&quot;).show();$(&quot;#commentsdiv img.waiting&quot;).hide();if(&quot;object&quot;==typeof r&amp;&amp;r.responses[0]){$(&quot;#the-comment-list&quot;).append(r.responses[0].data);theList=theExtraList=null;$(&quot;a[className*=':']&quot;).unbind();setCommentsList();if(commentsBox.st&gt;commentsBox.total){$(&quot;#show-comments&quot;).hide()}else{$(&quot;#show-comments&quot;).html(postL10n.showcomm)}return}else{if(1==r){$(&quot;#show-comments&quot;).parent().html(postL10n.endcomm);return}}$(&quot;#the-comment-list&quot;).append('&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;'+wpAjax.broken+&quot;&lt;/td&gt;&lt;/tr&gt;&quot;)});return false}};WPSetThumbnailHTML=function(html){$(&quot;.inside&quot;,&quot;#postimagediv&quot;).html(html)};WPSetThumbnailID=function(id){var field=$(&quot;input[value=_thumbnail_id]&quot;,&quot;#list-table&quot;);if(field.size()&gt;0){$(&quot;#meta\\[&quot;+field.attr(&quot;id&quot;).match(/[0-9]+/)+&quot;\\]\\[value\\]&quot;).text(id)}};WPRemoveThumbnail=function(){$.post(ajaxurl,{action:&quot;set-post-thumbnail&quot;,post_id:$(&quot;#post_ID&quot;).val(),thumbnail_id:-1,cookie:encodeURIComponent(document.cookie)},function(str){if(str==&quot;0&quot;){alert(setPostThumbnailL10n.error)}else{WPSetThumbnailHTML(str)}})}})(jQuery);jQuery(document).ready(function($){var stamp,visibility,sticky=&quot;&quot;;postboxes.add_postbox_toggles(pagenow);if($(&quot;#tagsdiv-post_tag&quot;).length){tagBox.init()}else{$(&quot;#side-sortables, #normal-sortables, #advanced-sortables&quot;).children(&quot;div.postbox&quot;).each(function(){if(this.id.indexOf(&quot;tagsdiv-&quot;)===0){tagBox.init();return false}})}$(&quot;.categorydiv&quot;).each(function(){var this_id=$(this).attr(&quot;id&quot;),noSyncChecks=false,syncChecks,catAddAfter,taxonomyParts,taxonomy,settingName;taxonomyParts=this_id.split(&quot;-&quot;);taxonomyParts.shift();taxonomy=taxonomyParts.join(&quot;-&quot;);settingName=taxonomy+&quot;_tab&quot;;if(taxonomy==&quot;category&quot;){settingName=&quot;cats&quot;}$(&quot;a&quot;,&quot;#&quot;+taxonomy+&quot;-tabs&quot;).click(function(){var t=$(this).attr(&quot;href&quot;);$(this).parent().addClass(&quot;tabs&quot;).siblings(&quot;li&quot;).removeClass(&quot;tabs&quot;);$(&quot;#&quot;+taxonomy+&quot;-tabs&quot;).siblings(&quot;.tabs-panel&quot;).hide();$(t).show();if(&quot;#&quot;+taxonomy+&quot;-all&quot;==t){deleteUserSetting(settingName)}else{setUserSetting(settingName,&quot;pop&quot;)}return false});if(getUserSetting(settingName)){$('a[href=&quot;#'+taxonomy+'-pop&quot;]',&quot;#&quot;+taxonomy+&quot;-tabs&quot;).click()}$(&quot;#new&quot;+taxonomy).one(&quot;focus&quot;,function(){$(this).val(&quot;&quot;).removeClass(&quot;form-input-tip&quot;)});$(&quot;#&quot;+taxonomy+&quot;-add-submit&quot;).click(function(){$(&quot;#new&quot;+taxonomy).focus()});syncChecks=function(){if(noSyncChecks){return}noSyncChecks=true;var th=jQuery(this),c=th.is(&quot;:checked&quot;),id=th.val().toString();$(&quot;#in-&quot;+taxonomy+&quot;-&quot;+id+&quot;, #in-&quot;+taxonomy+&quot;-category-&quot;+id).attr(&quot;checked&quot;,c);noSyncChecks=false};catAddBefore=function(s){if(!$(&quot;#new&quot;+taxonomy).val()){return false}s.data+=&quot;&amp;&quot;+$(&quot;:checked&quot;,&quot;#&quot;+taxonomy+&quot;checklist&quot;).serialize();return s};catAddAfter=function(r,s){var sup,drop=$(&quot;#new&quot;+taxonomy+&quot;_parent&quot;);if(&quot;undefined&quot;!=s.parsed.responses[0]&amp;&amp;(sup=s.parsed.responses[0].supplemental.newcat_parent)){drop.before(sup);drop.remove()}};$(&quot;#&quot;+taxonomy+&quot;checklist&quot;).wpList({alt:&quot;&quot;,response:taxonomy+&quot;-ajax-response&quot;,addBefore:catAddBefore,addAfter:catAddAfter});$(&quot;#&quot;+taxonomy+&quot;-add-toggle&quot;).click(function(){$(&quot;#&quot;+taxonomy+&quot;-adder&quot;).toggleClass(&quot;wp-hidden-children&quot;);$('a[href=&quot;#'+taxonomy+'-all&quot;]',&quot;#&quot;+taxonomy+&quot;-tabs&quot;).click();return false});$(&quot;#&quot;+taxonomy+&quot;checklist li.popular-category :checkbox, #&quot;+taxonomy+&quot;checklist-pop :checkbox&quot;).live(&quot;click&quot;,function(){var t=$(this),c=t.is(&quot;:checked&quot;),id=t.val();if(id&amp;&amp;t.parents(&quot;#taxonomy-&quot;+taxonomy).length){$(&quot;#in-&quot;+taxonomy+&quot;-&quot;+id+&quot;, #in-popular-&quot;+taxonomy+&quot;-&quot;+id).attr(&quot;checked&quot;,c)}})});if($(&quot;#postcustom&quot;).length){$(&quot;#the-list&quot;).wpList({addAfter:function(xml,s){$(&quot;table#list-table&quot;).show();if(typeof(autosave_update_post_ID)!=&quot;undefined&quot;){autosave_update_post_ID(s.parsed.responses[0].supplemental.postid)}},addBefore:function(s){s.data+=&quot;&amp;post_id=&quot;+$(&quot;#post_ID&quot;).val();return s}})}if($(&quot;#submitdiv&quot;).length){stamp=$(&quot;#timestamp&quot;).html();visibility=$(&quot;#post-visibility-display&quot;).html();function updateVisibility(){var pvSelect=$(&quot;#post-visibility-select&quot;);if($(&quot;input:radio:checked&quot;,pvSelect).val()!=&quot;public&quot;){$(&quot;#sticky&quot;).attr(&quot;checked&quot;,false);$(&quot;#sticky-span&quot;).hide()}else{$(&quot;#sticky-span&quot;).show()}if($(&quot;input:radio:checked&quot;,pvSelect).val()!=&quot;password&quot;){$(&quot;#password-span&quot;).hide()}else{$(&quot;#password-span&quot;).show()}}function updateText(){var attemptedDate,originalDate,currentDate,publishOn,page=&quot;page&quot;==pagenow||&quot;page-new&quot;==pagenow,postStatus=$(&quot;#post_status&quot;),optPublish=$(&quot;option[value=publish]&quot;,postStatus),aa=$(&quot;#aa&quot;).val(),mm=$(&quot;#mm&quot;).val(),jj=$(&quot;#jj&quot;).val(),hh=$(&quot;#hh&quot;).val(),mn=$(&quot;#mn&quot;).val();attemptedDate=new Date(aa,mm-1,jj,hh,mn);originalDate=new Date($(&quot;#hidden_aa&quot;).val(),$(&quot;#hidden_mm&quot;).val()-1,$(&quot;#hidden_jj&quot;).val(),$(&quot;#hidden_hh&quot;).val(),$(&quot;#hidden_mn&quot;).val());currentDate=new Date($(&quot;#cur_aa&quot;).val(),$(&quot;#cur_mm&quot;).val()-1,$(&quot;#cur_jj&quot;).val(),$(&quot;#cur_hh&quot;).val(),$(&quot;#cur_mn&quot;).val());if(attemptedDate.getFullYear()!=aa||(1+attemptedDate.getMonth())!=mm||attemptedDate.getDate()!=jj||attemptedDate.getMinutes()!=mn){$(&quot;.timestamp-wrap&quot;,&quot;#timestampdiv&quot;).addClass(&quot;form-invalid&quot;);return false}else{$(&quot;.timestamp-wrap&quot;,&quot;#timestampdiv&quot;).removeClass(&quot;form-invalid&quot;)}if(attemptedDate&gt;currentDate&amp;&amp;$(&quot;#original_post_status&quot;).val()!=&quot;future&quot;){publishOn=postL10n.publishOnFuture;$(&quot;#publish&quot;).val(postL10n.schedule)}else{if(attemptedDate&lt;=currentDate&amp;&amp;$(&quot;#original_post_status&quot;).val()!=&quot;publish&quot;){publishOn=postL10n.publishOn;$(&quot;#publish&quot;).val(postL10n.publish)}else{publishOn=postL10n.publishOnPast;if(page){$(&quot;#publish&quot;).val(postL10n.updatePage)}else{$(&quot;#publish&quot;).val(postL10n.updatePost)}}}if(originalDate.toUTCString()==attemptedDate.toUTCString()){$(&quot;#timestamp&quot;).html(stamp)}else{$(&quot;#timestamp&quot;).html(publishOn+&quot; &lt;b&gt;&quot;+$(&quot;option[value=&quot;+$(&quot;#mm&quot;).val()+&quot;]&quot;,&quot;#mm&quot;).text()+&quot; &quot;+jj+&quot;, &quot;+aa+&quot; @ &quot;+hh+&quot;:&quot;+mn+&quot;&lt;/b&gt; &quot;)}if($(&quot;input:radio:checked&quot;,&quot;#post-visibility-select&quot;).val()==&quot;private&quot;){if(page){$(&quot;#publish&quot;).val(postL10n.updatePage)}else{$(&quot;#publish&quot;).val(postL10n.updatePost)}if(optPublish.length==0){postStatus.append('&lt;option value=&quot;publish&quot;&gt;'+postL10n.privatelyPublished+&quot;&lt;/option&gt;&quot;)}else{optPublish.html(postL10n.privatelyPublished)}$(&quot;option[value=publish]&quot;,postStatus).attr(&quot;selected&quot;,true);$(&quot;.edit-post-status&quot;,&quot;#misc-publishing-actions&quot;).hide()}else{if($(&quot;#original_post_status&quot;).val()==&quot;future&quot;||$(&quot;#original_post_status&quot;).val()==&quot;draft&quot;){if(optPublish.length){optPublish.remove();postStatus.val($(&quot;#hidden_post_status&quot;).val())}}else{optPublish.html(postL10n.published)}if(postStatus.is(&quot;:hidden&quot;)){$(&quot;.edit-post-status&quot;,&quot;#misc-publishing-actions&quot;).show()}}$(&quot;#post-status-display&quot;).html($(&quot;option:selected&quot;,postStatus).text());if($(&quot;option:selected&quot;,postStatus).val()==&quot;private&quot;||$(&quot;option:selected&quot;,postStatus).val()==&quot;publish&quot;){$(&quot;#save-post&quot;).hide()}else{$(&quot;#save-post&quot;).show();if($(&quot;option:selected&quot;,postStatus).val()==&quot;pending&quot;){$(&quot;#save-post&quot;).show().val(postL10n.savePending)}else{$(&quot;#save-post&quot;).show().val(postL10n.saveDraft)}}return true}$(&quot;.edit-visibility&quot;,&quot;#visibility&quot;).click(function(){if($(&quot;#post-visibility-select&quot;).is(&quot;:hidden&quot;)){updateVisibility();$(&quot;#post-visibility-select&quot;).slideDown(&quot;normal&quot;);$(this).hide()}return false});$(&quot;.cancel-post-visibility&quot;,&quot;#post-visibility-select&quot;).click(function(){$(&quot;#post-visibility-select&quot;).slideUp(&quot;normal&quot;);$(&quot;#visibility-radio-&quot;+$(&quot;#hidden-post-visibility&quot;).val()).attr(&quot;checked&quot;,true);$(&quot;#post_password&quot;).val($(&quot;#hidden_post_password&quot;).val());$(&quot;#sticky&quot;).attr(&quot;checked&quot;,$(&quot;#hidden-post-sticky&quot;).attr(&quot;checked&quot;));$(&quot;#post-visibility-display&quot;).html(visibility);$(&quot;.edit-visibility&quot;,&quot;#visibility&quot;).show();updateText();return false});$(&quot;.save-post-visibility&quot;,&quot;#post-visibility-select&quot;).click(function(){var pvSelect=$(&quot;#post-visibility-select&quot;);pvSelect.slideUp(&quot;normal&quot;);$(&quot;.edit-visibility&quot;,&quot;#visibility&quot;).show();updateText();if($(&quot;input:radio:checked&quot;,pvSelect).val()!=&quot;public&quot;){$(&quot;#sticky&quot;).attr(&quot;checked&quot;,false)}if(true==$(&quot;#sticky&quot;).attr(&quot;checked&quot;)){sticky=&quot;Sticky&quot;}else{sticky=&quot;&quot;}$(&quot;#post-visibility-display&quot;).html(postL10n[$(&quot;input:radio:checked&quot;,pvSelect).val()+sticky]);return false});$(&quot;input:radio&quot;,&quot;#post-visibility-select&quot;).change(function(){updateVisibility()});$(&quot;#timestampdiv&quot;).siblings(&quot;a.edit-timestamp&quot;).click(function(){if($(&quot;#timestampdiv&quot;).is(&quot;:hidden&quot;)){$(&quot;#timestampdiv&quot;).slideDown(&quot;normal&quot;);$(this).hide()}return false});$(&quot;.cancel-timestamp&quot;,&quot;#timestampdiv&quot;).click(function(){$(&quot;#timestampdiv&quot;).slideUp(&quot;normal&quot;);$(&quot;#mm&quot;).val($(&quot;#hidden_mm&quot;).val());$(&quot;#jj&quot;).val($(&quot;#hidden_jj&quot;).val());$(&quot;#aa&quot;).val($(&quot;#hidden_aa&quot;).val());$(&quot;#hh&quot;).val($(&quot;#hidden_hh&quot;).val());$(&quot;#mn&quot;).val($(&quot;#hidden_mn&quot;).val());$(&quot;#timestampdiv&quot;).siblings(&quot;a.edit-timestamp&quot;).show();updateText();return false});$(&quot;.save-timestamp&quot;,&quot;#timestampdiv&quot;).click(function(){if(updateText()){$(&quot;#timestampdiv&quot;).slideUp(&quot;normal&quot;);$(&quot;#timestampdiv&quot;).siblings(&quot;a.edit-timestamp&quot;).show()}return false});$(&quot;#post-status-select&quot;).siblings(&quot;a.edit-post-status&quot;).click(function(){if($(&quot;#post-status-select&quot;).is(&quot;:hidden&quot;)){$(&quot;#post-status-select&quot;).slideDown(&quot;normal&quot;);$(this).hide()}return false});$(&quot;.save-post-status&quot;,&quot;#post-status-select&quot;).click(function(){$(&quot;#post-status-select&quot;).slideUp(&quot;normal&quot;);$(&quot;#post-status-select&quot;).siblings(&quot;a.edit-post-status&quot;).show();updateText();return false});$(&quot;.cancel-post-status&quot;,&quot;#post-status-select&quot;).click(function(){$(&quot;#post-status-select&quot;).slideUp(&quot;normal&quot;);$(&quot;#post_status&quot;).val($(&quot;#hidden_post_status&quot;).val());$(&quot;#post-status-select&quot;).siblings(&quot;a.edit-post-status&quot;).show();updateText();return false})}if($(&quot;#edit-slug-box&quot;).length){editPermalink=function(post_id){var i,c=0,e=$(&quot;#editable-post-name&quot;),revert_e=e.html(),real_slug=$(&quot;#post_name&quot;),revert_slug=real_slug.val(),b=$(&quot;#edit-slug-buttons&quot;),revert_b=b.html(),full=$(&quot;#editable-post-name-full&quot;).html();$(&quot;#view-post-btn&quot;).hide();b.html('&lt;a href=&quot;#&quot; class=&quot;save button&quot;&gt;'+postL10n.ok+'&lt;/a&gt; &lt;a class=&quot;cancel&quot; href=&quot;#&quot;&gt;'+postL10n.cancel+&quot;&lt;/a&gt;&quot;);b.children(&quot;.save&quot;).click(function(){var new_slug=e.children(&quot;input&quot;).val();$.post(ajaxurl,{action:&quot;sample-permalink&quot;,post_id:post_id,new_slug:new_slug,new_title:$(&quot;#title&quot;).val(),samplepermalinknonce:$(&quot;#samplepermalinknonce&quot;).val()},function(data){$(&quot;#edit-slug-box&quot;).html(data);b.html(revert_b);real_slug.attr(&quot;value&quot;,new_slug);makeSlugeditClickable();$(&quot;#view-post-btn&quot;).show()});return false});$(&quot;.cancel&quot;,&quot;#edit-slug-buttons&quot;).click(function(){$(&quot;#view-post-btn&quot;).show();e.html(revert_e);b.html(revert_b);real_slug.attr(&quot;value&quot;,revert_slug);return false});for(i=0;i&lt;full.length;++i){if(&quot;%&quot;==full.charAt(i)){c++}}slug_value=(c&gt;full.length/4)?&quot;&quot;:full;e.html('&lt;input type=&quot;text&quot; id=&quot;new-post-slug&quot; value=&quot;'+slug_value+'&quot; /&gt;').children(&quot;input&quot;).keypress(function(e){var key=e.keyCode||0;if(13==key){b.children(&quot;.save&quot;).click();return false}if(27==key){b.children(&quot;.cancel&quot;).click();return false}real_slug.attr(&quot;value&quot;,this.value)}).focus()};makeSlugeditClickable=function(){$(&quot;#editable-post-name&quot;).click(function(){$(&quot;#edit-slug-buttons&quot;).children(&quot;.edit-slug&quot;).click()})};makeSlugeditClickable()}if($(&quot;#title&quot;).val()==&quot;&quot;){$(&quot;#title&quot;).siblings(&quot;#title-prompt-text&quot;).css(&quot;visibility&quot;,&quot;&quot;)}$(&quot;#title-prompt-text&quot;).click(function(){$(this).css(&quot;visibility&quot;,&quot;hidden&quot;).siblings(&quot;#title&quot;).focus()});$(&quot;#title&quot;).blur(function(){if(this.value==&quot;&quot;){$(this).siblings(&quot;#title-prompt-text&quot;).css(&quot;visibility&quot;,&quot;&quot;)}}).focus(function(){$(this).siblings(&quot;#title-prompt-text&quot;).css(&quot;visibility&quot;,&quot;hidden&quot;)}).keydown(function(e){$(this).siblings(&quot;#title-prompt-text&quot;).css(&quot;visibility&quot;,&quot;hidden&quot;);$(this).unbind(e)})});
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjsjquerysuggestdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/jquery/suggest.dev.js (14386 => 14387)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/jquery/suggest.dev.js        2010-05-03 19:23:37 UTC (rev 14386)
+++ trunk/wp-includes/js/jquery/suggest.dev.js        2010-05-03 19:23:44 UTC (rev 14387)
</span><span class="lines">@@ -120,7 +120,7 @@
</span><span class="cx">                         if ( options.multiple ) {
</span><span class="cx">                                 multipleSepPos = q.lastIndexOf(options.multipleSep);
</span><span class="cx">                                 if ( multipleSepPos != -1 ) {
</span><del>-                                        q = q.substr(multipleSepPos + options.multipleSep.length);
</del><ins>+                                        q = $.trim(q.substr(multipleSepPos + options.multipleSep.length));
</ins><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                         if (q.length &gt;= options.minchars) {
</span></span></pre></div>
<a id="trunkwpincludesjsjquerysuggestjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/jquery/suggest.js (14386 => 14387)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/jquery/suggest.js        2010-05-03 19:23:37 UTC (rev 14386)
+++ trunk/wp-includes/js/jquery/suggest.js        2010-05-03 19:23:44 UTC (rev 14387)
</span><span class="lines">@@ -1 +1 @@
</span><del>-(function(a){a.suggest=function(o,g){var c,f,n,d,q,p;c=a(o).attr(&quot;autocomplete&quot;,&quot;off&quot;);f=a(document.createElement(&quot;ul&quot;));n=false;d=0;q=[];p=0;f.addClass(g.resultsClass).appendTo(&quot;body&quot;);j();a(window).load(j).resize(j);c.blur(function(){setTimeout(function(){f.hide()},200)});if(a.browser.msie){try{f.bgiframe()}catch(s){}}if(a.browser.mozilla){c.keypress(m)}else{c.keydown(m)}function j(){var e=c.offset();f.css({top:(e.top+o.offsetHeight)+&quot;px&quot;,left:e.left+&quot;px&quot;})}function m(w){if((/27$|38$|40$/.test(w.keyCode)&amp;&amp;f.is(&quot;:visible&quot;))||(/^13$|^9$/.test(w.keyCode)&amp;&amp;u())){if(w.preventDefault){w.preventDefault()}if(w.stopPropagation){w.stopPropagation()}w.cancelBubble=true;w.returnValue=false;switch(w.keyCode){case 38:k();break;case 40:t();break;case 9:case 13:r();break;case 27:f.hide();break}}else{if(c.val().length!=d){if(n){clearTimeout(n)}n=setTimeout(l,g.delay);d=c.val().length}}}function l(){var x=a.trim(c.val()),w,e;if(g.multiple){w=x.lastIndexOf(g.multipleSep);if(w!=-1){x=x.substr(w+g.multipleSep.length)}}if(x.length&gt;=g.minchars){cached=v(x);if(cached){i(cached.items)}else{a.get(g.source,{q:x},function(y){f.hide();e=b(y,x);i(e);h(x,e,y.length)})}}else{f.hide()}}function v(w){var e;for(e=0;e&lt;q.length;e++){if(q[e][&quot;q&quot;]==w){q.unshift(q.splice(e,1)[0]);return q[0]}}return false}function h(y,e,w){var x;while(q.length&amp;&amp;(p+w&gt;g.maxCacheSize)){x=q.pop();p-=x.size}q.push({q:y,size:w,items:e});p+=w}function i(e){var x=&quot;&quot;,w;if(!e){return}if(!e.length){f.hide();return}j();for(w=0;w&lt;e.length;w++){x+=&quot;&lt;li&gt;&quot;+e[w]+&quot;&lt;/li&gt;&quot;}f.html(x).show();f.children(&quot;li&quot;).mouseover(function(){f.children(&quot;li&quot;).removeClass(g.selectClass);a(this).addClass(g.selectClass)}).click(function(y){y.preventDefault();y.stopPropagation();r()})}function b(e,z){var w=[],A=e.split(g.delimiter),y,x;for(y=0;y&lt;A.length;y++){x=a.trim(A[y]);if(x){x=x.replace(new RegExp(z,&quot;ig&quot;),function(B){return'&lt;span class=&quot;'+g.matchClass+'&quot;&gt;'+B+&quot;&lt;/span&gt;&quot;});w[w.length]=x}}return w}function u(){var e;if(!f.is(&quot;:visible&quot;)){return false}e=f.children(&quot;li.&quot;+g.selectClass);if(!e.length){e=false}return e}function r(){$currentResult=u();if($currentResult){if(g.multiple){if(c.val().indexOf(g.multipleSep)!=-1){$currentVal=c.val().substr(0,(c.val().lastIndexOf(g.multipleSep)+g.multipleSep.length))}else{$currentVal=&quot;&quot;}c.val($currentVal+$currentResult.text()+g.multipleSep);c.focus()}else{c.val($currentResult.text())}f.hide();if(g.onSelect){g.onSelect.apply(c[0])}}}function t(){$currentResult=u();if($currentResult){$currentResult.removeClass(g.selectClass).next().addClass(g.selectClass)}else{f.children(&quot;li:first-child&quot;).addClass(g.selectClass)}}function k(){var e=u();if(e){e.removeClass(g.selectClass).prev().addClass(g.selectClass)}else{f.children(&quot;li:last-child&quot;).addClass(g.selectClass)}}};a.fn.suggest=function(c,b){if(!c){return}b=b||{};b.multiple=b.multiple||false;b.multipleSep=b.multipleSep||&quot;, &quot;;b.source=c;b.delay=b.delay||100;b.resultsClass=b.resultsClass||&quot;ac_results&quot;;b.selectClass=b.selectClass||&quot;ac_over&quot;;b.matchClass=b.matchClass||&quot;ac_match&quot;;b.minchars=b.minchars||2;b.delimiter=b.delimiter||&quot;\n&quot;;b.onSelect=b.onSelect||false;b.maxCacheSize=b.maxCacheSize||65536;this.each(function(){new a.suggest(this,b)});return this}})(jQuery);
</del><span class="cx">\ No newline at end of file
</span><ins>+(function($){$.suggest=function(input,options){var $input,$results,timeout,prevLength,cache,cacheSize;$input=$(input).attr(&quot;autocomplete&quot;,&quot;off&quot;);$results=$(document.createElement(&quot;ul&quot;));timeout=false;prevLength=0;cache=[];cacheSize=0;$results.addClass(options.resultsClass).appendTo(&quot;body&quot;);resetPosition();$(window).load(resetPosition).resize(resetPosition);$input.blur(function(){setTimeout(function(){$results.hide()},200)});if($.browser.msie){try{$results.bgiframe()}catch(e){}}if($.browser.mozilla){$input.keypress(processKey)}else{$input.keydown(processKey)}function resetPosition(){var offset=$input.offset();$results.css({top:(offset.top+input.offsetHeight)+&quot;px&quot;,left:offset.left+&quot;px&quot;})}function processKey(e){if((/27$|38$|40$/.test(e.keyCode)&amp;&amp;$results.is(&quot;:visible&quot;))||(/^13$|^9$/.test(e.keyCode)&amp;&amp;getCurrentResult())){if(e.preventDefault){e.preventDefault()}if(e.stopPropagation){e.stopPropagation()}e.cancelBubble=true;e.returnValue=false;switch(e.keyCode){case 38:prevResult();break;case 40:nextResult();break;case 9:case 13:selectCurrentResult();break;case 27:$results.hide();break}}else{if($input.val().length!=prevLength){if(timeout){clearTimeout(timeout)}timeout=setTimeout(suggest,options.delay);prevLength=$input.val().length}}}function suggest(){var q=$.trim($input.val()),multipleSepPos,items;if(options.multiple){multipleSepPos=q.lastIndexOf(options.multipleSep);if(multipleSepPos!=-1){q=$.trim(q.substr(multipleSepPos+options.multipleSep.length))}}if(q.length&gt;=options.minchars){cached=checkCache(q);if(cached){displayItems(cached.items)}else{$.get(options.source,{q:q},function(txt){$results.hide();items=parseTxt(txt,q);displayItems(items);addToCache(q,items,txt.length)})}}else{$results.hide()}}function checkCache(q){var i;for(i=0;i&lt;cache.length;i++){if(cache[i][&quot;q&quot;]==q){cache.unshift(cache.splice(i,1)[0]);return cache[0]}}return false}function addToCache(q,items,size){var cached;while(cache.length&amp;&amp;(cacheSize+size&gt;options.maxCacheSize)){cached=cache.pop();cacheSize-=cached.size}cache.push({q:q,size:size,items:items});cacheSize+=size}function displayItems(items){var html=&quot;&quot;,i;if(!items){return}if(!items.length){$results.hide();return}resetPosition();for(i=0;i&lt;items.length;i++){html+=&quot;&lt;li&gt;&quot;+items[i]+&quot;&lt;/li&gt;&quot;}$results.html(html).show();$results.children(&quot;li&quot;).mouseover(function(){$results.children(&quot;li&quot;).removeClass(options.selectClass);$(this).addClass(options.selectClass)}).click(function(e){e.preventDefault();e.stopPropagation();selectCurrentResult()})}function parseTxt(txt,q){var items=[],tokens=txt.split(options.delimiter),i,token;for(i=0;i&lt;tokens.length;i++){token=$.trim(tokens[i]);if(token){token=token.replace(new RegExp(q,&quot;ig&quot;),function(q){return'&lt;span class=&quot;'+options.matchClass+'&quot;&gt;'+q+&quot;&lt;/span&gt;&quot;});items[items.length]=token}}return items}function getCurrentResult(){var $currentResult;if(!$results.is(&quot;:visible&quot;)){return false}$currentResult=$results.children(&quot;li.&quot;+options.selectClass);if(!$currentResult.length){$currentResult=false}return $currentResult}function selectCurrentResult(){$currentResult=getCurrentResult();if($currentResult){if(options.multiple){if($input.val().indexOf(options.multipleSep)!=-1){$currentVal=$input.val().substr(0,($input.val().lastIndexOf(options.multipleSep)+options.multipleSep.length))}else{$currentVal=&quot;&quot;}$input.val($currentVal+$currentResult.text()+options.multipleSep);$input.focus()}else{$input.val($currentResult.text())}$results.hide();if(options.onSelect){options.onSelect.apply($input[0])}}}function nextResult(){$currentResult=getCurrentResult();if($currentResult){$currentResult.removeClass(options.selectClass).next().addClass(options.selectClass)}else{$results.children(&quot;li:first-child&quot;).addClass(options.selectClass)}}function prevResult(){var $currentResult=getCurrentResult();if($currentResult){$currentResult.removeClass(options.selectClass).prev().addClass(options.selectClass)}else{$results.children(&quot;li:last-child&quot;).addClass(options.selectClass)}}};$.fn.suggest=function(source,options){if(!source){return}options=options||{};options.multiple=options.multiple||false;options.multipleSep=options.multipleSep||&quot;, &quot;;options.source=source;options.delay=options.delay||100;options.resultsClass=options.resultsClass||&quot;ac_results&quot;;options.selectClass=options.selectClass||&quot;ac_over&quot;;options.matchClass=options.matchClass||&quot;ac_match&quot;;options.minchars=options.minchars||2;options.delimiter=options.delimiter||&quot;\n&quot;;options.onSelect=options.onSelect||false;options.maxCacheSize=options.maxCacheSize||65536;this.each(function(){new $.suggest(this,options)});return this}})(jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre>
</div>
</div>

</body>
</html>