<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][8030] trunk: Ensures metaboxes are collapsible in various Administration screens</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://buddypress.trac.wordpress.org/changeset/8030">8030</a></dd>
<dt>Author</dt> <dd>imath</dd>
<dt>Date</dt> <dd>2014-03-03 22:59:26 +0000 (Mon, 03 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Ensures metaboxes are collapsible in various Administration screens

When editing an activity, editing a group or editing a profile from the corresponding WordPress Administration screens, metaboxes are now fully collapsible.

Fixes <a href="http://buddypress.trac.wordpress.org/ticket/5364">#5364</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpactivityadminjsadminjs">trunk/bp-activity/admin/js/admin.js</a></li>
<li><a href="#trunkbpactivityadminjsadminminjs">trunk/bp-activity/admin/js/admin.min.js</a></li>
<li><a href="#trunkbpactivitybpactivityadminphp">trunk/bp-activity/bp-activity-admin.php</a></li>
<li><a href="#trunkbpgroupsbpgroupsadminphp">trunk/bp-groups/bp-groups-admin.php</a></li>
<li><a href="#trunkbpmembersbpmembersadminphp">trunk/bp-members/bp-members-admin.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpactivityadminjsadminjs"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/admin/js/admin.js (8029 => 8030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/admin/js/admin.js      2014-03-03 22:35:17 UTC (rev 8029)
+++ trunk/bp-activity/admin/js/admin.js 2014-03-03 22:59:26 UTC (rev 8030)
</span><span class="lines">@@ -162,6 +162,11 @@
</span><span class="cx"> 
</span><span class="cx">  // On the edit screen, unload the close/open toggle js for the action & content metaboxes
</span><span class="cx">  $( '#bp_activity_action h3, #bp_activity_content h3' ).unbind( 'click' );
</span><ins>+
+       // redo the post box toggles to reset the one made by comment.js in favor
+       // of activity administration page id so that metaboxes are still collapsible 
+       // in single Activity Administration screen.
+       postboxes.add_postbox_toggles( bp_activity_admin_vars.page );
</ins><span class="cx"> });
</span><span class="cx"> 
</span><span class="cx"> })(jQuery);
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkbpactivityadminjsadminminjs"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/admin/js/admin.min.js (8029 => 8030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/admin/js/admin.min.js  2014-03-03 22:35:17 UTC (rev 8029)
+++ trunk/bp-activity/admin/js/admin.min.js     2014-03-03 22:59:26 UTC (rev 8030)
</span><span class="lines">@@ -1 +1 @@
</span><del>-(function(b){var a={init:function(){b(document).on("click",".row-actions a.reply",a.open);b(document).on("click","#bp-activities-container a.cancel",a.close);b(document).on("click","#bp-activities-container a.save",a.send);b(document).on("keyup","#bp-activities:visible",function(c){if(27==c.which){a.close()}})},open:function(d){var c=b("#bp-activities-container").hide();b(this).parents("tr").after(c);c.fadeIn("300");b("#bp-activities").focus();return false},close:function(c){b("#bp-activities-container").fadeOut("200",function(){b("#bp-activities").val("").blur();b("#bp-replysubmit .error").html("").hide();b("#bp-replysubmit .waiting").hide()});return false},send:function(d){b("#bp-replysubmit .error").hide();b("#bp-replysubmit .waiting").show();var c={};c["_a
 jax_nonce-bp-activity-admin-reply"]=b('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val();c.action="bp-activity-admin-reply";c.content=b("#bp-activities").val();c.parent_id=b("#bp-activities-container").prev().data("parent_id");c.root_id=b("#bp-activities-container").prev().data("root_id");b.ajax({data:c,type:"POST",url:ajaxurl,error:function(e){a.error(e)},success:function(e){a.show(e)}});return false},error:function(c){var d=c.statusText;b("#bp-replysubmit .waiting").hide();if(c.responseText){d=c.responseText.replace(/<.[^<>]*?>/g,"")}if(d){b("#bp-replysubmit .error").html(d).show()}},show:function(d){var e,f,c;if(typeof(d)=="string"){a.error({responseText:d});return false}c=wpAjax.parseAjaxResponse(d);if(c.errors){a.error({responseText:wpAjax.broken});return false}c=c.responses[0];b("#bp-activities-container&
 quot;).fadeOut("200",function(){b("#bp-activities").val("").blur();b("#bp-replysubmit .error").html("").hide();b("#bp-replysubmit .waiting").hide();b("#bp-activities-container").before(c.data);f=b("#activity-"+c.id);e=f.closest(".widefat").css("backgroundColor");f.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:e},300)})}};b(document).ready(function(){a.init();b("#bp_activity_action h3, #bp_activity_content h3").unbind("click")})})(jQuery);
