<!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>[13551] trunk: Fix metabox hiding.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/13551">13551</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-03-02 18:06:14 +0000 (Tue, 02 Mar 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Fix metabox hiding. Props scribu. fixes <a href="http://trac.wordpress.org/ticket/12439">#12439</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminadminajaxphp">trunk/wp-admin/admin-ajax.php</a></li>
<li><a href="#trunkwpadminadminheaderphp">trunk/wp-admin/admin-header.php</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="#trunkwpadminjspostboxdevjs">trunk/wp-admin/js/postbox.dev.js</a></li>
<li><a href="#trunkwpincludesuserphp">trunk/wp-includes/user.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminadminajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/admin-ajax.php (13550 => 13551)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/admin-ajax.php        2010-03-02 17:56:24 UTC (rev 13550)
+++ trunk/wp-admin/admin-ajax.php        2010-03-02 18:06:14 UTC (rev 13551)
</span><span class="lines">@@ -1021,11 +1021,11 @@
</span><span class="cx">                 die('-1');
</span><span class="cx">
</span><span class="cx">         if ( is_array($closed) )
</span><del>-                update_user_meta($user->ID, 'closedpostboxes_'.$page, $closed);
</del><ins>+                update_user_option($user->ID, "closedpostboxes_$page", $closed);
</ins><span class="cx">
</span><span class="cx">         if ( is_array($hidden) ) {
</span><span class="cx">                 $hidden = array_diff( $hidden, array('submitdiv', 'linksubmitdiv') ); // postboxes that are always shown
</span><del>-                update_user_meta($user->ID, 'meta-box-hidden_'.$page, $hidden);
</del><ins>+                update_user_option($user->ID, "meta-box-hidden_$page", $hidden);
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         die('1');
</span><span class="lines">@@ -1043,7 +1043,7 @@
</span><span class="cx">                 die('-1');
</span><span class="cx">
</span><span class="cx">         if ( is_array($hidden) )
</span><del>-                update_user_meta($user->ID, "manage-$page-columns-hidden", $hidden);
</del><ins>+                update_user_option($user->ID, "manage-$page-columns-hidden", $hidden);
</ins><span class="cx">
</span><span class="cx">         die('1');
</span><span class="cx">         break;
</span><span class="lines">@@ -1063,7 +1063,7 @@
</span><span class="cx">                 update_user_option($user->ID, "meta-box-order_$page", $order);
</span><span class="cx">
</span><span class="cx">         if ( $page_columns )
</span><del>-                update_user_meta($user->ID, "screen_layout_$page", $page_columns);
</del><ins>+                update_user_option($user->ID, "screen_layout_$page", $page_columns);
</ins><span class="cx">
</span><span class="cx">         die('1');
</span><span class="cx">         break;
</span></span></pre></div>
<a id="trunkwpadminadminheaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/admin-header.php (13550 => 13551)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/admin-header.php        2010-03-02 17:56:24 UTC (rev 13550)
+++ trunk/wp-admin/admin-header.php        2010-03-02 18:06:14 UTC (rev 13551)
</span><span class="lines">@@ -34,8 +34,17 @@
</span><span class="cx"> <script type="text/javascript">
</span><span class="cx"> //<![CDATA[
</span><span class="cx"> addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
</span><del>-var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time() ?>'};
-var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = '<?php echo substr($pagenow, 0, -4); ?>', typenow = '<?php echo $typenow; ?>', adminpage = '<?php echo $admin_body_class; ?>', thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>', decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>';
</del><ins>+var userSettings = {
+                'url': '<?php echo SITECOOKIEPATH; ?>',
+                'uid': '<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>',
+                'time':'<?php echo time() ?>'
+        },
+        ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>',
+        pagenow = '<?php echo $current_screen->id; ?>',
+        typenow = '<?php if ( isset($current_screen->post_type) ) echo $current_screen->post_type; ?>',
+        adminpage = '<?php echo $admin_body_class; ?>',
+        thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',
+        decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>';
</ins><span class="cx"> //]]>
</span><span class="cx"> </script>
</span><span class="cx"> <?php
</span></span></pre></div>
<a id="trunkwpadminjspostdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/post.dev.js (13550 => 13551)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/post.dev.js        2010-03-02 17:56:24 UTC (rev 13550)
+++ trunk/wp-admin/js/post.dev.js        2010-03-02 18:06:14 UTC (rev 13551)
</span><span class="lines">@@ -228,17 +228,9 @@
</span><span class="cx"> })(jQuery);
</span><span class="cx">
</span><span class="cx"> jQuery(document).ready( function($) {
</span><del>-        var stamp, visibility, sticky = '', post = 'post' == pagenow || 'post-new' == pagenow, page = 'page' == pagenow || 'page-new' == pagenow;
</del><ins>+        var stamp, visibility, sticky = '';
</ins><span class="cx">
</span><del>-        // postboxes
-        if ( post ) {
-                type = 'post';
-                if ( typenow )
-                        type = typenow;
-                postboxes.add_postbox_toggles(type);
-        } else if ( page ) {
-                postboxes.add_postbox_toggles('page');
-        }
</del><ins>+        postboxes.add_postbox_toggles(pagenow);
</ins><span class="cx">
</span><span class="cx">         // multi-taxonomies
</span><span class="cx">         if ( $('#tagsdiv-post_tag').length ) {
</span></span></pre></div>
<a id="trunkwpadminjspostjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/post.js (13550 => 13551)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/post.js        2010-03-02 17:56:24 UTC (rev 13550)
+++ trunk/wp-admin/js/post.js        2010-03-02 18:06:14 UTC (rev 13551)
</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 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 li.popular-category :checkbox, #"+i+"checklist-pop :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()}});
</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(e){var b,a,f="";postboxes.add_postbox_toggles(pagenow);if(e("#tagsdiv-post_tag").length){tagBox.init()}else{e("#side-sortables, #normal-sortables, #advanced-sortables").children("div.postbox").each(function(){if(this.id.indexOf("tagsdiv-")===0){tagBox.init();return false}})}e(".categorydiv").each(function(){var l=e(this).attr("id"),h=false,k,m,j,g,i;j=l.split("-");j.shift();g=j.join("-");i=g+"_tab";if(g=="category"){i="cats"}e("a","#"+g+"-tabs").click(function(){var n=e(this).attr("href");e(this).parent().addClass("tabs").siblings("li").removeClass("tabs");e("#"+g+"-tabs").siblings(".tabs-panel").hide();e(n).show();if("#"+g+"-all"==n){deleteUserSetting(i)}else{setUserSetting(i,"pop")}return false});if(getUserSetting(i)){e('a[href="#'+g+'-pop"]',"#"+g+"-tabs").click()}e("#new"+g).one("focus",function(){e(this).val("").removeClass("form-input-tip")});e("#"+g+"-add-submit").click(function(){e("#new"+g).focus()});k=function(){if(h){return}h=true;var n=jQuery(this),p=n.is(":checked"),o=n.val().toString();e("#in-"+g+"-"+o+", #in-"+g+"-category-"+o).attr("checked",p);h=false};catAddBefore=function(n){if(!e("#new"+g).val()){return false}n.data+="&"+e(":checked","#"+g+"checklist").serialize();return n};m=function(q,p){var o,n=e("#new"+g+"_parent");if("undefined"!=p.parsed.responses[0]&&(o=p.parsed.responses[0].supplemental.newcat_parent)){n.before(o);n.remove()}};e("#"+g+"checklist").wpList({alt:"",response:g+"-ajax-response",addBefore:catAddBefore,addAfter:m});e("#"+g+"-add-toggle").click(function(){e("#"+g+"-adder").toggleClass("wp-hidden-children");e('a[href="#'+g+'-all"]',"#"+g+"-tabs").click();return false});e("#"+g+"checklist li.popular-category :checkbox, #"+g+"checklist-pop :checkbox").live("click",function(){var n=e(this),p=n.is(":checked"),o=n.val();if(o&&n.parents("#taxonomy-"+g).length){e("#in-"+g+"-"+o+", #in-popular-"+g+"-"+o).attr("checked",p)}})});if(e("#postcustom").length){e("#the-list").wpList({addAfter:function(g,h){e("table#list-table").show();if(typeof(autosave_update_post_ID)!="undefined"){autosave_update_post_ID(h.parsed.responses[0].supplemental.postid)}},addBefore:function(g){g.data+="&post_id="+e("#post_ID").val();return g}})}if(e("#submitdiv").length){b=e("#timestamp").html();a=e("#post-visibility-display").html();function d(){var g=e("#post-visibility-select");if(e("input:radio:checked",g).val()!="public"){e("#sticky").attr("checked",false);e("#sticky-span").hide()}else{e("#sticky-span").show()}if(e("input:radio:checked",g).val()!="password"){e("#password-span").hide()}else{e("#password-span").show()}}function c(){var n,o,h,q,p=e("#post_status"),i=e("option[value=publish]",p),g=e("#aa").val(),l=e("#mm").val(),m=e("#jj").val(),k=e("#hh").val(),j=e("#mn").val();n=new Date(g,l-1,m,k,j);o=new Date(e("#hidden_aa").val(),e("#hidden_mm").val()-1,e("#hidden_jj").val(),e("#hidden_hh").val(),e("#hidden_mn").val());h=new Date(e("#cur_aa").val(),e("#cur_mm").val()-1,e("#cur_jj").val(),e("#cur_hh").val(),e("#cur_mn").val());if(n.getFullYear()!=g||(1+n.getMonth())!=l||n.getDate()!=m||n.getMinutes()!=j){e(".timestamp-wrap","#timestampdiv").addClass("form-invalid");return false}else{e(".timestamp-wrap","#timestampdiv").removeClass("form-invalid")}if(n>h&&e("#original_post_status").val()!="future"){q=postL10n.publishOnFuture;e("#publish").val(postL10n.schedule)}else{if(n<=h&&e("#original_post_status").val()!="publish"){q=postL10n.publishOn;e("#publish").val(postL10n.publish)}else{q=postL10n.publishOnPast;if(page){e("#publish").val(postL10n.updatePage)}else{e("#publish").val(postL10n.updatePost)}}}if(o.toUTCString()==n.toUTCString()){e("#timestamp").html(b)}else{e("#timestamp").html(q+" <b>"+e("option[value="+e("#mm").val()+"]","#mm").text()+" "+m+", "+g+" @ "+k+":"+j+"</b> ")}if(e("input:radio:checked","#post-visibility-select").val()=="private"){if(page){e("#publish").val(postL10n.updatePage)}else{e("#publish").val(postL10n.updatePost)}if(i.length==0){p.append('<option value="publish">'+postL10n.privatelyPublished+"</option>")}else{i.html(postL10n.privatelyPublished)}e("option[value=publish]",p).attr("selected",true);e(".edit-post-status","#misc-publishing-actions").hide()}else{if(e("#original_post_status").val()=="future"||e("#original_post_status").val()=="draft"){if(i.length){i.remove();p.val(e("#hidden_post_status").val())}}else{i.html(postL10n.published)}if(p.is(":hidden")){e(".edit-post-status","#misc-publishing-actions").show()}}e("#post-status-display").html(e("option:selected",p).text());if(e("option:selected",p).val()=="private"||e("option:selected",p).val()=="publish"){e("#save-post").hide()}else{e("#save-post").show();if(e("option:selected",p).val()=="pending"){e("#save-post").show().val(postL10n.savePending)}else{e("#save-post").show().val(postL10n.saveDraft)}}return true}e(".edit-visibility","#visibility").click(function(){if(e("#post-visibility-select").is(":hidden")){d();e("#post-visibility-select").slideDown("normal");e(this).hide()}return false});e(".cancel-post-visibility","#post-visibility-select").click(function(){e("#post-visibility-select").slideUp("normal");e("#visibility-radio-"+e("#hidden-post-visibility").val()).attr("checked",true);e("#post_password").val(e("#hidden_post_password").val());e("#sticky").attr("checked",e("#hidden-post-sticky").attr("checked"));e("#post-visibility-display").html(a);e(".edit-visibility","#visibility").show();c();return false});e(".save-post-visibility","#post-visibility-select").click(function(){var g=e("#post-visibility-select");g.slideUp("normal");e(".edit-visibility","#visibility").show();c();if(e("input:radio:checked",g).val()!="public"){e("#sticky").attr("checked",false)}if(true==e("#sticky").attr("checked")){f="Sticky"}else{f=""}e("#post-visibility-display").html(postL10n[e("input:radio:checked",g).val()+f]);return false});e("input:radio","#post-visibility-select").change(function(){d()});e("#timestampdiv").siblings("a.edit-timestamp").click(function(){if(e("#timestampdiv").is(":hidden")){e("#timestampdiv").slideDown("normal");e(this).hide()}return false});e(".cancel-timestamp","#timestampdiv").click(function(){e("#timestampdiv").slideUp("normal");e("#mm").val(e("#hidden_mm").val());e("#jj").val(e("#hidden_jj").val());e("#aa").val(e("#hidden_aa").val());e("#hh").val(e("#hidden_hh").val());e("#mn").val(e("#hidden_mn").val());e("#timestampdiv").siblings("a.edit-timestamp").show();c();return false});e(".save-timestamp","#timestampdiv").click(function(){if(c()){e("#timestampdiv").slideUp("normal");e("#timestampdiv").siblings("a.edit-timestamp").show()}return false});e("#post-status-select").siblings("a.edit-post-status").click(function(){if(e("#post-status-select").is(":hidden")){e("#post-status-select").slideDown("normal");e(this).hide()}return false});e(".save-post-status","#post-status-select").click(function(){e("#post-status-select").slideUp("normal");e("#post-status-select").siblings("a.edit-post-status").show();c();return false});e(".cancel-post-status","#post-status-select").click(function(){e("#post-status-select").slideUp("normal");e("#post_status").val(e("#hidden_post_status").val());e("#post-status-select").siblings("a.edit-post-status").show();c();return false})}if(e("#edit-slug-box").length){editPermalink=function(g){var h,l=0,k=e("#editable-post-name"),m=k.html(),p=e("#post_name"),q=p.html(),n=e("#edit-slug-buttons"),o=n.html(),j=e("#editable-post-name-full").html();e("#view-post-btn").hide();n.html('<a href="#" class="save button">'+postL10n.ok+'</a> <a class="cancel" href="#">'+postL10n.cancel+"</a>");n.children(".save").click(function(){var i=k.children("input").val();e.post(ajaxurl,{action:"sample-permalink",post_id:g,new_slug:i,new_title:e("#title").val(),samplepermalinknonce:e("#samplepermalinknonce").val()},function(r){e("#edit-slug-box").html(r);n.html(o);p.attr("value",i);makeSlugeditClickable();e("#view-post-btn").show()});return false});e(".cancel","#edit-slug-buttons").click(function(){e("#view-post-btn").show();k.html(m);n.html(o);p.attr("value",q);return false});for(h=0;h<j.length;++h){if("%"==j.charAt(h)){l++}}slug_value=(l>j.length/4)?"":j;k.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children("input").keypress(function(r){var i=r.keyCode||0;if(13==i){n.children(".save").click();return false}if(27==i){n.children(".cancel").click();return false}p.attr("value",this.value)}).focus()};makeSlugeditClickable=function(){e("#editable-post-name").click(function(){e("#edit-slug-buttons").children(".edit-slug").click()})};makeSlugeditClickable()}});
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminjspostboxdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/postbox.dev.js (13550 => 13551)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/postbox.dev.js        2010-03-02 17:56:24 UTC (rev 13550)
+++ trunk/wp-admin/js/postbox.dev.js        2010-03-02 18:06:14 UTC (rev 13551)
</span><span class="lines">@@ -5,6 +5,7 @@
</span><span class="cx">                         this.init(page,args);
</span><span class="cx">                         $('.postbox h3, .postbox .handlediv').click( function() {
</span><span class="cx">                                 var p = $(this).parent('.postbox'), id = p.attr('id');
</span><ins>+
</ins><span class="cx">                                 p.toggleClass('closed');
</span><span class="cx">                                 postboxes.save_state(page);
</span><span class="cx">                                 if ( id ) {
</span><span class="lines">@@ -19,6 +20,7 @@
</span><span class="cx">                         } );
</span><span class="cx">                         $('.hide-postbox-tog').click( function() {
</span><span class="cx">                                 var box = $(this).val();
</span><ins>+
</ins><span class="cx">                                 if ( $(this).attr('checked') ) {
</span><span class="cx">                                         $('#' + box).show();
</span><span class="cx">                                         if ( $.isFunction( postboxes.pbshow ) )
</span><span class="lines">@@ -115,7 +117,8 @@
</span><span class="cx">
</span><span class="cx">                 save_state : function(page) {
</span><span class="cx">                         var closed = $('.postbox').filter('.closed').map(function() { return this.id; }).get().join(','),
</span><del>-                        hidden = $('.postbox').filter(':hidden').map(function() { return this.id; }).get().join(',');
</del><ins>+                                hidden = $('.postbox').filter(':hidden').map(function() { return this.id; }).get().join(',');
+
</ins><span class="cx">                         $.post(ajaxurl, {
</span><span class="cx">                                 action: 'closed-postboxes',
</span><span class="cx">                                 closed: closed,
</span><span class="lines">@@ -127,6 +130,7 @@
</span><span class="cx">
</span><span class="cx">                 save_order : function(page) {
</span><span class="cx">                         var postVars, page_columns = $('.columns-prefs input:checked').val() || 0;
</span><ins>+
</ins><span class="cx">                         postVars = {
</span><span class="cx">                                 action: 'meta-box-order',
</span><span class="cx">                                 _ajax_nonce: $('#meta-box-order-nonce').val(),
</span></span></pre></div>
<a id="trunkwpincludesuserphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/user.php (13550 => 13551)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/user.php        2010-03-02 17:56:24 UTC (rev 13550)
+++ trunk/wp-includes/user.php        2010-03-02 18:06:14 UTC (rev 13551)
</span><span class="lines">@@ -203,7 +203,6 @@
</span><span class="cx">         if ( !empty( $deprecated ) )
</span><span class="cx">                 _deprecated_argument( __FUNCTION__, '3.0' );
</span><span class="cx">
</span><del>-        $option = preg_replace('|[^a-z0-9_]|i', '', $option);
</del><span class="cx">         if ( empty($user) )
</span><span class="cx">                 $user = wp_get_current_user();
</span><span class="cx">         else
</span><span class="lines">@@ -237,6 +236,7 @@
</span><span class="cx"> */
</span><span class="cx"> function update_user_option( $user_id, $option_name, $newvalue, $global = false ) {
</span><span class="cx">         global $wpdb;
</span><ins>+
</ins><span class="cx">         if ( !$global )
</span><span class="cx">                 $option_name = $wpdb->prefix . $option_name;
</span><span class="cx">         return update_user_meta( $user_id, $option_name, $newvalue );
</span><span class="lines">@@ -666,4 +666,4 @@
</span><span class="cx">         wp_cache_delete($user->user_nicename, 'userslugs');
</span><span class="cx"> }
</span><span class="cx">
</span><del>-?>
</del><span class="cx">\ No newline at end of file
</span><ins>+?>
</ins></span></pre>
</div>
</div>
</body>
</html>