Skip to:
Content

BuddyPress.org

Changeset 8030


Ignore:
Timestamp:
03/03/2014 10:59:26 PM (11 years ago)
Author:
imath
Message:

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 #5364

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/admin/js/admin.js

    r6264 r8030  
    163163    // On the edit screen, unload the close/open toggle js for the action & content metaboxes
    164164    $( '#bp_activity_action h3, #bp_activity_content h3' ).unbind( 'click' );
     165
     166    // redo the post box toggles to reset the one made by comment.js in favor
     167    // of activity administration page id so that metaboxes are still collapsible
     168    // in single Activity Administration screen.
     169    postboxes.add_postbox_toggles( bp_activity_admin_vars.page );
    165170});
    166171
  • trunk/bp-activity/admin/js/admin.min.js

    r6264 r8030  
    1 (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["_ajax_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").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);
     1(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["_ajax_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").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)
  • trunk/bp-activity/bp-activity-admin.php

    r7756 r8030  
    280280    // Enqueue CSS and JavaScript
    281281    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 );
     282    wp_localize_script( 'bp_activity_admin_js', 'bp_activity_admin_vars', array(
     283        'page'   => get_current_screen()->id
     284    ) );
    282285    wp_enqueue_style( 'bp_activity_admin_css', $bp->plugin_url . "bp-activity/admin/css/admin.{$min}css", array(),                               bp_get_version()       );
    283286
  • trunk/bp-groups/bp-groups-admin.php

    r8013 r8030  
    132132        wp_enqueue_script( 'postbox' );
    133133        wp_enqueue_script( 'dashboard' );
    134         wp_enqueue_script( 'comment' );
    135134
    136135    // Index screen
  • trunk/bp-members/bp-members-admin.php

    r7990 r8030  
    361361            wp_enqueue_script( 'postbox' );
    362362            wp_enqueue_script( 'dashboard' );
    363             wp_enqueue_script( 'comment' );
    364363
    365364        // Spam or Ham user
Note: See TracChangeset for help on using the changeset viewer.