</del><span class="cx">\ No newline at end of file
</span><ins>+(function(e){var t={init:function(){e(document).on("click",".row-actions a.reply",t.open);e(document).on("click","#bp-activities-container a.cancel",t.close);e(document).on("click","#bp-activities-container a.save",t.send);e(document).on("keyup","#bp-activities:visible",function(e){if(27==e.which){t.close()}})},open:function(t){var n=e("#bp-activities-container").hide();e(this).parents("tr").after(n);n.fadeIn("300");e("#bp-activities").focus();return false},close:function(t){e("#bp-activities-container").fadeOut("200",function(){e("#bp-activities").val("").blur();e("#bp-replysubmit .error").html("").hide();e("#bp-replysubmit .waiting").hide()});return false},send:function(n){e("#bp-replysubmit .error").hide();e("#bp-replysubmit .waiting").show();var r={};r["_a
 jax_nonce-bp-activity-admin-reply"]=e('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val();r.action="bp-activity-admin-reply";r.content=e("#bp-activities").val();r.parent_id=e("#bp-activities-container").prev().data("parent_id");r.root_id=e("#bp-activities-container").prev().data("root_id");e.ajax({data:r,type:"POST",url:ajaxurl,error:function(e){t.error(e)},success:function(e){t.show(e)}});return false},error:function(t){var n=t.statusText;e("#bp-replysubmit .waiting").hide();if(t.responseText){n=t.responseText.replace(/<.[^<>]*?>/g,"")}if(n){e("#bp-replysubmit .error").html(n).show()}},show:function(n){var r,i,s;if(typeof n=="string"){t.error({responseText:n});return false}s=wpAjax.parseAjaxResponse(n);if(s.errors){t.error({responseText:wpAjax.broken});return false}s=s.responses[0];e("#bp-activities-container&q
 uot;).fadeOut("200",function(){e("#bp-activities").val("").blur();e("#bp-replysubmit .error").html("").hide();e("#bp-replysubmit .waiting").hide();e("#bp-activities-container").before(s.data);i=e("#activity-"+s.id);r=i.closest(".widefat").css("backgroundColor");i.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:r},300)})}};e(document).ready(function(){t.init();e("#bp_activity_action h3, #bp_activity_content h3").unbind("click");postboxes.add_postbox_toggles(bp_activity_admin_vars.page)})})(jQuery)
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkbpactivitybpactivityadminphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-admin.php (8029 => 8030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-admin.php  2014-03-03 22:35:17 UTC (rev 8029)
+++ trunk/bp-activity/bp-activity-admin.php     2014-03-03 22:59:26 UTC (rev 8030)
</span><span class="lines">@@ -279,6 +279,9 @@
</span><span class="cx"> 
</span><span class="cx">  // Enqueue CSS and JavaScript
</span><span class="cx">  wp_enqueue_script( 'bp_activity_admin_js', $bp->plugin_url . "bp-activity/admin/js/admin.{$min}js",   array( 'jquery', 'wp-ajax-response' ), bp_get_version(), true );
</span><ins>+       wp_localize_script( 'bp_activity_admin_js', 'bp_activity_admin_vars', array(
+               'page'   => get_current_screen()->id
+       ) );
</ins><span class="cx">   wp_enqueue_style( 'bp_activity_admin_css', $bp->plugin_url . "bp-activity/admin/css/admin.{$min}css", array(),                               bp_get_version()       );
</span><span class="cx"> 
</span><span class="cx">  // Handle spam/un-spam/delete of activities
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupsadminphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-admin.php (8029 => 8030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-admin.php      2014-03-03 22:35:17 UTC (rev 8029)
+++ trunk/bp-groups/bp-groups-admin.php 2014-03-03 22:59:26 UTC (rev 8030)
</span><span class="lines">@@ -131,7 +131,6 @@
</span><span class="cx">          // Enqueue javascripts
</span><span class="cx">          wp_enqueue_script( 'postbox' );
</span><span class="cx">          wp_enqueue_script( 'dashboard' );
</span><del>-               wp_enqueue_script( 'comment' );
</del><span class="cx"> 
</span><span class="cx">  // Index screen
</span><span class="cx">  } else {
</span></span></pre></div>
<a id="trunkbpmembersbpmembersadminphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-members/bp-members-admin.php (8029 => 8030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-members/bp-members-admin.php    2014-03-03 22:35:17 UTC (rev 8029)
+++ trunk/bp-members/bp-members-admin.php       2014-03-03 22:59:26 UTC (rev 8030)
</span><span class="lines">@@ -360,7 +360,6 @@
</span><span class="cx">                  // Enqueue javascripts
</span><span class="cx">                  wp_enqueue_script( 'postbox' );
</span><span class="cx">                  wp_enqueue_script( 'dashboard' );
</span><del>-                       wp_enqueue_script( 'comment' );
</del><span class="cx"> 
</span><span class="cx">          // Spam or Ham user
</span><span class="cx">          } else if ( in_array( $doaction, array( 'spam', 'ham' ) ) ) {
</span></span></pre>
</div>
</div>

</body>
</html>