<!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>[13195] trunk: Sync checkboxes only for categories,
some white space cleanup, props kevinB, fixes #12244</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/13195">13195</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2010-02-18 11:20:15 +0000 (Thu, 18 Feb 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Sync checkboxes only for categories, some white space cleanup, props kevinB, fixes <a href="http://trac.wordpress.org/ticket/12244">#12244</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="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</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 (13194 => 13195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/post.dev.js        2010-02-18 10:57:49 UTC (rev 13194)
+++ trunk/wp-admin/js/post.dev.js        2010-02-18 11:20:15 UTC (rev 13195)
</span><span class="lines">@@ -253,46 +253,45 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         // categories
</span><del>-        $('.categorydiv').each(function(){
-                var this_id = $(this).attr('id'), noSyncChecks = false, syncChecks, catAddAfter, popularCats;
-                var taxonomy_parts = this_id.split('-');
-                taxonomy_parts.shift();
-                var taxonomy = taxonomy_parts.join('-');
-                 var settingName = taxonomy+'_tab';
-                 if(taxonomy == 'category')
</del><ins>+        $('.categorydiv').each( function(){
+                var this_id = $(this).attr('id'), noSyncChecks = false, syncChecks, catAddAfter, taxonomyParts, taxonomy, settingName;
+
+                taxonomyParts = this_id.split('-');
+                taxonomyParts.shift();
+                taxonomy = taxonomyParts.join('-');
+                 settingName = taxonomy + '_tab';
+                 if ( taxonomy == 'category' )
</ins><span class="cx">                         settingName = 'cats';
</span><span class="cx">
</span><span class="cx">                 // TODO: move to jQuery 1.3+, support for multiple hierarchical taxonomies, see wp-lists.dev.js
</span><del>-                $('a', '#'+taxonomy+'-tabs').click(function(){
</del><ins>+                $('a', '#' + taxonomy + '-tabs').click( function(){
</ins><span class="cx">                         var t = $(this).attr('href');
</span><span class="cx">                         $(this).parent().addClass('tabs').siblings('li').removeClass('tabs');
</span><del>-                        $('#'+taxonomy+'-tabs').siblings('.tabs-panel').hide();
</del><ins>+                        $('#' + taxonomy + '-tabs').siblings('.tabs-panel').hide();
</ins><span class="cx">                         $(t).show();
</span><del>-                        if ( '#'+taxonomy+'-all' == t )
</del><ins>+                        if ( '#' + taxonomy + '-all' == t )
</ins><span class="cx">                                 deleteUserSetting(settingName);
</span><span class="cx">                         else
</span><del>-                                setUserSetting(settingName,'pop');
</del><ins>+                                setUserSetting(settingName, 'pop');
</ins><span class="cx">                         return false;
</span><span class="cx">                 });
</span><span class="cx">
</span><span class="cx">                 if ( getUserSetting(settingName) )
</span><del>-                        $('a[href="#'+taxonomy+'-pop"]', '#'+taxonomy+'-tabs').click();
</del><ins>+                        $('a[href="#' + taxonomy + '-pop"]', '#' + taxonomy + '-tabs').click();
</ins><span class="cx">
</span><span class="cx">                 // Ajax Cat
</span><del>-                $('#new'+taxonomy).one( 'focus', function() { $(this).val( '' ).removeClass( 'form-input-tip' ) } );
-                $('#'+taxonomy+'-add-submit').click(function(){$('#new'+taxonomy).focus();});
</del><ins>+                $('#new' + taxonomy).one( 'focus', function() { $(this).val( '' ).removeClass( 'form-input-tip' ) } );
+                $('#' + taxonomy + '-add-submit').click( function(){ $('#new' + taxonomy).focus(); });
</ins><span class="cx">
</span><span class="cx">                 syncChecks = function() {
</span><del>-                                if ( noSyncChecks )
-                                        return;
-                                noSyncChecks = true;
-                                var th = jQuery(this), c = th.is(':checked'), id = th.val().toString();
-                                $('#in-'+taxonomy+'-' + id + ', #in-'+taxonomy+'-category-' + id).attr( 'checked', c );
-                                noSyncChecks = false;
-                        };
</del><ins>+                        if ( noSyncChecks )
+                                return;
+                        noSyncChecks = true;
+                        var th = jQuery(this), c = th.is(':checked'), id = th.val().toString();
+                        $('#in-' + taxonomy + '-' + id + ', #in-' + taxonomy + '-category-' + id).attr( 'checked', c );
+                        noSyncChecks = false;
+                };
</ins><span class="cx">
</span><del>-
-
</del><span class="cx">                 catAddBefore = function( s ) {
</span><span class="cx">                         if ( !$('#new'+taxonomy).val() )
</span><span class="cx">                                 return false;
</span><span class="lines">@@ -309,21 +308,23 @@
</span><span class="cx">                         }
</span><span class="cx">                 };
</span><span class="cx">
</span><del>-                $('#'+taxonomy+'checklist').wpList({
</del><ins>+                $('#' + taxonomy + 'checklist').wpList({
</ins><span class="cx">                         alt: '',
</span><del>-                        response: taxonomy+'-ajax-response',
</del><ins>+                        response: taxonomy + '-ajax-response',
</ins><span class="cx">                         addBefore: catAddBefore,
</span><span class="cx">                         addAfter: catAddAfter
</span><span class="cx">                 });
</span><del>-                $('#'+taxonomy+'-add-toggle').click( function() {
-                        $('#'+taxonomy+'-adder').toggleClass( 'wp-hidden-children' );
-                        $('a[href="#'+taxonomy+'-all"]', '#'+taxonomy+'-tabs').click();
</del><ins>+
+                $('#' + taxonomy + '-add-toggle').click( function() {
+                        $('#' + taxonomy + '-adder').toggleClass( 'wp-hidden-children' );
+                        $('a[href="#' + taxonomy + '-all"]', '#' + taxonomy + '-tabs').click();
</ins><span class="cx">                         return false;
</span><span class="cx">                 });
</span><span class="cx">
</span><del>-                $('#'+taxonomy+'checklist').children('li.popular-category').add( $('#'+taxonomy+'checklist-pop').children() ).find(':checkbox').live( 'click', function(){
</del><ins>+                $('#' + taxonomy + 'checklist').children('li.popular-category').add( $('#' + taxonomy + 'checklist-pop').children() ).find(':checkbox').live( 'click', function(){
</ins><span class="cx">                         var t = $(this), c = t.is(':checked'), id = t.val();
</span><del>-                        $('#in-'+taxonomy+'-' + id + ', #in-popular-'+taxonomy+'-' + id).attr( 'checked', c );
</del><ins>+                        if ( id && t.parents('#taxonomy-'+taxonomy).length )
+                                $('#in-' + taxonomy + '-' + id + ', #in-popular-' + taxonomy + '-' + id).attr( 'checked', c );
</ins><span class="cx">                 });
</span><span class="cx">
</span><span class="cx">         }); // end cats
</span></span></pre></div>
<a id="trunkwpadminjspostjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/post.js (13194 => 13195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/post.js        2010-02-18 10:57:49 UTC (rev 13194)
+++ trunk/wp-admin/js/post.js        2010-02-18 11:20:15 UTC (rev 13195)
</span><span class="lines">@@ -1 +1 @@
</span><del>-var tagBox,commentsBox,editPermalink,makeSlugeditClickable,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail;function array_unique_noempty(b){var c=[];jQuery.each(b,function(a,d){d=jQuery.trim(d);if(d&&jQuery.inArray(d,c)==-1){c.push(d)}});return c}(function(a){tagBox={clean:function(b){return b.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,"")},parseTags:function(e){var h=e.id,b=h.split("-check-num-")[1],d=a(e).closest(".tagsdiv"),g=d.find(".the-tags"),c=g.val().split(","),f=[];delete c[b];a.each(c,function(i,j){j=a.trim(j);if(j){f.push(j)}});g.val(this.clean(f.join(",")));this.quickClicks(d);return false},quickClicks:function(c){var e=a(".the-tags",c),d=a(".tagchecklist",c),b;if(!e.length){return}b=e.val().split(",");d.empty();a.each(b,function(h,i){var f,g,j=a(c).attr("id");i=a.trim(i);if(!i.match(/^\s+$/)&&""!=i){g=j+"-check-num-"+h;f='<span><a id="'+g+'" class="ntdelbutton">X</a>&nbsp;'+i+"</span> ";d.append(f);a("#"+g).click(function(){tagBox.parseTags(this)})}})},flushTags:function(e,b,g){b=b||false;var i,c=a(".the-tags",e),h=a("input.newtag",e),d;i=b?a(b).text():h.val();tagsval=c.val();d=tagsval?tagsval+","+i:i;d=this.clean(d);d=array_unique_noempty(d.split(",")).join(",");c.val(d);this.quickClicks(e);if(!b){h.val("")}if("undefined"==typeof(g)){h.focus()}return false},get:function(c){var b=c.substr(c.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:b},function(e,d){if(0==e||"success"!=d){e=wpAjax.broken}e=a('<p id="tagcloud-'+b+'" class="the-tagcloud">'+e+"</p>");a("a",e).click(function(){tagBox.flushTags(a(this).closest(".inside").children(".tagsdiv"),this);return false});a("#"+c).after(e)})},init:function(){var b=this,c=a("div.ajaxtag");a(".tagsdiv").each(function(){tagBox.quickClicks(this)});a("input.tagadd",c).click(function(){b.flushTags(a(this).closest(".tagsdiv"))});a("div.taghint",c).click(function(){a(this).css("visibility","hidden").siblings(".newtag").focus()});a("input.newtag",c).blur(function(){if(this.value==""){a(this).siblings(".taghint").css("visibility","")}}).focus(function(){a(this).siblings(".taghint").css("visibility","hidden")}).keyup(function(d){if(13==d.which){tagBox.flushTags(a(this).closest(".tagsdiv"));return false}}).keypress(function(d){if(13==d.which){d.preventDefault();return false}}).each(function(){var d=a(this).closest("div.tagsdiv").attr("id");a(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+d,{delay:500,minchars:2,multiple:true,multipleSep:", "})});a("#post").submit(function(){a("div.tagsdiv").each(function(){tagBox.flushTags(this,false,1)})});a("a.tagcloud-link").click(function(){tagBox.get(a(this).attr("id"));a(this).unbind().click(function(){a(this).siblings(".the-tagcloud").toggle();return false});return false})}};commentsBox={st:0,get:function(d,c){var b=this.st,e;if(!c){c=20}this.st+=c;this.total=d;a("#commentsdiv img.waiting").show();e={action:"get-comments",mode:"single",_ajax_nonce:a("#add_comment_nonce").val(),post_ID:a("#post_ID").val(),start:b,num:c};a.post(ajaxurl,e,function(f){f=wpAjax.parseAjaxResponse(f);a("#commentsdiv .widefat").show();a("#commentsdiv img.waiting").hide();if("object"==typeof f&&f.responses[0]){a("#the-comment-list").append(f.responses[0].data);theList=theExtraList=null;a("a[className*=':']").unbind();setCommentsList();if(commentsBox.st>commentsBox.total){a("#show-comments").hide()}else{a("#show-comments").html(postL10n.showcomm)}return}else{if(1==f){a("#show-comments").parent().html(postL10n.endcomm);return}}a("#the-comment-list").append('<tr><td colspan="2">'+wpAjax.broken+"</td></tr>")});return false}};WPSetThumbnailHTML=function(b){a(".inside","#postimagediv").html(b)};WPSetThumbnailID=function(c){var b=a("input[value=_thumbnail_id]","#list-table");if(b.size()>0){a("#meta\\["+b.attr("id").match(/[0-9]+/)+"\\]\\[value\\]").text(c)}};WPRemoveThumbnail=function(){a.post(ajaxurl,{action:"set-post-thumbnail",post_id:a("#post_ID").val(),thumbnail_id:-1,cookie:encodeURIComponent(document.cookie)},function(b){if(b=="0"){alert(setPostThumbnailL10n.error)}else{WPSetThumbnailHTML(b)}})}})(jQuery);jQuery(document).ready(function(g){var c,a,h="",b="post"==pagenow||"post-new"==pagenow,f="page"==pagenow||"page-new"==pagenow;if(b){type="post";if(typenow){type=typenow}postboxes.add_postbox_toggles(type)}else{if(f){postboxes.add_postbox_toggles("page")}}if(g("#tagsdiv-post_tag").length){tagBox.init()}else{g("#side-sortables, #normal-sortables, #advanced-sortables").children("div.postbox").each(function(){if(this.id.indexOf("tagsdiv-")===0){tagBox.init();return false}})}g(".categorydiv").each(function(){var o=g(this).attr("id"),j=false,m,p,l;var n=o.split("-");n.shift();var i=n.join("-");var k=i+"_tab";if(i=="category"){k="cats"}g("a","#"+i+"-tabs").click(function(){var q=g(this).attr("href");g(this).parent().addClass("tabs").siblings("li").removeClass("tabs");g("#"+i+"-tabs").siblings(".tabs-panel").hide();g(q).show();if("#"+i+"-all"==q){deleteUserSetting(k)}else{setUserSetting(k,"pop")}return false});if(getUserSetting(k)){g('a[href="#'+i+'-pop"]',"#"+i+"-tabs").click()}g("#new"+i).one("focus",function(){g(this).val("").removeClass("form-input-tip")});g("#"+i+"-add-submit").click(function(){g("#new"+i).focus()});m=function(){if(j){return}j=true;var q=jQuery(this),s=q.is(":checked"),r=q.val().toString();g("#in-"+i+"-"+r+", #in-"+i+"-category-"+r).attr("checked",s);j=false};catAddBefore=function(q){if(!g("#new"+i).val()){return false}q.data+="&"+g(":checked","#"+i+"checklist").serialize();return q};p=function(v,u){var t,q=g("#new"+i+"_parent");if("undefined"!=u.parsed.responses[0]&&(t=u.parsed.responses[0].supplemental.newcat_parent)){q.before(t);q.remove()}};g("#"+i+"checklist").wpList({alt:"",response:i+"-ajax-response",addBefore:catAddBefore,addAfter:p});g("#"+i+"-add-toggle").click(function(){g("#"+i+"-adder").toggleClass("wp-hidden-children");g('a[href="#'+i+'-all"]',"#"+i+"-tabs").click();return false});g("#"+i+"checklist").children("li.popular-category").add(g("#"+i+"checklist-pop").children()).find(":checkbox").live("click",function(){var q=g(this),s=q.is(":checked"),r=q.val();g("#in-"+i+"-"+r+", #in-popular-"+i+"-"+r).attr("checked",s)})});if(g("#postcustom").length){g("#the-list").wpList({addAfter:function(i,j){g("table#list-table").show();if(typeof(autosave_update_post_ID)!="undefined"){autosave_update_post_ID(j.parsed.responses[0].supplemental.postid)}},addBefore:function(i){i.data+="&post_id="+g("#post_ID").val();return i}})}if(g("#submitdiv").length){c=g("#timestamp").html();a=g("#post-visibility-display").html();function e(){var i=g("#post-visibility-select");if(g("input:radio:checked",i).val()!="public"){g("#sticky").attr("checked",false);g("#sticky-span").hide()}else{g("#sticky-span").show()}if(g("input:radio:checked",i).val()!="password"){g("#password-span").hide()}else{g("#password-span").show()}}function d(){var p,q,j,s,r=g("#post_status"),k=g("option[value=publish]",r),i=g("#aa").val(),n=g("#mm").val(),o=g("#jj").val(),m=g("#hh").val(),l=g("#mn").val();p=new Date(i,n-1,o,m,l);q=new Date(g("#hidden_aa").val(),g("#hidden_mm").val()-1,g("#hidden_jj").val(),g("#hidden_hh").val(),g("#hidden_mn").val());j=new Date(g("#cur_aa").val(),g("#cur_mm").val()-1,g("#cur_jj").val(),g("#cur_hh").val(),g("#cur_mn").val());if(p.getFullYear()!=i||(1+p.getMonth())!=n||p.getDate()!=o||p.getMinutes()!=l){g(".timestamp-wrap","#timestampdiv").addClass("form-invalid");return false}else{g(".timestamp-wrap","#timestampdiv").removeClass("form-invalid")}if(p>j&&g("#original_post_status").val()!="future"){s=postL10n.publishOnFuture;g("#publish").val(postL10n.schedule)}else{if(p<=j&&g("#original_post_status").val()!="publish"){s=postL10n.publishOn;g("#publish").val(postL10n.publish)}else{s=postL10n.publishOnPast;if(f){g("#publish").val(postL10n.updatePage)}else{g("#publish").val(postL10n.updatePost)}}}if(q.toUTCString()==p.toUTCString()){g("#timestamp").html(c)}else{g("#timestamp").html(s+" <b>"+g("option[value="+g("#mm").val()+"]","#mm").text()+" "+o+", "+i+" @ "+m+":"+l+"</b> ")}if(g("input:radio:checked","#post-visibility-select").val()=="private"){if(f){g("#publish").val(postL10n.updatePage)}else{g("#publish").val(postL10n.updatePost)}if(k.length==0){r.append('<option value="publish">'+postL10n.privatelyPublished+"</option>")}else{k.html(postL10n.privatelyPublished)}g("option[value=publish]",r).attr("selected",true);g(".edit-post-status","#misc-publishing-actions").hide()}else{if(g("#original_post_status").val()=="future"||g("#original_post_status").val()=="draft"){if(k.length){k.remove();r.val(g("#hidden_post_status").val())}}else{k.html(postL10n.published)}if(r.is(":hidden")){g(".edit-post-status","#misc-publishing-actions").show()}}g("#post-status-display").html(g("option:selected",r).text());if(g("option:selected",r).val()=="private"||g("option:selected",r).val()=="publish"){g("#save-post").hide()}else{g("#save-post").show();if(g("option:selected",r).val()=="pending"){g("#save-post").show().val(postL10n.savePending)}else{g("#save-post").show().val(postL10n.saveDraft)}}return true}g(".edit-visibility","#visibility").click(function(){if(g("#post-visibility-select").is(":hidden")){e();g("#post-visibility-select").slideDown("normal");g(this).hide()}return false});g(".cancel-post-visibility","#post-visibility-select").click(function(){g("#post-visibility-select").slideUp("normal");g("#visibility-radio-"+g("#hidden-post-visibility").val()).attr("checked",true);g("#post_password").val(g("#hidden_post_password").val());g("#sticky").attr("checked",g("#hidden-post-sticky").attr("checked"));g("#post-visibility-display").html(a);g(".edit-visibility","#visibility").show();d();return false});g(".save-post-visibility","#post-visibility-select").click(function(){var i=g("#post-visibility-select");i.slideUp("normal");g(".edit-visibility","#visibility").show();d();if(g("input:radio:checked",i).val()!="public"){g("#sticky").attr("checked",false)}if(true==g("#sticky").attr("checked")){h="Sticky"}else{h=""}g("#post-visibility-display").html(postL10n[g("input:radio:checked",i).val()+h]);return false});g("input:radio","#post-visibility-select").change(function(){e()});g("#timestampdiv").siblings("a.edit-timestamp").click(function(){if(g("#timestampdiv").is(":hidden")){g("#timestampdiv").slideDown("normal");g(this).hide()}return false});g(".cancel-timestamp","#timestampdiv").click(function(){g("#timestampdiv").slideUp("normal");g("#mm").val(g("#hidden_mm").val());g("#jj").val(g("#hidden_jj").val());g("#aa").val(g("#hidden_aa").val());g("#hh").val(g("#hidden_hh").val());g("#mn").val(g("#hidden_mn").val());g("#timestampdiv").siblings("a.edit-timestamp").show();d();return false});g(".save-timestamp","#timestampdiv").click(function(){if(d()){g("#timestampdiv").slideUp("normal");g("#timestampdiv").siblings("a.edit-timestamp").show()}return false});g("#post-status-select").siblings("a.edit-post-status").click(function(){if(g("#post-status-select").is(":hidden")){g("#post-status-select").slideDown("normal");g(this).hide()}return false});g(".save-post-status","#post-status-select").click(function(){g("#post-status-select").slideUp("normal");g("#post-status-select").siblings("a.edit-post-status").show();d();return false});g(".cancel-post-status","#post-status-select").click(function(){g("#post-status-select").slideUp("normal");g("#post_status").val(g("#hidden_post_status").val());g("#post-status-select").siblings("a.edit-post-status").show();d();return false})}if(g("#edit-slug-box").length){editPermalink=function(j){var k,n=0,m=g("#editable-post-name"),o=m.html(),r=g("#post_name"),s=r.html(),p=g("#edit-slug-buttons"),q=p.html(),l=g("#editable-post-name-full").html();g("#view-post-btn").hide();p.html('<a href="#" class="save button">'+postL10n.ok+'</a> <a class="cancel" href="#">'+postL10n.cancel+"</a>");p.children(".save").click(function(){var i=m.children("input").val();g.post(ajaxurl,{action:"sample-permalink",post_id:j,new_slug:i,new_title:g("#title").val(),samplepermalinknonce:g("#samplepermalinknonce").val()},function(t){g("#edit-slug-box").html(t);p.html(q);r.attr("value",i);makeSlugeditClickable();g("#view-post-btn").show()});return false});g(".cancel","#edit-slug-buttons").click(function(){g("#view-post-btn").show();m.html(o);p.html(q);r.attr("value",s);return false});for(k=0;k<l.length;++k){if("%"==l.charAt(k)){n++}}slug_value=(n>l.length/4)?"":l;m.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children("input").keypress(function(t){var i=t.keyCode||0;if(13==i){p.children(".save").click();return false}if(27==i){p.children(".cancel").click();return false}r.attr("value",this.value)}).focus()};makeSlugeditClickable=function(){g("#editable-post-name").click(function(){g("#edit-slug-buttons").children(".edit-slug").click()})};makeSlugeditClickable()}});
</del><span class="cx">\ No newline at end of file
</span><ins>+var tagBox,commentsBox,editPermalink,makeSlugeditClickable,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail;function array_unique_noempty(b){var c=[];jQuery.each(b,function(a,d){d=jQuery.trim(d);if(d&&jQuery.inArray(d,c)==-1){c.push(d)}});return c}(function(a){tagBox={clean:function(b){return b.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,"")},parseTags:function(e){var h=e.id,b=h.split("-check-num-")[1],d=a(e).closest(".tagsdiv"),g=d.find(".the-tags"),c=g.val().split(","),f=[];delete c[b];a.each(c,function(i,j){j=a.trim(j);if(j){f.push(j)}});g.val(this.clean(f.join(",")));this.quickClicks(d);return false},quickClicks:function(c){var e=a(".the-tags",c),d=a(".tagchecklist",c),b;if(!e.length){return}b=e.val().split(",");d.empty();a.each(b,function(h,i){var f,g,j=a(c).attr("id");i=a.trim(i);if(!i.match(/^\s+$/)&&""!=i){g=j+"-check-num-"+h;f='<span><a id="'+g+'" class="ntdelbutton">X</a>&nbsp;'+i+"</span> ";d.append(f);a("#"+g).click(function(){tagBox.parseTags(this)})}})},flushTags:function(e,b,g){b=b||false;var i,c=a(".the-tags",e),h=a("input.newtag",e),d;i=b?a(b).text():h.val();tagsval=c.val();d=tagsval?tagsval+","+i:i;d=this.clean(d);d=array_unique_noempty(d.split(",")).join(",");c.val(d);this.quickClicks(e);if(!b){h.val("")}if("undefined"==typeof(g)){h.focus()}return false},get:function(c){var b=c.substr(c.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:b},function(e,d){if(0==e||"success"!=d){e=wpAjax.broken}e=a('<p id="tagcloud-'+b+'" class="the-tagcloud">'+e+"</p>");a("a",e).click(function(){tagBox.flushTags(a(this).closest(".inside").children(".tagsdiv"),this);return false});a("#"+c).after(e)})},init:function(){var b=this,c=a("div.ajaxtag");a(".tagsdiv").each(function(){tagBox.quickClicks(this)});a("input.tagadd",c).click(function(){b.flushTags(a(this).closest(".tagsdiv"))});a("div.taghint",c).click(function(){a(this).css("visibility","hidden").siblings(".newtag").focus()});a("input.newtag",c).blur(function(){if(this.value==""){a(this).siblings(".taghint").css("visibility","")}}).focus(function(){a(this).siblings(".taghint").css("visibility","hidden")}).keyup(function(d){if(13==d.which){tagBox.flushTags(a(this).closest(".tagsdiv"));return false}}).keypress(function(d){if(13==d.which){d.preventDefault();return false}}).each(function(){var d=a(this).closest("div.tagsdiv").attr("id");a(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+d,{delay:500,minchars:2,multiple:true,multipleSep:", "})});a("#post").submit(function(){a("div.tagsdiv").each(function(){tagBox.flushTags(this,false,1)})});a("a.tagcloud-link").click(function(){tagBox.get(a(this).attr("id"));a(this).unbind().click(function(){a(this).siblings(".the-tagcloud").toggle();return false});return false})}};commentsBox={st:0,get:function(d,c){var b=this.st,e;if(!c){c=20}this.st+=c;this.total=d;a("#commentsdiv img.waiting").show();e={action:"get-comments",mode:"single",_ajax_nonce:a("#add_comment_nonce").val(),post_ID:a("#post_ID").val(),start:b,num:c};a.post(ajaxurl,e,function(f){f=wpAjax.parseAjaxResponse(f);a("#commentsdiv .widefat").show();a("#commentsdiv img.waiting").hide();if("object"==typeof f&&f.responses[0]){a("#the-comment-list").append(f.responses[0].data);theList=theExtraList=null;a("a[className*=':']").unbind();setCommentsList();if(commentsBox.st>commentsBox.total){a("#show-comments").hide()}else{a("#show-comments").html(postL10n.showcomm)}return}else{if(1==f){a("#show-comments").parent().html(postL10n.endcomm);return}}a("#the-comment-list").append('<tr><td colspan="2">'+wpAjax.broken+"</td></tr>")});return false}};WPSetThumbnailHTML=function(b){a(".inside","#postimagediv").html(b)};WPSetThumbnailID=function(c){var b=a("input[value=_thumbnail_id]","#list-table");if(b.size()>0){a("#meta\\["+b.attr("id").match(/[0-9]+/)+"\\]\\[value\\]").text(c)}};WPRemoveThumbnail=function(){a.post(ajaxurl,{action:"set-post-thumbnail",post_id:a("#post_ID").val(),thumbnail_id:-1,cookie:encodeURIComponent(document.cookie)},function(b){if(b=="0"){alert(setPostThumbnailL10n.error)}else{WPSetThumbnailHTML(b)}})}})(jQuery);jQuery(document).ready(function(g){var c,a,h="",b="post"==pagenow||"post-new"==pagenow,f="page"==pagenow||"page-new"==pagenow;if(b){type="post";if(typenow){type=typenow}postboxes.add_postbox_toggles(type)}else{if(f){postboxes.add_postbox_toggles("page")}}if(g("#tagsdiv-post_tag").length){tagBox.init()}else{g("#side-sortables, #normal-sortables, #advanced-sortables").children("div.postbox").each(function(){if(this.id.indexOf("tagsdiv-")===0){tagBox.init();return false}})}g(".categorydiv").each(function(){var n=g(this).attr("id"),j=false,m,o,l,i,k;l=n.split("-");l.shift();i=l.join("-");k=i+"_tab";if(i=="category"){k="cats"}g("a","#"+i+"-tabs").click(function(){var p=g(this).attr("href");g(this).parent().addClass("tabs").siblings("li").removeClass("tabs");g("#"+i+"-tabs").siblings(".tabs-panel").hide();g(p).show();if("#"+i+"-all"==p){deleteUserSetting(k)}else{setUserSetting(k,"pop")}return false});if(getUserSetting(k)){g('a[href="#'+i+'-pop"]',"#"+i+"-tabs").click()}g("#new"+i).one("focus",function(){g(this).val("").removeClass("form-input-tip")});g("#"+i+"-add-submit").click(function(){g("#new"+i).focus()});m=function(){if(j){return}j=true;var p=jQuery(this),r=p.is(":checked"),q=p.val().toString();g("#in-"+i+"-"+q+", #in-"+i+"-category-"+q).attr("checked",r);j=false};catAddBefore=function(p){if(!g("#new"+i).val()){return false}p.data+="&"+g(":checked","#"+i+"checklist").serialize();return p};o=function(u,t){var q,p=g("#new"+i+"_parent");if("undefined"!=t.parsed.responses[0]&&(q=t.parsed.responses[0].supplemental.newcat_parent)){p.before(q);p.remove()}};g("#"+i+"checklist").wpList({alt:"",response:i+"-ajax-response",addBefore:catAddBefore,addAfter:o});g("#"+i+"-add-toggle").click(function(){g("#"+i+"-adder").toggleClass("wp-hidden-children");g('a[href="#'+i+'-all"]',"#"+i+"-tabs").click();return false});g("#"+i+"checklist").children("li.popular-category").add(g("#"+i+"checklist-pop").children()).find(":checkbox").live("click",function(){var p=g(this),r=p.is(":checked"),q=p.val();if(q&&p.parents("#taxonomy-"+i).length){g("#in-"+i+"-"+q+", #in-popular-"+i+"-"+q).attr("checked",r)}})});if(g("#postcustom").length){g("#the-list").wpList({addAfter:function(i,j){g("table#list-table").show();if(typeof(autosave_update_post_ID)!="undefined"){autosave_update_post_ID(j.parsed.responses[0].supplemental.postid)}},addBefore:function(i){i.data+="&post_id="+g("#post_ID").val();return i}})}if(g("#submitdiv").length){c=g("#timestamp").html();a=g("#post-visibility-display").html();function e(){var i=g("#post-visibility-select");if(g("input:radio:checked",i).val()!="public"){g("#sticky").attr("checked",false);g("#sticky-span").hide()}else{g("#sticky-span").show()}if(g("input:radio:checked",i).val()!="password"){g("#password-span").hide()}else{g("#password-span").show()}}function d(){var p,q,j,s,r=g("#post_status"),k=g("option[value=publish]",r),i=g("#aa").val(),n=g("#mm").val(),o=g("#jj").val(),m=g("#hh").val(),l=g("#mn").val();p=new Date(i,n-1,o,m,l);q=new Date(g("#hidden_aa").val(),g("#hidden_mm").val()-1,g("#hidden_jj").val(),g("#hidden_hh").val(),g("#hidden_mn").val());j=new Date(g("#cur_aa").val(),g("#cur_mm").val()-1,g("#cur_jj").val(),g("#cur_hh").val(),g("#cur_mn").val());if(p.getFullYear()!=i||(1+p.getMonth())!=n||p.getDate()!=o||p.getMinutes()!=l){g(".timestamp-wrap","#timestampdiv").addClass("form-invalid");return false}else{g(".timestamp-wrap","#timestampdiv").removeClass("form-invalid")}if(p>j&&g("#original_post_status").val()!="future"){s=postL10n.publishOnFuture;g("#publish").val(postL10n.schedule)}else{if(p<=j&&g("#original_post_status").val()!="publish"){s=postL10n.publishOn;g("#publish").val(postL10n.publish)}else{s=postL10n.publishOnPast;if(f){g("#publish").val(postL10n.updatePage)}else{g("#publish").val(postL10n.updatePost)}}}if(q.toUTCString()==p.toUTCString()){g("#timestamp").html(c)}else{g("#timestamp").html(s+" <b>"+g("option[value="+g("#mm").val()+"]","#mm").text()+" "+o+", "+i+" @ "+m+":"+l+"</b> ")}if(g("input:radio:checked","#post-visibility-select").val()=="private"){if(f){g("#publish").val(postL10n.updatePage)}else{g("#publish").val(postL10n.updatePost)}if(k.length==0){r.append('<option value="publish">'+postL10n.privatelyPublished+"</option>")}else{k.html(postL10n.privatelyPublished)}g("option[value=publish]",r).attr("selected",true);g(".edit-post-status","#misc-publishing-actions").hide()}else{if(g("#original_post_status").val()=="future"||g("#original_post_status").val()=="draft"){if(k.length){k.remove();r.val(g("#hidden_post_status").val())}}else{k.html(postL10n.published)}if(r.is(":hidden")){g(".edit-post-status","#misc-publishing-actions").show()}}g("#post-status-display").html(g("option:selected",r).text());if(g("option:selected",r).val()=="private"||g("option:selected",r).val()=="publish"){g("#save-post").hide()}else{g("#save-post").show();if(g("option:selected",r).val()=="pending"){g("#save-post").show().val(postL10n.savePending)}else{g("#save-post").show().val(postL10n.saveDraft)}}return true}g(".edit-visibility","#visibility").click(function(){if(g("#post-visibility-select").is(":hidden")){e();g("#post-visibility-select").slideDown("normal");g(this).hide()}return false});g(".cancel-post-visibility","#post-visibility-select").click(function(){g("#post-visibility-select").slideUp("normal");g("#visibility-radio-"+g("#hidden-post-visibility").val()).attr("checked",true);g("#post_password").val(g("#hidden_post_password").val());g("#sticky").attr("checked",g("#hidden-post-sticky").attr("checked"));g("#post-visibility-display").html(a);g(".edit-visibility","#visibility").show();d();return false});g(".save-post-visibility","#post-visibility-select").click(function(){var i=g("#post-visibility-select");i.slideUp("normal");g(".edit-visibility","#visibility").show();d();if(g("input:radio:checked",i).val()!="public"){g("#sticky").attr("checked",false)}if(true==g("#sticky").attr("checked")){h="Sticky"}else{h=""}g("#post-visibility-display").html(postL10n[g("input:radio:checked",i).val()+h]);return false});g("input:radio","#post-visibility-select").change(function(){e()});g("#timestampdiv").siblings("a.edit-timestamp").click(function(){if(g("#timestampdiv").is(":hidden")){g("#timestampdiv").slideDown("normal");g(this).hide()}return false});g(".cancel-timestamp","#timestampdiv").click(function(){g("#timestampdiv").slideUp("normal");g("#mm").val(g("#hidden_mm").val());g("#jj").val(g("#hidden_jj").val());g("#aa").val(g("#hidden_aa").val());g("#hh").val(g("#hidden_hh").val());g("#mn").val(g("#hidden_mn").val());g("#timestampdiv").siblings("a.edit-timestamp").show();d();return false});g(".save-timestamp","#timestampdiv").click(function(){if(d()){g("#timestampdiv").slideUp("normal");g("#timestampdiv").siblings("a.edit-timestamp").show()}return false});g("#post-status-select").siblings("a.edit-post-status").click(function(){if(g("#post-status-select").is(":hidden")){g("#post-status-select").slideDown("normal");g(this).hide()}return false});g(".save-post-status","#post-status-select").click(function(){g("#post-status-select").slideUp("normal");g("#post-status-select").siblings("a.edit-post-status").show();d();return false});g(".cancel-post-status","#post-status-select").click(function(){g("#post-status-select").slideUp("normal");g("#post_status").val(g("#hidden_post_status").val());g("#post-status-select").siblings("a.edit-post-status").show();d();return false})}if(g("#edit-slug-box").length){editPermalink=function(j){var k,n=0,m=g("#editable-post-name"),o=m.html(),r=g("#post_name"),s=r.html(),p=g("#edit-slug-buttons"),q=p.html(),l=g("#editable-post-name-full").html();g("#view-post-btn").hide();p.html('<a href="#" class="save button">'+postL10n.ok+'</a> <a class="cancel" href="#">'+postL10n.cancel+"</a>");p.children(".save").click(function(){var i=m.children("input").val();g.post(ajaxurl,{action:"sample-permalink",post_id:j,new_slug:i,new_title:g("#title").val(),samplepermalinknonce:g("#samplepermalinknonce").val()},function(t){g("#edit-slug-box").html(t);p.html(q);r.attr("value",i);makeSlugeditClickable();g("#view-post-btn").show()});return false});g(".cancel","#edit-slug-buttons").click(function(){g("#view-post-btn").show();m.html(o);p.html(q);r.attr("value",s);return false});for(k=0;k<l.length;++k){if("%"==l.charAt(k)){n++}}slug_value=(n>l.length/4)?"":l;m.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children("input").keypress(function(t){var i=t.keyCode||0;if(13==i){p.children(".save").click();return false}if(27==i){p.children(".cancel").click();return false}r.attr("value",this.value)}).focus()};makeSlugeditClickable=function(){g("#editable-post-name").click(function(){g("#edit-slug-buttons").children(".edit-slug").click()})};makeSlugeditClickable()}});
</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 (13194 => 13195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2010-02-18 10:57:49 UTC (rev 13194)
+++ trunk/wp-includes/script-loader.php        2010-02-18 11:20:15 UTC (rev 13195)
</span><span class="lines">@@ -275,7 +275,7 @@
</span><span class="cx">                 $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), '20091012' );
</span><span class="cx">                 $scripts->add_data( 'postbox', 'group', 1 );
</span><span class="cx">
</span><del>-                $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox'), '20091208' );
</del><ins>+                $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox'), '20100217' );
</ins><span class="cx">                 $scripts->add_data( 'post', 'group', 1 );
</span><span class="cx">                 $scripts->localize( 'post', 'postL10n', array(
</span><span class="cx">                         'tagsUsed' => __('Tags used on this post:'),
</span></span></pre>
</div>
</div>
</body>
</html>