BuddyPress - Version 2.4.0-beta2

Version Description

= 2.4.0 = See: https://codex.buddypress.org/releases/version-2-4-0/

= 2.3.4 = See: https://codex.buddypress.org/releases/version-2-3-4/

= 2.3.3 = See: https://codex.buddypress.org/releases/version-2-3-3/

= 2.3.2 = See: https://codex.buddypress.org/releases/version-2-3-2/

= 2.3.1 = See: https://codex.buddypress.org/releases/version-2-3-1/

= 2.3.0 = See: https://codex.buddypress.org/releases/version-2-3-0/

= 2.2.3.1 = See: https://codex.buddypress.org/releases/version-2-2-3-1/

= 2.2.3 = See: https://codex.buddypress.org/releases/version-2-2-3/

= 2.2.2.1 = See: https://codex.buddypress.org/releases/version-2-2-2-1/

= 2.2.2 = See: https://codex.buddypress.org/releases/version-2-2-2/

= 2.2.1 = See: https://codex.buddypress.org/releases/version-2-2-1/

= 2.2 = See: https://codex.buddypress.org/releases/version-2-2/

= 2.1 = See: https://codex.buddypress.org/releases/version-2-1/

= 2.0.3 = See: https://codex.buddypress.org/releases/version-2-0-3/

= 2.0.2 = See: https://codex.buddypress.org/releases/version-2-0-2/

= 2.0.1 = See: https://codex.buddypress.org/releases/version-2-0-1/

= 2.0 = See: https://codex.buddypress.org/releases/version-2-0/

= 1.9.2 = See: https://codex.buddypress.org/releases/version-1-9-2/

= 1.9.1 = See: https://codex.buddypress.org/releases/version-1-9-1/

= 1.9 = See: https://codex.buddypress.org/releases/version-1-9/

= 1.8.1 = See: https://codex.buddypress.org/releases/version-1-8-1/

= 1.8 = See: https://codex.buddypress.org/releases/version-1-8/

= 1.7.3 = See: https://codex.buddypress.org/releases/version-1-7-3/

= 1.7.2 = See: https://codex.buddypress.org/releases/version-1-7-2/

= 1.7.1 = See: https://codex.buddypress.org/releases/version-1-7-1/

= 1.7 = See: https://codex.buddypress.org/releases/version-1-7/

= 1.6.5 = See: https://codex.buddypress.org/releases/version-1-6-5/

= 1.6.4 = See: https://codex.buddypress.org/releases/version-1-6-4/

= 1.6.3 = See: https://codex.buddypress.org/releases/version-1-6-3/

= 1.6.2 = Compatibility with WordPress 3.5

= 1.6.1 = Fixes 4 bugs

= 1.6 = See: https://codex.buddypress.org/releases/version-1-6/

= 1.5 = See: https://codex.buddypress.org/releases/version-1-5/

= 1.2.9 = Compatibility with WordPress 3.2

= 1.2.8 = Compatibility with WordPress 3.1

= 1.2.7 = Fixes over 10 bugs.

Download this release

Release Info

Developer DJPaul
Plugin Icon 128x128 BuddyPress
Version 2.4.0-beta2
Comparing to
See all releases

Code changes from version 2.4.0-beta1 to 2.4.0-beta2

Files changed (126) hide show
  1. bp-activity/admin/js/admin.min.js +1 -1
  2. bp-activity/bp-activity-admin.php +6 -3
  3. bp-activity/bp-activity-akismet.php +1 -1
  4. bp-activity/bp-activity-functions.php +3 -3
  5. bp-activity/js/mentions.min.js +1 -1
  6. bp-blogs/bp-blogs-functions.php +5 -0
  7. bp-core/admin/bp-core-admin-functions.php +1 -1
  8. bp-core/bp-core-admin.php +30 -24
  9. bp-core/bp-core-avatars.php +95 -30
  10. bp-core/bp-core-filters.php +1 -1
  11. bp-core/bp-core-template-loader.php +12 -6
  12. bp-core/css/buddybar-rtl.min.css +1 -1
  13. bp-core/css/buddybar.min.css +1 -1
  14. bp-core/deprecated/js/autocomplete/jquery.autocomplete.min.js +1 -1
  15. bp-core/deprecated/js/autocomplete/jquery.autocompletefb.min.js +1 -1
  16. bp-core/deprecated/js/autocomplete/jquery.bgiframe.min.js +1 -1
  17. bp-core/deprecated/js/autocomplete/jquery.dimensions.min.js +1 -1
  18. bp-core/js/avatar.min.js +1 -1
  19. bp-core/js/bp-plupload.min.js +1 -1
  20. bp-core/js/confirm.min.js +1 -1
  21. bp-core/js/cover-image.min.js +1 -1
  22. bp-core/js/jquery-cookie.min.js +1 -1
  23. bp-core/js/jquery-query.min.js +1 -1
  24. bp-core/js/jquery-scroll-to.min.js +1 -1
  25. bp-core/js/jquery.atwho.min.js +1 -1
  26. bp-core/js/jquery.caret.min.js +1 -1
  27. bp-core/js/webcam.min.js +1 -1
  28. bp-core/js/widget-members.min.js +1 -1
  29. bp-forums/deprecated/1.6.php +8 -5
  30. bp-friends/bp-friends-widgets.php +1 -1
  31. bp-friends/js/widget-friends.min.js +1 -1
  32. bp-groups/admin/js/admin.min.js +1 -1
  33. bp-groups/bp-groups-actions.php +1 -1
  34. bp-groups/bp-groups-admin.php +4 -4
  35. bp-groups/bp-groups-functions.php +3 -10
  36. bp-groups/bp-groups-loader.php +1 -1
  37. bp-groups/bp-groups-screens.php +1 -1
  38. bp-groups/js/widget-groups.min.js +1 -1
  39. bp-loader.php +2 -2
  40. bp-members/admin/css/admin-rtl.css +3 -2
  41. bp-members/admin/css/admin-rtl.min.css +1 -1
  42. bp-members/admin/css/admin.css +3 -2
  43. bp-members/admin/css/admin.min.css +1 -1
  44. bp-members/admin/js/admin.min.js +1 -1
  45. bp-members/bp-members-admin.php +1 -1
  46. bp-members/bp-members-functions.php +1 -1
  47. bp-members/bp-members-screens.php +1 -1
  48. bp-members/bp-members-widgets.php +2 -2
  49. bp-messages/bp-messages-actions.php +46 -45
  50. bp-messages/bp-messages-cache.php +9 -9
  51. bp-messages/bp-messages-filters.php +3 -2
  52. bp-messages/bp-messages-functions.php +55 -40
  53. bp-messages/bp-messages-loader.php +20 -21
  54. bp-messages/bp-messages-notifications.php +15 -16
  55. bp-messages/bp-messages-screens.php +3 -3
  56. bp-messages/bp-messages-star.php +35 -35
  57. bp-messages/bp-messages-template.php +47 -34
  58. bp-messages/bp-messages-widgets.php +2 -5
  59. bp-messages/classes/class-bp-messages-message.php +7 -12
  60. bp-messages/classes/class-bp-messages-notice.php +4 -3
  61. bp-messages/classes/class-bp-messages-thread.php +36 -46
  62. bp-notifications/bp-notifications-actions.php +17 -17
  63. bp-notifications/bp-notifications-adminbar.php +1 -1
  64. bp-notifications/bp-notifications-cache.php +4 -5
  65. bp-notifications/bp-notifications-classes.php +0 -1
  66. bp-notifications/bp-notifications-functions.php +59 -65
  67. bp-notifications/bp-notifications-loader.php +17 -14
  68. bp-notifications/bp-notifications-template.php +42 -45
  69. bp-notifications/classes/class-bp-notifications-notification.php +73 -93
  70. bp-settings/bp-settings-template.php +7 -1
  71. bp-templates/bp-legacy/buddypress-functions.php +6 -5
  72. bp-templates/bp-legacy/buddypress/activity/entry.php +1 -1
  73. bp-templates/bp-legacy/buddypress/activity/index.php +4 -4
  74. bp-templates/bp-legacy/buddypress/blogs/index.php +2 -2
  75. bp-templates/bp-legacy/buddypress/forums/index.php +2 -2
  76. bp-templates/bp-legacy/buddypress/groups/index.php +2 -2
  77. bp-templates/bp-legacy/buddypress/groups/single/cover-image-header.php +62 -64
  78. bp-templates/bp-legacy/buddypress/members/index.php +2 -2
  79. bp-templates/bp-legacy/buddypress/members/register.php +13 -2
  80. bp-templates/bp-legacy/buddypress/members/single/cover-image-header.php +46 -48
  81. bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php +2 -2
  82. bp-templates/bp-legacy/buddypress/members/single/profile/edit.php +13 -2
  83. bp-templates/bp-legacy/css/buddypress-rtl.css +19 -8
  84. bp-templates/bp-legacy/css/buddypress-rtl.min.css +1 -1
  85. bp-templates/bp-legacy/css/buddypress.css +19 -8
  86. bp-templates/bp-legacy/css/buddypress.min.css +1 -1
  87. bp-templates/bp-legacy/css/twentyfifteen-rtl.css +0 -10
  88. bp-templates/bp-legacy/css/twentyfifteen-rtl.min.css +1 -1
  89. bp-templates/bp-legacy/css/twentyfifteen.css +0 -10
  90. bp-templates/bp-legacy/css/twentyfifteen.min.css +1 -1
  91. bp-templates/bp-legacy/css/twentyfifteen.scss +0 -5
  92. bp-templates/bp-legacy/css/twentyfourteen-rtl.css +0 -8
  93. bp-templates/bp-legacy/css/twentyfourteen-rtl.min.css +1 -1
  94. bp-templates/bp-legacy/css/twentyfourteen.css +0 -8
  95. bp-templates/bp-legacy/css/twentyfourteen.min.css +1 -1
  96. bp-templates/bp-legacy/css/twentyfourteen.scss +0 -10
  97. bp-templates/bp-legacy/css/twentysixteen-rtl.css +65 -49
  98. bp-templates/bp-legacy/css/twentysixteen-rtl.min.css +1 -1
  99. bp-templates/bp-legacy/css/twentysixteen.css +65 -49
  100. bp-templates/bp-legacy/css/twentysixteen.min.css +1 -1
  101. bp-templates/bp-legacy/css/twentysixteen.scss +91 -33
  102. bp-templates/bp-legacy/css/twentythirteen-rtl.css +72 -53
  103. bp-templates/bp-legacy/css/twentythirteen-rtl.min.css +1 -1
  104. bp-templates/bp-legacy/css/twentythirteen.css +72 -53
  105. bp-templates/bp-legacy/css/twentythirteen.min.css +1 -1
  106. bp-templates/bp-legacy/css/twentythirteen.scss +83 -26
  107. bp-templates/bp-legacy/js/buddypress.js +63 -35
  108. bp-templates/bp-legacy/js/buddypress.min.js +3 -3
  109. bp-templates/bp-legacy/js/password-verify.min.js +1 -1
  110. bp-xprofile/admin/css/admin-rtl.min.css +1 -1
  111. bp-xprofile/admin/css/admin.min.css +1 -1
  112. bp-xprofile/admin/js/admin.min.js +1 -1
  113. bp-xprofile/bp-xprofile-activity.php +1 -1
  114. bp-xprofile/bp-xprofile-admin.php +7 -2
  115. bp-xprofile/bp-xprofile-loader.php +1 -0
  116. bp-xprofile/bp-xprofile-notifications.php +49 -0
  117. bp-xprofile/bp-xprofile-template.php +2 -2
  118. bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php +1 -0
  119. bp-xprofile/classes/class-bp-xprofile-field-type-number.php +1 -0
  120. bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php +1 -0
  121. bp-xprofile/classes/class-bp-xprofile-field-type-textbox.php +1 -0
  122. bp-xprofile/classes/class-bp-xprofile-field-type-url.php +1 -0
  123. bp-xprofile/classes/class-bp-xprofile-field-type.php +0 -1
  124. bp-xprofile/classes/class-bp-xprofile-field.php +2 -2
  125. bp-xprofile/classes/class-bp-xprofile-group.php +2 -2
  126. buddypress.pot +345 -351
bp-activity/admin/js/admin.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! buddypress - v2.4.0 - 2015-10-12 8:03:39 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
!function(a){var b={init:function(){a(document).on("click",".row-actions a.reply",b.open),a(document).on("click","#bp-activities-container a.cancel",b.close),a(document).on("click","#bp-activities-container a.save",b.send),a(document).on("keyup","#bp-activities:visible",function(a){27===a.which&&b.close()})},open:function(){var b=a("#bp-activities-container").hide();return a(this).parents("tr").after(b),b.fadeIn("300"),a("#bp-activities").focus(),!1},close:function(){return a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide()}),!1},send:function(){a("#bp-replysubmit .error").hide(),a("#bp-replysubmit .waiting").show();var c={};return c["_ajax_nonce-bp-activity-admin-reply"]=a('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val(),c.action="bp-activity-admin-reply",c.content=a("#bp-activities").val(),c.parent_id=a("#bp-activities-container").prev().data("parent_id"),c.root_id=a("#bp-activities-container").prev().data("root_id"),a.ajax({data:c,type:"POST",url:ajaxurl,error:function(a){b.error(a)},success:function(a){b.show(a)}}),!1},error:function(b){var c=b.statusText;a("#bp-replysubmit .waiting").hide(),b.responseText&&(c=b.responseText.replace(/<.[^<>]*?>/g,"")),c&&a("#bp-replysubmit .error").html(c).show()},show:function(c){var d,e,f;return"string"==typeof c?(b.error({responseText:c}),!1):(f=wpAjax.parseAjaxResponse(c),f.errors?(b.error({responseText:wpAjax.broken}),!1):(f=f.responses[0],void a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide(),a("#bp-activities-container").before(f.data),e=a("#activity-"+f.id),d=e.closest(".widefat").css("backgroundColor"),e.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:d},300)})))}};a(document).ready(function(){b.init(),a("#bp_activity_action h3, #bp_activity_content h3").unbind("click"),"undefined"!=typeof postboxes&&postboxes.add_postbox_toggles(bp_activity_admin_vars.page)})}(jQuery);
1
+ /*! buddypress - v2.4.0 - 2015-10-22 1:39:20 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
!function(a){var b={init:function(){a(document).on("click",".row-actions a.reply",b.open),a(document).on("click","#bp-activities-container a.cancel",b.close),a(document).on("click","#bp-activities-container a.save",b.send),a(document).on("keyup","#bp-activities:visible",function(a){27===a.which&&b.close()})},open:function(){var b=a("#bp-activities-container").hide();return a(this).parents("tr").after(b),b.fadeIn("300"),a("#bp-activities").focus(),!1},close:function(){return a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide()}),!1},send:function(){a("#bp-replysubmit .error").hide(),a("#bp-replysubmit .waiting").show();var c={};return c["_ajax_nonce-bp-activity-admin-reply"]=a('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val(),c.action="bp-activity-admin-reply",c.content=a("#bp-activities").val(),c.parent_id=a("#bp-activities-container").prev().data("parent_id"),c.root_id=a("#bp-activities-container").prev().data("root_id"),a.ajax({data:c,type:"POST",url:ajaxurl,error:function(a){b.error(a)},success:function(a){b.show(a)}}),!1},error:function(b){var c=b.statusText;a("#bp-replysubmit .waiting").hide(),b.responseText&&(c=b.responseText.replace(/<.[^<>]*?>/g,"")),c&&a("#bp-replysubmit .error").html(c).show()},show:function(c){var d,e,f;return"string"==typeof c?(b.error({responseText:c}),!1):(f=wpAjax.parseAjaxResponse(c),f.errors?(b.error({responseText:wpAjax.broken}),!1):(f=f.responses[0],void a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide(),a("#bp-activities-container").before(f.data),e=a("#activity-"+f.id),d=e.closest(".widefat").css("backgroundColor"),e.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:d},300)})))}};a(document).ready(function(){b.init(),a("#bp_activity_action h3, #bp_activity_content h3").unbind("click"),"undefined"!=typeof postboxes&&postboxes.add_postbox_toggles(bp_activity_admin_vars.page)})}(jQuery);
bp-activity/bp-activity-admin.php CHANGED
@@ -699,7 +699,10 @@ function bp_activity_admin_edit() {
699
</form>
700
701
<?php else : ?>
702
- <p><?php printf( __( 'No activity found with this ID. <a href="%s">Go back and try again</a>.', 'buddypress' ), esc_url( bp_get_admin_url( 'admin.php?page=bp-activity' ) ) ); ?></p>
703
<?php endif; ?>
704
705
</div><!-- .wrap -->
@@ -740,7 +743,7 @@ function bp_activity_admin_edit_metabox_status( $item ) {
740
$datef = __( 'M j, Y @ G:i', 'buddypress' );
741
$date = date_i18n( $datef, strtotime( $item->date_recorded ) );
742
?>
743
- <span id="timestamp"><?php printf( __( 'Submitted on: <strong>%1$s</strong>', 'buddypress' ), $date ); ?></span>&nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e( 'Edit', 'buddypress' ); ?></a>
744
745
<div id='timestampdiv' class='hide-if-js'>
746
<?php touch_time( 1, 0, 5 ); ?>
@@ -1649,7 +1652,7 @@ class BP_Activity_List_Table extends WP_List_Table {
1649
// Activity permalink
1650
$activity_permalink = '';
1651
if ( ! $item['is_spam'] ) {
1652
- $activity_permalink = sprintf( __( '<a href="%1$s" class="comments-view-item-link">View Activity</a>', 'buddypress' ), bp_activity_get_permalink( $item['id'], (object) $item ) );
1653
}
1654
1655
/**
699
</form>
700
701
<?php else : ?>
702
+ <p>
703
+ <?php _e( 'No activity found with this ID.', 'buddypress' ); ?>
704
+ <a href="<?php echo esc_url( bp_get_admin_url( 'admin.php?page=bp-activity' ) ); ?>"><?php _e( 'Go back and try again.', 'buddypress' ); ?></a>
705
+ </p>
706
<?php endif; ?>
707
708
</div><!-- .wrap -->
743
$datef = __( 'M j, Y @ G:i', 'buddypress' );
744
$date = date_i18n( $datef, strtotime( $item->date_recorded ) );
745
?>
746
+ <span id="timestamp"><?php printf( __( 'Submitted on: %s', 'buddypress' ), '<strong>' . $date . '</strong>' ); ?></span>&nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e( 'Edit', 'buddypress' ); ?></a>
747
748
<div id='timestampdiv' class='hide-if-js'>
749
<?php touch_time( 1, 0, 5 ); ?>
1652
// Activity permalink
1653
$activity_permalink = '';
1654
if ( ! $item['is_spam'] ) {
1655
+ $activity_permalink = '<a href="' . bp_activity_get_permalink( $item['id'], (object) $item ) . '" class="comments-view-item-link">' . __( 'View Activity', 'buddypress' ) . '</a>';
1656
}
1657
1658
/**
bp-activity/bp-activity-akismet.php CHANGED
@@ -606,7 +606,7 @@ class BP_Akismet {
606
return;
607
608
echo '<div class="akismet-history"><div>';
609
- printf( _x( '<span>%1$s</span> &mdash; %2$s', 'x hours ago - akismet cleared this item', 'buddypress' ), bp_core_time_since( $history[2] ), esc_html( $history[1] ) );
610
echo '</div></div>';
611
}
612
606
return;
607
608
echo '<div class="akismet-history"><div>';
609
+ printf( _x( '%1$s &mdash; %2$s', 'x hours ago - akismet cleared this item', 'buddypress' ), '<span>' . bp_core_time_since( $history[2] ) . '</span>', esc_html( $history[1] ) );
610
echo '</div></div>';
611
}
612
bp-activity/bp-activity-functions.php CHANGED
@@ -2149,9 +2149,9 @@ function bp_activity_new_comment( $args = '' ) {
2149
*
2150
* @since 1.2.0
2151
*
2152
- * @param int $comment_id ID of the newly posted activity comment.
2153
- * @param array $r Array of parsed comment arguments.
2154
- * @param int $activity ID of the activity item being commented on.
2155
*/
2156
do_action( 'bp_activity_comment_posted', $comment_id, $r, $activity );
2157
2149
*
2150
* @since 1.2.0
2151
*
2152
+ * @param int $comment_id ID of the newly posted activity comment.
2153
+ * @param array $r Array of parsed comment arguments.
2154
+ * @param BP_Activity_Activity $activity Activity item being commented on.
2155
*/
2156
do_action( 'bp_activity_comment_posted', $comment_id, $r, $activity );
2157
bp-activity/js/mentions.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! buddypress - v2.4.0 - 2015-10-12 8:03:39 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
window.bp=window.bp||{},function(a,b,c){var d,e=[];a.mentions=a.mentions||{},a.mentions.users=window.bp.mentions.users||[],"object"==typeof window.BP_Suggestions&&(a.mentions.users=window.BP_Suggestions.friends||a.mentions.users),b.fn.bp_mentions=function(a){b.isArray(a)&&(a={data:a});var c={delay:200,hide_without_suffix:!0,insert_tpl:"</>${atwho-data-value}</>",limit:10,start_with_space:!1,suffix:"",callbacks:{filter:function(a,b,c){var d,e,f,g=[],h=new RegExp("^"+a+"| "+a,"ig");for(e=0,f=b.length;f>e;e++)d=b[e],d[c].toLowerCase().match(h)&&g.push(d);return g},highlighter:function(a,b){if(!b)return a;var c=new RegExp(">(\\s*|[\\w\\s]*)("+this.at.replace("+","\\+")+"?"+b.replace("+","\\+")+")([\\w ]*)\\s*<","ig");return a.replace(c,function(a,b,c,d){return">"+b+"<strong>"+c+"</strong>"+d+"<"})},before_reposition:function(a){var c,d,e,f,g=b("#atwho-ground-"+this.id+" .atwho-view"),h=b("body"),i=this.$inputor.data("atwho");"undefined"!==i&&"undefined"!==i.iframe&&null!==i.iframe?(c=this.$inputor.caret("offset",{iframe:i.iframe}),e=b(i.iframe).offset(),"undefined"!==e&&(c.left+=e.left,c.top+=e.top)):c=this.$inputor.caret("offset"),c.left>h.width()/2?(g.addClass("right"),f=c.left-a.left-this.view.$el.width()):(g.removeClass("right"),f=c.left-a.left+1),h.width()<=400&&b(document).scrollTop(c.top-6),d=parseInt(this.$inputor.css("line-height").substr(0,this.$inputor.css("line-height").length-2),10),(!d||5>d)&&(d=19),a.top=c.top+d,a.left+=f},inserting_wrapper:function(a,b,c){return""+b+c}}},f={callbacks:{remote_filter:function(a,c){var f=b(this),g={};return d=e[a],"object"==typeof d?void c(d):(f.xhr&&f.xhr.abort(),g={action:"bp_get_suggestions",term:a,type:"members"},b.isNumeric(this.$inputor.data("suggestions-group-id"))&&(g["group-id"]=parseInt(this.$inputor.data("suggestions-group-id"),10)),void(f.xhr=b.getJSON(ajaxurl,g).done(function(d){if(d.success){var f=b.map(d.data,function(a){return a.search=a.search||a.ID+" "+a.name,a});e[a]=f,c(f)}})))}},data:b.map(a.data,function(a){return a.search=a.search||a.ID+" "+a.name,a}),at:"@",search_key:"search",tpl:'<li data-value="@${ID}"><img src="${image}" /><span class="username">@${ID}</span><small>${name}</small></li>'},g=b.extend(!0,{},c,f,a);return b.fn.atwho.call(this,g)},b(document).ready(function(){b(".bp-suggestions, #comments form textarea, .wp-editor-area").bp_mentions(a.mentions.users)}),a.mentions.tinyMCEinit=function(){"undefined"!=typeof window.tinyMCE&&null!==window.tinyMCE.activeEditor&&"undefined"!=typeof window.tinyMCE.activeEditor&&b(window.tinyMCE.activeEditor.contentDocument.activeElement).atwho("setIframe",b("#content_ifr")[0]).bp_mentions(a.mentions.users)}}(bp,jQuery);
1
+ /*! buddypress - v2.4.0 - 2015-10-22 1:39:20 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
window.bp=window.bp||{},function(a,b,c){var d,e=[];a.mentions=a.mentions||{},a.mentions.users=window.bp.mentions.users||[],"object"==typeof window.BP_Suggestions&&(a.mentions.users=window.BP_Suggestions.friends||a.mentions.users),b.fn.bp_mentions=function(a){b.isArray(a)&&(a={data:a});var c={delay:200,hide_without_suffix:!0,insert_tpl:"</>${atwho-data-value}</>",limit:10,start_with_space:!1,suffix:"",callbacks:{filter:function(a,b,c){var d,e,f,g=[],h=new RegExp("^"+a+"| "+a,"ig");for(e=0,f=b.length;f>e;e++)d=b[e],d[c].toLowerCase().match(h)&&g.push(d);return g},highlighter:function(a,b){if(!b)return a;var c=new RegExp(">(\\s*|[\\w\\s]*)("+this.at.replace("+","\\+")+"?"+b.replace("+","\\+")+")([\\w ]*)\\s*<","ig");return a.replace(c,function(a,b,c,d){return">"+b+"<strong>"+c+"</strong>"+d+"<"})},before_reposition:function(a){var c,d,e,f,g=b("#atwho-ground-"+this.id+" .atwho-view"),h=b("body"),i=this.$inputor.data("atwho");"undefined"!==i&&"undefined"!==i.iframe&&null!==i.iframe?(c=this.$inputor.caret("offset",{iframe:i.iframe}),e=b(i.iframe).offset(),"undefined"!==e&&(c.left+=e.left,c.top+=e.top)):c=this.$inputor.caret("offset"),c.left>h.width()/2?(g.addClass("right"),f=c.left-a.left-this.view.$el.width()):(g.removeClass("right"),f=c.left-a.left+1),h.width()<=400&&b(document).scrollTop(c.top-6),d=parseInt(this.$inputor.css("line-height").substr(0,this.$inputor.css("line-height").length-2),10),(!d||5>d)&&(d=19),a.top=c.top+d,a.left+=f},inserting_wrapper:function(a,b,c){return""+b+c}}},f={callbacks:{remote_filter:function(a,c){var f=b(this),g={};return d=e[a],"object"==typeof d?void c(d):(f.xhr&&f.xhr.abort(),g={action:"bp_get_suggestions",term:a,type:"members"},b.isNumeric(this.$inputor.data("suggestions-group-id"))&&(g["group-id"]=parseInt(this.$inputor.data("suggestions-group-id"),10)),void(f.xhr=b.getJSON(ajaxurl,g).done(function(d){if(d.success){var f=b.map(d.data,function(a){return a.search=a.search||a.ID+" "+a.name,a});e[a]=f,c(f)}})))}},data:b.map(a.data,function(a){return a.search=a.search||a.ID+" "+a.name,a}),at:"@",search_key:"search",tpl:'<li data-value="@${ID}"><img src="${image}" /><span class="username">@${ID}</span><small>${name}</small></li>'},g=b.extend(!0,{},c,f,a);return b.fn.atwho.call(this,g)},b(document).ready(function(){b(".bp-suggestions, #comments form textarea, .wp-editor-area").bp_mentions(a.mentions.users)}),a.mentions.tinyMCEinit=function(){"undefined"!=typeof window.tinyMCE&&null!==window.tinyMCE.activeEditor&&"undefined"!=typeof window.tinyMCE.activeEditor&&b(window.tinyMCE.activeEditor.contentDocument.activeElement).atwho("setIframe",b("#content_ifr")[0]).bp_mentions(a.mentions.users)}}(bp,jQuery);
bp-blogs/bp-blogs-functions.php CHANGED
@@ -673,6 +673,11 @@ function bp_blogs_record_comment( $comment_id, $is_approved = true ) {
673
'secondary_item_id' => $recorded_comment->comment_post_ID
674
) );
675
676
// we found the parent activity entry
677
// so let's go ahead and reconfigure some activity args
678
if ( ! empty( $parent_activity_id ) ) {
673
'secondary_item_id' => $recorded_comment->comment_post_ID
674
) );
675
676
+ // Try to create a new activity item for the parent blog post
677
+ if ( empty( $parent_activity_id ) ) {
678
+ $parent_activity_id = bp_activity_post_type_publish( $recorded_comment->comment_post_ID, $recorded_comment->post );
679
+ }
680
+
681
// we found the parent activity entry
682
// so let's go ahead and reconfigure some activity args
683
if ( ! empty( $parent_activity_id ) ) {
bp-core/admin/bp-core-admin-functions.php CHANGED
@@ -570,7 +570,7 @@ function bp_core_add_contextual_help_content( $tab = '' ) {
570
break;
571
572
case 'bp-profile-overview' :
573
- $retval = __( 'Your users will distinguish themselves through their profile page. Create relevant profile fields that will show on each users profile.<br /><br />Note: Any fields in the first group will appear on the signup page.', 'buddypress' );
574
break;
575
576
default:
570
break;
571
572
case 'bp-profile-overview' :
573
+ $retval = __( 'Your users will distinguish themselves through their profile page. Create relevant profile fields that will show on each users profile.', 'buddypress' ) . '<br /><br />' . __( 'Note: Any fields in the first group will appear on the signup page.', 'buddypress' );
574
break;
575
576
default:
bp-core/bp-core-admin.php CHANGED
@@ -730,46 +730,52 @@ class BP_Admin {
730
731
<h4 class="wp-people-group"><?php printf( esc_html__( 'Contributors to BuddyPress %s', 'buddypress' ), self::display_version() ); ?></h4>
732
<p class="wp-credits-list">
733
- <a href="https://profiles.wordpress.org/jorbin/">Aaron Jorbin (aaronjorbin)</a>,
734
<a href="https://profiles.wordpress.org/boonebgorges/">Boone B Gorges (boonebgorges)</a>,
735
- <a href="https://profiles.wordpress.org/sbrajesh/">Brajesh Singh (sbrajesh)</a>,
736
- <a href="https://profiles.wordpress.org/CristinaCannon/">CristinaCannon</a>,
737
<a href="https://profiles.wordpress.org/dcavins/">David Cavins (dcavins)</a>,
738
- <a href="https://profiles.wordpress.org/wpdennis/">Dennis (wpdennis)</a>,
739
- <a href="https://profiles.wordpress.org/ocean90/">Dominik Schilling (ocean90)</a>,
740
- ecehren,
741
- <a href="https://profiles.wordpress.org/finzend/">finzend</a>,
742
- <a href="https://profiles.wordpress.org/Mamaduka/">George Mamadashvili (Mamaduka)</a>,
743
- <a href="https://profiles.wordpress.org/gregrickaby/">Greg Rickaby (gregrickaby)</a>,
744
- <a href="https://profiles.wordpress.org/henrywright/">Henry Wright (henry.wright)</a>,
745
<a href="https://profiles.wordpress.org/hnla/">Hugo (hnla)</a>,
746
- <a href="https://profiles.wordpress.org/jaimieolmstead/">jaimieolmstead</a>,
747
<a href="https://profiles.wordpress.org/johnjamesjacoby/">John James Jacoby (johnjamesjacoby)</a>,
748
- <a href="https://profiles.wordpress.org/jreeve/">jreeve</a>,
749
- <a href="https://profiles.wordpress.org/JustinSainton/">Justin Sainton (JustinSainton)</a>,
750
- <a href="https://profiles.wordpress.org/kadamwhite/">K.Adam White (kadamwhite)</a>,
751
<a href="https://profiles.wordpress.org/Offereins">Laurens Offereins (Offereins)</a>
752
<a href="https://profiles.wordpress.org/lenasterg/">lenasterg</a>,
753
- <a href="https://profiles.wordpress.org/natrio/">Marc (natrio)</a>,
754
- <a href="https://profiles.wordpress.org/mechter/">Markus Echterhoff (mechter)</a>,
755
<a href="https://profiles.wordpress.org/imath/">Mathieu Viet (imath)</a>,
756
- <a href="https://profiles.wordpress.org/melhop/">melhop</a>,
757
<a href="https://profiles.wordpress.org/mercime/">mercime</a>,
758
<a href="https://profiles.wordpress.org/tw2113/">Michael Beckwith (tw2113)</a>,
759
<a href="https://profiles.wordpress.org/pareshradadiya/">paresh.radadiya (pareshradadiya)</a>,
760
<a href="https://profiles.wordpress.org/DJPaul/">Paul Gibbs (DJPaul)</a>,
761
- <a href="https://profiles.wordpress.org/prometheus-fire/">Prometheus Fire</a>,
762
<a href="https://profiles.wordpress.org/r-a-y/">r-a-y</a>,
763
- <a href="https://profiles.wordpress.org/rogercoathup/">Roger Coathup (rogercoathup)</a>,
764
- <a href="https://profiles.wordpress.org/dtc7240/">Scott Seitz (dtc7240)</a>,
765
- <a href="https://profiles.wordpress.org/wonderboymusic/">Scott Taylor (wonderboymusic)</a>.
766
<a href="https://profiles.wordpress.org/SergeyBiryukov/">Sergey Biryukov (SergeyBiryukov)</a>,
767
<a href="https://profiles.wordpress.org/shanebp/">shanebp</a>,
768
<a href="https://profiles.wordpress.org/netweb/">Stephen Edgar (netweb)</a>,
769
<a href="https://profiles.wordpress.org/svenl77/">svenl77</a>,
770
- <a href="https://profiles.wordpress.org/WeddyWood/">WeddyWood</a>,
771
- <a href="https://profiles.wordpress.org/wolfhoundjesse/">wolfhoundjesse</a>,
772
- <a href="https://profiles.wordpress.org/xgz/">xgz</a>.
773
</p>
774
775
<h4 class="wp-people-group"><?php _e( 'External Libraries', 'buddypress' ); ?></h4>
730
731
<h4 class="wp-people-group"><?php printf( esc_html__( 'Contributors to BuddyPress %s', 'buddypress' ), self::display_version() ); ?></h4>
732
<p class="wp-credits-list">
733
+ <a href="https://profiles.wordpress.org/ankit-k-gupta/">Ankit K Gupta</a>,
734
+ <a href="https://profiles.wordpress.org/anthonyvalera/">anthonyvalera</a>,
735
<a href="https://profiles.wordpress.org/boonebgorges/">Boone B Gorges (boonebgorges)</a>,
736
+ <a href="https://profiles.wordpress.org/thebrandonallen/">Brandon Allen (thebrandonallen)</a>,
737
+ <a href="https://profiles.wordpress.org/BuddyBoss/">BuddyBoss</a>,
738
+ <a href="https://profiles.wordpress.org/needle/">Christian Wach (needle)</a>,
739
+ <a href="https://profiles.wordpress.org/damland/">damland</a>,
740
+ <a href="https://profiles.wordpress.org/danbp/">danbp</a>,
741
+ <a href="https://profiles.wordpress.org/daniluk4000/">daniluk4000</a>,
742
+ <a href="https://profiles.wordpress.org/davidtcarson/">David Carson (davidtcarson)</a>,
743
<a href="https://profiles.wordpress.org/dcavins/">David Cavins (dcavins)</a>,
744
+ <a href="https://profiles.wordpress.org/valendesigns/">Derek Herman (valendesigns)</a>,
745
+ <a href="https://profiles.wordpress.org/ganesh641/">ganesh641</a>,
746
<a href="https://profiles.wordpress.org/hnla/">Hugo (hnla)</a>,
747
+ <a href="https://profiles.wordpress.org/jdgrimes/">J.D. Grimes</a>,
748
+ <a href="https://profiles.wordpress.org/JeffMatson/">JeffMatson</a>,
749
+ <a href="https://profiles.wordpress.org/jmarx75/">jmarx75</a>,
750
<a href="https://profiles.wordpress.org/johnjamesjacoby/">John James Jacoby (johnjamesjacoby)</a>,
751
+ <a href="https://profiles.wordpress.org/kahless/">Jon Breitenbucher (kahless)</a>,
752
+ <a href="https://profiles.wordpress.org/jbrinley/">Jonathan Brinley (jbrinley)</a>,
753
+ <a href="https://profiles.wordpress.org/dunhakdis/">Joseph G. (dunhakdis)</a>,
754
+ <a href="https://profiles.wordpress.org/lakrisgubben/">lakrisgubben</a>,
755
+ <a href="https://profiles.wordpress.org/landwire/">landwire</a>,
756
<a href="https://profiles.wordpress.org/Offereins">Laurens Offereins (Offereins)</a>
757
<a href="https://profiles.wordpress.org/lenasterg/">lenasterg</a>,
758
+ <a href="https://profiles.wordpress.org/mrk-1/">m@rk</a>,
759
+ <a href="https://profiles.wordpress.org/mahype/">mahype</a>,
760
<a href="https://profiles.wordpress.org/imath/">Mathieu Viet (imath)</a>,
761
+ <a href="https://profiles.wordpress.org/mehulkaklotar/">mehulkaklotar</a>,
762
<a href="https://profiles.wordpress.org/mercime/">mercime</a>,
763
<a href="https://profiles.wordpress.org/tw2113/">Michael Beckwith (tw2113)</a>,
764
+ <a href="https://profiles.wordpress.org/modemlooper/">modemlooper</a>,
765
<a href="https://profiles.wordpress.org/pareshradadiya/">paresh.radadiya (pareshradadiya)</a>,
766
<a href="https://profiles.wordpress.org/DJPaul/">Paul Gibbs (DJPaul)</a>,
767
<a href="https://profiles.wordpress.org/r-a-y/">r-a-y</a>,
768
+ <a href="https://profiles.wordpress.org/ramiy/">Rami Yushuvaev (ramiy)</a>,
769
+ <a href="https://profiles.wordpress.org/ritteshpatel/">Ritesh Patel (ritteshpatel)</a>,
770
<a href="https://profiles.wordpress.org/SergeyBiryukov/">Sergey Biryukov (SergeyBiryukov)</a>,
771
<a href="https://profiles.wordpress.org/shanebp/">shanebp</a>,
772
+ <a href="https://profiles.wordpress.org/slaffik/">Slava UA (slaffik)</a>,
773
<a href="https://profiles.wordpress.org/netweb/">Stephen Edgar (netweb)</a>,
774
<a href="https://profiles.wordpress.org/svenl77/">svenl77</a>,
775
+ <a href="https://profiles.wordpress.org/tanner-m/">Tanner Moushey</a>,
776
+ <a href="https://profiles.wordpress.org/thomaslhotta/">thomaslhotta</a>,
777
+ <a href="https://profiles.wordpress.org/vnd/">vnd</a>,
778
+ <a href="https://profiles.wordpress.org/willgladstone/">willgladstone</a>.
779
</p>
780
781
<h4 class="wp-people-group"><?php _e( 'External Libraries', 'buddypress' ); ?></h4>
bp-core/bp-core-avatars.php CHANGED
@@ -103,6 +103,9 @@ add_action( 'bp_setup_globals', 'bp_core_set_avatar_globals' );
103
* locally:
104
* add_filter( 'bp_core_fetch_avatar_no_grav', '__return_true' );
105
*
106
* @param array|string $args {
107
* An array of arguments. All arguments are technically optional; some
108
* will, if not provided, be auto-detected by bp_core_fetch_avatar(). This
@@ -172,6 +175,13 @@ add_action( 'bp_setup_globals', 'bp_core_set_avatar_globals' );
172
* @type bool $html Whether to return an <img> HTML element, vs a raw URL
173
* to an avatar. If false, <img>-specific arguments (like 'css_id')
174
* will be ignored. Default: true.
175
* }
176
*
177
* @return string Formatted HTML <img> element, or raw avatar URL based on $html arg.
@@ -188,19 +198,23 @@ function bp_core_fetch_avatar( $args = '' ) {
188
189
// Set the default variables array and parse it against incoming $args array.
190
$params = wp_parse_args( $args, array(
191
- 'item_id' => false,
192
- 'object' => 'user',
193
- 'type' => 'thumb',
194
- 'avatar_dir' => false,
195
- 'width' => false,
196
- 'height' => false,
197
- 'class' => 'avatar',
198
- 'css_id' => false,
199
- 'alt' => '',
200
- 'email' => false,
201
- 'no_grav' => false,
202
- 'html' => true,
203
- 'title' => '',
204
) );
205
206
/** Set item_id ***********************************************************/
@@ -346,6 +360,9 @@ function bp_core_fetch_avatar( $args = '' ) {
346
$html_title = ' title="' . esc_attr( $params['title'] ) . '"';
347
}
348
349
// Set CSS ID and create html string.
350
$html_css_id = '';
351
@@ -505,6 +522,8 @@ function bp_core_fetch_avatar( $args = '' ) {
505
506
// If we found a locally uploaded avatar
507
if ( isset( $avatar_url ) ) {
508
509
// Return it wrapped in an <img> element
510
if ( true === $params['html'] ) {
@@ -524,7 +543,7 @@ function bp_core_fetch_avatar( $args = '' ) {
524
* @param string $avatar_folder_url Avatar URL path.
525
* @param string $avatar_folder_dir Avatar dir path.
526
*/
527
- return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $avatar_url . '"' . $html_class . $html_css_id . $html_width . $html_height . $html_alt . $html_title . ' />', $params, $params['item_id'], $params['avatar_dir'], $html_css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
528
529
// ...or only the URL
530
} else {
@@ -579,8 +598,6 @@ function bp_core_fetch_avatar( $args = '' ) {
579
}
580
}
581
582
- $host = '//www.gravatar.com/avatar/';
583
-
584
/**
585
* Filters the Gravatar email to use.
586
*
@@ -593,20 +610,37 @@ function bp_core_fetch_avatar( $args = '' ) {
593
$params['email'] = apply_filters( 'bp_core_gravatar_email', $params['email'], $params['item_id'], $params['object'] );
594
595
/**
596
- * Filters the Gravatar URL path.
597
*
598
* @since 1.0.2
599
*
600
- * @param string $value Gravatar URL path.
601
*/
602
- $gravatar = apply_filters( 'bp_gravatar_url', $host ) . md5( strtolower( $params['email'] ) ) . '?d=' . $default_grav . '&amp;s=' . $params['width'];
603
604
- // Gravatar rating; http://bit.ly/89QxZA
605
- $rating = get_option( 'avatar_rating' );
606
- if ( ! empty( $rating ) ) {
607
- $gravatar .= "&amp;r={$rating}";
608
}
609
610
// No avatar was found, and we've been told not to use a gravatar.
611
} else {
612
@@ -626,7 +660,7 @@ function bp_core_fetch_avatar( $args = '' ) {
626
if ( true === $params['html'] ) {
627
628
/** This filter is documented in bp-core/bp-core-avatars.php */
629
- return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $gravatar . '"' . $html_css_id . $html_class . $html_width . $html_height . $html_alt . $html_title . ' />', $params, $params['item_id'], $params['avatar_dir'], $html_css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
630
} else {
631
632
/** This filter is documented in bp-core/bp-core-avatars.php */
@@ -1281,17 +1315,20 @@ add_action( 'wp_ajax_bp_avatar_set', 'bp_avatar_ajax_set' );
1281
/**
1282
* Replace default WordPress avatars with BP avatars, if available.
1283
*
1284
- * Filters 'get_avatar'.
1285
*
1286
* @param string $avatar The avatar path passed to 'get_avatar'.
1287
* @param int|string|object $user A user ID, email address, or comment object.
1288
* @param int $size Size of the avatar image ('thumb' or 'full').
1289
* @param string $default URL to a default image to use if no avatar is available.
1290
* @param string $alt Alternate text to use in image tag. Default: ''.
1291
*
1292
* @return string BP avatar path, if found; else the original avatar path.
1293
*/
1294
- function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt = '' ) {
1295
global $pagenow;
1296
1297
// Do not filter if inside WordPress options page
@@ -1332,19 +1369,47 @@ function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt = ''
1332
$type = 'full';
1333
}
1334
1335
- // Let BuddyPress handle the fetching of the avatar
1336
- $bp_avatar = bp_core_fetch_avatar( array(
1337
'item_id' => $id,
1338
'type' => $type,
1339
'width' => $size,
1340
'height' => $size,
1341
'alt' => $alt,
1342
- ) );
1343
1344
// If BuddyPress found an avatar, use it. If not, use the result of get_avatar
1345
return ( !$bp_avatar ) ? $avatar : $bp_avatar;
1346
}
1347
- add_filter( 'get_avatar', 'bp_core_fetch_avatar_filter', 10, 5 );
1348
1349
/**
1350
* Is the current avatar upload error-free?
103
* locally:
104
* add_filter( 'bp_core_fetch_avatar_no_grav', '__return_true' );
105
*
106
+ * @since 2.4.0 Added 'extra_attr', 'scheme', 'rating' and 'force_default' for $args.
107
+ * These are inherited from WordPress 4.2.0. See {@link get_avatar()}.
108
+ *
109
* @param array|string $args {
110
* An array of arguments. All arguments are technically optional; some
111
* will, if not provided, be auto-detected by bp_core_fetch_avatar(). This
175
* @type bool $html Whether to return an <img> HTML element, vs a raw URL
176
* to an avatar. If false, <img>-specific arguments (like 'css_id')
177
* will be ignored. Default: true.
178
+ * @type string $extra_attr HTML attributes to insert in the IMG element. Not sanitized. Default: ''.
179
+ * @type string $scheme URL scheme to use. See set_url_scheme() for accepted values.
180
+ * Default null.
181
+ * @type string $rating What rating to display Gravatars for. Accepts 'G', 'PG', 'R', 'X'.
182
+ * Default is the value of the 'avatar_rating' option.
183
+ * @type bool $force_default Used when creating the Gravatar URL. Whether to force the default
184
+ * image regardless if the Gravatar exists. Default: false.
185
* }
186
*
187
* @return string Formatted HTML <img> element, or raw avatar URL based on $html arg.
198
199
// Set the default variables array and parse it against incoming $args array.
200
$params = wp_parse_args( $args, array(
201
+ 'item_id' => false,
202
+ 'object' => 'user',
203
+ 'type' => 'thumb',
204
+ 'avatar_dir' => false,
205
+ 'width' => false,
206
+ 'height' => false,
207
+ 'class' => 'avatar',
208
+ 'css_id' => false,
209
+ 'alt' => '',
210
+ 'email' => false,
211
+ 'no_grav' => false,
212
+ 'html' => true,
213
+ 'title' => '',
214
+ 'extra_attr' => '',
215
+ 'scheme' => null,
216
+ 'rating' => get_option( 'avatar_rating' ),
217
+ 'force_default' => false,
218
) );
219
220
/** Set item_id ***********************************************************/
360
$html_title = ' title="' . esc_attr( $params['title'] ) . '"';
361
}
362
363
+ // Extra attributes
364
+ $extra_attr = ! empty( $args['extra_attr'] ) ? ' ' . $args['extra_attr'] : '';
365
+
366
// Set CSS ID and create html string.
367
$html_css_id = '';
368
522
523
// If we found a locally uploaded avatar
524
if ( isset( $avatar_url ) ) {
525
+ // Support custom scheme
526
+ $avatar_url = set_url_scheme( $avatar_url, $params['scheme'] );
527
528
// Return it wrapped in an <img> element
529
if ( true === $params['html'] ) {
543
* @param string $avatar_folder_url Avatar URL path.
544
* @param string $avatar_folder_dir Avatar dir path.
545
*/
546
+ return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $avatar_url . '"' . $html_class . $html_css_id . $html_width . $html_height . $html_alt . $html_title . $extra_attr . ' />', $params, $params['item_id'], $params['avatar_dir'], $html_css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
547
548
// ...or only the URL
549
} else {
598
}
599
}
600
601
/**
602
* Filters the Gravatar email to use.
603
*
610
$params['email'] = apply_filters( 'bp_core_gravatar_email', $params['email'], $params['item_id'], $params['object'] );
611
612
/**
613
+ * Filters the Gravatar URL host.
614
*
615
* @since 1.0.2
616
*
617
+ * @param string $value Gravatar URL host.
618
*/
619
+ $gravatar = apply_filters( 'bp_gravatar_url', '//www.gravatar.com/avatar/' );
620
+
621
+ // Append email hash to Gravatar
622
+ $gravatar .= md5( strtolower( $params['email'] ) );
623
624
+ // Main Gravatar URL args
625
+ $url_args = array(
626
+ 'd' => $default_grav,
627
+ 's' => $params['width']
628
+ );
629
+
630
+ // Custom Gravatar URL args
631
+ if ( ! empty( $params['force_default'] ) ) {
632
+ $url_args['f'] = 'y';
633
+ }
634
+ if ( ! empty( $params['rating'] ) ) {
635
+ $url_args['r'] = strtolower( $params['rating'] );
636
}
637
638
+ // Set up the Gravatar URL
639
+ $gravatar = esc_url( add_query_arg(
640
+ rawurlencode_deep( array_filter( $url_args ) ),
641
+ $gravatar
642
+ ) );
643
+
644
// No avatar was found, and we've been told not to use a gravatar.
645
} else {
646
660
if ( true === $params['html'] ) {
661
662
/** This filter is documented in bp-core/bp-core-avatars.php */
663
+ return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $gravatar . '"' . $html_css_id . $html_class . $html_width . $html_height . $html_alt . $html_title . $extra_attr . ' />', $params, $params['item_id'], $params['avatar_dir'], $html_css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
664
} else {
665
666
/** This filter is documented in bp-core/bp-core-avatars.php */
1315
/**
1316
* Replace default WordPress avatars with BP avatars, if available.
1317
*
1318
+ * See 'get_avatar' filter description in wp-includes/pluggable.php.
1319
+ *
1320
+ * @since 2.4.0 Added $args parameter to coincide with WordPress 4.2.0.
1321
*
1322
* @param string $avatar The avatar path passed to 'get_avatar'.
1323
* @param int|string|object $user A user ID, email address, or comment object.
1324
* @param int $size Size of the avatar image ('thumb' or 'full').
1325
* @param string $default URL to a default image to use if no avatar is available.
1326
* @param string $alt Alternate text to use in image tag. Default: ''.
1327
+ * @param array $args Arguments passed to get_avatar_data(), after processing.
1328
*
1329
* @return string BP avatar path, if found; else the original avatar path.
1330
*/
1331
+ function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt = '', $args = array() ) {
1332
global $pagenow;
1333
1334
// Do not filter if inside WordPress options page
1369
$type = 'full';
1370
}
1371
1372
+ $avatar_args = array(
1373
'item_id' => $id,
1374
'type' => $type,
1375
'width' => $size,
1376
'height' => $size,
1377
'alt' => $alt,
1378
+ );
1379
+
1380
+ // Support new arguments as of WordPress 4.2.0
1381
+ if ( ! empty( $args['width'] ) ) {
1382
+ $avatar_args['width'] = $args['width'];
1383
+ }
1384
+ if ( ! empty( $args['height'] ) ) {
1385
+ $avatar_args['height'] = $args['height'];
1386
+ }
1387
+ if ( ! empty( $args['class'] ) ) {
1388
+ $avatar_args['class'] = $args['class'];
1389
+ }
1390
+ if ( ! empty( $args['class'] ) ) {
1391
+ $avatar_args['class'] = $args['class'];
1392
+ }
1393
+ if ( ! empty( $args['extra_attr'] ) ) {
1394
+ $avatar_args['extra_attr'] = $args['extra_attr'];
1395
+ }
1396
+ if ( ! empty( $args['scheme'] ) ) {
1397
+ $avatar_args['scheme'] = $args['scheme'];
1398
+ }
1399
+ if ( ! empty( $args['force_default'] ) ) {
1400
+ $avatar_args['force_default'] = $args['force_default'];
1401
+ }
1402
+ if ( ! empty( $args['rating'] ) ) {
1403
+ $avatar_args['rating'] = $args['rating'];
1404
+ }
1405
+
1406
+ // Let BuddyPress handle the fetching of the avatar
1407
+ $bp_avatar = bp_core_fetch_avatar( $avatar_args );
1408
1409
// If BuddyPress found an avatar, use it. If not, use the result of get_avatar
1410
return ( !$bp_avatar ) ? $avatar : $bp_avatar;
1411
}
1412
+ add_filter( 'get_avatar', 'bp_core_fetch_avatar_filter', 10, 6 );
1413
1414
/**
1415
* Is the current avatar upload error-free?
bp-core/bp-core-filters.php CHANGED
@@ -758,7 +758,7 @@ function bp_modify_page_title( $title = '', $sep = '&raquo;', $seplocation = 'ri
758
759
// Activation page
760
} elseif ( bp_is_activation_page() ) {
761
- $title_parts = array( __( 'Activate your Account', 'buddypress' ) );
762
763
// Group creation page
764
} elseif ( bp_is_group_create() ) {
758
759
// Activation page
760
} elseif ( bp_is_activation_page() ) {
761
+ $title_parts = array( __( 'Activate Your Account', 'buddypress' ) );
762
763
// Group creation page
764
} elseif ( bp_is_group_create() ) {
bp-core/bp-core-template-loader.php CHANGED
@@ -212,23 +212,29 @@ function bp_get_template_stack() {
212
$wp_current_filter[] = $tag;
213
214
// Sort
215
- if ( ! isset( $merged_filters[ $tag ] ) ) {
216
- ksort( $wp_filter[$tag] );
217
- $merged_filters[ $tag ] = true;
218
}
219
220
// Ensure we're always at the beginning of the filter array
221
- reset( $wp_filter[ $tag ] );
222
223
// Loop through 'bp_template_stack' filters, and call callback functions
224
do {
225
- foreach( (array) current( $wp_filter[$tag] ) as $the_ ) {
226
if ( ! is_null( $the_['function'] ) ) {
227
$args[1] = $stack;
228
$stack[] = call_user_func_array( $the_['function'], array_slice( $args, 1, (int) $the_['accepted_args'] ) );
229
}
230
}
231
- } while ( next( $wp_filter[$tag] ) !== false );
232
233
// Remove 'bp_template_stack' from the current filter array
234
array_pop( $wp_current_filter );
212
$wp_current_filter[] = $tag;
213
214
// Sort
215
+ if ( class_exists( 'WP_Hook' ) ) {
216
+ $filter = $wp_filter[ $tag ]->callbacks;
217
+ } else {
218
+ $filter = &$wp_filter[ $tag ];
219
+
220
+ if ( ! isset( $merged_filters[ $tag ] ) ) {
221
+ ksort( $filter );
222
+ $merged_filters[ $tag ] = true;
223
+ }
224
}
225
226
// Ensure we're always at the beginning of the filter array
227
+ reset( $filter );
228
229
// Loop through 'bp_template_stack' filters, and call callback functions
230
do {
231
+ foreach( (array) current( $filter ) as $the_ ) {
232
if ( ! is_null( $the_['function'] ) ) {
233
$args[1] = $stack;
234
$stack[] = call_user_func_array( $the_['function'], array_slice( $args, 1, (int) $the_['accepted_args'] ) );
235
}
236
}
237
+ } while ( next( $filter ) !== false );
238
239
// Remove 'bp_template_stack' from the current filter array
240
array_pop( $wp_current_filter );
bp-core/css/buddybar-rtl.min.css CHANGED
@@ -1 +1 @@
1
- #admin-bar-logo,#wp-admin-bar li a{font-size:11px;text-decoration:none}body:not(.wp-admin){padding-top:25px!important}#wp-admin-bar{position:fixed;top:0;right:0;height:25px;font-size:11px;width:100%;z-index:9999}#wp-admin-bar .padder{position:relative;padding:0;width:100%;margin:0 auto;background:url(../images/60pc_black.png);height:25px}body#bp-default #wp-admin-bar .padder{max-width:1250px}#wp-admin-bar *{z-index:999}#wp-admin-bar div#admin-bar-logo{position:absolute;top:5px;right:10px}#wp-admin-bar a img,#wp-admin-bar li.alt{border:none}#wp-admin-bar li{list-style:none;margin:0;padding:0;line-height:100%;text-align:right}#wp-admin-bar li a{padding:7px 15px;color:#eee}#wp-admin-bar li.no-arrow a{padding-left:15px}#wp-admin-bar ul li ul li a span{display:none}#wp-admin-bar li.hover,#wp-admin-bar li:hover{position:static}#admin-bar-logo{float:right;font-weight:700;padding:5px 8px;margin:0;color:#fff}body#bp-default #admin-bar-logo{padding:2px 8px}#wp-admin-bar ul{margin:0;list-style:none;line-height:1;cursor:pointer;height:auto;padding:0}#wp-admin-bar ul li{padding:0 0 0 11px;float:right;position:relative;background:url(../images/admin-menu-arrow.gif) 12% 53% no-repeat}#wp-admin-bar ul li.no-arrow{background:0 0;padding-left:0}#wp-admin-bar ul li ul li{background-image:none}#wp-admin-bar ul li.align-right{position:absolute;left:0}#wp-admin-bar ul li a{display:block}#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li.sfhover,#wp-admin-bar ul.main-nav li:hover{background-color:#333}#wp-admin-bar ul li ul{position:absolute;width:185px;right:-999em;margin-right:0;background:#333;border:1px solid #222;-moz-box-shadow:0 4px 8px rgba(0,0,0,.1);-webkit-box-shadow:0 4px 8px rgba(0,0,0,.1);-moz-border-radius:3px;-webkit-border-radius:0 0 3px 3px;-moz-border-radius-topleft:0;-moz-border-radius-topright:0}#wp-admin-bar ul li>ul{border-top:none}#wp-admin-bar ul li ul a{color:#eee}#wp-admin-bar ul li ul li{float:right;width:174px;margin:0}#wp-admin-bar ul li ul li:hover a{color:#fff}#wp-admin-bar ul li div.admin-bar-clear{clear:both}#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li ul li:hover{background-color:#222}#wp-admin-bar ul li ul ul{margin:-25px 184px 0 0;-moz-border-radius:3px;-webkit-border-radius:3px}#wp-admin-bar ul li ul li:hover ul li a{color:#eee}#wp-admin-bar ul li ul li ul li:hover a{color:#fff}#wp-admin-bar ul li ul li.sfhover ul,#wp-admin-bar ul li ul li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li:hover ul{right:auto}#wp-admin-bar ul li.align-right:hover ul{left:0}#wp-admin-bar li.sfhover ul li ul,#wp-admin-bar ul li:hover ul ul{right:-999em}#wp-admin-bar img.avatar{float:right;margin-left:8px}#wp-admin-bar span.activity{display:block;margin-right:34px;padding:0}#wp-admin-bar ul.author-list li a{height:17px}#wp-admin-bar ul li#bp-adminbar-notifications-menu a span{padding:0 6px;margin-right:2px;background:#fff;color:#000;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}
1
+ #admin-bar-logo,#wp-admin-bar li a{font-size:11px;text-decoration:none}#wp-admin-bar ul li ul a,#wp-admin-bar ul li ul li:hover ul li a{color:#eee}#wp-admin-bar ul li ul li ul li:hover a,#wp-admin-bar ul li ul li:hover a{color:#fff}body:not(.wp-admin){padding-top:25px!important}#wp-admin-bar{position:fixed;top:0;right:0;height:25px;font-size:11px;width:100%;z-index:9999}#wp-admin-bar .padder{position:relative;padding:0;width:100%;margin:0 auto;background:url(../images/60pc_black.png);height:25px}body#bp-default #wp-admin-bar .padder{max-width:1250px}#wp-admin-bar *{z-index:999}#wp-admin-bar div#admin-bar-logo{position:absolute;top:5px;right:10px}#wp-admin-bar a img,#wp-admin-bar li.alt{border:none}#wp-admin-bar li{list-style:none;margin:0;padding:0;line-height:100%;text-align:right}#wp-admin-bar li a{padding:7px 15px;color:#eee}#wp-admin-bar li.no-arrow a{padding-left:15px}#wp-admin-bar ul li ul li a span{display:none}#wp-admin-bar li.hover,#wp-admin-bar li:hover{position:static}#admin-bar-logo{float:right;font-weight:700;padding:5px 8px;margin:0;color:#fff}body#bp-default #admin-bar-logo{padding:2px 8px}#wp-admin-bar ul{margin:0;list-style:none;line-height:1;cursor:pointer;height:auto;padding:0}#wp-admin-bar ul li{padding:0 0 0 11px;float:right;position:relative;background:url(../images/admin-menu-arrow.gif) 12% 53% no-repeat}#wp-admin-bar ul li.no-arrow{background:0 0;padding-left:0}#wp-admin-bar ul li ul li{background-image:none;float:right;width:174px;margin:0}#wp-admin-bar ul li.align-right{position:absolute;left:0}#wp-admin-bar ul li a{display:block}#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li.sfhover,#wp-admin-bar ul.main-nav li:hover{background-color:#333}#wp-admin-bar ul li ul{position:absolute;width:185px;right:-999em;margin-right:0;background:#333;border:1px solid #222;-moz-box-shadow:0 4px 8px rgba(0,0,0,.1);-webkit-box-shadow:0 4px 8px rgba(0,0,0,.1);-moz-border-radius:3px;-webkit-border-radius:0 0 3px 3px;-moz-border-radius-topleft:0;-moz-border-radius-topright:0}#wp-admin-bar ul li>ul{border-top:none}#wp-admin-bar ul li div.admin-bar-clear{clear:both}#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li ul li:hover{background-color:#222}#wp-admin-bar ul li ul ul{margin:-25px 184px 0 0;-moz-border-radius:3px;-webkit-border-radius:3px}#wp-admin-bar ul li ul li.sfhover ul,#wp-admin-bar ul li ul li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li:hover ul{right:auto}#wp-admin-bar ul li.align-right:hover ul{left:0}#wp-admin-bar li.sfhover ul li ul,#wp-admin-bar ul li:hover ul ul{right:-999em}#wp-admin-bar img.avatar{float:right;margin-left:8px}#wp-admin-bar span.activity{display:block;margin-right:34px;padding:0}#wp-admin-bar ul.author-list li a{height:17px}#wp-admin-bar ul li#bp-adminbar-notifications-menu a span{padding:0 6px;margin-right:2px;background:#fff;color:#000;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}
bp-core/css/buddybar.min.css CHANGED
@@ -1 +1 @@
1
- #admin-bar-logo,#wp-admin-bar li a{font-size:11px;text-decoration:none}body:not(.wp-admin){padding-top:25px!important}#wp-admin-bar{position:fixed;top:0;left:0;height:25px;font-size:11px;width:100%;z-index:9999}#wp-admin-bar .padder{position:relative;padding:0;width:100%;margin:0 auto;background:url(../images/60pc_black.png);height:25px}body#bp-default #wp-admin-bar .padder{max-width:1250px}#wp-admin-bar *{z-index:999}#wp-admin-bar div#admin-bar-logo{position:absolute;top:5px;left:10px}#wp-admin-bar a img,#wp-admin-bar li.alt{border:none}#wp-admin-bar li{list-style:none;margin:0;padding:0;line-height:100%;text-align:left}#wp-admin-bar li a{padding:7px 15px;color:#eee}#wp-admin-bar li.no-arrow a{padding-right:15px}#wp-admin-bar ul li ul li a span{display:none}#wp-admin-bar li.hover,#wp-admin-bar li:hover{position:static}#admin-bar-logo{float:left;font-weight:700;padding:5px 8px;margin:0;color:#fff}body#bp-default #admin-bar-logo{padding:2px 8px}#wp-admin-bar ul{margin:0;list-style:none;line-height:1;cursor:pointer;height:auto;padding:0}#wp-admin-bar ul li{padding:0 11px 0 0;float:left;position:relative;background:url(../images/admin-menu-arrow.gif) 88% 53% no-repeat}#wp-admin-bar ul li.no-arrow{background:0 0;padding-right:0}#wp-admin-bar ul li ul li{background-image:none}#wp-admin-bar ul li.align-right{position:absolute;right:0}#wp-admin-bar ul li a{display:block}#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li.sfhover,#wp-admin-bar ul.main-nav li:hover{background-color:#333}#wp-admin-bar ul li ul{position:absolute;width:185px;left:-999em;margin-left:0;background:#333;border:1px solid #222;-moz-box-shadow:0 4px 8px rgba(0,0,0,.1);-webkit-box-shadow:0 4px 8px rgba(0,0,0,.1);-moz-border-radius:3px;-webkit-border-radius:0 0 3px 3px;-moz-border-radius-topleft:0;-moz-border-radius-topright:0}#wp-admin-bar ul li>ul{border-top:none}#wp-admin-bar ul li ul a{color:#eee}#wp-admin-bar ul li ul li{float:left;width:174px;margin:0}#wp-admin-bar ul li ul li:hover a{color:#fff}#wp-admin-bar ul li div.admin-bar-clear{clear:both}#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li ul li:hover{background-color:#222}#wp-admin-bar ul li ul ul{margin:-25px 0 0 184px;-moz-border-radius:3px;-webkit-border-radius:3px}#wp-admin-bar ul li ul li:hover ul li a{color:#eee}#wp-admin-bar ul li ul li ul li:hover a{color:#fff}#wp-admin-bar ul li ul li.sfhover ul,#wp-admin-bar ul li ul li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li:hover ul{left:auto}#wp-admin-bar ul li.align-right:hover ul{right:0}#wp-admin-bar li.sfhover ul li ul,#wp-admin-bar ul li:hover ul ul{left:-999em}#wp-admin-bar img.avatar{float:left;margin-right:8px}#wp-admin-bar span.activity{display:block;margin-left:34px;padding:0}#wp-admin-bar ul.author-list li a{height:17px}#wp-admin-bar ul li#bp-adminbar-notifications-menu a span{padding:0 6px;margin-left:2px;background:#fff;color:#000;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}
1
+ #admin-bar-logo,#wp-admin-bar li a{font-size:11px;text-decoration:none}#wp-admin-bar ul li ul a,#wp-admin-bar ul li ul li:hover ul li a{color:#eee}#wp-admin-bar ul li ul li ul li:hover a,#wp-admin-bar ul li ul li:hover a{color:#fff}body:not(.wp-admin){padding-top:25px!important}#wp-admin-bar{position:fixed;top:0;left:0;height:25px;font-size:11px;width:100%;z-index:9999}#wp-admin-bar .padder{position:relative;padding:0;width:100%;margin:0 auto;background:url(../images/60pc_black.png);height:25px}body#bp-default #wp-admin-bar .padder{max-width:1250px}#wp-admin-bar *{z-index:999}#wp-admin-bar div#admin-bar-logo{position:absolute;top:5px;left:10px}#wp-admin-bar a img,#wp-admin-bar li.alt{border:none}#wp-admin-bar li{list-style:none;margin:0;padding:0;line-height:100%;text-align:left}#wp-admin-bar li a{padding:7px 15px;color:#eee}#wp-admin-bar li.no-arrow a{padding-right:15px}#wp-admin-bar ul li ul li a span{display:none}#wp-admin-bar li.hover,#wp-admin-bar li:hover{position:static}#admin-bar-logo{float:left;font-weight:700;padding:5px 8px;margin:0;color:#fff}body#bp-default #admin-bar-logo{padding:2px 8px}#wp-admin-bar ul{margin:0;list-style:none;line-height:1;cursor:pointer;height:auto;padding:0}#wp-admin-bar ul li{padding:0 11px 0 0;float:left;position:relative;background:url(../images/admin-menu-arrow.gif) 88% 53% no-repeat}#wp-admin-bar ul li.no-arrow{background:0 0;padding-right:0}#wp-admin-bar ul li ul li{background-image:none;float:left;width:174px;margin:0}#wp-admin-bar ul li.align-right{position:absolute;right:0}#wp-admin-bar ul li a{display:block}#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li.sfhover,#wp-admin-bar ul.main-nav li:hover{background-color:#333}#wp-admin-bar ul li ul{position:absolute;width:185px;left:-999em;margin-left:0;background:#333;border:1px solid #222;-moz-box-shadow:0 4px 8px rgba(0,0,0,.1);-webkit-box-shadow:0 4px 8px rgba(0,0,0,.1);-moz-border-radius:3px;-webkit-border-radius:0 0 3px 3px;-moz-border-radius-topleft:0;-moz-border-radius-topright:0}#wp-admin-bar ul li>ul{border-top:none}#wp-admin-bar ul li div.admin-bar-clear{clear:both}#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li ul li:hover{background-color:#222}#wp-admin-bar ul li ul ul{margin:-25px 0 0 184px;-moz-border-radius:3px;-webkit-border-radius:3px}#wp-admin-bar ul li ul li.sfhover ul,#wp-admin-bar ul li ul li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li:hover ul{left:auto}#wp-admin-bar ul li.align-right:hover ul{right:0}#wp-admin-bar li.sfhover ul li ul,#wp-admin-bar ul li:hover ul ul{left:-999em}#wp-admin-bar img.avatar{float:left;margin-right:8px}#wp-admin-bar span.activity{display:block;margin-left:34px;padding:0}#wp-admin-bar ul.author-list li a{height:17px}#wp-admin-bar ul li#bp-adminbar-notifications-menu a span{padding:0 6px;margin-left:2px;background:#fff;color:#000;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}
bp-core/deprecated/js/autocomplete/jquery.autocomplete.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! buddypress - v2.4.0 - 2015-10-12 8:03:39 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
!function(a){a.fn.extend({autocomplete:function(b,c){var d="string"==typeof b;return c=a.extend({},a.Autocompleter.defaults,{url:d?b:null,data:d?null:b,delay:d?a.Autocompleter.defaults.delay:10,max:c&&!c.scroll?10:150},c),c.highlight=c.highlight||function(a){return a},this.each(function(){new a.Autocompleter(this,c)})},result:function(a){return this.bind("result",a)},search:function(a){return this.trigger("search",[a])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(a){return this.trigger("setOptions",[a])},unautocomplete:function(){return this.trigger("unautocomplete")}}),a.Autocompleter=function(b,c){function d(){var a=x.selected();if(!a)return!1;var b=a.result;if(t=b,c.multiple){var d=f(s.val());d.length>1&&(b=d.slice(0,d.length-1).join(c.multipleSeparator)+c.multipleSeparator+b),b+=c.multipleSeparator}return s.val(b),j(),s.trigger("result",[a.data,a.value]),!0}function e(a,b){if(q==r.DEL)return void x.hide();var d=s.val();(b||d!=t)&&(t=d,d=g(d),d.length>=c.minChars?(s.addClass(c.loadingClass),jQuery("#send-to-input").addClass("loading"),c.matchCase||(d=d.toLowerCase()),l(d,k,j)):(n(),x.hide()))}function f(b){if(!b)return[""];var d=b.split(a.trim(c.multipleSeparator)),e=[];return a.each(d,function(b,c){a.trim(c)&&(e[b]=a.trim(c))}),e}function g(a){if(!c.multiple)return a;var b=f(a);return b[b.length-1]}function h(d,e){c.autoFill&&g(s.val()).toLowerCase()==d.toLowerCase()&&8!=q&&(s.val(s.val()+e.substring(g(t).length)),a.Autocompleter.Selection(b,t.length,t.length+e.length))}function i(){clearTimeout(p),p=setTimeout(j,200)}function j(){x.hide(),clearTimeout(p),n(),c.mustMatch&&s.search(function(a){a||s.val("")})}function k(a,b){if(b&&b.length&&v){n(),x.display(b,a);var c=b[0].value.split(";");b.value=c[0],h(a,b.value),x.show()}else j()}function l(d,e,f){c.matchCase||(d=d.toLowerCase());var h=u.load(d);if(h&&h.length)e(d,h);else if("string"==typeof c.url&&c.url.length>0){var i={};a.each(c.extraParams,function(a,b){i[a]="function"==typeof b?b():b}),a.ajax({mode:"abort",port:"autocomplete"+b.name,dataType:c.dataType,url:c.url,data:a.extend({q:g(d),limit:c.max,action:"messages_autocomplete_results",cookie:o()},i),success:function(a){var b=c.parse&&c.parse(a)||m(a);u.add(d,b),e(d,b)}})}else f(d)}function m(b){for(var d=[],e=b.split("\n"),f=0;f<e.length;f++){var g=a.trim(e[f]);g&&(g=g.split("|"),d[d.length]={data:g,value:g[0],result:c.formatResult&&c.formatResult(g,g[0])||g[0]})}return d}function n(){s.removeClass(c.loadingClass),jQuery("#send-to-input").removeClass("loading")}function o(){var a,b,c,d,e,f=document.cookie.split(";"),g={},h="bp-";for(a=0;a<f.length;a++)b=f[a],c=b.indexOf("="),d=jq.trim(unescape(b.slice(0,c))),e=unescape(b.slice(c+1)),0===d.indexOf(h)&&(g[d]=e);return encodeURIComponent(jq.param(g))}var p,q,r={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34},s=a(b).attr("autocomplete","off").addClass(c.inputClass),t="",u=a.Autocompleter.Cache(c),v=0,w={mouseDownOnSelect:!1},x=a.Autocompleter.Select(c,b,d,w);s.keydown(function(b){switch(q=b.keyCode,b.keyCode){case r.UP:b.preventDefault(),x.visible()?x.prev():e(0,!0);break;case r.DOWN:b.preventDefault(),x.visible()?x.next():e(0,!0);break;case r.PAGEUP:b.preventDefault(),x.visible()?x.pageUp():e(0,!0);break;case r.PAGEDOWN:b.preventDefault(),x.visible()?x.pageDown():e(0,!0);break;case c.multiple&&","==a.trim(c.multipleSeparator)&&r.COMMA:case r.TAB:case r.RETURN:d()&&(c.multiple||s.blur(),b.preventDefault(),s.focus());break;case r.ESC:x.hide();break;default:clearTimeout(p),p=setTimeout(e,c.delay)}}).keypress(function(){}).focus(function(){v++}).blur(function(){v=0,w.mouseDownOnSelect||i()}).click(function(){v++>1&&!x.visible()&&e(0,!0)}).bind("search",function(){function b(a,b){var d;if(b&&b.length)for(var e=0;e<b.length;e++)if(b[e].result.toLowerCase()==a.toLowerCase()){d=b[e];break}"function"==typeof c?c(d):s.trigger("result",d&&[d.data,d.value])}var c=arguments.length>1?arguments[1]:null;a.each(f(s.val()),function(a,c){l(c,b,b)})}).bind("flushCache",function(){u.flush()}).bind("setOptions",function(){a.extend(c,arguments[1]),"data"in arguments[1]&&u.populate()}).bind("unautocomplete",function(){x.unbind(),s.unbind()})},a.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:!1,matchSubset:!0,matchContains:!1,cacheLength:10,max:100,mustMatch:!1,extraParams:{},selectFirst:!0,formatItem:function(a){return a[0]},autoFill:!1,width:0,multiple:!1,multipleSeparator:", ",highlight:function(a,b){return a.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+b.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:!0,scrollHeight:250,attachTo:"body"},a.Autocompleter.Cache=function(b){function c(a,c){b.matchCase||(a=a.toLowerCase());var d=a.indexOf(c);return-1==d?!1:0==d||b.matchContains}function d(a,c){h>b.cacheLength&&f(),g[a]||h++,g[a]=c}function e(){if(!b.data)return!1;var c={},e=0;b.url||(b.cacheLength=1),c[""]=[];for(var f=0,g=b.data.length;g>f;f++){var h=b.data[f];h="string"==typeof h?[h]:h;var i=b.formatItem(h,f+1,b.data.length);if(i!==!1){var j=i.charAt(0).toLowerCase();c[j]||(c[j]=[]);var k={value:i,data:h,result:b.formatResult&&b.formatResult(h)||i};c[j].push(k),e++<b.max&&c[""].push(k)}}a.each(c,function(a,c){b.cacheLength++,d(a,c)})}function f(){g={},h=0}var g={},h=0;return setTimeout(e,25),{flush:f,add:d,populate:e,load:function(d){if(!b.cacheLength||!h)return null;if(!b.url&&b.matchContains){var e=[];for(var f in g)if(f.length>0){var i=g[f];a.each(i,function(a,b){c(b.value,d)&&e.push(b)})}return e}if(g[d])return g[d];if(b.matchSubset)for(var j=d.length-1;j>=b.minChars;j--){var i=g[d.substr(0,j)];if(i){var e=[];return a.each(i,function(a,b){c(b.value,d)&&(e[e.length]=b)}),e}}return null}}},a.Autocompleter.Select=function(b,c,d,e){function f(){s&&(n=a("<div/>").hide().addClass(b.resultsClass).css("position","absolute").appendTo(b.attachTo),o=a("<ul>").appendTo(n).mouseover(function(b){g(b).nodeName&&"LI"==g(b).nodeName.toUpperCase()&&(q=a("li",o).removeClass(p.ACTIVE).index(g(b)),a(g(b)).addClass(p.ACTIVE))}).click(function(b){return a(g(b)).addClass(p.ACTIVE),d(),c.focus(),!1}).mousedown(function(){e.mouseDownOnSelect=!0}).mouseup(function(){e.mouseDownOnSelect=!1}),b.width>0&&n.css("width",b.width),s=!1)}function g(a){for(var b=a.target;b&&"LI"!=b.tagName;)b=b.parentNode;return b?b:[]}function h(a){l.slice(q,q+1).removeClass(),i(a);var c=l.slice(q,q+1).addClass(p.ACTIVE);if(b.scroll){var d=0;l.slice(0,q).each(function(){d+=this.offsetHeight}),d+c[0].offsetHeight-o.scrollTop()>o[0].clientHeight?o.scrollTop(d+c[0].offsetHeight-o.innerHeight()):d<o.scrollTop()&&o.scrollTop(d)}}function i(a){q+=a,0>q?q=l.size()-1:q>=l.size()&&(q=0)}function j(a){return b.max&&b.max<a?b.max:a}function k(){o.empty();for(var c=j(m.length),d=0;c>d;d++)if(m[d]){var e=b.formatItem(m[d].data,d+1,c,m[d].value,r);if(e!==!1){var f=a("<li>").html(b.highlight(e,r)).addClass(d%2==0?"ac_event":"ac_odd").appendTo(o)[0];a.data(f,"ac_data",m[d])}}l=o.find("li"),b.selectFirst&&(l.slice(0,1).addClass(p.ACTIVE),q=0),o.bgiframe()}var l,m,n,o,p={ACTIVE:"ac_over"},q=-1,r="",s=!0;return{display:function(a,b){f(),m=a,r=b,k()},next:function(){h(1)},prev:function(){h(-1)},pageUp:function(){h(0!=q&&0>q-8?-q:-8)},pageDown:function(){h(q!=l.size()-1&&q+8>l.size()?l.size()-1-q:8)},hide:function(){n&&n.hide(),q=-1},visible:function(){return n&&n.is(":visible")},current:function(){return this.visible()&&(l.filter("."+p.ACTIVE)[0]||b.selectFirst&&l[0])},show:function(){var d=a(c).offset();if(n.css({width:"string"==typeof b.width||b.width>0?b.width:a(c).width(),top:d.top+c.offsetHeight,left:d.left}).show(),b.scroll&&(o.scrollTop(0),o.css({maxHeight:b.scrollHeight,overflow:"auto"}),a.browser.msie&&"undefined"==typeof document.body.style.maxHeight)){var e=0;l.each(function(){e+=this.offsetHeight});var f=e>b.scrollHeight;o.css("height",f?b.scrollHeight:e),f||l.width(o.width()-parseInt(l.css("padding-left"))-parseInt(l.css("padding-right")))}},selected:function(){var b=l&&l.filter("."+p.ACTIVE).removeClass(p.ACTIVE);return b&&b.length&&a.data(b[0],"ac_data")},unbind:function(){n&&n.remove()}}},a.Autocompleter.Selection=function(a,b,c){if(a.createTextRange){var d=a.createTextRange();d.collapse(!0),d.moveStart("character",b),d.moveEnd("character",c),d.select()}else a.setSelectionRange?a.setSelectionRange(b,c):a.selectionStart&&(a.selectionStart=b,a.selectionEnd=c);a.focus()}}(jQuery);
1
+ /*! buddypress - v2.4.0 - 2015-10-22 1:39:20 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
!function(a){a.fn.extend({autocomplete:function(b,c){var d="string"==typeof b;return c=a.extend({},a.Autocompleter.defaults,{url:d?b:null,data:d?null:b,delay:d?a.Autocompleter.defaults.delay:10,max:c&&!c.scroll?10:150},c),c.highlight=c.highlight||function(a){return a},this.each(function(){new a.Autocompleter(this,c)})},result:function(a){return this.bind("result",a)},search:function(a){return this.trigger("search",[a])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(a){return this.trigger("setOptions",[a])},unautocomplete:function(){return this.trigger("unautocomplete")}}),a.Autocompleter=function(b,c){function d(){var a=x.selected();if(!a)return!1;var b=a.result;if(t=b,c.multiple){var d=f(s.val());d.length>1&&(b=d.slice(0,d.length-1).join(c.multipleSeparator)+c.multipleSeparator+b),b+=c.multipleSeparator}return s.val(b),j(),s.trigger("result",[a.data,a.value]),!0}function e(a,b){if(q==r.DEL)return void x.hide();var d=s.val();(b||d!=t)&&(t=d,d=g(d),d.length>=c.minChars?(s.addClass(c.loadingClass),jQuery("#send-to-input").addClass("loading"),c.matchCase||(d=d.toLowerCase()),l(d,k,j)):(n(),x.hide()))}function f(b){if(!b)return[""];var d=b.split(a.trim(c.multipleSeparator)),e=[];return a.each(d,function(b,c){a.trim(c)&&(e[b]=a.trim(c))}),e}function g(a){if(!c.multiple)return a;var b=f(a);return b[b.length-1]}function h(d,e){c.autoFill&&g(s.val()).toLowerCase()==d.toLowerCase()&&8!=q&&(s.val(s.val()+e.substring(g(t).length)),a.Autocompleter.Selection(b,t.length,t.length+e.length))}function i(){clearTimeout(p),p=setTimeout(j,200)}function j(){x.hide(),clearTimeout(p),n(),c.mustMatch&&s.search(function(a){a||s.val("")})}function k(a,b){if(b&&b.length&&v){n(),x.display(b,a);var c=b[0].value.split(";");b.value=c[0],h(a,b.value),x.show()}else j()}function l(d,e,f){c.matchCase||(d=d.toLowerCase());var h=u.load(d);if(h&&h.length)e(d,h);else if("string"==typeof c.url&&c.url.length>0){var i={};a.each(c.extraParams,function(a,b){i[a]="function"==typeof b?b():b}),a.ajax({mode:"abort",port:"autocomplete"+b.name,dataType:c.dataType,url:c.url,data:a.extend({q:g(d),limit:c.max,action:"messages_autocomplete_results",cookie:o()},i),success:function(a){var b=c.parse&&c.parse(a)||m(a);u.add(d,b),e(d,b)}})}else f(d)}function m(b){for(var d=[],e=b.split("\n"),f=0;f<e.length;f++){var g=a.trim(e[f]);g&&(g=g.split("|"),d[d.length]={data:g,value:g[0],result:c.formatResult&&c.formatResult(g,g[0])||g[0]})}return d}function n(){s.removeClass(c.loadingClass),jQuery("#send-to-input").removeClass("loading")}function o(){var a,b,c,d,e,f=document.cookie.split(";"),g={},h="bp-";for(a=0;a<f.length;a++)b=f[a],c=b.indexOf("="),d=jq.trim(unescape(b.slice(0,c))),e=unescape(b.slice(c+1)),0===d.indexOf(h)&&(g[d]=e);return encodeURIComponent(jq.param(g))}var p,q,r={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34},s=a(b).attr("autocomplete","off").addClass(c.inputClass),t="",u=a.Autocompleter.Cache(c),v=0,w={mouseDownOnSelect:!1},x=a.Autocompleter.Select(c,b,d,w);s.keydown(function(b){switch(q=b.keyCode,b.keyCode){case r.UP:b.preventDefault(),x.visible()?x.prev():e(0,!0);break;case r.DOWN:b.preventDefault(),x.visible()?x.next():e(0,!0);break;case r.PAGEUP:b.preventDefault(),x.visible()?x.pageUp():e(0,!0);break;case r.PAGEDOWN:b.preventDefault(),x.visible()?x.pageDown():e(0,!0);break;case c.multiple&&","==a.trim(c.multipleSeparator)&&r.COMMA:case r.TAB:case r.RETURN:d()&&(c.multiple||s.blur(),b.preventDefault(),s.focus());break;case r.ESC:x.hide();break;default:clearTimeout(p),p=setTimeout(e,c.delay)}}).keypress(function(){}).focus(function(){v++}).blur(function(){v=0,w.mouseDownOnSelect||i()}).click(function(){v++>1&&!x.visible()&&e(0,!0)}).bind("search",function(){function b(a,b){var d;if(b&&b.length)for(var e=0;e<b.length;e++)if(b[e].result.toLowerCase()==a.toLowerCase()){d=b[e];break}"function"==typeof c?c(d):s.trigger("result",d&&[d.data,d.value])}var c=arguments.length>1?arguments[1]:null;a.each(f(s.val()),function(a,c){l(c,b,b)})}).bind("flushCache",function(){u.flush()}).bind("setOptions",function(){a.extend(c,arguments[1]),"data"in arguments[1]&&u.populate()}).bind("unautocomplete",function(){x.unbind(),s.unbind()})},a.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:!1,matchSubset:!0,matchContains:!1,cacheLength:10,max:100,mustMatch:!1,extraParams:{},selectFirst:!0,formatItem:function(a){return a[0]},autoFill:!1,width:0,multiple:!1,multipleSeparator:", ",highlight:function(a,b){return a.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+b.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:!0,scrollHeight:250,attachTo:"body"},a.Autocompleter.Cache=function(b){function c(a,c){b.matchCase||(a=a.toLowerCase());var d=a.indexOf(c);return-1==d?!1:0==d||b.matchContains}function d(a,c){h>b.cacheLength&&f(),g[a]||h++,g[a]=c}function e(){if(!b.data)return!1;var c={},e=0;b.url||(b.cacheLength=1),c[""]=[];for(var f=0,g=b.data.length;g>f;f++){var h=b.data[f];h="string"==typeof h?[h]:h;var i=b.formatItem(h,f+1,b.data.length);if(i!==!1){var j=i.charAt(0).toLowerCase();c[j]||(c[j]=[]);var k={value:i,data:h,result:b.formatResult&&b.formatResult(h)||i};c[j].push(k),e++<b.max&&c[""].push(k)}}a.each(c,function(a,c){b.cacheLength++,d(a,c)})}function f(){g={},h=0}var g={},h=0;return setTimeout(e,25),{flush:f,add:d,populate:e,load:function(d){if(!b.cacheLength||!h)return null;if(!b.url&&b.matchContains){var e=[];for(var f in g)if(f.length>0){var i=g[f];a.each(i,function(a,b){c(b.value,d)&&e.push(b)})}return e}if(g[d])return g[d];if(b.matchSubset)for(var j=d.length-1;j>=b.minChars;j--){var i=g[d.substr(0,j)];if(i){var e=[];return a.each(i,function(a,b){c(b.value,d)&&(e[e.length]=b)}),e}}return null}}},a.Autocompleter.Select=function(b,c,d,e){function f(){s&&(n=a("<div/>").hide().addClass(b.resultsClass).css("position","absolute").appendTo(b.attachTo),o=a("<ul>").appendTo(n).mouseover(function(b){g(b).nodeName&&"LI"==g(b).nodeName.toUpperCase()&&(q=a("li",o).removeClass(p.ACTIVE).index(g(b)),a(g(b)).addClass(p.ACTIVE))}).click(function(b){return a(g(b)).addClass(p.ACTIVE),d(),c.focus(),!1}).mousedown(function(){e.mouseDownOnSelect=!0}).mouseup(function(){e.mouseDownOnSelect=!1}),b.width>0&&n.css("width",b.width),s=!1)}function g(a){for(var b=a.target;b&&"LI"!=b.tagName;)b=b.parentNode;return b?b:[]}function h(a){l.slice(q,q+1).removeClass(),i(a);var c=l.slice(q,q+1).addClass(p.ACTIVE);if(b.scroll){var d=0;l.slice(0,q).each(function(){d+=this.offsetHeight}),d+c[0].offsetHeight-o.scrollTop()>o[0].clientHeight?o.scrollTop(d+c[0].offsetHeight-o.innerHeight()):d<o.scrollTop()&&o.scrollTop(d)}}function i(a){q+=a,0>q?q=l.size()-1:q>=l.size()&&(q=0)}function j(a){return b.max&&b.max<a?b.max:a}function k(){o.empty();for(var c=j(m.length),d=0;c>d;d++)if(m[d]){var e=b.formatItem(m[d].data,d+1,c,m[d].value,r);if(e!==!1){var f=a("<li>").html(b.highlight(e,r)).addClass(d%2==0?"ac_event":"ac_odd").appendTo(o)[0];a.data(f,"ac_data",m[d])}}l=o.find("li"),b.selectFirst&&(l.slice(0,1).addClass(p.ACTIVE),q=0),o.bgiframe()}var l,m,n,o,p={ACTIVE:"ac_over"},q=-1,r="",s=!0;return{display:function(a,b){f(),m=a,r=b,k()},next:function(){h(1)},prev:function(){h(-1)},pageUp:function(){h(0!=q&&0>q-8?-q:-8)},pageDown:function(){h(q!=l.size()-1&&q+8>l.size()?l.size()-1-q:8)},hide:function(){n&&n.hide(),q=-1},visible:function(){return n&&n.is(":visible")},current:function(){return this.visible()&&(l.filter("."+p.ACTIVE)[0]||b.selectFirst&&l[0])},show:function(){var d=a(c).offset();if(n.css({width:"string"==typeof b.width||b.width>0?b.width:a(c).width(),top:d.top+c.offsetHeight,left:d.left}).show(),b.scroll&&(o.scrollTop(0),o.css({maxHeight:b.scrollHeight,overflow:"auto"}),a.browser.msie&&"undefined"==typeof document.body.style.maxHeight)){var e=0;l.each(function(){e+=this.offsetHeight});var f=e>b.scrollHeight;o.css("height",f?b.scrollHeight:e),f||l.width(o.width()-parseInt(l.css("padding-left"))-parseInt(l.css("padding-right")))}},selected:function(){var b=l&&l.filter("."+p.ACTIVE).removeClass(p.ACTIVE);return b&&b.length&&a.data(b[0],"ac_data")},unbind:function(){n&&n.remove()}}},a.Autocompleter.Selection=function(a,b,c){if(a.createTextRange){var d=a.createTextRange();d.collapse(!0),d.moveStart("character",b),d.moveEnd("character",c),d.select()}else a.setSelectionRange?a.setSelectionRange(b,c):a.selectionStart&&(a.selectionStart=b,a.selectionEnd=c);a.focus()}}(jQuery);
bp-core/deprecated/js/autocomplete/jquery.autocompletefb.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! buddypress - v2.4.0 - 2015-10-12 8:03:39 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
jQuery.fn.autoCompletefb=function(a){var b=this,c={ul:b,urlLookup:[""],acOptions:{},foundClass:".friend-tab",inputClass:".send-to-input"};a&&jQuery.extend(c,a);var d={params:c,removeFind:function(a){return d.removeUsername(a),jQuery(a).unbind("click").parent().remove(),jQuery(c.inputClass,b).focus(),b.acfb},removeUsername:function(a){var b=a.parentNode.id.substr(a.parentNode.id.indexOf("-")+1);jQuery("#send-to-usernames").removeClass(b)}};return jQuery(c.foundClass+" img.p").click(function(){d.removeFind(this)}),jQuery(c.inputClass,b).autocomplete(c.urlLookup,c.acOptions),jQuery(c.inputClass,b).result(function(a,e,f){var f=c.foundClass.replace(/\./,""),e=String(e).split(" ("),g=e[1].substr(0,e[1].length-1);if(0===jQuery(c.inputClass).siblings("#un-"+g).length){var h="#link-"+g,i=jQuery(h).attr("href"),j='<li class="'+f+'" id="un-'+g+'"><span><a href="'+i+'">'+e[0]+'</a></span> <span class="p">X</span></li>',k=jQuery(c.inputClass,b).before(j);jQuery("#send-to-usernames").addClass(g),jQuery(".p",k[0].previousSibling).click(function(){d.removeFind(this)})}jQuery(c.inputClass,b).val("")}),jQuery(c.inputClass,b).focus(),d};
1
+ /*! buddypress - v2.4.0 - 2015-10-22 1:39:20 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
jQuery.fn.autoCompletefb=function(a){var b=this,c={ul:b,urlLookup:[""],acOptions:{},foundClass:".friend-tab",inputClass:".send-to-input"};a&&jQuery.extend(c,a);var d={params:c,removeFind:function(a){return d.removeUsername(a),jQuery(a).unbind("click").parent().remove(),jQuery(c.inputClass,b).focus(),b.acfb},removeUsername:function(a){var b=a.parentNode.id.substr(a.parentNode.id.indexOf("-")+1);jQuery("#send-to-usernames").removeClass(b)}};return jQuery(c.foundClass+" img.p").click(function(){d.removeFind(this)}),jQuery(c.inputClass,b).autocomplete(c.urlLookup,c.acOptions),jQuery(c.inputClass,b).result(function(a,e,f){var f=c.foundClass.replace(/\./,""),e=String(e).split(" ("),g=e[1].substr(0,e[1].length-1);if(0===jQuery(c.inputClass).siblings("#un-"+g).length){var h="#link-"+g,i=jQuery(h).attr("href"),j='<li class="'+f+'" id="un-'+g+'"><span><a href="'+i+'">'+e[0]+'</a></span> <span class="p">X</span></li>',k=jQuery(c.inputClass,b).before(j);jQuery("#send-to-usernames").addClass(g),jQuery(".p",k[0].previousSibling).click(function(){d.removeFind(this)})}jQuery(c.inputClass,b).val("")}),jQuery(c.inputClass,b).focus(),d};
bp-core/deprecated/js/autocomplete/jquery.bgiframe.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! buddypress - v2.4.0 - 2015-10-12 8:03:39 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
!function(a){function b(a){return a&&a.constructor===Number?a+"px":a}a.fn.bgiframe=a.browser.msie&&/msie 6\.0/i.test(navigator.userAgent)?function(c){c=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:!0,src:"javascript:false;"},c);var d='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+c.src+'"style="display:block;position:absolute;z-index:-1;'+(c.opacity!==!1?"filter:Alpha(Opacity='0');":"")+"top:"+("auto"==c.top?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":b(c.top))+";left:"+("auto"==c.left?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":b(c.left))+";width:"+("auto"==c.width?"expression(this.parentNode.offsetWidth+'px')":b(c.width))+";height:"+("auto"==c.height?"expression(this.parentNode.offsetHeight+'px')":b(c.height))+';"/>';return this.each(function(){0===a(this).children("iframe.bgiframe").length&&this.insertBefore(document.createElement(d),this.firstChild)})}:function(){return this},a.fn.bgIframe=a.fn.bgiframe}(jQuery);
1
+ /*! buddypress - v2.4.0 - 2015-10-22 1:39:20 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
!function(a){function b(a){return a&&a.constructor===Number?a+"px":a}a.fn.bgiframe=a.browser.msie&&/msie 6\.0/i.test(navigator.userAgent)?function(c){c=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:!0,src:"javascript:false;"},c);var d='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+c.src+'"style="display:block;position:absolute;z-index:-1;'+(c.opacity!==!1?"filter:Alpha(Opacity='0');":"")+"top:"+("auto"==c.top?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":b(c.top))+";left:"+("auto"==c.left?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":b(c.left))+";width:"+("auto"==c.width?"expression(this.parentNode.offsetWidth+'px')":b(c.width))+";height:"+("auto"==c.height?"expression(this.parentNode.offsetHeight+'px')":b(c.height))+';"/>';return this.each(function(){0===a(this).children("iframe.bgiframe").length&&this.insertBefore(document.createElement(d),this.firstChild)})}:function(){return this},a.fn.bgIframe=a.fn.bgiframe}(jQuery);
bp-core/deprecated/js/autocomplete/jquery.dimensions.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! buddypress - v2.4.0 - 2015-10-12 8:03:39 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
!function(a){a.dimensions={version:"@VERSION"},a.each(["Height","Width"],function(c,d){a.fn["inner"+d]=function(){if(this[0]){var a="Height"==d?"Top":"Left",c="Height"==d?"Bottom":"Right";return this[d.toLowerCase()]()+b(this,"padding"+a)+b(this,"padding"+c)}},a.fn["outer"+d]=function(c){if(this[0]){var e="Height"==d?"Top":"Left",f="Height"==d?"Bottom":"Right";return c=a.extend({margin:!1},c||{}),this[d.toLowerCase()]()+b(this,"border"+e+"Width")+b(this,"border"+f+"Width")+b(this,"padding"+e)+b(this,"padding"+f)+(c.margin?b(this,"margin"+e)+b(this,"margin"+f):0)}}}),a.each(["Left","Top"],function(b,c){a.fn["scroll"+c]=function(b){return this[0]?void 0!=b?this.each(function(){this==window||this==document?window.scrollTo("Left"==c?b:a(window).scrollLeft(),"Top"==c?b:a(window).scrollTop()):this["scroll"+c]=b}):this[0]==window||this[0]==document?self["Left"==c?"pageXOffset":"pageYOffset"]||a.boxModel&&document.documentElement["scroll"+c]||document.body["scroll"+c]:this[0]["scroll"+c]:void 0}}),a.fn.extend({position:function(){var a,c,d,e,f=this[0];return f&&(d=this.offsetParent(),a=this.offset(),c=d.offset(),a.top-=b(f,"marginTop"),a.left-=b(f,"marginLeft"),c.top+=b(d,"borderTopWidth"),c.left+=b(d,"borderLeftWidth"),e={top:a.top-c.top,left:a.left-c.left}),e},offsetParent:function(){for(var b=this[0].offsetParent;b&&!/^body|html#x2F;i.test(b.tagName)&&"static"==a.css(b,"position");)b=b.offsetParent;return a(b)}});var b=function(b,c){return parseInt(a.css(b.jquery?b[0]:b,c))||0}}(jQuery);
1
+ /*! buddypress - v2.4.0 - 2015-10-22 1:39:20 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
!function(a){a.dimensions={version:"@VERSION"},a.each(["Height","Width"],function(c,d){a.fn["inner"+d]=function(){if(this[0]){var a="Height"==d?"Top":"Left",c="Height"==d?"Bottom":"Right";return this[d.toLowerCase()]()+b(this,"padding"+a)+b(this,"padding"+c)}},a.fn["outer"+d]=function(c){if(this[0]){var e="Height"==d?"Top":"Left",f="Height"==d?"Bottom":"Right";return c=a.extend({margin:!1},c||{}),this[d.toLowerCase()]()+b(this,"border"+e+"Width")+b(this,"border"+f+"Width")+b(this,"padding"+e)+b(this,"padding"+f)+(c.margin?b(this,"margin"+e)+b(this,"margin"+f):0)}}}),a.each(["Left","Top"],function(b,c){a.fn["scroll"+c]=function(b){return this[0]?void 0!=b?this.each(function(){this==window||this==document?window.scrollTo("Left"==c?b:a(window).scrollLeft(),"Top"==c?b:a(window).scrollTop()):this["scroll"+c]=b}):this[0]==window||this[0]==document?self["Left"==c?"pageXOffset":"pageYOffset"]||a.boxModel&&document.documentElement["scroll"+c]||document.body["scroll"+c]:this[0]["scroll"+c]:void 0}}),a.fn.extend({position:function(){var a,c,d,e,f=this[0];return f&&(d=this.offsetParent(),a=this.offset(),c=d.offset(),a.top-=b(f,"marginTop"),a.left-=b(f,"marginLeft"),c.top+=b(d,"borderTopWidth"),c.left+=b(d,"borderLeftWidth"),e={top:a.top-c.top,left:a.left-c.left}),e},offsetParent:function(){for(var b=this[0].offsetParent;b&&!/^body|html#x2F;i.test(b.tagName)&&"static"==a.css(b,"position");)b=b.offsetParent;return a(b)}});var b=function(b,c){return parseInt(a.css(b.jquery?b[0]:b,c))||0}}(jQuery);
bp-core/js/avatar.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! buddypress - v2.4.0 - 2015-10-12 8:03:39 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
window.bp=window.bp||{},function(a,b){"undefined"!=typeof BP_Uploader&&(bp.Models=bp.Models||{},bp.Collections=bp.Collections||{},bp.Views=bp.Views||{},bp.Avatar={start:function(){this.removeLegacyUI(),this.views=new Backbone.Collection,this.jcropapi={},this.warning=null,this.setupNav(),this.avatars=bp.Uploader.filesUploaded,this.Attachment=new Backbone.Model,bp.Uploader.filesQueue.on("reset",this.cropView,this),b("body.wp-admin").on("tb_unload","#TB_window",function(){bp.Avatar.nav.trigger("bp-avatar-view:changed","upload"),_.each(bp.Avatar.navItems.models,function(a){"upload"===a.id?a.set({active:1}):a.set({active:0})})})},removeLegacyUI:function(){b("#avatar-upload-form").length?(b("#avatar-upload").remove(),b("#avatar-upload-form p").remove()):b("#group-settings-form").length?(b("#group-settings-form p").each(function(a){0!==a&&b(this).remove()}),b("#delete-group-avatar-button").length&&b("#delete-group-avatar-button").remove()):b("#group-create-body").length?(b(".main-column p #file").remove(),b(".main-column p #upload").remove()):b("#bp_xprofile_user_admin_avatar a.bp-xprofile-avatar-user-admin").length&&b("#bp_xprofile_user_admin_avatar a.bp-xprofile-avatar-user-admin").remove()},setView:function(a){switch(_.isUndefined(this.views.models)||_.each(this.views.models,function(a){a.get("view").remove()},this),this.views.reset(),_.isUndefined(this.avatars)||this.avatars.reset(),_.isEmpty(this.jcropapi)||(this.jcropapi.destroy(),this.jcropapi={}),a){case"upload":this.uploaderView();break;case"delete":this.deleteView()}},setupNav:function(){var a,b,c=this;this.navItems=new Backbone.Collection,_.each(BP_Uploader.settings.nav,function(d,e){_.isObject(d)&&(b=0,0===e&&(a=d.id,b=1),c.navItems.add({id:d.id,name:d.caption,href:"#",active:b,hide:_.isUndefined(d.hide)?0:d.hide}))}),this.nav=new bp.Views.Nav({collection:this.navItems}),this.nav.inject(".bp-avatar-nav"),this.setView(a),this.nav.on("bp-avatar-view:changed",_.bind(this.setView,this))},uploaderView:function(){bp.Uploader.filesQueue.on("add",this.uploadProgress,this);var a=new bp.Views.Uploader;this.views.add({id:"upload",view:a}),a.inject(".bp-avatar")},uploadProgress:function(){var a=new bp.Views.uploaderStatus({collection:bp.Uploader.filesQueue});_.isUndefined(this.views.get("status"))?this.views.add({id:"status",view:a}):this.views.set({id:"status",view:a}),a.inject(".bp-avatar-status")},cropView:function(){var a;if(!_.isEmpty(this.avatars.models)){_.isUndefined(this.views.get("status"))||(a=this.views.get("status"),a.get("view").remove(),this.views.remove({id:"status",view:a}));var b=new bp.Views.Avatars({collection:this.avatars});this.views.add({id:"crop",view:b}),b.inject(".bp-avatar")}},setAvatar:function(a){var c,d=this;_.isUndefined(this.views.get("crop"))||(_.isEmpty(this.jcropapi)||(this.jcropapi.destroy(),this.jcropapi={}),c=this.views.get("crop"),c.get("view").remove(),this.views.remove({id:"crop",view:c})),bp.ajax.post("bp_avatar_set",{json:!0,original_file:a.get("url"),crop_w:a.get("w"),crop_h:a.get("h"),crop_x:a.get("x"),crop_y:a.get("y"),item_id:a.get("item_id"),object:a.get("object"),type:_.isUndefined(a.get("type"))?"crop":a.get("type"),nonce:a.get("nonces").set}).done(function(c){var e=new bp.Views.AvatarStatus({value:BP_Uploader.strings.feedback_messages[c.feedback_code],type:"success"});d.views.add({id:"status",view:e}),e.inject(".bp-avatar-status"),b("."+a.get("object")+"-"+c.item_id+"-avatar").each(function(){b(this).prop("src",c.avatar)}),bp.Avatar.navItems.get("delete").set({hide:0}),d.Attachment.set(_.extend(_.pick(a.attributes,["object","item_id"]),{url:c.avatar,action:"uploaded"}))}).fail(function(a){var b=BP_Uploader.strings.default_error;_.isUndefined(a)||(b=BP_Uploader.strings.feedback_messages[a.feedback_code]);var c=new bp.Views.AvatarStatus({value:b,type:"error"});d.views.add({id:"status",view:c}),c.inject(".bp-avatar-status")})},deleteView:function(){var a=new Backbone.Model(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,"object","item_id","nonces")),b=new bp.Views.DeleteAvatar({model:a});this.views.add({id:"delete",view:b}),b.inject(".bp-avatar")},deleteAvatar:function(a){var c,d=this;_.isUndefined(this.views.get("delete"))||(c=this.views.get("delete"),c.get("view").remove(),this.views.remove({id:"delete",view:c})),bp.ajax.post("bp_avatar_delete",{json:!0,item_id:a.get("item_id"),object:a.get("object"),nonce:a.get("nonces").remove}).done(function(c){var e=new bp.Views.AvatarStatus({value:BP_Uploader.strings.feedback_messages[c.feedback_code],type:"success"});d.views.add({id:"status",view:e}),e.inject(".bp-avatar-status"),b("."+a.get("object")+"-"+c.item_id+"-avatar").each(function(){b(this).prop("src",c.avatar)}),bp.Avatar.navItems.get("delete").set({active:0,hide:1}),d.Attachment.set(_.extend(_.pick(a.attributes,["object","item_id"]),{url:c.avatar,action:"deleted"}))}).fail(function(a){var b=BP_Uploader.strings.default_error;_.isUndefined(a)||(b=BP_Uploader.strings.feedback_messages[a.feedback_code]);var c=new bp.Views.AvatarStatus({value:b,type:"error"});d.views.add({id:"status",view:c}),c.inject(".bp-avatar-status")})},removeWarning:function(){_.isNull(this.warning)||this.warning.remove()},displayWarning:function(a){this.removeWarning(),this.warning=new bp.Views.uploaderWarning({value:a}),this.warning.inject(".bp-avatar-status")}},bp.Views.Nav=bp.View.extend({tagName:"ul",className:"avatar-nav-items",events:{"click .bp-avatar-nav-item":"toggleView"},initialize:function(){var a=_.findWhere(this.collection.models,{id:"delete"});1!==a.get("hide")&&bp.Avatar.displayWarning(BP_Uploader.strings.has_avatar_warning),_.each(this.collection.models,this.addNavItem,this),this.collection.on("change:hide",this.showHideNavItem,this)},addNavItem:function(a){1!==a.get("hide")&&this.views.add(new bp.Views.NavItem({model:a}))},showHideNavItem:function(a){var b=null;_.each(this.views._views[""],function(c){1===c.model.get("hide")&&c.remove(),a.get("id")===c.model.get("id")&&(b=!0)}),_.isBoolean(b)||this.addNavItem(a)},toggleView:function(a){a.preventDefault(),bp.Avatar.removeWarning();var c=b(a.target).data("nav");_.each(this.collection.models,function(a){a.id===c?(a.set({active:1}),this.trigger("bp-avatar-view:changed",a.id)):a.set({active:0})},this)}}),bp.Views.NavItem=bp.View.extend({tagName:"li",className:"avatar-nav-item",template:bp.template("bp-avatar-nav"),initialize:function(){1===this.model.get("active")&&(this.el.className+=" current"),this.el.id+="bp-avatar-"+this.model.get("id"),this.model.on("change:active",this.setCurrentNav,this)},setCurrentNav:function(a){1===a.get("active")?this.$el.addClass("current"):this.$el.removeClass("current")}}),bp.Views.Avatars=bp.View.extend({className:"items",initialize:function(){_.each(this.collection.models,this.addItemView,this)},addItemView:function(a){var b={full_h:150,full_w:150};_.isUndefined(BP_Uploader.settings.crop.full_h)||_.isUndefined(BP_Uploader.settings.crop.full_w)||(b.full_h=BP_Uploader.settings.crop.full_h,b.full_w=BP_Uploader.settings.crop.full_w),a.set(_.extend(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,"object","item_id","nonces"),b)),this.views.add(new bp.Views.Avatar({model:a}))}}),bp.Views.Avatar=bp.View.extend({className:"item",template:bp.template("bp-avatar-item"),events:{"click .avatar-crop-submit":"cropAvatar"},initialize:function(){_.defaults(this.options,{full_h:BP_Uploader.settings.crop.full_h,full_w:BP_Uploader.settings.crop.full_w,aspectRatio:1}),!1!==this.model.get("feedback")&&bp.Avatar.displayWarning(this.model.get("feedback")),this.on("ready",this.initCropper)},initCropper:function(){var a,c,d,e,f,g,h=this,i=this.$el.find("#avatar-to-crop img"),j=this.$el.width(),k={};_.isUndefined(this.options.full_h)||_.isUndefined(this.options.full_w)||(this.options.aspectRatio=this.options.full_w/this.options.full_h),k.w=this.model.get("width"),k.h=this.model.get("height"),this.options.full_w+k.w+20<j&&(b("#avatar-to-crop").addClass("adjust"),this.$el.find(".avatar-crop-management").addClass("adjust")),k.h<=k.w?(a=Math.round(k.h/4),f=g=Math.round(k.h/2),c=f+a,d=(k.w-g)/2,e=g+d):(d=Math.round(k.w/4),f=g=Math.round(k.w/2),e=g+d,a=(k.h-f)/2,c=f+a),i.Jcrop({onChange:_.bind(h.showPreview,h),onSelect:_.bind(h.showPreview,h),aspectRatio:h.options.aspectRatio,setSelect:[d,a,e,c]},function(){bp.Avatar.jcropapi=this})},cropAvatar:function(a){a.preventDefault(),bp.Avatar.setAvatar(this.model)},showPreview:function(a){if(a.w&&a.h&&parseInt(a.w,10)>0){var c=this.options.full_w,d=this.options.full_h,e=c/a.w,f=d/a.h;this.model.set({x:a.x,y:a.y,w:a.w,h:a.h}),b("#avatar-crop-preview").css({maxWidth:"none",width:Math.round(e*this.model.get("width"))+"px",height:Math.round(f*this.model.get("height"))+"px",marginLeft:"-"+Math.round(e*this.model.get("x"))+"px",marginTop:"-"+Math.round(f*this.model.get("y"))+"px"})}}}),bp.Views.AvatarStatus=bp.View.extend({tagName:"p",className:"updated",id:"bp-avatar-feedback",initialize:function(){this.el.className+=" "+this.options.type,this.value=this.options.value},render:function(){return this.$el.html(this.value),this}}),bp.Views.DeleteAvatar=bp.View.extend({tagName:"div",id:"bp-delete-avatar-container",template:bp.template("bp-avatar-delete"),events:{"click #bp-delete-avatar":"deleteAvatar"},deleteAvatar:function(a){a.preventDefault(),bp.Avatar.deleteAvatar(this.model)}}),bp.Avatar.start())}(bp,jQuery);
1
+ /*! buddypress - v2.4.0 - 2015-10-22 1:39:20 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
window.bp=window.bp||{},function(a,b){"undefined"!=typeof BP_Uploader&&(bp.Models=bp.Models||{},bp.Collections=bp.Collections||{},bp.Views=bp.Views||{},bp.Avatar={start:function(){this.removeLegacyUI(),this.views=new Backbone.Collection,this.jcropapi={},this.warning=null,this.setupNav(),this.avatars=bp.Uploader.filesUploaded,this.Attachment=new Backbone.Model,bp.Uploader.filesQueue.on("reset",this.cropView,this),b("body.wp-admin").on("tb_unload","#TB_window",function(){bp.Avatar.nav.trigger("bp-avatar-view:changed","upload"),_.each(bp.Avatar.navItems.models,function(a){"upload"===a.id?a.set({active:1}):a.set({active:0})})})},removeLegacyUI:function(){b("#avatar-upload-form").length?(b("#avatar-upload").remove(),b("#avatar-upload-form p").remove()):b("#group-settings-form").length?(b("#group-settings-form p").each(function(a){0!==a&&b(this).remove()}),b("#delete-group-avatar-button").length&&b("#delete-group-avatar-button").remove()):b("#group-create-body").length?(b(".main-column p #file").remove(),b(".main-column p #upload").remove()):b("#bp_xprofile_user_admin_avatar a.bp-xprofile-avatar-user-admin").length&&b("#bp_xprofile_user_admin_avatar a.bp-xprofile-avatar-user-admin").remove()},setView:function(a){switch(_.isUndefined(this.views.models)||_.each(this.views.models,function(a){a.get("view").remove()},this),this.views.reset(),_.isUndefined(this.avatars)||this.avatars.reset(),_.isEmpty(this.jcropapi)||(this.jcropapi.destroy(),this.jcropapi={}),a){case"upload":this.uploaderView();break;case"delete":this.deleteView()}},setupNav:function(){var a,b,c=this;this.navItems=new Backbone.Collection,_.each(BP_Uploader.settings.nav,function(d,e){_.isObject(d)&&(b=0,0===e&&(a=d.id,b=1),c.navItems.add({id:d.id,name:d.caption,href:"#",active:b,hide:_.isUndefined(d.hide)?0:d.hide}))}),this.nav=new bp.Views.Nav({collection:this.navItems}),this.nav.inject(".bp-avatar-nav"),this.setView(a),this.nav.on("bp-avatar-view:changed",_.bind(this.setView,this))},uploaderView:function(){bp.Uploader.filesQueue.on("add",this.uploadProgress,this);var a=new bp.Views.Uploader;this.views.add({id:"upload",view:a}),a.inject(".bp-avatar")},uploadProgress:function(){var a=new bp.Views.uploaderStatus({collection:bp.Uploader.filesQueue});_.isUndefined(this.views.get("status"))?this.views.add({id:"status",view:a}):this.views.set({id:"status",view:a}),a.inject(".bp-avatar-status")},cropView:function(){var a;if(!_.isEmpty(this.avatars.models)){_.isUndefined(this.views.get("status"))||(a=this.views.get("status"),a.get("view").remove(),this.views.remove({id:"status",view:a}));var b=new bp.Views.Avatars({collection:this.avatars});this.views.add({id:"crop",view:b}),b.inject(".bp-avatar")}},setAvatar:function(a){var c,d=this;_.isUndefined(this.views.get("crop"))||(_.isEmpty(this.jcropapi)||(this.jcropapi.destroy(),this.jcropapi={}),c=this.views.get("crop"),c.get("view").remove(),this.views.remove({id:"crop",view:c})),bp.ajax.post("bp_avatar_set",{json:!0,original_file:a.get("url"),crop_w:a.get("w"),crop_h:a.get("h"),crop_x:a.get("x"),crop_y:a.get("y"),item_id:a.get("item_id"),object:a.get("object"),type:_.isUndefined(a.get("type"))?"crop":a.get("type"),nonce:a.get("nonces").set}).done(function(c){var e=new bp.Views.AvatarStatus({value:BP_Uploader.strings.feedback_messages[c.feedback_code],type:"success"});d.views.add({id:"status",view:e}),e.inject(".bp-avatar-status"),b("."+a.get("object")+"-"+c.item_id+"-avatar").each(function(){b(this).prop("src",c.avatar)}),bp.Avatar.navItems.get("delete").set({hide:0}),d.Attachment.set(_.extend(_.pick(a.attributes,["object","item_id"]),{url:c.avatar,action:"uploaded"}))}).fail(function(a){var b=BP_Uploader.strings.default_error;_.isUndefined(a)||(b=BP_Uploader.strings.feedback_messages[a.feedback_code]);var c=new bp.Views.AvatarStatus({value:b,type:"error"});d.views.add({id:"status",view:c}),c.inject(".bp-avatar-status")})},deleteView:function(){var a=new Backbone.Model(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,"object","item_id","nonces")),b=new bp.Views.DeleteAvatar({model:a});this.views.add({id:"delete",view:b}),b.inject(".bp-avatar")},deleteAvatar:function(a){var c,d=this;_.isUndefined(this.views.get("delete"))||(c=this.views.get("delete"),c.get("view").remove(),this.views.remove({id:"delete",view:c})),bp.ajax.post("bp_avatar_delete",{json:!0,item_id:a.get("item_id"),object:a.get("object"),nonce:a.get("nonces").remove}).done(function(c){var e=new bp.Views.AvatarStatus({value:BP_Uploader.strings.feedback_messages[c.feedback_code],type:"success"});d.views.add({id:"status",view:e}),e.inject(".bp-avatar-status"),b("."+a.get("object")+"-"+c.item_id+"-avatar").each(function(){b(this).prop("src",c.avatar)}),bp.Avatar.navItems.get("delete").set({active:0,hide:1}),d.Attachment.set(_.extend(_.pick(a.attributes,["object","item_id"]),{url:c.avatar,action:"deleted"}))}).fail(function(a){var b=BP_Uploader.strings.default_error;_.isUndefined(a)||(b=BP_Uploader.strings.feedback_messages[a.feedback_code]);var c=new bp.Views.AvatarStatus({value:b,type:"error"});d.views.add({id:"status",view:c}),c.inject(".bp-avatar-status")})},removeWarning:function(){_.isNull(this.warning)||this.warning.remove()},displayWarning:function(a){this.removeWarning(),this.warning=new bp.Views.uploaderWarning({value:a}),this.warning.inject(".bp-avatar-status")}},bp.Views.Nav=bp.View.extend({tagName:"ul",className:"avatar-nav-items",events:{"click .bp-avatar-nav-item":"toggleView"},initialize:function(){var a=_.findWhere(this.collection.models,{id:"delete"});1!==a.get("hide")&&bp.Avatar.displayWarning(BP_Uploader.strings.has_avatar_warning),_.each(this.collection.models,this.addNavItem,this),this.collection.on("change:hide",this.showHideNavItem,this)},addNavItem:function(a){1!==a.get("hide")&&this.views.add(new bp.Views.NavItem({model:a}))},showHideNavItem:function(a){var b=null;_.each(this.views._views[""],function(c){1===c.model.get("hide")&&c.remove(),a.get("id")===c.model.get("id")&&(b=!0)}),_.isBoolean(b)||this.addNavItem(a)},toggleView:function(a){a.preventDefault(),bp.Avatar.removeWarning();var c=b(a.target).data("nav");_.each(this.collection.models,function(a){a.id===c?(a.set({active:1}),this.trigger("bp-avatar-view:changed",a.id)):a.set({active:0})},this)}}),bp.Views.NavItem=bp.View.extend({tagName:"li",className:"avatar-nav-item",template:bp.template("bp-avatar-nav"),initialize:function(){1===this.model.get("active")&&(this.el.className+=" current"),this.el.id+="bp-avatar-"+this.model.get("id"),this.model.on("change:active",this.setCurrentNav,this)},setCurrentNav:function(a){1===a.get("active")?this.$el.addClass("current"):this.$el.removeClass("current")}}),bp.Views.Avatars=bp.View.extend({className:"items",initialize:function(){_.each(this.collection.models,this.addItemView,this)},addItemView:function(a){var b={full_h:150,full_w:150};_.isUndefined(BP_Uploader.settings.crop.full_h)||_.isUndefined(BP_Uploader.settings.crop.full_w)||(b.full_h=BP_Uploader.settings.crop.full_h,b.full_w=BP_Uploader.settings.crop.full_w),a.set(_.extend(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,"object","item_id","nonces"),b)),this.views.add(new bp.Views.Avatar({model:a}))}}),bp.Views.Avatar=bp.View.extend({className:"item",template:bp.template("bp-avatar-item"),events:{"click .avatar-crop-submit":"cropAvatar"},initialize:function(){_.defaults(this.options,{full_h:BP_Uploader.settings.crop.full_h,full_w:BP_Uploader.settings.crop.full_w,aspectRatio:1}),!1!==this.model.get("feedback")&&bp.Avatar.displayWarning(this.model.get("feedback")),this.on("ready",this.initCropper)},initCropper:function(){var a,c,d,e,f,g,h=this,i=this.$el.find("#avatar-to-crop img"),j=this.$el.width(),k={};_.isUndefined(this.options.full_h)||_.isUndefined(this.options.full_w)||(this.options.aspectRatio=this.options.full_w/this.options.full_h),k.w=this.model.get("width"),k.h=this.model.get("height"),this.options.full_w+k.w+20<j&&(b("#avatar-to-crop").addClass("adjust"),this.$el.find(".avatar-crop-management").addClass("adjust")),k.h<=k.w?(a=Math.round(k.h/4),f=g=Math.round(k.h/2),c=f+a,d=(k.w-g)/2,e=g+d):(d=Math.round(k.w/4),f=g=Math.round(k.w/2),e=g+d,a=(k.h-f)/2,c=f+a),i.Jcrop({onChange:_.bind(h.showPreview,h),onSelect:_.bind(h.showPreview,h),aspectRatio:h.options.aspectRatio,setSelect:[d,a,e,c]},function(){bp.Avatar.jcropapi=this})},cropAvatar:function(a){a.preventDefault(),bp.Avatar.setAvatar(this.model)},showPreview:function(a){if(a.w&&a.h&&parseInt(a.w,10)>0){var c=this.options.full_w,d=this.options.full_h,e=c/a.w,f=d/a.h;this.model.set({x:a.x,y:a.y,w:a.w,h:a.h}),b("#avatar-crop-preview").css({maxWidth:"none",width:Math.round(e*this.model.get("width"))+"px",height:Math.round(f*this.model.get("height"))+"px",marginLeft:"-"+Math.round(e*this.model.get("x"))+"px",marginTop:"-"+Math.round(f*this.model.get("y"))+"px"})}}}),bp.Views.AvatarStatus=bp.View.extend({tagName:"p",className:"updated",id:"bp-avatar-feedback",initialize:function(){this.el.className+=" "+this.options.type,this.value=this.options.value},render:function(){return this.$el.html(this.value),this}}),bp.Views.DeleteAvatar=bp.View.extend({tagName:"div",id:"bp-delete-avatar-container",template:bp.template("bp-avatar-delete"),events:{"click #bp-delete-avatar":"deleteAvatar"},deleteAvatar:function(a){a.preventDefault(),bp.Avatar.deleteAvatar(this.model)}}),bp.Avatar.start())}(bp,jQuery);
bp-core/js/bp-plupload.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! buddypress - v2.4.0 - 2015-10-12 8:03:39 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
window.wp=window.wp||{},window.bp=window.bp||{},function(a,b){"undefined"!=typeof BP_Uploader&&(_.extend(bp,_.pick(wp,"Backbone","ajax","template")),bp.Models=bp.Models||{},bp.Collections=bp.Collections||{},bp.Views=bp.Views||{},bp.Uploader={},bp.Uploader.uploader=function(){var a=this,c=-1!==navigator.userAgent.indexOf("Trident/")||-1!==navigator.userAgent.indexOf("MSIE ");return this.params=BP_Uploader.settings,this.strings=BP_Uploader.strings,this.supports={upload:this.params.browser.supported},this.supported=this.supports.upload,this.supported?(c||"flash"!==plupload.predictRuntime(this.params.defaults)||this.params.defaults.required_features&&this.params.defaults.required_features.hasOwnProperty("send_binary_string")||(this.params.defaults.required_features=this.params.defaults.required_features||{},this.params.defaults.required_features.send_binary_string=!0),this.uploader=new plupload.Uploader(this.params.defaults),this.uploader.bind("Init",function(c){var d=b("#"+a.params.defaults.container),e=b("#"+a.params.defaults.drop_element);"html4"===c.runtime&&(c.settings.multipart_params.html4=!0),"bp_avatar_upload"===c.settings.multipart_params.action&&(c.settings.multipart_params.bp_params.ui_available_width=d.width()),c.features.dragdrop&&!a.params.browser.mobile?(d.addClass("drag-drop"),e.bind("dragover.wp-uploader",function(){d.addClass("drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){d.removeClass("drag-over")})):(d.removeClass("drag-drop"),e.unbind(".wp-uploader"))}),this.uploader.init(),this.feedback=function(a,b,c){!_.isNull(c)&&c.item&&c.item.clear(),bp.Uploader.filesError.unshift({message:a,data:b,file:c})},this.uploader.bind("FilesAdded",function(c,d){var e=104857600,f=parseInt(c.settings.max_file_size,10),g=this;if(!c.settings.multi_selection&&d.length>1){for(var h in d)c.removeFile(d[h]);return void b(a).trigger("bp-uploader-warning",a.strings.unique_file_warning)}_.each(d,function(a){var b;plupload.FAILED!==a.status&&(f>e&&a.size>e&&"html5"!==c.runtime?g.uploadSizeError(c,a,!0):(b=_.extend({id:a.id,file:a,uploading:!0,date:new Date,filename:a.name},_.pick(a,"loaded","size","percent")),a.item=new bp.Models.File(b),bp.Uploader.filesQueue.add(a.item)))}),c.refresh(),c.start()}),this.uploader.bind("UploadProgress",function(a,b){b.item.set(_.pick(b,"loaded","percent"))}),this.uploader.bind("FileUploaded",function(b,c,d){var e=a.strings.default_error;try{d=JSON.parse(d.response)}catch(f){return a.feedback(e,f,c)}return!_.isObject(d)||_.isUndefined(d.success)?a.feedback(e,null,c):d.success?(_.each(["file","loaded","size","percent"],function(a){c.item.unset(a)}),c.item.set(_.extend(d.data,{uploading:!1})),void bp.Uploader.filesUploaded.add(c.item)):(d.data&&d.data.message&&(e=d.data.message),a.feedback(e,d.data,c))}),this.uploader.bind("BeforeUpload",function(c,d){b(a).trigger("bp-uploader-new-upload",c,d)}),this.uploader.bind("UploadComplete",function(c,d){b(a).trigger("bp-uploader-upload-complete",c,d),bp.Uploader.filesQueue.reset()}),void this.uploader.bind("Error",function(c,d){var e,f=a.strings.default_error,g={FAILED:a.strings.upload_failed,FILE_EXTENSION_ERROR:a.strings.invalid_filetype,IMAGE_FORMAT_ERROR:a.strings.not_an_image,IMAGE_MEMORY_ERROR:a.strings.image_memory_exceeded,IMAGE_DIMENSIONS_ERROR:a.strings.image_dimensions_exceeded,GENERIC_ERROR:a.strings.upload_failed,IO_ERROR:a.strings.io_error,HTTP_ERROR:a.strings.http_error,SECURITY_ERROR:a.strings.security_error,FILE_SIZE_ERROR:a.strings.file_exceeds_size_limit.replace("%s",d.file.name)};for(e in g)if(d.code===plupload[e]){f=g[e];break}b(a).trigger("bp-uploader-warning",f),c.refresh()})):void(BP_Uploader=void 0)},bp.Models.File=Backbone.Model.extend({file:{}}),b.extend(bp.Uploader,{filesQueue:new Backbone.Collection,filesUploaded:new Backbone.Collection,filesError:new Backbone.Collection}),bp.View=bp.Backbone.View.extend({inject:function(a){this.render(),b(a).html(this.el),this.views.ready()},prepare:function(){return!_.isUndefined(this.model)&&_.isFunction(this.model.toJSON)?this.model.toJSON():{}}}),bp.Views.Uploader=bp.View.extend({className:"bp-uploader-window",template:bp.template("upload-window"),defaults:_.pick(BP_Uploader.settings.defaults,"container","drop_element","browse_button"),initialize:function(){this.warnings=[],this.model=new Backbone.Model(this.defaults),this.on("ready",this.initUploader)},initUploader:function(){this.uploader=new bp.Uploader.uploader,b(this.uploader).on("bp-uploader-warning",_.bind(this.setWarning,this)),b(this.uploader).on("bp-uploader-new-upload",_.bind(this.resetWarning,this))},setWarning:function(a,b){if(!_.isUndefined(b)){var c=new bp.Views.uploaderWarning({value:b}).render();this.warnings.push(c),this.$el.after(c.el)}},resetWarning:function(){0!==this.warnings.length&&(_.each(this.warnings,function(a){a.remove()}),this.warnings=[])}}),bp.Views.uploaderWarning=bp.View.extend({tagName:"p",className:"warning",initialize:function(){this.value=this.options.value},render:function(){return this.$el.html(this.value),this}}),bp.Views.uploaderStatus=bp.View.extend({className:"files",initialize:function(){_.each(this.collection.models,this.addFile,this),this.collection.on("change:percent",this.progress,this),bp.Uploader.filesError.on("add",this.feedback,this)},addFile:function(a){this.views.add(new bp.Views.uploaderProgress({model:a}))},progress:function(a){_.isUndefined(a.get("percent"))||b("#"+a.get("id")+" .bp-progress .bp-bar").css("width",a.get("percent")+"%")},feedback:function(a){_.isUndefined(a.get("message"))||_.isUndefined(a.get("file"))||b("#"+a.get("file").id).html(a.get("message")).addClass("error")}}),bp.Views.uploaderProgress=bp.View.extend({className:"bp-uploader-progress",template:bp.template("progress-window")}))}(bp,jQuery);
1
+ /*! buddypress - v2.4.0 - 2015-10-22 1:39:20 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
window.wp=window.wp||{},window.bp=window.bp||{},function(a,b){"undefined"!=typeof BP_Uploader&&(_.extend(bp,_.pick(wp,"Backbone","ajax","template")),bp.Models=bp.Models||{},bp.Collections=bp.Collections||{},bp.Views=bp.Views||{},bp.Uploader={},bp.Uploader.uploader=function(){var a=this,c=-1!==navigator.userAgent.indexOf("Trident/")||-1!==navigator.userAgent.indexOf("MSIE ");return this.params=BP_Uploader.settings,this.strings=BP_Uploader.strings,this.supports={upload:this.params.browser.supported},this.supported=this.supports.upload,this.supported?(c||"flash"!==plupload.predictRuntime(this.params.defaults)||this.params.defaults.required_features&&this.params.defaults.required_features.hasOwnProperty("send_binary_string")||(this.params.defaults.required_features=this.params.defaults.required_features||{},this.params.defaults.required_features.send_binary_string=!0),this.uploader=new plupload.Uploader(this.params.defaults),this.uploader.bind("Init",function(c){var d=b("#"+a.params.defaults.container),e=b("#"+a.params.defaults.drop_element);"html4"===c.runtime&&(c.settings.multipart_params.html4=!0),"bp_avatar_upload"===c.settings.multipart_params.action&&(c.settings.multipart_params.bp_params.ui_available_width=d.width()),c.features.dragdrop&&!a.params.browser.mobile?(d.addClass("drag-drop"),e.bind("dragover.wp-uploader",function(){d.addClass("drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){d.removeClass("drag-over")})):(d.removeClass("drag-drop"),e.unbind(".wp-uploader"))}),this.uploader.init(),this.feedback=function(a,b,c){!_.isNull(c)&&c.item&&c.item.clear(),bp.Uploader.filesError.unshift({message:a,data:b,file:c})},this.uploader.bind("FilesAdded",function(c,d){var e=104857600,f=parseInt(c.settings.max_file_size,10),g=this;if(!c.settings.multi_selection&&d.length>1){for(var h in d)c.removeFile(d[h]);return void b(a).trigger("bp-uploader-warning",a.strings.unique_file_warning)}_.each(d,function(a){var b;plupload.FAILED!==a.status&&(f>e&&a.size>e&&"html5"!==c.runtime?g.uploadSizeError(c,a,!0):(b=_.extend({id:a.id,file:a,uploading:!0,date:new Date,filename:a.name},_.pick(a,"loaded","size","percent")),a.item=new bp.Models.File(b),bp.Uploader.filesQueue.add(a.item)))}),c.refresh(),c.start()}),this.uploader.bind("UploadProgress",function(a,b){b.item.set(_.pick(b,"loaded","percent"))}),this.uploader.bind("FileUploaded",function(b,c,d){var e=a.strings.default_error;try{d=JSON.parse(d.response)}catch(f){return a.feedback(e,f,c)}return!_.isObject(d)||_.isUndefined(d.success)?a.feedback(e,null,c):d.success?(_.each(["file","loaded","size","percent"],function(a){c.item.unset(a)}),c.item.set(_.extend(d.data,{uploading:!1})),void bp.Uploader.filesUploaded.add(c.item)):(d.data&&d.data.message&&(e=d.data.message),a.feedback(e,d.data,c))}),this.uploader.bind("BeforeUpload",function(c,d){b(a).trigger("bp-uploader-new-upload",c,d)}),this.uploader.bind("UploadComplete",function(c,d){b(a).trigger("bp-uploader-upload-complete",c,d),bp.Uploader.filesQueue.reset()}),void this.uploader.bind("Error",function(c,d){var e,f=a.strings.default_error,g={FAILED:a.strings.upload_failed,FILE_EXTENSION_ERROR:a.strings.invalid_filetype,IMAGE_FORMAT_ERROR:a.strings.not_an_image,IMAGE_MEMORY_ERROR:a.strings.image_memory_exceeded,IMAGE_DIMENSIONS_ERROR:a.strings.image_dimensions_exceeded,GENERIC_ERROR:a.strings.upload_failed,IO_ERROR:a.strings.io_error,HTTP_ERROR:a.strings.http_error,SECURITY_ERROR:a.strings.security_error,FILE_SIZE_ERROR:a.strings.file_exceeds_size_limit.replace("%s",d.file.name)};for(e in g)if(d.code===plupload[e]){f=g[e];break}b(a).trigger("bp-uploader-warning",f),c.refresh()})):void(BP_Uploader=void 0)},bp.Models.File=Backbone.Model.extend({file:{}}),b.extend(bp.Uploader,{filesQueue:new Backbone.Collection,filesUploaded:new Backbone.Collection,filesError:new Backbone.Collection}),bp.View=bp.Backbone.View.extend({inject:function(a){this.render(),b(a).html(this.el),this.views.ready()},prepare:function(){return!_.isUndefined(this.model)&&_.isFunction(this.model.toJSON)?this.model.toJSON():{}}}),bp.Views.Uploader=bp.View.extend({className:"bp-uploader-window",template:bp.template("upload-window"),defaults:_.pick(BP_Uploader.settings.defaults,"container","drop_element","browse_button"),initialize:function(){this.warnings=[],this.model=new Backbone.Model(this.defaults),this.on("ready",this.initUploader)},initUploader:function(){this.uploader=new bp.Uploader.uploader,b(this.uploader).on("bp-uploader-warning",_.bind(this.setWarning,this)),b(this.uploader).on("bp-uploader-new-upload",_.bind(this.resetWarning,this))},setWarning:function(a,b){if(!_.isUndefined(b)){var c=new bp.Views.uploaderWarning({value:b}).render();this.warnings.push(c),this.$el.after(c.el)}},resetWarning:function(){0!==this.warnings.length&&(_.each(this.warnings,function(a){a.remove()}),this.warnings=[])}}),bp.Views.uploaderWarning=bp.View.extend({tagName:"p",className:"warning",initialize:function(){this.value=this.options.value},render:function(){return this.$el.html(this.value),this}}),bp.Views.uploaderStatus=bp.View.extend({className:"files",initialize:function(){_.each(this.collection.models,this.addFile,this),this.collection.on("change:percent",this.progress,this),bp.Uploader.filesError.on("add",this.feedback,this)},addFile:function(a){this.views.add(new bp.Views.uploaderProgress({model:a}))},progress:function(a){_.isUndefined(a.get("percent"))||b("#"+a.get("id")+" .bp-progress .bp-bar").css("width",a.get("percent")+"%")},feedback:function(a){_.isUndefined(a.get("message"))||_.isUndefined(a.get("file"))||b("#"+a.get("file").id).html(a.get("message")).addClass("error")}}),bp.Views.uploaderProgress=bp.View.extend({className:"bp-uploader-progress",template:bp.template("progress-window")}))}(bp,jQuery);
bp-core/js/confirm.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! buddypress - v2.4.0 - 2015-10-12 8:03:39 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
jQuery(document).ready(function(){jQuery("a.confirm").click(function(){return confirm(BP_Confirm.are_you_sure)?!0:!1})});
1
+ /*! buddypress - v2.4.0 - 2015-10-22 1:39:20 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
jQuery(document).ready(function(){jQuery("a.confirm").click(function(){return confirm(BP_Confirm.are_you_sure)?!0:!1})});
bp-core/js/cover-image.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! buddypress - v2.4.0 - 2015-10-12 8:03:39 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
window.bp=window.bp||{},function(a,b){"undefined"!=typeof BP_Uploader&&(bp.Models=bp.Models||{},bp.Collections=bp.Collections||{},bp.Views=bp.Views||{},bp.CoverImage={start:function(){this.views=new Backbone.Collection,this.warning=null,this.Attachment=new Backbone.Model,this.uploaderView(),this.displayWarning(BP_Uploader.strings.cover_image_warnings.dimensions),!0===BP_Uploader.settings.defaults.multipart_params.bp_params.has_cover_image&&this.deleteView()},uploaderView:function(){bp.Uploader.filesQueue.on("add",this.uploadProgress,this);var a=new bp.Views.Uploader;this.views.add({id:"upload",view:a}),a.inject(".bp-cover-image")},uploadProgress:function(){var a=new bp.Views.coverImageUploadProgress({collection:bp.Uploader.filesQueue});_.isUndefined(this.views.get("status"))?this.views.add({id:"status",view:a}):this.views.set({id:"status",view:a}),a.inject(".bp-cover-image-status")},deleteView:function(){var a=new Backbone.Model(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,["object","item_id","nonces"]));if(_.isUndefined(this.views.get("delete"))){var b=new bp.Views.DeleteCoverImage({model:a});this.views.add({id:"delete",view:b}),b.inject(".bp-cover-image-manage")}},deleteCoverImage:function(a){var c,d=this;_.isUndefined(this.views.get("delete"))||(c=this.views.get("delete"),c.get("view").remove(),this.views.remove({id:"delete",view:c})),bp.ajax.post("bp_cover_image_delete",{json:!0,item_id:a.get("item_id"),object:a.get("object"),nonce:a.get("nonces").remove}).done(function(c){var e=new bp.Views.CoverImageStatus({value:BP_Uploader.strings.feedback_messages[c.feedback_code],type:"success"});d.views.add({id:"status",view:e}),e.inject(".bp-cover-image-status"),""===c.reset_url?b("#header-cover-image").css({"background-image":"none"}):b("#header-cover-image").css({"background-image":"url( "+c.reset_url+" )"}),BP_Uploader.settings.defaults.multipart_params.bp_params.has_cover_image=!1,d.Attachment.set(_.extend(_.pick(a.attributes,["object","item_id"]),{url:c.reset_url,action:"deleted"}))}).fail(function(a){var b=BP_Uploader.strings.default_error;_.isUndefined(a)||(b=BP_Uploader.strings.feedback_messages[a.feedback_code]);var c=new bp.Views.CoverImageStatus({value:b,type:"error"});d.views.add({id:"status",view:c}),c.inject(".bp-cover-image-status"),bp.CoverImage.deleteView()})},removeWarning:function(){_.isNull(this.warning)||this.warning.remove()},displayWarning:function(a){this.removeWarning(),this.warning=new bp.Views.uploaderWarning({value:a}),this.warning.inject(".bp-cover-image-status")}},bp.Views.coverImageUploadProgress=bp.Views.uploaderStatus.extend({className:"files",initialize:function(){bp.Views.uploaderStatus.prototype.initialize.apply(this,arguments),this.collection.on("change:url",this.uploadResult,this)},uploadResult:function(a){var c,d;_.isUndefined(a.get("url"))||(0===a.get("feedback_code")?(c=BP_Uploader.strings.cover_image_warnings.dimensions,d="warning"):(c=BP_Uploader.strings.feedback_messages[a.get("feedback_code")],d="success"),this.views.set(".bp-uploader-progress",new bp.Views.CoverImageStatus({value:c,type:d})),b("#header-cover-image").css({"background-image":"url( "+a.get("url")+" )"}),bp.CoverImage.deleteView(),bp.CoverImage.Attachment.set(_.extend(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,["object","item_id"]),{url:a.get("url"),action:"uploaded"})))}}),bp.Views.CoverImageStatus=bp.View.extend({tagName:"p",className:"updated",id:"bp-cover-image-feedback",initialize:function(){this.el.className+=" "+this.options.type,this.value=this.options.value},render:function(){return this.$el.html(this.value),this}}),bp.Views.DeleteCoverImage=bp.View.extend({tagName:"div",id:"bp-delete-cover-image-container",template:bp.template("bp-cover-image-delete"),events:{"click #bp-delete-cover-image":"deleteCoverImage"},deleteCoverImage:function(a){a.preventDefault(),bp.CoverImage.deleteCoverImage(this.model)}}),bp.CoverImage.start())}(bp,jQuery);
1
+ /*! buddypress - v2.4.0 - 2015-10-22 1:39:20 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
window.bp=window.bp||{},function(a,b){"undefined"!=typeof BP_Uploader&&(bp.Models=bp.Models||{},bp.Collections=bp.Collections||{},bp.Views=bp.Views||{},bp.CoverImage={start:function(){this.views=new Backbone.Collection,this.warning=null,this.Attachment=new Backbone.Model,this.uploaderView(),this.displayWarning(BP_Uploader.strings.cover_image_warnings.dimensions),!0===BP_Uploader.settings.defaults.multipart_params.bp_params.has_cover_image&&this.deleteView()},uploaderView:function(){bp.Uploader.filesQueue.on("add",this.uploadProgress,this);var a=new bp.Views.Uploader;this.views.add({id:"upload",view:a}),a.inject(".bp-cover-image")},uploadProgress:function(){var a=new bp.Views.coverImageUploadProgress({collection:bp.Uploader.filesQueue});_.isUndefined(this.views.get("status"))?this.views.add({id:"status",view:a}):this.views.set({id:"status",view:a}),a.inject(".bp-cover-image-status")},deleteView:function(){var a=new Backbone.Model(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,["object","item_id","nonces"]));if(_.isUndefined(this.views.get("delete"))){var b=new bp.Views.DeleteCoverImage({model:a});this.views.add({id:"delete",view:b}),b.inject(".bp-cover-image-manage")}},deleteCoverImage:function(a){var c,d=this;_.isUndefined(this.views.get("delete"))||(c=this.views.get("delete"),c.get("view").remove(),this.views.remove({id:"delete",view:c})),bp.ajax.post("bp_cover_image_delete",{json:!0,item_id:a.get("item_id"),object:a.get("object"),nonce:a.get("nonces").remove}).done(function(c){var e=new bp.Views.CoverImageStatus({value:BP_Uploader.strings.feedback_messages[c.feedback_code],type:"success"});d.views.add({id:"status",view:e}),e.inject(".bp-cover-image-status"),""===c.reset_url?b("#header-cover-image").css({"background-image":"none"}):b("#header-cover-image").css({"background-image":"url( "+c.reset_url+" )"}),BP_Uploader.settings.defaults.multipart_params.bp_params.has_cover_image=!1,d.Attachment.set(_.extend(_.pick(a.attributes,["object","item_id"]),{url:c.reset_url,action:"deleted"}))}).fail(function(a){var b=BP_Uploader.strings.default_error;_.isUndefined(a)||(b=BP_Uploader.strings.feedback_messages[a.feedback_code]);var c=new bp.Views.CoverImageStatus({value:b,type:"error"});d.views.add({id:"status",view:c}),c.inject(".bp-cover-image-status"),bp.CoverImage.deleteView()})},removeWarning:function(){_.isNull(this.warning)||this.warning.remove()},displayWarning:function(a){this.removeWarning(),this.warning=new bp.Views.uploaderWarning({value:a}),this.warning.inject(".bp-cover-image-status")}},bp.Views.coverImageUploadProgress=bp.Views.uploaderStatus.extend({className:"files",initialize:function(){bp.Views.uploaderStatus.prototype.initialize.apply(this,arguments),this.collection.on("change:url",this.uploadResult,this)},uploadResult:function(a){var c,d;_.isUndefined(a.get("url"))||(0===a.get("feedback_code")?(c=BP_Uploader.strings.cover_image_warnings.dimensions,d="warning"):(c=BP_Uploader.strings.feedback_messages[a.get("feedback_code")],d="success"),this.views.set(".bp-uploader-progress",new bp.Views.CoverImageStatus({value:c,type:d})),b("#header-cover-image").css({"background-image":"url( "+a.get("url")+" )"}),bp.CoverImage.deleteView(),bp.CoverImage.Attachment.set(_.extend(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,["object","item_id"]),{url:a.get("url"),action:"uploaded"})))}}),bp.Views.CoverImageStatus=bp.View.extend({tagName:"p",className:"updated",id:"bp-cover-image-feedback",initialize:function(){this.el.className+=" "+this.options.type,this.value=this.options.value},render:function(){return this.$el.html(this.value),this}}),bp.Views.DeleteCoverImage=bp.View.extend({tagName:"div",id:"bp-delete-cover-image-container",template:bp.template("bp-cover-image-delete"),events:{"click #bp-delete-cover-image":"deleteCoverImage"},deleteCoverImage:function(a){a.preventDefault(),bp.CoverImage.deleteCoverImage(this.model)}}),bp.CoverImage.start())}(bp,jQuery);
bp-core/js/jquery-cookie.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! buddypress - v2.4.0 - 2015-10-12 8:03:39 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){function b(a){return h.raw?a:encodeURIComponent(a)}function c(a){return h.raw?a:decodeURIComponent(a)}function d(a){return b(h.json?JSON.stringify(a):String(a))}function e(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return a=decodeURIComponent(a.replace(g," ")),h.json?JSON.parse(a):a}catch(b){}}function f(b,c){var d=h.raw?b:e(b);return a.isFunction(c)?c(d):d}var g=/\+/g,h=a.cookie=function(e,g,i){if(void 0!==g&&!a.isFunction(g)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setTime(+k+864e5*j)}return document.cookie=[b(e),"=",d(g),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=e?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=c(p.shift()),r=p.join("=");if(e&&e===q){l=f(r,g);break}e||void 0===(r=f(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0===a.cookie(b)?!1:(a.cookie(b,"",a.extend({},c,{expires:-1})),!a.cookie(b))}});
1
+ /*! buddypress - v2.4.0 - 2015-10-22 1:39:20 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){function b(a){return h.raw?a:encodeURIComponent(a)}function c(a){return h.raw?a:decodeURIComponent(a)}function d(a){return b(h.json?JSON.stringify(a):String(a))}function e(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return a=decodeURIComponent(a.replace(g," ")),h.json?JSON.parse(a):a}catch(b){}}function f(b,c){var d=h.raw?b:e(b);return a.isFunction(c)?c(d):d}var g=/\+/g,h=a.cookie=function(e,g,i){if(void 0!==g&&!a.isFunction(g)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setTime(+k+864e5*j)}return document.cookie=[b(e),"=",d(g),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=e?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=c(p.shift()),r=p.join("=");if(e&&e===q){l=f(r,g);break}e||void 0===(r=f(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0===a.cookie(b)?!1:(a.cookie(b,"",a.extend({},c,{expires:-1})),!a.cookie(b))}});
bp-core/js/jquery-query.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! buddypress - v2.4.0 - 2015-10-12 8:03:39 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
function bp_get_querystring(a){var b=location.search.split(a+"=")[1];return b?decodeURIComponent(b.split("&")[0]):null}
1
+ /*! buddypress - v2.4.0 - 2015-10-22 1:39:20 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
function bp_get_querystring(a){var b=location.search.split(a+"=")[1];return b?decodeURIComponent(b.split("&")[0]):null}
bp-core/js/jquery-scroll-to.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! buddypress - v2.4.0 - 2015-10-12 8:03:39 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){function b(b){return a.isFunction(b)||"object"==typeof b?b:{top:b,left:b}}var c=a.scrollTo=function(b,c,d){return a(window).scrollTo(b,c,d)};return c.defaults={axis:"xy",duration:parseFloat(a.fn.jquery)>=1.3?0:1,limit:!0},c.window=function(){return a(window)._scrollable()},a.fn._scrollable=function(){return this.map(function(){var b=this,c=!b.nodeName||-1!==a.inArray(b.nodeName.toLowerCase(),["iframe","#document","html","body"]);if(!c)return b;var d=(b.contentWindow||b).document||b.ownerDocument||b;return/webkit/i.test(navigator.userAgent)||"BackCompat"===d.compatMode?d.body:d.documentElement})},a.fn.scrollTo=function(d,e,f){return"object"==typeof e&&(f=e,e=0),"function"==typeof f&&(f={onAfter:f}),"max"===d&&(d=9e9),f=a.extend({},c.defaults,f),e=e||f.duration,f.queue=f.queue&&f.axis.length>1,f.queue&&(e/=2),f.offset=b(f.offset),f.over=b(f.over),this._scrollable().each(function(){function g(a){j.animate(l,e,f.easing,a&&function(){a.call(this,k,f)})}if(null!==d){var h,i=this,j=a(i),k=d,l={},m=j.is("html,body");switch(typeof k){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?#x2F;.test(k)){k=b(k);break}if(k=m?a(k):a(k,this),!k.length)return;case"object":(k.is||k.style)&&(h=(k=a(k)).offset())}var n=a.isFunction(f.offset)&&f.offset(i,k)||f.offset;a.each(f.axis.split(""),function(a,b){var d="x"===b?"Left":"Top",e=d.toLowerCase(),o="scroll"+d,p=i[o],q=c.max(i,b);if(h)l[o]=h[e]+(m?0:p-j.offset()[e]),f.margin&&(l[o]-=parseInt(k.css("margin"+d))||0,l[o]-=parseInt(k.css("border"+d+"Width"))||0),l[o]+=n[e]||0,f.over[e]&&(l[o]+=k["x"===b?"width":"height"]()*f.over[e]);else{var r=k[e];l[o]=r.slice&&"%"===r.slice(-1)?parseFloat(r)/100*q:r}f.limit&&/^\d+#x2F;.test(l[o])&&(l[o]=l[o]<=0?0:Math.min(l[o],q)),!a&&f.queue&&(p!==l[o]&&g(f.onAfterFirst),delete l[o])}),g(f.onAfter)}}).end()},c.max=function(b,c){var d="x"===c?"Width":"Height",e="scroll"+d;if(!a(b).is("html,body"))return b[e]-a(b)[d.toLowerCase()]();var f="client"+d,g=b.ownerDocument.documentElement,h=b.ownerDocument.body;return Math.max(g[e],h[e])-Math.min(g[f],h[f])},c});
1
+ /*! buddypress - v2.4.0 - 2015-10-22 1:39:20 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){function b(b){return a.isFunction(b)||"object"==typeof b?b:{top:b,left:b}}var c=a.scrollTo=function(b,c,d){return a(window).scrollTo(b,c,d)};return c.defaults={axis:"xy",duration:parseFloat(a.fn.jquery)>=1.3?0:1,limit:!0},c.window=function(){return a(window)._scrollable()},a.fn._scrollable=function(){return this.map(function(){var b=this,c=!b.nodeName||-1!==a.inArray(b.nodeName.toLowerCase(),["iframe","#document","html","body"]);if(!c)return b;var d=(b.contentWindow||b).document||b.ownerDocument||b;return/webkit/i.test(navigator.userAgent)||"BackCompat"===d.compatMode?d.body:d.documentElement})},a.fn.scrollTo=function(d,e,f){return"object"==typeof e&&(f=e,e=0),"function"==typeof f&&(f={onAfter:f}),"max"===d&&(d=9e9),f=a.extend({},c.defaults,f),e=e||f.duration,f.queue=f.queue&&f.axis.length>1,f.queue&&(e/=2),f.offset=b(f.offset),f.over=b(f.over),this._scrollable().each(function(){function g(a){j.animate(l,e,f.easing,a&&function(){a.call(this,k,f)})}if(null!==d){var h,i=this,j=a(i),k=d,l={},m=j.is("html,body");switch(typeof k){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?#x2F;.test(k)){k=b(k);break}if(k=m?a(k):a(k,this),!k.length)return;case"object":(k.is||k.style)&&(h=(k=a(k)).offset())}var n=a.isFunction(f.offset)&&f.offset(i,k)||f.offset;a.each(f.axis.split(""),function(a,b){var d="x"===b?"Left":"Top",e=d.toLowerCase(),o="scroll"+d,p=i[o],q=c.max(i,b);if(h)l[o]=h[e]+(m?0:p-j.offset()[e]),f.margin&&(l[o]-=parseInt(k.css("margin"+d))||0,l[o]-=parseInt(k.css("border"+d+"Width"))||0),l[o]+=n[e]||0,f.over[e]&&(l[o]+=k["x"===b?"width":"height"]()*f.over[e]);else{var r=k[e];l[o]=r.slice&&"%"===r.slice(-1)?parseFloat(r)/100*q:r}f.limit&&/^\d+#x2F;.test(l[o])&&(l[o]=l[o]<=0?0:Math.min(l[o],q)),!a&&f.queue&&(p!==l[o]&&g(f.onAfterFirst),delete l[o])}),g(f.onAfter)}}).end()},c.max=function(b,c){var d="x"===c?"Width":"Height",e="scroll"+d;if(!a(b).is("html,body"))return b[e]-a(b)[d.toLowerCase()]();var f="client"+d,g=b.ownerDocument.documentElement,h=b.ownerDocument.body;return Math.max(g[e],h[e])-Math.min(g[f],h[f])},c});
bp-core/js/jquery.atwho.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! buddypress - v2.4.0 - 2015-10-12 8:03:39 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(c){return a.returnExportsGlobal=b(c)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){var b,c,d,e,f,g,h,i=[].slice;c=function(){function b(b){this.current_flag=null,this.controllers={},this.alias_maps={},this.$inputor=a(b),this.setIframe(),this.listen()}return b.prototype.createContainer=function(b){return 0===(this.$el=a("#atwho-container",b)).length?a(b.body).append(this.$el=a("<div id='atwho-container'></div>")):void 0},b.prototype.setIframe=function(a,b){var c;return null==b&&(b=!1),a?(this.window=a.contentWindow,this.document=a.contentDocument||this.window.document,this.iframe=a):(this.document=document,this.window=window,this.iframe=null),(this.iframeStandalone=b)?(null!=(c=this.$el)&&c.remove(),this.createContainer(this.document)):this.createContainer(document)},b.prototype.controller=function(a){var b,c,d,e;if(this.alias_maps[a])c=this.controllers[this.alias_maps[a]];else{e=this.controllers;for(d in e)if(b=e[d],d===a){c=b;break}}return c?c:this.controllers[this.current_flag]},b.prototype.set_context_for=function(a){return this.current_flag=a,this},b.prototype.reg=function(a,b){var c,e;return c=(e=this.controllers)[a]||(e[a]=new d(this,a)),b.alias&&(this.alias_maps[b.alias]=a),c.init(b),this},b.prototype.listen=function(){return this.$inputor.on("keyup.atwhoInner",function(a){return function(b){return a.on_keyup(b)}}(this)).on("keydown.atwhoInner",function(a){return function(b){return a.on_keydown(b)}}(this)).on("scroll.atwhoInner",function(a){return function(b){var c;return null!=(c=a.controller())?c.view.hide(b):void 0}}(this)).on("blur.atwhoInner",function(a){return function(b){var c;return(c=a.controller())?c.view.hide(b,c.get_opt("display_timeout")):void 0}}(this)).on("click.atwhoInner",function(a){return function(b){return a.dispatch()}}(this))},b.prototype.shutdown=function(){var a,b,c;c=this.controllers;for(b in c)a=c[b],a.destroy(),delete this.controllers[b];return this.$inputor.off(".atwhoInner"),this.$el.remove()},b.prototype.dispatch=function(){return a.map(this.controllers,function(a){return function(b){var c;return(c=b.get_opt("delay"))?(clearTimeout(a.delayedCallback),a.delayedCallback=setTimeout(function(){return b.look_up()?a.set_context_for(b.at):void 0},c)):b.look_up()?a.set_context_for(b.at):void 0}}(this))},b.prototype.on_keyup=function(b){var c;switch(b.keyCode){case f.ESC:b.preventDefault(),null!=(c=this.controller())&&c.view.hide();break;case f.DOWN:case f.UP:case f.CTRL:a.noop();break;case f.P:case f.N:b.ctrlKey||this.dispatch();break;default:this.dispatch()}},b.prototype.on_keydown=function(b){var c,d;if(c=null!=(d=this.controller())?d.view:void 0,c&&c.visible())switch(b.keyCode){case f.ESC:b.preventDefault(),c.hide(b);break;case f.UP:b.preventDefault(),c.prev();break;case f.DOWN:b.preventDefault(),c.next();break;case f.P:if(!b.ctrlKey)return;b.preventDefault(),c.prev();break;case f.N:if(!b.ctrlKey)return;b.preventDefault(),c.next();break;case f.TAB:case f.ENTER:if(!c.visible())return;b.preventDefault(),c.choose(b);break;default:a.noop()}},b}(),d=function(){function b(b,c){this.app=b,this.at=c,this.$inputor=this.app.$inputor,this.id=this.$inputor[0].id||this.uid(),this.setting=null,this.query=null,this.pos=0,this.cur_rect=null,this.range=null,0===(this.$el=a("#atwho-ground-"+this.id,this.app.$el)).length&&this.app.$el.append(this.$el=a("<div id='atwho-ground-"+this.id+"'></div>")),this.model=new g(this),this.view=new h(this)}return b.prototype.uid=function(){return(Math.random().toString(16)+"000000000").substr(2,8)+(new Date).getTime()},b.prototype.init=function(b){return this.setting=a.extend({},this.setting||a.fn.atwho["default"],b),this.view.init(),this.model.reload(this.setting.data)},b.prototype.destroy=function(){return this.trigger("beforeDestroy"),this.model.destroy(),this.view.destroy(),this.$el.remove()},b.prototype.call_default=function(){var b,c,d;d=arguments[0],b=2<=arguments.length?i.call(arguments,1):[];try{return e[d].apply(this,b)}catch(f){return c=f,a.error(""+c+" Or maybe At.js doesn't have function "+d)}},b.prototype.trigger=function(a,b){var c,d;return null==b&&(b=[]),b.push(this),c=this.get_opt("alias"),d=c?""+a+"-"+c+".atwho":""+a+".atwho",this.$inputor.trigger(d,b)},b.prototype.callbacks=function(a){return this.get_opt("callbacks")[a]||e[a]},b.prototype.get_opt=function(a,b){var c;try{return this.setting[a]}catch(d){return c=d,null}},b.prototype.content=function(){var a;if(this.$inputor.is("textarea, input"))return this.$inputor.val();if(a=this.mark_range())return(a.startContainer.textContent||"").slice(0,a.startOffset)},b.prototype.catch_query=function(){var a,b,c,d,e,f;return b=this.content(),a=this.$inputor.caret("pos",{iframe:this.app.iframe}),f=b.slice(0,a),d=this.callbacks("matcher").call(this,this.at,f,this.get_opt("start_with_space")),"string"==typeof d&&d.length<=this.get_opt("max_len",20)?(e=a-d.length,c=e+d.length,this.pos=e,d={text:d,head_pos:e,end_pos:c},this.trigger("matched",[this.at,d.text])):(d=null,this.view.hide()),this.query=d},b.prototype.rect=function(){var b,c,d;if(b=this.$inputor.caret("offset",this.pos-1,{iframe:this.app.iframe}))return this.app.iframe&&!this.app.iframeStandalone&&(c=a(this.app.iframe).offset(),b.left+=c.left,b.top+=c.top),this.$inputor.is("[contentEditable]")&&(b=this.cur_rect||(this.cur_rect=b)),d=this.app.document.selection?0:2,{left:b.left,top:b.top,bottom:b.top+b.height+d}},b.prototype.reset_rect=function(){return this.$inputor.is("[contentEditable]")?this.cur_rect=null:void 0},b.prototype.mark_range=function(){var a;if(this.$inputor.is("[contentEditable]"))return this.app.window.getSelection&&(a=this.app.window.getSelection()).rangeCount>0?this.range=a.getRangeAt(0):this.app.document.selection?this.ie8_range=this.app.document.selection.createRange():void 0},b.prototype.insert_content_for=function(b){var c,d,e;return d=b.data("value"),e=this.get_opt("insert_tpl"),this.$inputor.is("textarea, input")||!e?d:(c=a.extend({},b.data("item-data"),{"atwho-data-value":d,"atwho-at":this.at}),this.callbacks("tpl_eval").call(this,e,c))},b.prototype.insert=function(b,c){var d,e,f,g,h,i,j,k,l,m,n,o;if(d=this.$inputor,l=this.callbacks("inserting_wrapper").call(this,d,b,this.get_opt("suffix")),d.is("textarea, input"))i=d.val(),j=i.slice(0,Math.max(this.query.head_pos-this.at.length,0)),k=""+j+l+i.slice(this.query.end_pos||0),d.val(k),d.caret("pos",j.length+l.length,{iframe:this.app.iframe});else if(g=this.range){for(f=g.startOffset-(this.query.end_pos-this.query.head_pos)-this.at.length,g.setStart(g.endContainer,Math.max(f,0)),g.setEnd(g.endContainer,g.endOffset),g.deleteContents(),o=a(l,this.app.document),m=0,n=o.length;n>m;m++)e=o[m],g.insertNode(e),g.setEndAfter(e),g.collapse(!1);h=this.app.window.getSelection(),h.removeAllRanges(),h.addRange(g)}else(g=this.ie8_range)&&(g.moveStart("character",this.query.end_pos-this.query.head_pos-this.at.length),g.pasteHTML(l),g.collapse(!1),g.select());return d.is(":focus")||d.focus(),d.change()},b.prototype.render_view=function(a){var b;return b=this.get_opt("search_key"),a=this.callbacks("sorter").call(this,this.query.text,a.slice(0,1001),b),this.view.render(a.slice(0,this.get_opt("limit")))},b.prototype.look_up=function(){var b,c;if(b=this.catch_query())return c=function(a){return a&&a.length>0?this.render_view(a):this.view.hide()},this.model.query(b.text,a.proxy(c,this)),b},b}(),g=function(){function b(a){this.context=a,this.at=this.context.at,this.storage=this.context.$inputor}return b.prototype.destroy=function(){return this.storage.data(this.at,null)},b.prototype.saved=function(){return this.fetch()>0},b.prototype.query=function(a,b){var c,d,e;return c=this.fetch(),d=this.context.get_opt("search_key"),c=this.context.callbacks("filter").call(this.context,a,c,d)||[],e=this.context.callbacks("remote_filter"),c.length>0||!e&&0===c.length?b(c):e.call(this.context,a,b)},b.prototype.fetch=function(){return this.storage.data(this.at)||[]},b.prototype.save=function(a){return this.storage.data(this.at,this.context.callbacks("before_save").call(this.context,a||[]))},b.prototype.load=function(a){return!this.saved()&&a?this._load(a):void 0},b.prototype.reload=function(a){return this._load(a)},b.prototype._load=function(b){return"string"==typeof b?a.ajax(b,{dataType:"json"}).done(function(a){return function(b){return a.save(b)}}(this)):this.save(b)},b}(),h=function(){function b(b){this.context=b,this.$el=a("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>"),this.timeout_id=null,this.context.$el.append(this.$el),this.bind_event()}return b.prototype.init=function(){var a;return a=this.context.get_opt("alias")||this.context.at.charCodeAt(0),this.$el.attr({id:"at-view-"+a})},b.prototype.destroy=function(){return this.$el.remove()},b.prototype.bind_event=function(){var b;return b=this.$el.find("ul"),b.on("mouseenter.atwho-view","li",function(c){return b.find(".cur").removeClass("cur"),a(c.currentTarget).addClass("cur")}).on("click.atwho-view","li",function(c){return function(d){return b.find(".cur").removeClass("cur"),a(d.currentTarget).addClass("cur"),c.choose(d),d.preventDefault()}}(this))},b.prototype.visible=function(){return this.$el.is(":visible")},b.prototype.choose=function(a){var b,c;return(b=this.$el.find(".cur")).length&&(c=this.context.insert_content_for(b),this.context.insert(this.context.callbacks("before_insert").call(this.context,c,b),b),this.context.trigger("inserted",[b,a]),this.hide(a)),this.context.get_opt("hide_without_suffix")?this.stop_showing=!0:void 0},b.prototype.reposition=function(b){var c,d,e,f;return f=this.context.app.iframeStandalone?this.context.app.window:window,b.bottom+this.$el.height()-a(f).scrollTop()>a(f).height()&&(b.bottom=b.top-this.$el.height()),b.left>(d=a(f).width()-this.$el.width()-5)&&(b.left=d),c={left:b.left,top:b.bottom},null!=(e=this.context.callbacks("before_reposition"))&&e.call(this.context,c),this.$el.offset(c),this.context.trigger("reposition",[c])},b.prototype.next=function(){var a,b;return a=this.$el.find(".cur").removeClass("cur"),b=a.next(),b.length||(b=this.$el.find("li:first")),b.addClass("cur"),this.$el.animate({scrollTop:Math.max(0,a.innerHeight()*(b.index()+2)-this.$el.height())},150)},b.prototype.prev=function(){var a,b;return a=this.$el.find(".cur").removeClass("cur"),b=a.prev(),b.length||(b=this.$el.find("li:last")),b.addClass("cur"),this.$el.animate({scrollTop:Math.max(0,a.innerHeight()*(b.index()+2)-this.$el.height())},150)},b.prototype.show=function(){var a;return this.stop_showing?void(this.stop_showing=!1):(this.context.mark_range(),this.visible()||(this.$el.show(),this.$el.scrollTop(0),this.context.trigger("shown")),(a=this.context.rect())?this.reposition(a):void 0)},b.prototype.hide=function(a,b){var c;if(this.visible())return isNaN(b)?(this.context.reset_rect(),this.$el.hide(),this.context.trigger("hidden",[a])):(c=function(a){return function(){return a.hide()}}(this),clearTimeout(this.timeout_id),this.timeout_id=setTimeout(c,b))},b.prototype.render=function(b){var c,d,e,f,g,h,i;if(!(a.isArray(b)&&b.length>0))return void this.hide();for(this.$el.find("ul").empty(),d=this.$el.find("ul"),g=this.context.get_opt("tpl"),h=0,i=b.length;i>h;h++)e=b[h],e=a.extend({},e,{"atwho-at":this.context.at}),f=this.context.callbacks("tpl_eval").call(this.context,g,e),c=a(this.context.callbacks("highlighter").call(this.context,f,this.context.query.text)),c.data("item-data",e),d.append(c);return this.show(),this.context.get_opt("highlight_first")?d.find("li:first").addClass("cur"):void 0},b}(),f={DOWN:40,UP:38,ESC:27,TAB:9,ENTER:13,CTRL:17,P:80,N:78},e={before_save:function(b){var c,d,e,f;if(!a.isArray(b))return b;for(f=[],d=0,e=b.length;e>d;d++)c=b[d],a.isPlainObject(c)?f.push(c):f.push({name:c});return f},matcher:function(a,b,c){var d,e,f,g;return a=a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\amp;"),c&&(a="(?:^|\\s)"+a),f=decodeURI("%C3%80"),g=decodeURI("%C3%BF"),e=new RegExp(""+a+"([A-Za-z"+f+"-"+g+"0-9_+-]*)$|"+a+"([^\\x00-\\xff]*)quot;,"gi"),d=e.exec(b),d?d[2]||d[1]:null},filter:function(a,b,c){var d,e,f,g;for(g=[],e=0,f=b.length;f>e;e++)d=b[e],~new String(d[c]).toLowerCase().indexOf(a.toLowerCase())&&g.push(d);return g},remote_filter:null,sorter:function(a,b,c){var d,e,f,g;if(!a)return b;for(g=[],e=0,f=b.length;f>e;e++)d=b[e],d.atwho_order=new String(d[c]).toLowerCase().indexOf(a.toLowerCase()),d.atwho_order>-1&&g.push(d);return g.sort(function(a,b){return a.atwho_order-b.atwho_order})},tpl_eval:function(a,b){var c;try{return a.replace(/\$\{([^\}]*)\}/g,function(a,c,d){return b[c]})}catch(d){return c=d,""}},highlighter:function(a,b){var c;return b?(c=new RegExp(">\\s*(\\w*?)("+b.replace("+","\\+")+")(\\w*)\\s*<","ig"),a.replace(c,function(a,b,c,d){return"> "+b+"<strong>"+c+"</strong>"+d+" <"})):a},before_insert:function(a,b){return a},inserting_wrapper:function(a,b,c){var d;return c=""===c?c:c||" ",a.is("textarea, input")?""+b+c:"true"===a.attr("contentEditable")?(c=" "===c?"&nbsp;":c,/firefox/i.test(navigator.userAgent)?d="<span>"+b+c+"</span>":(c="<span contenteditable='false'>"+c+"</span>",d="<span contenteditable='false'>"+b+c+"</span>"),this.app.document.selection&&(d="<span contenteditable='true'>"+b+"</span>"),d+"<span></span>"):void 0}},b={load:function(a,b){var c;return(c=this.controller(a))?c.model.load(b):void 0},setIframe:function(a,b){return this.setIframe(a,b),null},run:function(){return this.dispatch()},destroy:function(){return this.shutdown(),this.$inputor.data("atwho",null)}},a.fn.atwho=function(d){var e,f;return f=arguments,e=null,this.filter('textarea, input, [contenteditable=""], [contenteditable=true]').each(function(){var g,h;return(h=(g=a(this)).data("atwho"))||g.data("atwho",h=new c(this)),"object"!=typeof d&&d?b[d]&&h?e=b[d].apply(h,Array.prototype.slice.call(f,1)):a.error("Method "+d+" does not exist on jQuery.caret"):h.reg(d.at,d)}),e||this},a.fn.atwho["default"]={at:void 0,alias:void 0,data:null,tpl:"<li data-value='${atwho-at}${name}'>${name}</li>",insert_tpl:"<span id='${id}'>${atwho-data-value}</span>",callbacks:e,search_key:"name",suffix:void 0,hide_without_suffix:!1,start_with_space:!0,highlight_first:!0,limit:5,max_len:20,display_timeout:300,delay:null}});
1
+ /*! buddypress - v2.4.0 - 2015-10-22 1:39:20 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(c){return a.returnExportsGlobal=b(c)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){var b,c,d,e,f,g,h,i=[].slice;c=function(){function b(b){this.current_flag=null,this.controllers={},this.alias_maps={},this.$inputor=a(b),this.setIframe(),this.listen()}return b.prototype.createContainer=function(b){return 0===(this.$el=a("#atwho-container",b)).length?a(b.body).append(this.$el=a("<div id='atwho-container'></div>")):void 0},b.prototype.setIframe=function(a,b){var c;return null==b&&(b=!1),a?(this.window=a.contentWindow,this.document=a.contentDocument||this.window.document,this.iframe=a):(this.document=document,this.window=window,this.iframe=null),(this.iframeStandalone=b)?(null!=(c=this.$el)&&c.remove(),this.createContainer(this.document)):this.createContainer(document)},b.prototype.controller=function(a){var b,c,d,e;if(this.alias_maps[a])c=this.controllers[this.alias_maps[a]];else{e=this.controllers;for(d in e)if(b=e[d],d===a){c=b;break}}return c?c:this.controllers[this.current_flag]},b.prototype.set_context_for=function(a){return this.current_flag=a,this},b.prototype.reg=function(a,b){var c,e;return c=(e=this.controllers)[a]||(e[a]=new d(this,a)),b.alias&&(this.alias_maps[b.alias]=a),c.init(b),this},b.prototype.listen=function(){return this.$inputor.on("keyup.atwhoInner",function(a){return function(b){return a.on_keyup(b)}}(this)).on("keydown.atwhoInner",function(a){return function(b){return a.on_keydown(b)}}(this)).on("scroll.atwhoInner",function(a){return function(b){var c;return null!=(c=a.controller())?c.view.hide(b):void 0}}(this)).on("blur.atwhoInner",function(a){return function(b){var c;return(c=a.controller())?c.view.hide(b,c.get_opt("display_timeout")):void 0}}(this)).on("click.atwhoInner",function(a){return function(b){return a.dispatch()}}(this))},b.prototype.shutdown=function(){var a,b,c;c=this.controllers;for(b in c)a=c[b],a.destroy(),delete this.controllers[b];return this.$inputor.off(".atwhoInner"),this.$el.remove()},b.prototype.dispatch=function(){return a.map(this.controllers,function(a){return function(b){var c;return(c=b.get_opt("delay"))?(clearTimeout(a.delayedCallback),a.delayedCallback=setTimeout(function(){return b.look_up()?a.set_context_for(b.at):void 0},c)):b.look_up()?a.set_context_for(b.at):void 0}}(this))},b.prototype.on_keyup=function(b){var c;switch(b.keyCode){case f.ESC:b.preventDefault(),null!=(c=this.controller())&&c.view.hide();break;case f.DOWN:case f.UP:case f.CTRL:a.noop();break;case f.P:case f.N:b.ctrlKey||this.dispatch();break;default:this.dispatch()}},b.prototype.on_keydown=function(b){var c,d;if(c=null!=(d=this.controller())?d.view:void 0,c&&c.visible())switch(b.keyCode){case f.ESC:b.preventDefault(),c.hide(b);break;case f.UP:b.preventDefault(),c.prev();break;case f.DOWN:b.preventDefault(),c.next();break;case f.P:if(!b.ctrlKey)return;b.preventDefault(),c.prev();break;case f.N:if(!b.ctrlKey)return;b.preventDefault(),c.next();break;case f.TAB:case f.ENTER:if(!c.visible())return;b.preventDefault(),c.choose(b);break;default:a.noop()}},b}(),d=function(){function b(b,c){this.app=b,this.at=c,this.$inputor=this.app.$inputor,this.id=this.$inputor[0].id||this.uid(),this.setting=null,this.query=null,this.pos=0,this.cur_rect=null,this.range=null,0===(this.$el=a("#atwho-ground-"+this.id,this.app.$el)).length&&this.app.$el.append(this.$el=a("<div id='atwho-ground-"+this.id+"'></div>")),this.model=new g(this),this.view=new h(this)}return b.prototype.uid=function(){return(Math.random().toString(16)+"000000000").substr(2,8)+(new Date).getTime()},b.prototype.init=function(b){return this.setting=a.extend({},this.setting||a.fn.atwho["default"],b),this.view.init(),this.model.reload(this.setting.data)},b.prototype.destroy=function(){return this.trigger("beforeDestroy"),this.model.destroy(),this.view.destroy(),this.$el.remove()},b.prototype.call_default=function(){var b,c,d;d=arguments[0],b=2<=arguments.length?i.call(arguments,1):[];try{return e[d].apply(this,b)}catch(f){return c=f,a.error(""+c+" Or maybe At.js doesn't have function "+d)}},b.prototype.trigger=function(a,b){var c,d;return null==b&&(b=[]),b.push(this),c=this.get_opt("alias"),d=c?""+a+"-"+c+".atwho":""+a+".atwho",this.$inputor.trigger(d,b)},b.prototype.callbacks=function(a){return this.get_opt("callbacks")[a]||e[a]},b.prototype.get_opt=function(a,b){var c;try{return this.setting[a]}catch(d){return c=d,null}},b.prototype.content=function(){var a;if(this.$inputor.is("textarea, input"))return this.$inputor.val();if(a=this.mark_range())return(a.startContainer.textContent||"").slice(0,a.startOffset)},b.prototype.catch_query=function(){var a,b,c,d,e,f;return b=this.content(),a=this.$inputor.caret("pos",{iframe:this.app.iframe}),f=b.slice(0,a),d=this.callbacks("matcher").call(this,this.at,f,this.get_opt("start_with_space")),"string"==typeof d&&d.length<=this.get_opt("max_len",20)?(e=a-d.length,c=e+d.length,this.pos=e,d={text:d,head_pos:e,end_pos:c},this.trigger("matched",[this.at,d.text])):(d=null,this.view.hide()),this.query=d},b.prototype.rect=function(){var b,c,d;if(b=this.$inputor.caret("offset",this.pos-1,{iframe:this.app.iframe}))return this.app.iframe&&!this.app.iframeStandalone&&(c=a(this.app.iframe).offset(),b.left+=c.left,b.top+=c.top),this.$inputor.is("[contentEditable]")&&(b=this.cur_rect||(this.cur_rect=b)),d=this.app.document.selection?0:2,{left:b.left,top:b.top,bottom:b.top+b.height+d}},b.prototype.reset_rect=function(){return this.$inputor.is("[contentEditable]")?this.cur_rect=null:void 0},b.prototype.mark_range=function(){var a;if(this.$inputor.is("[contentEditable]"))return this.app.window.getSelection&&(a=this.app.window.getSelection()).rangeCount>0?this.range=a.getRangeAt(0):this.app.document.selection?this.ie8_range=this.app.document.selection.createRange():void 0},b.prototype.insert_content_for=function(b){var c,d,e;return d=b.data("value"),e=this.get_opt("insert_tpl"),this.$inputor.is("textarea, input")||!e?d:(c=a.extend({},b.data("item-data"),{"atwho-data-value":d,"atwho-at":this.at}),this.callbacks("tpl_eval").call(this,e,c))},b.prototype.insert=function(b,c){var d,e,f,g,h,i,j,k,l,m,n,o;if(d=this.$inputor,l=this.callbacks("inserting_wrapper").call(this,d,b,this.get_opt("suffix")),d.is("textarea, input"))i=d.val(),j=i.slice(0,Math.max(this.query.head_pos-this.at.length,0)),k=""+j+l+i.slice(this.query.end_pos||0),d.val(k),d.caret("pos",j.length+l.length,{iframe:this.app.iframe});else if(g=this.range){for(f=g.startOffset-(this.query.end_pos-this.query.head_pos)-this.at.length,g.setStart(g.endContainer,Math.max(f,0)),g.setEnd(g.endContainer,g.endOffset),g.deleteContents(),o=a(l,this.app.document),m=0,n=o.length;n>m;m++)e=o[m],g.insertNode(e),g.setEndAfter(e),g.collapse(!1);h=this.app.window.getSelection(),h.removeAllRanges(),h.addRange(g)}else(g=this.ie8_range)&&(g.moveStart("character",this.query.end_pos-this.query.head_pos-this.at.length),g.pasteHTML(l),g.collapse(!1),g.select());return d.is(":focus")||d.focus(),d.change()},b.prototype.render_view=function(a){var b;return b=this.get_opt("search_key"),a=this.callbacks("sorter").call(this,this.query.text,a.slice(0,1001),b),this.view.render(a.slice(0,this.get_opt("limit")))},b.prototype.look_up=function(){var b,c;if(b=this.catch_query())return c=function(a){return a&&a.length>0?this.render_view(a):this.view.hide()},this.model.query(b.text,a.proxy(c,this)),b},b}(),g=function(){function b(a){this.context=a,this.at=this.context.at,this.storage=this.context.$inputor}return b.prototype.destroy=function(){return this.storage.data(this.at,null)},b.prototype.saved=function(){return this.fetch()>0},b.prototype.query=function(a,b){var c,d,e;return c=this.fetch(),d=this.context.get_opt("search_key"),c=this.context.callbacks("filter").call(this.context,a,c,d)||[],e=this.context.callbacks("remote_filter"),c.length>0||!e&&0===c.length?b(c):e.call(this.context,a,b)},b.prototype.fetch=function(){return this.storage.data(this.at)||[]},b.prototype.save=function(a){return this.storage.data(this.at,this.context.callbacks("before_save").call(this.context,a||[]))},b.prototype.load=function(a){return!this.saved()&&a?this._load(a):void 0},b.prototype.reload=function(a){return this._load(a)},b.prototype._load=function(b){return"string"==typeof b?a.ajax(b,{dataType:"json"}).done(function(a){return function(b){return a.save(b)}}(this)):this.save(b)},b}(),h=function(){function b(b){this.context=b,this.$el=a("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>"),this.timeout_id=null,this.context.$el.append(this.$el),this.bind_event()}return b.prototype.init=function(){var a;return a=this.context.get_opt("alias")||this.context.at.charCodeAt(0),this.$el.attr({id:"at-view-"+a})},b.prototype.destroy=function(){return this.$el.remove()},b.prototype.bind_event=function(){var b;return b=this.$el.find("ul"),b.on("mouseenter.atwho-view","li",function(c){return b.find(".cur").removeClass("cur"),a(c.currentTarget).addClass("cur")}).on("click.atwho-view","li",function(c){return function(d){return b.find(".cur").removeClass("cur"),a(d.currentTarget).addClass("cur"),c.choose(d),d.preventDefault()}}(this))},b.prototype.visible=function(){return this.$el.is(":visible")},b.prototype.choose=function(a){var b,c;return(b=this.$el.find(".cur")).length&&(c=this.context.insert_content_for(b),this.context.insert(this.context.callbacks("before_insert").call(this.context,c,b),b),this.context.trigger("inserted",[b,a]),this.hide(a)),this.context.get_opt("hide_without_suffix")?this.stop_showing=!0:void 0},b.prototype.reposition=function(b){var c,d,e,f;return f=this.context.app.iframeStandalone?this.context.app.window:window,b.bottom+this.$el.height()-a(f).scrollTop()>a(f).height()&&(b.bottom=b.top-this.$el.height()),b.left>(d=a(f).width()-this.$el.width()-5)&&(b.left=d),c={left:b.left,top:b.bottom},null!=(e=this.context.callbacks("before_reposition"))&&e.call(this.context,c),this.$el.offset(c),this.context.trigger("reposition",[c])},b.prototype.next=function(){var a,b;return a=this.$el.find(".cur").removeClass("cur"),b=a.next(),b.length||(b=this.$el.find("li:first")),b.addClass("cur"),this.$el.animate({scrollTop:Math.max(0,a.innerHeight()*(b.index()+2)-this.$el.height())},150)},b.prototype.prev=function(){var a,b;return a=this.$el.find(".cur").removeClass("cur"),b=a.prev(),b.length||(b=this.$el.find("li:last")),b.addClass("cur"),this.$el.animate({scrollTop:Math.max(0,a.innerHeight()*(b.index()+2)-this.$el.height())},150)},b.prototype.show=function(){var a;return this.stop_showing?void(this.stop_showing=!1):(this.context.mark_range(),this.visible()||(this.$el.show(),this.$el.scrollTop(0),this.context.trigger("shown")),(a=this.context.rect())?this.reposition(a):void 0)},b.prototype.hide=function(a,b){var c;if(this.visible())return isNaN(b)?(this.context.reset_rect(),this.$el.hide(),this.context.trigger("hidden",[a])):(c=function(a){return function(){return a.hide()}}(this),clearTimeout(this.timeout_id),this.timeout_id=setTimeout(c,b))},b.prototype.render=function(b){var c,d,e,f,g,h,i;if(!(a.isArray(b)&&b.length>0))return void this.hide();for(this.$el.find("ul").empty(),d=this.$el.find("ul"),g=this.context.get_opt("tpl"),h=0,i=b.length;i>h;h++)e=b[h],e=a.extend({},e,{"atwho-at":this.context.at}),f=this.context.callbacks("tpl_eval").call(this.context,g,e),c=a(this.context.callbacks("highlighter").call(this.context,f,this.context.query.text)),c.data("item-data",e),d.append(c);return this.show(),this.context.get_opt("highlight_first")?d.find("li:first").addClass("cur"):void 0},b}(),f={DOWN:40,UP:38,ESC:27,TAB:9,ENTER:13,CTRL:17,P:80,N:78},e={before_save:function(b){var c,d,e,f;if(!a.isArray(b))return b;for(f=[],d=0,e=b.length;e>d;d++)c=b[d],a.isPlainObject(c)?f.push(c):f.push({name:c});return f},matcher:function(a,b,c){var d,e,f,g;return a=a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\amp;"),c&&(a="(?:^|\\s)"+a),f=decodeURI("%C3%80"),g=decodeURI("%C3%BF"),e=new RegExp(""+a+"([A-Za-z"+f+"-"+g+"0-9_+-]*)$|"+a+"([^\\x00-\\xff]*)quot;,"gi"),d=e.exec(b),d?d[2]||d[1]:null},filter:function(a,b,c){var d,e,f,g;for(g=[],e=0,f=b.length;f>e;e++)d=b[e],~new String(d[c]).toLowerCase().indexOf(a.toLowerCase())&&g.push(d);return g},remote_filter:null,sorter:function(a,b,c){var d,e,f,g;if(!a)return b;for(g=[],e=0,f=b.length;f>e;e++)d=b[e],d.atwho_order=new String(d[c]).toLowerCase().indexOf(a.toLowerCase()),d.atwho_order>-1&&g.push(d);return g.sort(function(a,b){return a.atwho_order-b.atwho_order})},tpl_eval:function(a,b){var c;try{return a.replace(/\$\{([^\}]*)\}/g,function(a,c,d){return b[c]})}catch(d){return c=d,""}},highlighter:function(a,b){var c;return b?(c=new RegExp(">\\s*(\\w*?)("+b.replace("+","\\+")+")(\\w*)\\s*<","ig"),a.replace(c,function(a,b,c,d){return"> "+b+"<strong>"+c+"</strong>"+d+" <"})):a},before_insert:function(a,b){return a},inserting_wrapper:function(a,b,c){var d;return c=""===c?c:c||" ",a.is("textarea, input")?""+b+c:"true"===a.attr("contentEditable")?(c=" "===c?"&nbsp;":c,/firefox/i.test(navigator.userAgent)?d="<span>"+b+c+"</span>":(c="<span contenteditable='false'>"+c+"</span>",d="<span contenteditable='false'>"+b+c+"</span>"),this.app.document.selection&&(d="<span contenteditable='true'>"+b+"</span>"),d+"<span></span>"):void 0}},b={load:function(a,b){var c;return(c=this.controller(a))?c.model.load(b):void 0},setIframe:function(a,b){return this.setIframe(a,b),null},run:function(){return this.dispatch()},destroy:function(){return this.shutdown(),this.$inputor.data("atwho",null)}},a.fn.atwho=function(d){var e,f;return f=arguments,e=null,this.filter('textarea, input, [contenteditable=""], [contenteditable=true]').each(function(){var g,h;return(h=(g=a(this)).data("atwho"))||g.data("atwho",h=new c(this)),"object"!=typeof d&&d?b[d]&&h?e=b[d].apply(h,Array.prototype.slice.call(f,1)):a.error("Method "+d+" does not exist on jQuery.caret"):h.reg(d.at,d)}),e||this},a.fn.atwho["default"]={at:void 0,alias:void 0,data:null,tpl:"<li data-value='${atwho-at}${name}'>${name}</li>",insert_tpl:"<span id='${id}'>${atwho-data-value}</span>",callbacks:e,search_key:"name",suffix:void 0,hide_without_suffix:!1,start_with_space:!0,highlight_first:!0,limit:5,max_len:20,display_timeout:300,delay:null}});
bp-core/js/jquery.caret.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! buddypress - v2.4.0 - 2015-10-12 8:03:39 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(c){return a.returnExportsGlobal=b(c)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){"use strict";var b,c,d,e,f,g,h,i,j,k,l;k="caret",b=function(){function b(a){this.$inputor=a,this.domInputor=this.$inputor[0]}return b.prototype.setPos=function(a){return this.domInputor},b.prototype.getIEPosition=function(){return this.getPosition()},b.prototype.getPosition=function(){var a,b;return b=this.getOffset(),a=this.$inputor.offset(),b.left-=a.left,b.top-=a.top,b},b.prototype.getOldIEPos=function(){var a,b;return b=h.selection.createRange(),a=h.body.createTextRange(),a.moveToElementText(this.domInputor),a.setEndPoint("EndToEnd",b),a.text.length},b.prototype.getPos=function(){var a,b,c;return(c=this.range())?(a=c.cloneRange(),a.selectNodeContents(this.domInputor),a.setEnd(c.endContainer,c.endOffset),b=a.toString().length,a.detach(),b):h.selection?this.getOldIEPos():void 0},b.prototype.getOldIEOffset=function(){var a,b;return a=h.selection.createRange().duplicate(),a.moveStart("character",-1),b=a.getBoundingClientRect(),{height:b.bottom-b.top,left:b.left,top:b.top}},b.prototype.getOffset=function(b){var c,d,e,f,g;return j.getSelection&&(e=this.range())?(e.endOffset-1>0&&e.endContainer===!this.domInputor&&(c=e.cloneRange(),c.setStart(e.endContainer,e.endOffset-1),c.setEnd(e.endContainer,e.endOffset),f=c.getBoundingClientRect(),d={height:f.height,left:f.left+f.width,top:f.top},c.detach()),d&&0!==(null!=d?d.height:void 0)||(c=e.cloneRange(),g=a(h.createTextNode("|")),c.insertNode(g[0]),c.selectNode(g[0]),f=c.getBoundingClientRect(),d={height:f.height,left:f.left,top:f.top},g.remove(),c.detach())):h.selection&&(d=this.getOldIEOffset()),d&&(d.top+=a(j).scrollTop(),d.left+=a(j).scrollLeft()),d},b.prototype.range=function(){var a;if(j.getSelection)return a=j.getSelection(),a.rangeCount>0?a.getRangeAt(0):null},b}(),c=function(){function b(a){this.$inputor=a,this.domInputor=this.$inputor[0]}return b.prototype.getIEPos=function(){var a,b,c,d,e,f,g;return b=this.domInputor,f=h.selection.createRange(),e=0,f&&f.parentElement()===b&&(d=b.value.replace(/\r\n/g,"\n"),c=d.length,g=b.createTextRange(),g.moveToBookmark(f.getBookmark()),a=b.createTextRange(),a.collapse(!1),e=g.compareEndPoints("StartToEnd",a)>-1?c:-g.moveStart("character",-c)),e},b.prototype.getPos=function(){return h.selection?this.getIEPos():this.domInputor.selectionStart},b.prototype.setPos=function(a){var b,c;return b=this.domInputor,h.selection?(c=b.createTextRange(),c.move("character",a),c.select()):b.setSelectionRange&&b.setSelectionRange(a,a),b},b.prototype.getIEOffset=function(a){var b,c,d,e;return c=this.domInputor.createTextRange(),a||(a=this.getPos()),c.move("character",a),d=c.boundingLeft,e=c.boundingTop,b=c.boundingHeight,{left:d,top:e,height:b}},b.prototype.getOffset=function(b){var c,d,e;return c=this.$inputor,h.selection?(d=this.getIEOffset(b),d.top+=a(j).scrollTop()+c.scrollTop(),d.left+=a(j).scrollLeft()+c.scrollLeft(),d):(d=c.offset(),e=this.getPosition(b),d={left:d.left+e.left-c.scrollLeft(),top:d.top+e.top-c.scrollTop(),height:e.height})},b.prototype.getPosition=function(a){var b,c,e,f,g,h,i;return b=this.$inputor,f=function(a){return a=a.replace(/<|>|`|"|&/g,"?").replace(/\r\n|\r|\n/g,"<br/>"),/firefox/i.test(navigator.userAgent)&&(a=a.replace(/\s/g,"&nbsp;")),a},void 0===a&&(a=this.getPos()),i=b.val().slice(0,a),e=b.val().slice(a),g="<span style='position: relative; display: inline;'>"+f(i)+"</span>",g+="<span id='caret' style='position: relative; display: inline;'>|</span>",g+="<span style='position: relative; display: inline;'>"+f(e)+"</span>",h=new d(b),c=h.create(g).rect()},b.prototype.getIEPosition=function(a){var b,c,d,e,f;return d=this.getIEOffset(a),c=this.$inputor.offset(),e=d.left-c.left,f=d.top-c.top,b=d.height,{left:e,top:f,height:b}},b}(),d=function(){function b(a){this.$inputor=a}return b.prototype.css_attr=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","boxSizing","fontFamily","fontSize","fontWeight","height","letterSpacing","lineHeight","marginBottom","marginLeft","marginRight","marginTop","outlineWidth","overflow","overflowX","overflowY","paddingBottom","paddingLeft","paddingRight","paddingTop","textAlign","textOverflow","textTransform","whiteSpace","wordBreak","wordWrap"],b.prototype.mirrorCss=function(){var b,c=this;return b={position:"absolute",left:-9999,top:0,zIndex:-2e4},"TEXTAREA"===this.$inputor.prop("tagName")&&this.css_attr.push("width"),a.each(this.css_attr,function(a,d){return b[d]=c.$inputor.css(d)}),b},b.prototype.create=function(b){return this.$mirror=a("<div></div>"),this.$mirror.css(this.mirrorCss()),this.$mirror.html(b),this.$inputor.after(this.$mirror),this},b.prototype.rect=function(){var a,b,c;return a=this.$mirror.find("#caret"),b=a.position(),c={left:b.left,top:b.top,height:a.height()},this.$mirror.remove(),c},b}(),e={contentEditable:function(a){return!(!a[0].contentEditable||"true"!==a[0].contentEditable)}},g={pos:function(a){return a||0===a?this.setPos(a):this.getPos()},position:function(a){return h.selection?this.getIEPosition(a):this.getPosition(a)},offset:function(a){var b;return b=this.getOffset(a)}},h=null,j=null,i=null,l=function(a){var b;return(b=null!=a?a.iframe:void 0)?(i=b,j=b.contentWindow,h=b.contentDocument||j.document):(i=void 0,j=window,h=document)},f=function(a){var b;h=a[0].ownerDocument,j=h.defaultView||h.parentWindow;try{return i=j.frameElement}catch(c){b=c}},a.fn.caret=function(d,f,h){var i;return g[d]?(a.isPlainObject(f)?(l(f),f=void 0):l(h),i=e.contentEditable(this)?new b(this):new c(this),g[d].apply(i,[f])):a.error("Method "+d+" does not exist on jQuery.caret")},a.fn.caret.EditableCaret=b,a.fn.caret.InputCaret=c,a.fn.caret.Utils=e,a.fn.caret.apis=g});
1
+ /*! buddypress - v2.4.0 - 2015-10-22 1:39:20 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(c){return a.returnExportsGlobal=b(c)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){"use strict";var b,c,d,e,f,g,h,i,j,k,l;k="caret",b=function(){function b(a){this.$inputor=a,this.domInputor=this.$inputor[0]}return b.prototype.setPos=function(a){return this.domInputor},b.prototype.getIEPosition=function(){return this.getPosition()},b.prototype.getPosition=function(){var a,b;return b=this.getOffset(),a=this.$inputor.offset(),b.left-=a.left,b.top-=a.top,b},b.prototype.getOldIEPos=function(){var a,b;return b=h.selection.createRange(),a=h.body.createTextRange(),a.moveToElementText(this.domInputor),a.setEndPoint("EndToEnd",b),a.text.length},b.prototype.getPos=function(){var a,b,c;return(c=this.range())?(a=c.cloneRange(),a.selectNodeContents(this.domInputor),a.setEnd(c.endContainer,c.endOffset),b=a.toString().length,a.detach(),b):h.selection?this.getOldIEPos():void 0},b.prototype.getOldIEOffset=function(){var a,b;return a=h.selection.createRange().duplicate(),a.moveStart("character",-1),b=a.getBoundingClientRect(),{height:b.bottom-b.top,left:b.left,top:b.top}},b.prototype.getOffset=function(b){var c,d,e,f,g;return j.getSelection&&(e=this.range())?(e.endOffset-1>0&&e.endContainer===!this.domInputor&&(c=e.cloneRange(),c.setStart(e.endContainer,e.endOffset-1),c.setEnd(e.endContainer,e.endOffset),f=c.getBoundingClientRect(),d={height:f.height,left:f.left+f.width,top:f.top},c.detach()),d&&0!==(null!=d?d.height:void 0)||(c=e.cloneRange(),g=a(h.createTextNode("|")),c.insertNode(g[0]),c.selectNode(g[0]),f=c.getBoundingClientRect(),d={height:f.height,left:f.left,top:f.top},g.remove(),c.detach())):h.selection&&(d=this.getOldIEOffset()),d&&(d.top+=a(j).scrollTop(),d.left+=a(j).scrollLeft()),d},b.prototype.range=function(){var a;if(j.getSelection)return a=j.getSelection(),a.rangeCount>0?a.getRangeAt(0):null},b}(),c=function(){function b(a){this.$inputor=a,this.domInputor=this.$inputor[0]}return b.prototype.getIEPos=function(){var a,b,c,d,e,f,g;return b=this.domInputor,f=h.selection.createRange(),e=0,f&&f.parentElement()===b&&(d=b.value.replace(/\r\n/g,"\n"),c=d.length,g=b.createTextRange(),g.moveToBookmark(f.getBookmark()),a=b.createTextRange(),a.collapse(!1),e=g.compareEndPoints("StartToEnd",a)>-1?c:-g.moveStart("character",-c)),e},b.prototype.getPos=function(){return h.selection?this.getIEPos():this.domInputor.selectionStart},b.prototype.setPos=function(a){var b,c;return b=this.domInputor,h.selection?(c=b.createTextRange(),c.move("character",a),c.select()):b.setSelectionRange&&b.setSelectionRange(a,a),b},b.prototype.getIEOffset=function(a){var b,c,d,e;return c=this.domInputor.createTextRange(),a||(a=this.getPos()),c.move("character",a),d=c.boundingLeft,e=c.boundingTop,b=c.boundingHeight,{left:d,top:e,height:b}},b.prototype.getOffset=function(b){var c,d,e;return c=this.$inputor,h.selection?(d=this.getIEOffset(b),d.top+=a(j).scrollTop()+c.scrollTop(),d.left+=a(j).scrollLeft()+c.scrollLeft(),d):(d=c.offset(),e=this.getPosition(b),d={left:d.left+e.left-c.scrollLeft(),top:d.top+e.top-c.scrollTop(),height:e.height})},b.prototype.getPosition=function(a){var b,c,e,f,g,h,i;return b=this.$inputor,f=function(a){return a=a.replace(/<|>|`|"|&/g,"?").replace(/\r\n|\r|\n/g,"<br/>"),/firefox/i.test(navigator.userAgent)&&(a=a.replace(/\s/g,"&nbsp;")),a},void 0===a&&(a=this.getPos()),i=b.val().slice(0,a),e=b.val().slice(a),g="<span style='position: relative; display: inline;'>"+f(i)+"</span>",g+="<span id='caret' style='position: relative; display: inline;'>|</span>",g+="<span style='position: relative; display: inline;'>"+f(e)+"</span>",h=new d(b),c=h.create(g).rect()},b.prototype.getIEPosition=function(a){var b,c,d,e,f;return d=this.getIEOffset(a),c=this.$inputor.offset(),e=d.left-c.left,f=d.top-c.top,b=d.height,{left:e,top:f,height:b}},b}(),d=function(){function b(a){this.$inputor=a}return b.prototype.css_attr=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","boxSizing","fontFamily","fontSize","fontWeight","height","letterSpacing","lineHeight","marginBottom","marginLeft","marginRight","marginTop","outlineWidth","overflow","overflowX","overflowY","paddingBottom","paddingLeft","paddingRight","paddingTop","textAlign","textOverflow","textTransform","whiteSpace","wordBreak","wordWrap"],b.prototype.mirrorCss=function(){var b,c=this;return b={position:"absolute",left:-9999,top:0,zIndex:-2e4},"TEXTAREA"===this.$inputor.prop("tagName")&&this.css_attr.push("width"),a.each(this.css_attr,function(a,d){return b[d]=c.$inputor.css(d)}),b},b.prototype.create=function(b){return this.$mirror=a("<div></div>"),this.$mirror.css(this.mirrorCss()),this.$mirror.html(b),this.$inputor.after(this.$mirror),this},b.prototype.rect=function(){var a,b,c;return a=this.$mirror.find("#caret"),b=a.position(),c={left:b.left,top:b.top,height:a.height()},this.$mirror.remove(),c},b}(),e={contentEditable:function(a){return!(!a[0].contentEditable||"true"!==a[0].contentEditable)}},g={pos:function(a){return a||0===a?this.setPos(a):this.getPos()},position:function(a){return h.selection?this.getIEPosition(a):this.getPosition(a)},offset:function(a){var b;return b=this.getOffset(a)}},h=null,j=null,i=null,l=function(a){var b;return(b=null!=a?a.iframe:void 0)?(i=b,j=b.contentWindow,h=b.contentDocument||j.document):(i=void 0,j=window,h=document)},f=function(a){var b;h=a[0].ownerDocument,j=h.defaultView||h.parentWindow;try{return i=j.frameElement}catch(c){b=c}},a.fn.caret=function(d,f,h){var i;return g[d]?(a.isPlainObject(f)?(l(f),f=void 0):l(h),i=e.contentEditable(this)?new b(this):new c(this),g[d].apply(i,[f])):a.error("Method "+d+" does not exist on jQuery.caret")},a.fn.caret.EditableCaret=b,a.fn.caret.InputCaret=c,a.fn.caret.Utils=e,a.fn.caret.apis=g});
bp-core/js/webcam.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! buddypress - v2.4.0 - 2015-10-12 8:03:39 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
window.bp=window.bp||{},function(){"undefined"!=typeof BP_Uploader&&(bp.Models=bp.Models||{},bp.Collections=bp.Collections||{},bp.Views=bp.Views||{},bp.WebCam={start:function(){this.params={video:null,videoStream:null,capture_enable:!1,capture:null,canvas:null,warning:null,flipped:!1},bp.Avatar.nav.on("bp-avatar-view:changed",_.bind(this.setView,this))},setView:function(a){if("camera"!==a)return void(_.isNull(this.params.video)||(this.stop(),this.removeWarning()));var b=new bp.Views.WebCamAvatar({model:new Backbone.Model({user_media:!1})});this.params.flipped=!1,bp.Avatar.views.add({id:"camera",view:b}),b.inject(".bp-avatar")},removeView:function(){var a;_.isUndefined(bp.Avatar.views.get("camera"))||(a=bp.Avatar.views.get("camera"),a.get("view").remove(),bp.Avatar.views.remove({id:"camera",view:a}))},gotStream:function(a){var b=bp.WebCam.params.video;bp.WebCam.params.videoStream=a,bp.WebCam.displayWarning("loaded"),b.onerror=function(){bp.WebCam.displayWarning("videoerror"),b&&bp.WebCam.stop()},a.onended=bp.WebCam.noStream(),void 0!==b.mozSrcObject?(b.mozSrcObject=a,b.play()):navigator.mozGetUserMedia?(b.src=a,b.play()):window.URL?b.src=window.URL.createObjectURL(a):b.src=a,bp.WebCam.params.capture_enable=!0},stop:function(){bp.WebCam.params.capture_enable=!1,bp.WebCam.params.videoStream&&(bp.WebCam.params.videoStream.stop?bp.WebCam.params.videoStream.stop():bp.WebCam.params.videoStream.msStop&&bp.WebCam.params.videoStream.msStop(),bp.WebCam.params.videoStream.onended=null,bp.WebCam.params.videoStream=null),bp.WebCam.params.video&&(bp.WebCam.params.video.onerror=null,bp.WebCam.params.video.pause(),bp.WebCam.params.video.mozSrcObject&&(bp.WebCam.params.video.mozSrcObject=null),bp.WebCam.params.video.src="")},noStream:function(){_.isNull(bp.WebCam.params.videoStream)&&(bp.WebCam.displayWarning("noaccess"),bp.WebCam.removeView())},setAvatar:function(a){a.get("url")||bp.WebCam.displayWarning("nocapture"),bp.WebCam.removeView(),bp.Avatar.setAvatar(a)},removeWarning:function(){_.isNull(this.params.warning)||this.params.warning.remove()},displayWarning:function(a){this.removeWarning(),this.params.warning=new bp.Views.uploaderWarning({value:BP_Uploader.strings.camera_warnings[a]}),this.params.warning.inject(".bp-avatar-status")}},bp.Views.WebCamAvatar=bp.View.extend({tagName:"div",id:"bp-webcam-avatar",template:bp.template("bp-avatar-webcam"),events:{"click .avatar-webcam-capture":"captureStream","click .avatar-webcam-save":"saveCapture"},initialize:function(){var a;(navigator.getUserMedia||navigator.oGetUserMedia||navigator.mozGetUserMedia||navigator.webkitGetUserMedia||navigator.msGetUserMedia)&&(a=_.extend(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,"object","item_id","nonces"),{user_media:!0,w:BP_Uploader.settings.crop.full_w,h:BP_Uploader.settings.crop.full_h,x:0,y:0,type:"camera"}),this.model.set(a)),this.on("ready",this.useStream,this)},useStream:function(){this.model.get("user_media")&&(this.options.video=new bp.Views.WebCamVideo,this.options.canvas=new bp.Views.WebCamCanvas,this.$el.find("#avatar-to-crop").append(this.options.video.el),this.$el.find("#avatar-crop-pane").append(this.options.canvas.el),bp.WebCam.params.video=this.options.video.el,bp.WebCam.params.canvas=this.options.canvas.el,bp.WebCam.displayWarning("requesting"),navigator.getUserMedia?navigator.getUserMedia({video:!0},bp.WebCam.gotStream,bp.WebCams.noStream):navigator.oGetUserMedia?navigator.oGetUserMedia({video:!0},bp.WebCam.gotStream,bp.WebCam.noStream):navigator.mozGetUserMedia?navigator.mozGetUserMedia({video:!0},bp.WebCam.gotStream,bp.WebCam.noStream):navigator.webkitGetUserMedia?navigator.webkitGetUserMedia({video:!0},bp.WebCam.gotStream,bp.WebCam.noStream):navigator.msGetUserMedia?navigator.msGetUserMedia({video:!0,audio:!1},bp.WebCams.gotStream,bp.WebCam.noStream):bp.WebCam.displayWarning("errormsg"))},captureStream:function(a){var b,c;return a.preventDefault(),bp.WebCam.params.capture_enable?this.model.get("h")>this.options.video.el.videoHeight||this.model.get("w")>this.options.video.el.videoWidth?void bp.WebCam.displayWarning("videoerror"):(c=this.options.video.el.videoHeight,b=(this.options.video.el.videoWidth-c)/2,bp.WebCam.params.flipped||(this.options.canvas.el.getContext("2d").translate(this.model.get("w"),0),this.options.canvas.el.getContext("2d").scale(-1,1),bp.WebCam.params.flipped=!0),this.options.canvas.el.getContext("2d").drawImage(this.options.video.el,b,0,c,c,0,0,this.model.get("w"),this.model.get("h")),bp.WebCam.params.capture=this.options.canvas.el.toDataURL("image/png"),this.model.set("url",bp.WebCam.params.capture),void bp.WebCam.displayWarning("ready")):void bp.WebCam.displayWarning("loading")},saveCapture:function(a){return a.preventDefault(),bp.WebCam.params.capture?(bp.WebCam.stop(),void bp.WebCam.setAvatar(this.model)):void bp.WebCam.displayWarning("nocapture")}}),bp.Views.WebCamVideo=bp.View.extend({tagName:"video",id:"bp-webcam-video",attributes:{autoplay:"autoplay"}}),bp.Views.WebCamCanvas=bp.View.extend({tagName:"canvas",id:"bp-webcam-canvas",attributes:{width:150,height:150},initialize:function(){_.isUndefined(BP_Uploader.settings.crop.full_h)||_.isUndefined(BP_Uploader.settings.crop.full_w)||(this.el.attributes.width.value=BP_Uploader.settings.crop.full_w,this.el.attributes.height.value=BP_Uploader.settings.crop.full_h)}}),bp.WebCam.start())}(bp,jQuery);
1
+ /*! buddypress - v2.4.0 - 2015-10-22 1:39:20 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
window.bp=window.bp||{},function(){"undefined"!=typeof BP_Uploader&&(bp.Models=bp.Models||{},bp.Collections=bp.Collections||{},bp.Views=bp.Views||{},bp.WebCam={start:function(){this.params={video:null,videoStream:null,capture_enable:!1,capture:null,canvas:null,warning:null,flipped:!1},bp.Avatar.nav.on("bp-avatar-view:changed",_.bind(this.setView,this))},setView:function(a){if("camera"!==a)return void(_.isNull(this.params.video)||(this.stop(),this.removeWarning()));var b=new bp.Views.WebCamAvatar({model:new Backbone.Model({user_media:!1})});this.params.flipped=!1,bp.Avatar.views.add({id:"camera",view:b}),b.inject(".bp-avatar")},removeView:function(){var a;_.isUndefined(bp.Avatar.views.get("camera"))||(a=bp.Avatar.views.get("camera"),a.get("view").remove(),bp.Avatar.views.remove({id:"camera",view:a}))},gotStream:function(a){var b=bp.WebCam.params.video;bp.WebCam.params.videoStream=a,bp.WebCam.displayWarning("loaded"),b.onerror=function(){bp.WebCam.displayWarning("videoerror"),b&&bp.WebCam.stop()},a.onended=bp.WebCam.noStream(),void 0!==b.mozSrcObject?(b.mozSrcObject=a,b.play()):navigator.mozGetUserMedia?(b.src=a,b.play()):window.URL?b.src=window.URL.createObjectURL(a):b.src=a,bp.WebCam.params.capture_enable=!0},stop:function(){bp.WebCam.params.capture_enable=!1,bp.WebCam.params.videoStream&&(bp.WebCam.params.videoStream.stop?bp.WebCam.params.videoStream.stop():bp.WebCam.params.videoStream.msStop&&bp.WebCam.params.videoStream.msStop(),bp.WebCam.params.videoStream.onended=null,bp.WebCam.params.videoStream=null),bp.WebCam.params.video&&(bp.WebCam.params.video.onerror=null,bp.WebCam.params.video.pause(),bp.WebCam.params.video.mozSrcObject&&(bp.WebCam.params.video.mozSrcObject=null),bp.WebCam.params.video.src="")},noStream:function(){_.isNull(bp.WebCam.params.videoStream)&&(bp.WebCam.displayWarning("noaccess"),bp.WebCam.removeView())},setAvatar:function(a){a.get("url")||bp.WebCam.displayWarning("nocapture"),bp.WebCam.removeView(),bp.Avatar.setAvatar(a)},removeWarning:function(){_.isNull(this.params.warning)||this.params.warning.remove()},displayWarning:function(a){this.removeWarning(),this.params.warning=new bp.Views.uploaderWarning({value:BP_Uploader.strings.camera_warnings[a]}),this.params.warning.inject(".bp-avatar-status")}},bp.Views.WebCamAvatar=bp.View.extend({tagName:"div",id:"bp-webcam-avatar",template:bp.template("bp-avatar-webcam"),events:{"click .avatar-webcam-capture":"captureStream","click .avatar-webcam-save":"saveCapture"},initialize:function(){var a;(navigator.getUserMedia||navigator.oGetUserMedia||navigator.mozGetUserMedia||navigator.webkitGetUserMedia||navigator.msGetUserMedia)&&(a=_.extend(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,"object","item_id","nonces"),{user_media:!0,w:BP_Uploader.settings.crop.full_w,h:BP_Uploader.settings.crop.full_h,x:0,y:0,type:"camera"}),this.model.set(a)),this.on("ready",this.useStream,this)},useStream:function(){this.model.get("user_media")&&(this.options.video=new bp.Views.WebCamVideo,this.options.canvas=new bp.Views.WebCamCanvas,this.$el.find("#avatar-to-crop").append(this.options.video.el),this.$el.find("#avatar-crop-pane").append(this.options.canvas.el),bp.WebCam.params.video=this.options.video.el,bp.WebCam.params.canvas=this.options.canvas.el,bp.WebCam.displayWarning("requesting"),navigator.getUserMedia?navigator.getUserMedia({video:!0},bp.WebCam.gotStream,bp.WebCams.noStream):navigator.oGetUserMedia?navigator.oGetUserMedia({video:!0},bp.WebCam.gotStream,bp.WebCam.noStream):navigator.mozGetUserMedia?navigator.mozGetUserMedia({video:!0},bp.WebCam.gotStream,bp.WebCam.noStream):navigator.webkitGetUserMedia?navigator.webkitGetUserMedia({video:!0},bp.WebCam.gotStream,bp.WebCam.noStream):navigator.msGetUserMedia?navigator.msGetUserMedia({video:!0,audio:!1},bp.WebCams.gotStream,bp.WebCam.noStream):bp.WebCam.displayWarning("errormsg"))},captureStream:function(a){var b,c;return a.preventDefault(),bp.WebCam.params.capture_enable?this.model.get("h")>this.options.video.el.videoHeight||this.model.get("w")>this.options.video.el.videoWidth?void bp.WebCam.displayWarning("videoerror"):(c=this.options.video.el.videoHeight,b=(this.options.video.el.videoWidth-c)/2,bp.WebCam.params.flipped||(this.options.canvas.el.getContext("2d").translate(this.model.get("w"),0),this.options.canvas.el.getContext("2d").scale(-1,1),bp.WebCam.params.flipped=!0),this.options.canvas.el.getContext("2d").drawImage(this.options.video.el,b,0,c,c,0,0,this.model.get("w"),this.model.get("h")),bp.WebCam.params.capture=this.options.canvas.el.toDataURL("image/png"),this.model.set("url",bp.WebCam.params.capture),void bp.WebCam.displayWarning("ready")):void bp.WebCam.displayWarning("loading")},saveCapture:function(a){return a.preventDefault(),bp.WebCam.params.capture?(bp.WebCam.stop(),void bp.WebCam.setAvatar(this.model)):void bp.WebCam.displayWarning("nocapture")}}),bp.Views.WebCamVideo=bp.View.extend({tagName:"video",id:"bp-webcam-video",attributes:{autoplay:"autoplay"}}),bp.Views.WebCamCanvas=bp.View.extend({tagName:"canvas",id:"bp-webcam-canvas",attributes:{width:150,height:150},initialize:function(){_.isUndefined(BP_Uploader.settings.crop.full_h)||_.isUndefined(BP_Uploader.settings.crop.full_w)||(this.el.attributes.width.value=BP_Uploader.settings.crop.full_w,this.el.attributes.height.value=BP_Uploader.settings.crop.full_h)}}),bp.WebCam.start())}(bp,jQuery);
bp-core/js/widget-members.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! buddypress - v2.4.0 - 2015-10-12 8:03:39 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
function member_widget_response(a){a=a.substr(0,a.length-1),a=a.split("[[SPLIT]]"),"-1"!==a[0]?jQuery(".widget ul#members-list").fadeOut(200,function(){jQuery(".widget ul#members-list").html(a[1]),jQuery(".widget ul#members-list").fadeIn(200)}):jQuery(".widget ul#members-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#members-list").html(b),jQuery(".widget ul#members-list").fadeIn(200)})}jQuery(document).ready(function(){jQuery(".widget div#members-list-options a").on("click",function(){var a=this;return jQuery(a).addClass("loading"),jQuery(".widget div#members-list-options a").removeClass("selected"),jQuery(this).addClass("selected"),jQuery.post(ajaxurl,{action:"widget_members",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-members").val(),"max-members":jQuery("input#members_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading"),member_widget_response(b)}),!1})});
1
+ /*! buddypress - v2.4.0 - 2015-10-22 1:39:20 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
function member_widget_response(a){a=a.substr(0,a.length-1),a=a.split("[[SPLIT]]"),"-1"!==a[0]?jQuery(".widget ul#members-list").fadeOut(200,function(){jQuery(".widget ul#members-list").html(a[1]),jQuery(".widget ul#members-list").fadeIn(200)}):jQuery(".widget ul#members-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#members-list").html(b),jQuery(".widget ul#members-list").fadeIn(200)})}jQuery(document).ready(function(){jQuery(".widget div#members-list-options a").on("click",function(){var a=this;return jQuery(a).addClass("loading"),jQuery(".widget div#members-list-options a").removeClass("selected"),jQuery(this).addClass("selected"),jQuery.post(ajaxurl,{action:"widget_members",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-members").val(),"max-members":jQuery("input#members_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading"),member_widget_response(b)}),!1})});
bp-forums/deprecated/1.6.php CHANGED
@@ -165,15 +165,18 @@ function bp_forums_bbpress_install_wizard() {
165
166
switch ( $result ) {
167
case 1:
168
- _e( '<p>All done! Configuration settings have been saved to the file <code>bb-config.php</code> in the root of your WordPress install.</p>', 'buddypress' );
169
break;
170
default:
171
// Just write the contents to screen.
172
- _e( '<p>A configuration file could not be created. No problem, but you will need to save the text shown below into a file named <code>bb-config.php</code> in the root directory of your WordPress installation before you can start using the forum functionality.</p>', 'buddypress' ); ?>
173
-
174
<textarea style="display:block; margin-top: 30px; width: 80%;" rows="50"><?php echo esc_textarea( $result ); ?></textarea>
175
-
176
- <?php
177
break;
178
}
179
} else { ?>
165
166
switch ( $result ) {
167
case 1:
168
+ echo '<p>';
169
+ _e( 'All done! Configuration settings have been saved to the file <code>bb-config.php</code> in the root of your WordPress install.', 'buddypress' );
170
+ echo '</p>';
171
break;
172
default:
173
// Just write the contents to screen.
174
+ echo '<p>';
175
+ _e( 'A configuration file could not be created. No problem, but you will need to save the text shown below into a file named <code>bb-config.php</code> in the root directory of your WordPress installation before you can start using the forum functionality.', 'buddypress' );
176
+ echo '</p>';
177
+ ?>
178
<textarea style="display:block; margin-top: 30px; width: 80%;" rows="50"><?php echo esc_textarea( $result ); ?></textarea>
179
+ <?php
180
break;
181
}
182
} else { ?>
bp-friends/bp-friends-widgets.php CHANGED
@@ -70,7 +70,7 @@ class BP_Core_Friends_Widget extends WP_Widget {
70
71
$user_id = bp_displayed_user_id();
72
$link = trailingslashit( bp_displayed_user_domain() . bp_get_friends_slug() );
73
- $instance['title'] = sprintf( __( '%s&#8217;s Friends', 'buddypress' ), bp_get_displayed_user_fullname() );
74
75
if ( empty( $instance['friend_default'] ) ) {
76
$instance['friend_default'] = 'active';
70
71
$user_id = bp_displayed_user_id();
72
$link = trailingslashit( bp_displayed_user_domain() . bp_get_friends_slug() );
73
+ $instance['title'] = sprintf( __( "%s's Friends", 'buddypress' ), bp_get_displayed_user_fullname() );
74
75
if ( empty( $instance['friend_default'] ) ) {
76
$instance['friend_default'] = 'active';
bp-friends/js/widget-friends.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! buddypress - v2.4.0 - 2015-10-12 8:03:39 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
function friend_widget_response(a){a=a.substr(0,a.length-1),a=a.split("[[SPLIT]]"),"-1"!==a[0]?jQuery(".widget ul#friends-list").fadeOut(200,function(){jQuery(".widget ul#friends-list").html(a[1]),jQuery(".widget ul#friends-list").fadeIn(200)}):jQuery(".widget ul#friends-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#friends-list").html(b),jQuery(".widget ul#friends-list").fadeIn(200)})}jQuery(document).ready(function(){jQuery(".widget div#friends-list-options a").on("click",function(){var a=this;return jQuery(a).addClass("loading"),jQuery(".widget div#friends-list-options a").removeClass("selected"),jQuery(this).addClass("selected"),jQuery.post(ajaxurl,{action:"widget_friends",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-friends").val(),"max-friends":jQuery("input#friends_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading"),friend_widget_response(b)}),!1})});
1
+ /*! buddypress - v2.4.0 - 2015-10-22 1:39:20 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
function friend_widget_response(a){a=a.substr(0,a.length-1),a=a.split("[[SPLIT]]"),"-1"!==a[0]?jQuery(".widget ul#friends-list").fadeOut(200,function(){jQuery(".widget ul#friends-list").html(a[1]),jQuery(".widget ul#friends-list").fadeIn(200)}):jQuery(".widget ul#friends-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#friends-list").html(b),jQuery(".widget ul#friends-list").fadeIn(200)})}jQuery(document).ready(function(){jQuery(".widget div#friends-list-options a").on("click",function(){var a=this;return jQuery(a).addClass("loading"),jQuery(".widget div#friends-list-options a").removeClass("selected"),jQuery(this).addClass("selected"),jQuery.post(ajaxurl,{action:"widget_friends",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-friends").val(),"max-friends":jQuery("input#friends_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading"),friend_widget_response(b)}),!1})});
bp-groups/admin/js/admin.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! buddypress - v2.4.0 - 2015-10-12 8:03:39 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
!function(a){function b(b,c){a("#bp-groups-new-members-list").append('<li data-login="'+c.item.value+'"><a href="#" class="bp-groups-remove-new-member">x</a> '+c.item.label+"</li>")}var c="undefined"!=typeof group_id?"&group_id="+group_id:"";a(document).ready(function(){window.warn_on_leave=!1,a(".bp-suggest-user").autocomplete({source:ajaxurl+"?action=bp_group_admin_member_autocomplete"+c,delay:500,minLength:2,position:"undefined"!=typeof isRtl&&isRtl?{my:"right top",at:"right bottom",offset:"0, -1"}:{offset:"0, -1"},open:function(){a(this).addClass("open")},close:function(){a(this).removeClass("open"),a(this).val("")},select:function(a,c){b(a,c)}}),a("#bp-groups-new-members").prop("placeholder",BP_Group_Admin.add_member_placeholder),a("#bp_group_add_members").on("click",".bp-groups-remove-new-member",function(b){b.preventDefault(),a(b.target.parentNode).remove()}),a(document).on("change",'input#bp-groups-name, input#bp-groups-description, select.bp-groups-role, #bp-groups-settings-section-status input[type="radio"]',function(){window.warn_on_leave=!0}),a("input#save").on("click",function(){var b=[];a("#bp-groups-new-members-list li").each(function(){b.push(a(this).data("login"))}),b.length&&a("#bp-groups-new-members").val("").val(b.join(", ")),window.warn_on_leave=!1}),window.onbeforeunload=function(){return window.warn_on_leave?BP_Group_Admin.warn_on_leave:void 0}})}(jQuery);
1
+ /*! buddypress - v2.4.0 - 2015-10-22 1:39:20 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
!function(a){function b(b,c){a("#bp-groups-new-members-list").append('<li data-login="'+c.item.value+'"><a href="#" class="bp-groups-remove-new-member">x</a> '+c.item.label+"</li>")}var c="undefined"!=typeof group_id?"&group_id="+group_id:"";a(document).ready(function(){window.warn_on_leave=!1,a(".bp-suggest-user").autocomplete({source:ajaxurl+"?action=bp_group_admin_member_autocomplete"+c,delay:500,minLength:2,position:"undefined"!=typeof isRtl&&isRtl?{my:"right top",at:"right bottom",offset:"0, -1"}:{offset:"0, -1"},open:function(){a(this).addClass("open")},close:function(){a(this).removeClass("open"),a(this).val("")},select:function(a,c){b(a,c)}}),a("#bp-groups-new-members").prop("placeholder",BP_Group_Admin.add_member_placeholder),a("#bp_group_add_members").on("click",".bp-groups-remove-new-member",function(b){b.preventDefault(),a(b.target.parentNode).remove()}),a(document).on("change",'input#bp-groups-name, input#bp-groups-description, select.bp-groups-role, #bp-groups-settings-section-status input[type="radio"]',function(){window.warn_on_leave=!0}),a("input#save").on("click",function(){var b=[];a("#bp-groups-new-members-list li").each(function(){b.push(a(this).data("login"))}),b.length&&a("#bp-groups-new-members").val("").val(b.join(", ")),window.warn_on_leave=!1}),window.onbeforeunload=function(){return window.warn_on_leave?BP_Group_Admin.warn_on_leave:void 0}})}(jQuery);
bp-groups/bp-groups-actions.php CHANGED
@@ -340,7 +340,7 @@ function groups_action_create_group() {
340
if ( !bp_core_avatar_handle_crop( array( 'object' => 'group', 'avatar_dir' => 'group-avatars', 'item_id' => $bp->groups->current_group->id, 'original_file' => $_POST['image_src'], 'crop_x' => $_POST['x'], 'crop_y' => $_POST['y'], 'crop_w' => $_POST['w'], 'crop_h' => $_POST['h'] ) ) )
341
bp_core_add_message( __( 'There was an error saving the group profile photo, please try uploading again.', 'buddypress' ), 'error' );
342
else
343
- bp_core_add_message( __( 'The group profile photo was uploaded successfully!', 'buddypress' ) );
344
}
345
}
346
340
if ( !bp_core_avatar_handle_crop( array( 'object' => 'group', 'avatar_dir' => 'group-avatars', 'item_id' => $bp->groups->current_group->id, 'original_file' => $_POST['image_src'], 'crop_x' => $_POST['x'], 'crop_y' => $_POST['y'], 'crop_w' => $_POST['w'], 'crop_h' => $_POST['h'] ) ) )
341
bp_core_add_message( __( 'There was an error saving the group profile photo, please try uploading again.', 'buddypress' ), 'error' );
342
else
343
+ bp_core_add_message( __( 'The group profile photo was uploaded successfully.', 'buddypress' ) );
344
}
345
}
346
bp-groups/bp-groups-admin.php CHANGED
@@ -525,21 +525,21 @@ function bp_groups_admin_edit() {
525
}
526
527
if ( ! empty( $error_new ) ) {
528
- $messages[] = sprintf( __( 'The following users could not be added to the group: <em>%s</em>', 'buddypress' ), implode( ', ', $error_new ) );
529
}
530
531
if ( ! empty( $success_new ) ) {
532
- $messages[] = sprintf( __( 'The following users were successfully added to the group: <em>%s</em>', 'buddypress' ), implode( ', ', $success_new ) );
533
}
534
535
if ( ! empty( $error_modified ) ) {
536
$error_modified = bp_groups_admin_get_usernames_from_ids( $error_modified );
537
- $messages[] = sprintf( __( 'An error occurred when trying to modify the following members: <em>%s</em>', 'buddypress' ), implode( ', ', $error_modified ) );
538
}
539
540
if ( ! empty( $success_modified ) ) {
541
$success_modified = bp_groups_admin_get_usernames_from_ids( $success_modified );
542
- $messages[] = sprintf( __( 'The following members were successfully modified: <em>%s</em>', 'buddypress' ), implode( ', ', $success_modified ) );
543
}
544
}
545
525
}
526
527
if ( ! empty( $error_new ) ) {
528
+ $messages[] = sprintf( __( 'The following users could not be added to the group: %s', 'buddypress' ), '<em>' . implode( ', ', $error_new ) . '</em>' );
529
}
530
531
if ( ! empty( $success_new ) ) {
532
+ $messages[] = sprintf( __( 'The following users were successfully added to the group: %s', 'buddypress' ), '<em>' . implode( ', ', $success_new ) . '</em>' );
533
}
534
535
if ( ! empty( $error_modified ) ) {
536
$error_modified = bp_groups_admin_get_usernames_from_ids( $error_modified );
537
+ $messages[] = sprintf( __( 'An error occurred when trying to modify the following members: %s', 'buddypress' ), '<em>' . implode( ', ', $error_modified ) . '</em>' );
538
}
539
540
if ( ! empty( $success_modified ) ) {
541
$success_modified = bp_groups_admin_get_usernames_from_ids( $success_modified );
542
+ $messages[] = sprintf( __( 'The following members were successfully modified: %s', 'buddypress' ), '<em>' . implode( ', ', $success_modified ) . '</em>' );
543
}
544
}
545
bp-groups/bp-groups-functions.php CHANGED
@@ -439,7 +439,7 @@ function groups_leave_group( $group_id, $user_id = 0 ) {
439
}
440
}
441
442
- if ( ! groups_remove_member( $user_id, $group_id ) ) {
443
return false;
444
}
445
@@ -1434,15 +1434,8 @@ function groups_unban_member( $user_id, $group_id ) {
1434
function groups_remove_member( $user_id, $group_id ) {
1435
1436
if ( ! bp_is_item_admin() ) {
1437
- // bp_is_item_admin may not be set if this function is called outside of group context.
1438
- // Site admins and group admins can remove a member from a group.
1439
- // A member may also request to remove herself from a group.
1440
- if ( ! current_user_can( 'bp_moderate' )
1441
- && ! groups_is_user_admin( bp_loggedin_user_id(), $group_id )
1442
- && $user_id != bp_loggedin_user_id() ) {
1443
- return false;
1444
- }
1445
- }
1446
1447
$member = new BP_Groups_Member( $user_id, $group_id );
1448
439
}
440
}
441
442
+ if ( ! BP_Groups_Member::delete( $user_id, $group_id ) ) {
443
return false;
444
}
445
1434
function groups_remove_member( $user_id, $group_id ) {
1435
1436
if ( ! bp_is_item_admin() ) {
1437
+ return false;
1438
+ }
1439
1440
$member = new BP_Groups_Member( $user_id, $group_id );
1441
bp-groups/bp-groups-loader.php CHANGED
@@ -561,7 +561,7 @@ class BP_Groups_Component extends BP_Component {
561
* Only add the members subnav if it's not the home's nav
562
*/
563
$sub_nav[] = array(
564
- 'name' => sprintf( _x( 'Members <span>%s</span>', 'My Group screen nav', 'buddypress' ), number_format( $this->current_group->total_member_count ) ),
565
'slug' => 'members',
566
'parent_url' => $group_link,
567
'parent_slug' => $this->current_group->slug,
561
* Only add the members subnav if it's not the home's nav
562
*/
563
$sub_nav[] = array(
564
+ 'name' => sprintf( _x( 'Members %s', 'My Group screen nav', 'buddypress' ), '<span>' . number_format( $this->current_group->total_member_count ) . '</span>' ),
565
'slug' => 'members',
566
'parent_url' => $group_link,
567
'parent_slug' => $this->current_group->slug,
bp-groups/bp-groups-screens.php CHANGED
@@ -1332,7 +1332,7 @@ function groups_screen_group_admin_delete_group() {
1332
if ( !groups_delete_group( $bp->groups->current_group->id ) ) {
1333
bp_core_add_message( __( 'There was an error deleting the group. Please try again.', 'buddypress' ), 'error' );
1334
} else {
1335
- bp_core_add_message( __( 'The group was deleted successfully', 'buddypress' ) );
1336
1337
/**
1338
* Fires after the deletion of a group from the Delete Group page.
1332
if ( !groups_delete_group( $bp->groups->current_group->id ) ) {
1333
bp_core_add_message( __( 'There was an error deleting the group. Please try again.', 'buddypress' ), 'error' );
1334
} else {
1335
+ bp_core_add_message( __( 'The group was deleted successfully.', 'buddypress' ) );
1336
1337
/**
1338
* Fires after the deletion of a group from the Delete Group page.
bp-groups/js/widget-groups.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! buddypress - v2.4.0 - 2015-10-12 8:03:39 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
function groups_widget_response(a){a=a.substr(0,a.length-1),a=a.split("[[SPLIT]]"),"-1"!==a[0]?jQuery(".widget ul#groups-list").fadeOut(200,function(){jQuery(".widget ul#groups-list").html(a[1]),jQuery(".widget ul#groups-list").fadeIn(200)}):jQuery(".widget ul#groups-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#groups-list").html(b),jQuery(".widget ul#groups-list").fadeIn(200)})}jQuery(document).ready(function(){jQuery(".widget div#groups-list-options a").on("click",function(){var a=this;return jQuery(a).addClass("loading"),jQuery(".widget div#groups-list-options a").removeClass("selected"),jQuery(this).addClass("selected"),jQuery.post(ajaxurl,{action:"widget_groups_list",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-groups").val(),max_groups:jQuery("input#groups_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading"),groups_widget_response(b)}),!1})});
1
+ /*! buddypress - v2.4.0 - 2015-10-22 1:39:20 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
function groups_widget_response(a){a=a.substr(0,a.length-1),a=a.split("[[SPLIT]]"),"-1"!==a[0]?jQuery(".widget ul#groups-list").fadeOut(200,function(){jQuery(".widget ul#groups-list").html(a[1]),jQuery(".widget ul#groups-list").fadeIn(200)}):jQuery(".widget ul#groups-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#groups-list").html(b),jQuery(".widget ul#groups-list").fadeIn(200)})}jQuery(document).ready(function(){jQuery(".widget div#groups-list-options a").on("click",function(){var a=this;return jQuery(a).addClass("loading"),jQuery(".widget div#groups-list-options a").removeClass("selected"),jQuery(this).addClass("selected"),jQuery.post(ajaxurl,{action:"widget_groups_list",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-groups").val(),max_groups:jQuery("input#groups_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading"),groups_widget_response(b)}),!1})});
bp-loader.php CHANGED
@@ -14,7 +14,7 @@
14
* Description: BuddyPress helps you run any kind of social network on your WordPress, with member profiles, activity streams, user groups, messaging, and more.
15
* Author: The BuddyPress Community
16
* Author URI: https://buddypress.org/
17
- * Version: 2.4.0-beta1
18
* Text Domain: buddypress
19
* Domain Path: /bp-languages/
20
* License: GPLv2 or later (license.txt)
@@ -326,7 +326,7 @@ class BuddyPress {
326
327
/** Versions **********************************************************/
328
329
- $this->version = '2.4.0-beta1';
330
$this->db_version = 10000;
331
332
/** Loading ***********************************************************/
14
* Description: BuddyPress helps you run any kind of social network on your WordPress, with member profiles, activity streams, user groups, messaging, and more.
15
* Author: The BuddyPress Community
16
* Author URI: https://buddypress.org/
17
+ * Version: 2.4.0-beta2
18
* Text Domain: buddypress
19
* Domain Path: /bp-languages/
20
* License: GPLv2 or later (license.txt)
326
327
/** Versions **********************************************************/
328
329
+ $this->version = '2.4.0-beta2';
330
$this->db_version = 10000;
331
332
/** Loading ***********************************************************/
bp-members/admin/css/admin-rtl.css CHANGED
@@ -1,7 +1,8 @@
1
/**** BP Members Profile Administration Screens ****/
2
3
div#profile-page.wrap form#your-profile {
4
- position:relative;
5
}
6
7
div#profile-page.wrap form#your-profile h3:first-of-type {
@@ -10,7 +11,7 @@ div#profile-page.wrap form#your-profile h3:first-of-type {
10
11
div#profile-page.wrap form#your-profile #profile-nav {
12
position: absolute;
13
- top: -3.65em;
14
width: 97%;
15
}
16
1
/**** BP Members Profile Administration Screens ****/
2
3
div#profile-page.wrap form#your-profile {
4
+ position: relative;
5
+ padding-top: 50px;
6
}
7
8
div#profile-page.wrap form#your-profile h3:first-of-type {
11
12
div#profile-page.wrap form#your-profile #profile-nav {
13
position: absolute;
14
+ top: 0;
15
width: 97%;
16
}
17
bp-members/admin/css/admin-rtl.min.css CHANGED
@@ -1 +1 @@
1
- div#profile-page.wrap form#your-profile{position:relative}div#profile-page.wrap form#your-profile h3:first-of-type{margin-top:5em}div#profile-page.wrap form#your-profile #profile-nav{position:absolute;top:-3.65em;width:97%}div#community-profile-page #profile-nav{margin-bottom:1em}#bp_members_admin_user_stats ul{margin-bottom:0}div#community-profile-page a.bp-xprofile-avatar-user-admin:before,div#community-profile-page a.bp-xprofile-avatar-user-edit:before,div#community-profile-page li.bp-blogs-profile-stats:before,div#community-profile-page li.bp-friends-profile-stats:before,div#community-profile-page li.bp-groups-profile-stats:before,div#community-profile-page li.bp-members-profile-stats:before{font:400 20px/1 dashicons;speak:none;display:inline-block;padding:0 0 0 2px;top:0;right:-1px;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#888}div#community-profile-page li.bp-members-profile-stats:before{content:"\f130"}div#community-profile-page li.bp-friends-profile-stats:before{content:"\f454"}div#community-profile-page li.bp-groups-profile-stats:before{content:"\f456"}div#community-profile-page li.bp-blogs-profile-stats:before{content:"\f120"}div#community-profile-page a.bp-xprofile-avatar-user-admin:before{content:"\f182"}div#community-profile-page a.bp-xprofile-avatar-user-edit:before{content:"\f107"}div#community-profile-page div#bp_xprofile_user_admin_avatar div.avatar{width:150px;margin:0 auto}div#community-profile-page div#bp_xprofile_user_admin_avatar div.avatar img{max-width:100%;height:auto}div#community-profile-page div#bp_xprofile_user_admin_avatar a{display:block;margin:1em 0;text-decoration:none;color:#888}div#community-profile-page p.not-activated{margin:1em 1em 0;color:red}#community-profile-page #submitdiv #publishing-action{float:none;width:100%}.bp-view-profile{float:right}.alt{background:0 0}.bp-profile-field{border-bottom:dotted 1px #ccc;font-size:14px;margin:15px 0;padding:10px}.bp-profile-field:last-child{border-bottom:0}.bp-profile-field p{font-size:14px}.bp-profile-field .datebox>label,.bp-profile-field .radio>label,.bp-profile-field>label{display:inline-block;font-weight:600;text-align:right;vertical-align:middle;width:200px}.clear-value,.field_type_radio .radio div:not(.field-visibility-settings) label{display:block}.field_type_checkbox .checkbox>label,.field_type_multiselectbox>label,.field_type_radio .radio>label,.field_type_textarea>label{vertical-align:top}.bp-profile-field .description{margin:10px 200px 10px 0;text-align:right}.clear-value{font-size:12px;margin-right:200px}.field_type_checkbox .checkbox>label+label{display:block;margin-right:200px;width:auto}.field_type_radio .radio div:not(.field-visibility-settings){display:inline-block}.field-visibility-settings-notoggle,.field-visibility-settings-toggle{margin:10px 200px 10px 0;text-align:right}.field-visibility-settings{display:none;margin-right:200px}.field-visibility-settings .button{margin-bottom:15px}#normal-sortables .field-visibility-settings legend{font-size:16px;margin-bottom:10px}
1
+ div#profile-page.wrap form#your-profile{position:relative;padding-top:50px}div#profile-page.wrap form#your-profile h3:first-of-type{margin-top:5em}div#profile-page.wrap form#your-profile #profile-nav{position:absolute;top:0;width:97%}div#community-profile-page #profile-nav{margin-bottom:1em}#bp_members_admin_user_stats ul{margin-bottom:0}div#community-profile-page a.bp-xprofile-avatar-user-admin:before,div#community-profile-page a.bp-xprofile-avatar-user-edit:before,div#community-profile-page li.bp-blogs-profile-stats:before,div#community-profile-page li.bp-friends-profile-stats:before,div#community-profile-page li.bp-groups-profile-stats:before,div#community-profile-page li.bp-members-profile-stats:before{font:400 20px/1 dashicons;speak:none;display:inline-block;padding:0 0 0 2px;top:0;right:-1px;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#888}div#community-profile-page li.bp-members-profile-stats:before{content:"\f130"}div#community-profile-page li.bp-friends-profile-stats:before{content:"\f454"}div#community-profile-page li.bp-groups-profile-stats:before{content:"\f456"}div#community-profile-page li.bp-blogs-profile-stats:before{content:"\f120"}div#community-profile-page a.bp-xprofile-avatar-user-admin:before{content:"\f182"}div#community-profile-page a.bp-xprofile-avatar-user-edit:before{content:"\f107"}div#community-profile-page div#bp_xprofile_user_admin_avatar div.avatar{width:150px;margin:0 auto}div#community-profile-page div#bp_xprofile_user_admin_avatar div.avatar img{max-width:100%;height:auto}div#community-profile-page div#bp_xprofile_user_admin_avatar a{display:block;margin:1em 0;text-decoration:none;color:#888}div#community-profile-page p.not-activated{margin:1em 1em 0;color:red}#community-profile-page #submitdiv #publishing-action{float:none;width:100%}.bp-view-profile{float:right}.alt{background:0 0}.bp-profile-field{border-bottom:dotted 1px #ccc;font-size:14px;margin:15px 0;padding:10px}.bp-profile-field:last-child{border-bottom:0}.bp-profile-field p{font-size:14px}.bp-profile-field .datebox>label,.bp-profile-field .radio>label,.bp-profile-field>label{display:inline-block;font-weight:600;text-align:right;vertical-align:middle;width:200px}.clear-value,.field_type_radio .radio div:not(.field-visibility-settings) label{display:block}.field_type_checkbox .checkbox>label,.field_type_multiselectbox>label,.field_type_radio .radio>label,.field_type_textarea>label{vertical-align:top}.bp-profile-field .description{margin:10px 200px 10px 0;text-align:right}.clear-value{font-size:12px;margin-right:200px}.field_type_checkbox .checkbox>label+label{display:block;margin-right:200px;width:auto}.field_type_radio .radio div:not(.field-visibility-settings){display:inline-block}.field-visibility-settings-notoggle,.field-visibility-settings-toggle{margin:10px 200px 10px 0;text-align:right}.field-visibility-settings{display:none;margin-right:200px}.field-visibility-settings .button{margin-bottom:15px}#normal-sortables .field-visibility-settings legend{font-size:16px;margin-bottom:10px}
bp-members/admin/css/admin.css CHANGED
@@ -1,7 +1,8 @@
1
/**** BP Members Profile Administration Screens ****/
2
3
div#profile-page.wrap form#your-profile {
4
- position:relative;
5
}
6
7
div#profile-page.wrap form#your-profile h3:first-of-type {
@@ -10,7 +11,7 @@ div#profile-page.wrap form#your-profile h3:first-of-type {
10
11
div#profile-page.wrap form#your-profile #profile-nav {
12
position: absolute;
13
- top: -3.65em;
14
width: 97%;
15
}
16
1
/**** BP Members Profile Administration Screens ****/
2
3
div#profile-page.wrap form#your-profile {
4
+ position: relative;
5
+ padding-top: 50px;
6
}
7
8
div#profile-page.wrap form#your-profile h3:first-of-type {
11
12
div#profile-page.wrap form#your-profile #profile-nav {
13
position: absolute;
14
+ top: 0;
15
width: 97%;
16
}
17
bp-members/admin/css/admin.min.css CHANGED
@@ -1 +1 @@
1
- div#profile-page.wrap form#your-profile{position:relative}div#profile-page.wrap form#your-profile h3:first-of-type{margin-top:5em}div#profile-page.wrap form#your-profile #profile-nav{position:absolute;top:-3.65em;width:97%}div#community-profile-page #profile-nav{margin-bottom:1em}#bp_members_admin_user_stats ul{margin-bottom:0}div#community-profile-page a.bp-xprofile-avatar-user-admin:before,div#community-profile-page a.bp-xprofile-avatar-user-edit:before,div#community-profile-page li.bp-blogs-profile-stats:before,div#community-profile-page li.bp-friends-profile-stats:before,div#community-profile-page li.bp-groups-profile-stats:before,div#community-profile-page li.bp-members-profile-stats:before{font:400 20px/1 dashicons;speak:none;display:inline-block;padding:0 2px 0 0;top:0;left:-1px;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#888}div#community-profile-page li.bp-members-profile-stats:before{content:"\f130"}div#community-profile-page li.bp-friends-profile-stats:before{content:"\f454"}div#community-profile-page li.bp-groups-profile-stats:before{content:"\f456"}div#community-profile-page li.bp-blogs-profile-stats:before{content:"\f120"}div#community-profile-page a.bp-xprofile-avatar-user-admin:before{content:"\f182"}div#community-profile-page a.bp-xprofile-avatar-user-edit:before{content:"\f107"}div#community-profile-page div#bp_xprofile_user_admin_avatar div.avatar{width:150px;margin:0 auto}div#community-profile-page div#bp_xprofile_user_admin_avatar div.avatar img{max-width:100%;height:auto}div#community-profile-page div#bp_xprofile_user_admin_avatar a{display:block;margin:1em 0;text-decoration:none;color:#888}div#community-profile-page p.not-activated{margin:1em 1em 0;color:red}#community-profile-page #submitdiv #publishing-action{float:none;width:100%}.bp-view-profile{float:left}.alt{background:0 0}.bp-profile-field{border-bottom:dotted 1px #ccc;font-size:14px;margin:15px 0;padding:10px}.bp-profile-field:last-child{border-bottom:0}.bp-profile-field p{font-size:14px}.bp-profile-field .datebox>label,.bp-profile-field .radio>label,.bp-profile-field>label{display:inline-block;font-weight:600;text-align:left;vertical-align:middle;width:200px}.clear-value,.field_type_radio .radio div:not(.field-visibility-settings) label{display:block}.field_type_checkbox .checkbox>label,.field_type_multiselectbox>label,.field_type_radio .radio>label,.field_type_textarea>label{vertical-align:top}.bp-profile-field .description{margin:10px 0 10px 200px;text-align:left}.clear-value{font-size:12px;margin-left:200px}.field_type_checkbox .checkbox>label+label{display:block;margin-left:200px;width:auto}.field_type_radio .radio div:not(.field-visibility-settings){display:inline-block}.field-visibility-settings-notoggle,.field-visibility-settings-toggle{margin:10px 0 10px 200px;text-align:left}.field-visibility-settings{display:none;margin-left:200px}.field-visibility-settings .button{margin-bottom:15px}#normal-sortables .field-visibility-settings legend{font-size:16px;margin-bottom:10px}
1
+ div#profile-page.wrap form#your-profile{position:relative;padding-top:50px}div#profile-page.wrap form#your-profile h3:first-of-type{margin-top:5em}div#profile-page.wrap form#your-profile #profile-nav{position:absolute;top:0;width:97%}div#community-profile-page #profile-nav{margin-bottom:1em}#bp_members_admin_user_stats ul{margin-bottom:0}div#community-profile-page a.bp-xprofile-avatar-user-admin:before,div#community-profile-page a.bp-xprofile-avatar-user-edit:before,div#community-profile-page li.bp-blogs-profile-stats:before,div#community-profile-page li.bp-friends-profile-stats:before,div#community-profile-page li.bp-groups-profile-stats:before,div#community-profile-page li.bp-members-profile-stats:before{font:400 20px/1 dashicons;speak:none;display:inline-block;padding:0 2px 0 0;top:0;left:-1px;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#888}div#community-profile-page li.bp-members-profile-stats:before{content:"\f130"}div#community-profile-page li.bp-friends-profile-stats:before{content:"\f454"}div#community-profile-page li.bp-groups-profile-stats:before{content:"\f456"}div#community-profile-page li.bp-blogs-profile-stats:before{content:"\f120"}div#community-profile-page a.bp-xprofile-avatar-user-admin:before{content:"\f182"}div#community-profile-page a.bp-xprofile-avatar-user-edit:before{content:"\f107"}div#community-profile-page div#bp_xprofile_user_admin_avatar div.avatar{width:150px;margin:0 auto}div#community-profile-page div#bp_xprofile_user_admin_avatar div.avatar img{max-width:100%;height:auto}div#community-profile-page div#bp_xprofile_user_admin_avatar a{display:block;margin:1em 0;text-decoration:none;color:#888}div#community-profile-page p.not-activated{margin:1em 1em 0;color:red}#community-profile-page #submitdiv #publishing-action{float:none;width:100%}.bp-view-profile{float:left}.alt{background:0 0}.bp-profile-field{border-bottom:dotted 1px #ccc;font-size:14px;margin:15px 0;padding:10px}.bp-profile-field:last-child{border-bottom:0}.bp-profile-field p{font-size:14px}.bp-profile-field .datebox>label,.bp-profile-field .radio>label,.bp-profile-field>label{display:inline-block;font-weight:600;text-align:left;vertical-align:middle;width:200px}.clear-value,.field_type_radio .radio div:not(.field-visibility-settings) label{display:block}.field_type_checkbox .checkbox>label,.field_type_multiselectbox>label,.field_type_radio .radio>label,.field_type_textarea>label{vertical-align:top}.bp-profile-field .description{margin:10px 0 10px 200px;text-align:left}.clear-value{font-size:12px;margin-left:200px}.field_type_checkbox .checkbox>label+label{display:block;margin-left:200px;width:auto}.field_type_radio .radio div:not(.field-visibility-settings){display:inline-block}.field-visibility-settings-notoggle,.field-visibility-settings-toggle{margin:10px 0 10px 200px;text-align:left}.field-visibility-settings{display:none;margin-left:200px}.field-visibility-settings .button{margin-bottom:15px}#normal-sortables .field-visibility-settings legend{font-size:16px;margin-bottom:10px}
bp-members/admin/js/admin.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! buddypress - v2.4.0 - 2015-10-12 8:03:39 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
function clear(a){if(a=document.getElementById(a)){var b=a.getElementsByTagName("INPUT"),c=a.getElementsByTagName("OPTION"),d=0;if(b)for(d=0;d<b.length;d++)b[d].checked="";if(c)for(d=0;d<c.length;d++)c[d].selected=!1}}!function(a){a(".visibility-toggle-link").on("click",function(b){b.preventDefault(),a(this).parent().hide().siblings(".field-visibility-settings").show()}),a(".field-visibility-settings-close").on("click",function(b){b.preventDefault();var c=a(this).parent(),d=c.find("input:checked").parent().text();c.hide().siblings(".field-visibility-settings-toggle").children(".current-visibility-level").text(d).end().show()})}(jQuery);
1
+ /*! buddypress - v2.4.0 - 2015-10-22 1:39:20 PM UTC - https://wordpress.org/plugins/buddypress/ */
2
function clear(a){if(a=document.getElementById(a)){var b=a.getElementsByTagName("INPUT"),c=a.getElementsByTagName("OPTION"),d=0;if(b)for(d=0;d<b.length;d++)b[d].checked="";if(c)for(d=0;d<c.length;d++)c[d].selected=!1}}!function(a){a(".visibility-toggle-link").on("click",function(b){b.preventDefault(),a(this).parent().hide().siblings(".field-visibility-settings").show()}),a(".field-visibility-settings-close").on("click",function(b){b.preventDefault();var c=a(this).parent(),d=c.find("input:checked").parent().text();c.hide().siblings(".field-visibility-settings-toggle").children(".current-visibility-level").text(d).end().show()})}(jQuery);
bp-members/bp-members-admin.php CHANGED
@@ -992,7 +992,7 @@ class BP_Members_Admin {
992
$datef = __( 'M j, Y @ G:i', 'buddypress' );
993
$date = date_i18n( $datef, strtotime( $user->user_registered ) );
994
?>
995
- <span id="timestamp"><?php printf( __( 'Registered on: <strong>%1$s</strong>', 'buddypress' ), $date ); ?></span>
996
</div>
997
</div> <!-- #misc-publishing-actions -->
998
992
$datef = __( 'M j, Y @ G:i', 'buddypress' );
993
$date = date_i18n( $datef, strtotime( $user->user_registered ) );
994
?>
995
+ <span id="timestamp"><?php printf( __( 'Registered on: %s', 'buddypress' ), '<strong>' . $date . '</strong>' ); ?></span>
996
</div>
997
</div> <!-- #misc-publishing-actions -->
998
bp-members/bp-members-functions.php CHANGED
@@ -1975,7 +1975,7 @@ function bp_core_activate_signup( $key ) {
1975
} elseif ( $key == wp_hash( $user_id ) ) {
1976
// Change the user's status so they become active
1977
if ( ! $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_status = 0 WHERE ID = %d", $user_id ) ) ) {
1978
- return new WP_Error( 'invalid_key', __( 'Invalid activation key', 'buddypress' ) );
1979
}
1980
1981
bp_delete_user_meta( $user_id, 'activation_key' );
1975
} elseif ( $key == wp_hash( $user_id ) ) {
1976
// Change the user's status so they become active
1977
if ( ! $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_status = 0 WHERE ID = %d", $user_id ) ) ) {
1978
+ return new WP_Error( 'invalid_key', __( 'Invalid activation key.', 'buddypress' ) );
1979
}
1980
1981
bp_delete_user_meta( $user_id, 'activation_key' );
bp-members/bp-members-screens.php CHANGED
@@ -679,7 +679,7 @@ class BP_Registration_Theme_Compat {
679
680
// Activation page
681
} else {
682
- $title = __( 'Activate your Account', 'buddypress' );
683
684
if ( bp_account_was_activated() ) {
685
$title = __( 'Account Activated', 'buddypress' );
679
680
// Activation page
681
} else {
682
+ $title = __( 'Activate Your Account', 'buddypress' );
683
684
if ( bp_account_was_activated() ) {
685
$title = __( 'Account Activated', 'buddypress' );
bp-members/bp-members-widgets.php CHANGED
@@ -371,7 +371,7 @@ class BP_Core_Whos_Online_Widget extends WP_Widget {
371
372
<p>
373
<label for="<?php echo $this->get_field_id( 'max_members' ); ?>">
374
- <?php esc_html_e( 'Max Members to show:', 'buddypress' ); ?>
375
<input class="widefat" id="<?php echo $this->get_field_id( 'max_members' ); ?>" name="<?php echo $this->get_field_name( 'max_members' ); ?>" type="text" value="<?php echo esc_attr( $max_members ); ?>" style="width: 30%" />
376
</label>
377
</p>
@@ -521,7 +521,7 @@ class BP_Core_Recently_Active_Widget extends WP_Widget {
521
522
<p>
523
<label for="<?php echo $this->get_field_id( 'max_members' ); ?>">
524
- <?php esc_html_e( 'Max Members to show:', 'buddypress' ); ?>
525
<input class="widefat" id="<?php echo $this->get_field_id( 'max_members' ); ?>" name="<?php echo $this->get_field_name( 'max_members' ); ?>" type="text" value="<?php echo esc_attr( $max_members ); ?>" style="width: 30%" />
526
</label>
527
</p>
371
372
<p>
373
<label for="<?php echo $this->get_field_id( 'max_members' ); ?>">
374
+ <?php esc_html_e( 'Max members to show:', 'buddypress' ); ?>
375
<input class="widefat" id="<?php echo $this->get_field_id( 'max_members' ); ?>" name="<?php echo $this->get_field_name( 'max_members' ); ?>" type="text" value="<?php echo esc_attr( $max_members ); ?>" style="width: 30%" />
376
</label>
377
</p>
521
522
<p>
523
<label for="<?php echo $this->get_field_id( 'max_members' ); ?>">
524
+ <?php esc_html_e( 'Max members to show:', 'buddypress' ); ?>
525
<input class="widefat" id="<?php echo $this->get_field_id( 'max_members' ); ?>" name="<?php echo $this->get_field_name( 'max_members' ); ?>" type="text" value="<?php echo esc_attr( $max_members ); ?>" style="width: 30%" />
526
</label>
527
</p>
bp-messages/bp-messages-actions.php CHANGED
@@ -22,20 +22,20 @@ defined( 'ABSPATH' ) || exit;
22
*/
23
function bp_messages_action_create_message() {
24
25
- // Bail if not posting to the compose message screen
26
if ( ! bp_is_post_request() || ! bp_is_messages_component() || ! bp_is_current_action( 'compose' ) ) {
27
return false;
28
}
29
30
- // Check the nonce
31
check_admin_referer( 'messages_send_message' );
32
33
- // Define local variables
34
$redirect_to = '';
35
$feedback = '';
36
$success = false;
37
38
- // Missing subject or content
39
if ( empty( $_POST['subject'] ) || empty( $_POST['content'] ) ) {
40
$success = false;
41
@@ -45,31 +45,31 @@ function bp_messages_action_create_message() {
45
$feedback = __( 'Your message was not sent. Please enter some content.', 'buddypress' );
46
}
47
48
- // Subject and content present
49
} else {
50
51
- // Setup the link to the logged-in user's messages
52
$member_messages = trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() );
53
54
- // Site-wide notice
55
if ( isset( $_POST['send-notice'] ) ) {
56
57
- // Attempt to save the notice and redirect to notices
58
if ( messages_send_notice( $_POST['subject'], $_POST['content'] ) ) {
59
$success = true;
60
$feedback = __( 'Notice successfully created.', 'buddypress' );
61
$redirect_to = trailingslashit( $member_messages . 'notices' );
62
63
- // Notice could not be sent
64
} else {
65
$success = false;
66
$feedback = __( 'Notice was not created. Please try again.', 'buddypress' );
67
}
68
69
- // Private conversation
70
} else {
71
72
- // Filter recipients into the format we need - array( 'username/userid', 'username/userid' )
73
$autocomplete_recipients = (array) explode( ',', $_POST['send-to-input'] );
74
$typed_recipients = (array) explode( ' ', $_POST['send_to_usernames'] );
75
$recipients = array_merge( $autocomplete_recipients, $typed_recipients );
@@ -83,41 +83,42 @@ function bp_messages_action_create_message() {
83
*/
84
$recipients = apply_filters( 'bp_messages_recipients', $recipients );
85
86
- // Attempt to send the message
87
- $thread_id = messages_new_message( array(
88
'recipients' => $recipients,
89
'subject' => $_POST['subject'],
90
- 'content' => $_POST['content']
91
) );
92
93
- // Send the message and redirect to it
94
- if ( ! empty( $thread_id ) ) {
95
$success = true;
96
$feedback = __( 'Message successfully sent.', 'buddypress' );
97
$view = trailingslashit( $member_messages . 'view' );
98
- $redirect_to = trailingslashit( $view . $thread_id );
99
100
- // Message could not be sent
101
} else {
102
$success = false;
103
- $feedback = __( 'Message was not sent. Please try again.', 'buddypress' );
104
}
105
}
106
}
107
108
- // Feedback
109
if ( ! empty( $feedback ) ) {
110
111
- // Determine message type
112
$type = ( true === $success )
113
? 'success'
114
: 'error';
115
116
- // Add feedback message
117
bp_core_add_message( $feedback, $type );
118
}
119
120
- // Maybe redirect
121
if ( ! empty( $redirect_to ) ) {
122
bp_core_redirect( $redirect_to );
123
}
@@ -125,7 +126,7 @@ function bp_messages_action_create_message() {
125
add_action( 'bp_actions', 'bp_messages_action_create_message' );
126
127
/**
128
- * Handle editing of sitewide notices
129
*
130
* @since 2.4.0 This function was split from messages_screen_notices(). See #6505.
131
*
@@ -136,32 +137,32 @@ add_action( 'bp_actions', 'bp_messages_action_create_message' );
136
function bp_messages_action_edit_notice() {
137
global $notice_id;
138
139
- // Bail if not viewing a single notice URL
140
if ( ! bp_is_messages_component() || ! bp_is_current_action( 'notices' ) || ! bp_action_variable( 1 ) ) {
141
return false;
142
}
143
144
- // Get action variables
145
- $action = bp_action_variable( 0 ); // deactivate|activate|delete
146
$notice_id = bp_action_variable( 1 ); // 1|2|3|etc...
147
148
- // Bail if notice ID is not numeric
149
if ( ! is_numeric( $notice_id ) ) {
150
return;
151
}
152
153
- // Define local variables
154
$redirect_to = '';
155
$feedback = '';
156
$success = false;
157
158
- // Get the notice from database
159
$notice = new BP_Messages_Notice( $notice_id );
160
161
- // Take action
162
switch ( $action ) {
163
164
- // Deactivate
165
case 'deactivate' :
166
$success = $notice->deactivate();
167
$feedback = true === $success
@@ -169,7 +170,7 @@ function bp_messages_action_edit_notice() {
169
: __( 'There was a problem deactivating that notice.', 'buddypress' );
170
break;
171
172
- // Activate
173
case 'activate' :
174
$success = $notice->activate();
175
$feedback = true === $success
@@ -177,7 +178,7 @@ function bp_messages_action_edit_notice() {
177
: __( 'There was a problem activating that notice.', 'buddypress' );
178
break;
179
180
- // Delete
181
case 'delete' :
182
$success = $notice->delete();
183
$feedback = true === $success
@@ -186,19 +187,19 @@ function bp_messages_action_edit_notice() {
186
break;
187
}
188
189
- // Feedback
190
if ( ! empty( $feedback ) ) {
191
192
- // Determine message type
193
$type = ( true === $success )
194
? 'success'
195
: 'error';
196
197
- // Add feedback message
198
bp_core_add_message( $feedback, $type );
199
}
200
201
- // Redirect
202
$member_notices = trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() );
203
$redirect_to = trailingslashit( $member_notices . 'notices' );
204
@@ -211,22 +212,22 @@ add_action( 'bp_actions', 'bp_messages_action_edit_notice' );
211
*/
212
function messages_action_conversation() {
213
214
- // Bail if not viewing a single conversation
215
if ( ! bp_is_messages_component() || ! bp_is_current_action( 'view' ) ) {
216
return false;
217
}
218
219
- // Get the thread ID from the action variable
220
$thread_id = (int) bp_action_variable( 0 );
221
222
if ( ! messages_is_valid_thread( $thread_id ) || ( ! messages_check_thread_access( $thread_id ) && ! bp_current_user_can( 'bp_moderate' ) ) ) {
223
bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() ) );
224
}
225
226
- // Check if a new reply has been submitted
227
if ( isset( $_POST['send'] ) ) {
228
229
- // Check the nonce
230
check_admin_referer( 'messages_send_message', 'send_message_nonce' );
231
232
$new_reply = messages_new_message( array(
@@ -235,7 +236,7 @@ function messages_action_conversation() {
235
'content' => $_POST['content']
236
) );
237
238
- // Send the reply
239
if ( ! empty( $new_reply ) ) {
240
bp_core_add_message( __( 'Your reply was sent successfully', 'buddypress' ) );
241
} else {
@@ -245,7 +246,7 @@ function messages_action_conversation() {
245
bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/view/' . $thread_id . '/' );
246
}
247
248
- // Mark message read
249
messages_mark_thread_read( $thread_id );
250
251
/**
@@ -277,7 +278,7 @@ function messages_action_delete_message() {
277
return false;
278
}
279
280
- // Delete message
281
if ( !messages_delete_thread( $thread_id ) ) {
282
bp_core_add_message( __('There was an error deleting that message.', 'buddypress'), 'error' );
283
} else {
22
*/
23
function bp_messages_action_create_message() {
24
25
+ // Bail if not posting to the compose message screen.
26
if ( ! bp_is_post_request() || ! bp_is_messages_component() || ! bp_is_current_action( 'compose' ) ) {
27
return false;
28
}
29
30
+ // Check the nonce.
31
check_admin_referer( 'messages_send_message' );
32
33
+ // Define local variables.
34
$redirect_to = '';
35
$feedback = '';
36
$success = false;
37
38
+ // Missing subject or content.
39
if ( empty( $_POST['subject'] ) || empty( $_POST['content'] ) ) {
40
$success = false;
41
45
$feedback = __( 'Your message was not sent. Please enter some content.', 'buddypress' );
46
}
47
48
+ // Subject and content present.
49
} else {
50
51
+ // Setup the link to the logged-in user's messages.
52
$member_messages = trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() );
53
54
+ // Site-wide notice.
55
if ( isset( $_POST['send-notice'] ) ) {
56
57
+ // Attempt to save the notice and redirect to notices.
58
if ( messages_send_notice( $_POST['subject'], $_POST['content'] ) ) {
59
$success = true;
60
$feedback = __( 'Notice successfully created.', 'buddypress' );
61
$redirect_to = trailingslashit( $member_messages . 'notices' );
62
63
+ // Notice could not be sent.
64
} else {
65
$success = false;
66
$feedback = __( 'Notice was not created. Please try again.', 'buddypress' );
67
}
68
69
+ // Private conversation.
70
} else {
71
72
+ // Filter recipients into the format we need - array( 'username/userid', 'username/userid' ).
73
$autocomplete_recipients = (array) explode( ',', $_POST['send-to-input'] );
74
$typed_recipients = (array) explode( ' ', $_POST['send_to_usernames'] );
75
$recipients = array_merge( $autocomplete_recipients, $typed_recipients );
83
*/
84
$recipients = apply_filters( 'bp_messages_recipients', $recipients );
85
86
+ // Attempt to send the message.
87
+ $send = messages_new_message( array(
88
'recipients' => $recipients,
89
'subject' => $_POST['subject'],
90
+ 'content' => $_POST['content'],
91
+ 'error_type' => 'wp_error'
92
) );
93
94
+ // Send the message and redirect to it.
95
+ if ( true === is_int( $send ) ) {
96
$success = true;
97
$feedback = __( 'Message successfully sent.', 'buddypress' );
98
$view = trailingslashit( $member_messages . 'view' );
99
+ $redirect_to = trailingslashit( $view . $send );
100
101
+ // Message could not be sent.
102
} else {
103
$success = false;
104
+ $feedback = $send->get_error_message();
105
}
106
}
107
}
108
109
+ // Feedback.
110
if ( ! empty( $feedback ) ) {
111
112
+ // Determine message type.
113
$type = ( true === $success )
114
? 'success'
115
: 'error';
116
117
+ // Add feedback message.
118
bp_core_add_message( $feedback, $type );
119
}
120
121
+ // Maybe redirect.
122
if ( ! empty( $redirect_to ) ) {
123
bp_core_redirect( $redirect_to );
124
}
126
add_action( 'bp_actions', 'bp_messages_action_create_message' );
127
128
/**
129
+ * Handle editing of sitewide notices.
130
*
131
* @since 2.4.0 This function was split from messages_screen_notices(). See #6505.
132
*
137
function bp_messages_action_edit_notice() {
138
global $notice_id;
139
140
+ // Bail if not viewing a single notice URL.
141
if ( ! bp_is_messages_component() || ! bp_is_current_action( 'notices' ) || ! bp_action_variable( 1 ) ) {
142
return false;
143
}
144
145
+ // Get action variables.
146
+ $action = bp_action_variable( 0 ); // deactivate|activate|delete.
147
$notice_id = bp_action_variable( 1 ); // 1|2|3|etc...
148
149
+ // Bail if notice ID is not numeric.
150
if ( ! is_numeric( $notice_id ) ) {
151
return;
152
}
153
154
+ // Define local variables.
155
$redirect_to = '';
156
$feedback = '';
157
$success = false;
158
159
+ // Get the notice from database.
160
$notice = new BP_Messages_Notice( $notice_id );
161
162
+ // Take action.
163
switch ( $action ) {
164
165
+ // Deactivate.
166
case 'deactivate' :
167
$success = $notice->deactivate();
168
$feedback = true === $success
170
: __( 'There was a problem deactivating that notice.', 'buddypress' );
171
break;
172
173
+ // Activate.
174
case 'activate' :
175
$success = $notice->activate();
176
$feedback = true === $success
178
: __( 'There was a problem activating that notice.', 'buddypress' );
179
break;
180
181
+ // Delete.
182
case 'delete' :
183
$success = $notice->delete();
184
$feedback = true === $success
187
break;
188
}
189
190
+ // Feedback.
191
if ( ! empty( $feedback ) ) {
192
193
+ // Determine message type.
194
$type = ( true === $success )
195
? 'success'
196
: 'error';
197
198
+ // Add feedback message.
199
bp_core_add_message( $feedback, $type );
200
}
201
202
+ // Redirect.
203
$member_notices = trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() );
204
$redirect_to = trailingslashit( $member_notices . 'notices' );
205
212
*/
213
function messages_action_conversation() {
214
215
+ // Bail if not viewing a single conversation.
216
if ( ! bp_is_messages_component() || ! bp_is_current_action( 'view' ) ) {
217
return false;
218
}
219
220
+ // Get the thread ID from the action variable.
221
$thread_id = (int) bp_action_variable( 0 );
222
223
if ( ! messages_is_valid_thread( $thread_id ) || ( ! messages_check_thread_access( $thread_id ) && ! bp_current_user_can( 'bp_moderate' ) ) ) {
224
bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() ) );
225
}
226
227
+ // Check if a new reply has been submitted.
228
if ( isset( $_POST['send'] ) ) {
229
230
+ // Check the nonce.
231
check_admin_referer( 'messages_send_message', 'send_message_nonce' );
232
233
$new_reply = messages_new_message( array(
236
'content' => $_POST['content']
237
) );
238
239
+ // Send the reply.
240
if ( ! empty( $new_reply ) ) {
241
bp_core_add_message( __( 'Your reply was sent successfully', 'buddypress' ) );
242
} else {
246
bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/view/' . $thread_id . '/' );
247
}
248
249
+ // Mark message read.
250
messages_mark_thread_read( $thread_id );
251
252
/**
278
return false;
279
}
280
281
+ // Delete message.
282
if ( !messages_delete_thread( $thread_id ) ) {
283
bp_core_add_message( __('There was an error deleting that message.', 'buddypress'), 'error' );
284
} else {
bp-messages/bp-messages-cache.php CHANGED
@@ -35,12 +35,12 @@ function bp_messages_update_meta_cache( $message_ids = false ) {
35
) );
36
}
37
38
- // List actions to clear super cached pages on, if super cache is installed
39
add_action( 'messages_delete_thread', 'bp_core_clear_cache' );
40
add_action( 'messages_send_notice', 'bp_core_clear_cache' );
41
add_action( 'messages_message_sent', 'bp_core_clear_cache' );
42
43
- // Don't cache message inbox/sentbox/compose as it's too problematic
44
add_action( 'messages_screen_compose', 'bp_core_clear_cache' );
45
add_action( 'messages_screen_sentbox', 'bp_core_clear_cache' );
46
add_action( 'messages_screen_inbox', 'bp_core_clear_cache' );
@@ -50,18 +50,18 @@ add_action( 'messages_screen_inbox', 'bp_core_clear_cache' );
50
*
51
* @since 2.0.0
52
*
53
- * @param BP_Messages_Message $message
54
*/
55
function bp_messages_clear_cache_on_message_save( BP_Messages_Message $message ) {
56
- // Delete thread cache
57
wp_cache_delete( $message->thread_id, 'bp_messages_threads' );
58
59
- // Delete unread count for each recipient
60
foreach ( (array) $message->recipients as $recipient ) {
61
wp_cache_delete( $recipient->user_id, 'bp_messages_unread_count' );
62
}
63
64
- // Delete thread recipient cache
65
wp_cache_delete( 'thread_recipients_' . $message->thread_id, 'bp_messages' );
66
}
67
add_action( 'messages_message_after_save', 'bp_messages_clear_cache_on_message_save' );
@@ -75,13 +75,13 @@ add_action( 'messages_message_after_save', 'bp_messages_clear_cache_on_message_s
75
* Otherwise, an array of thread IDs.
76
*/
77
function bp_messages_clear_cache_on_message_delete( $thread_ids ) {
78
- // Delete thread and thread recipient cache
79
foreach( (array) $thread_ids as $thread_id ) {
80
wp_cache_delete( $thread_id, 'bp_messages_threads' );
81
wp_cache_delete( "thread_recipients_{$thread_id}", 'bp_messages' );
82
}
83
84
- // Delete unread count for logged-in user
85
wp_cache_delete( bp_loggedin_user_id(), 'bp_messages_unread_count' );
86
}
87
add_action( 'messages_delete_thread', 'bp_messages_clear_cache_on_message_delete' );
@@ -93,7 +93,7 @@ add_action( 'messages_delete_thread', 'bp_messages_clear_cache_on_message_delete
93
*
94
* @since 2.0.0
95
*
96
- * @param BP_Messages_Notice $notice
97
*/
98
function bp_notices_clear_cache( $notice ) {
99
wp_cache_delete( 'active_notice', 'bp_messages' );
35
) );
36
}
37
38
+ // List actions to clear super cached pages on, if super cache is installed.
39
add_action( 'messages_delete_thread', 'bp_core_clear_cache' );
40
add_action( 'messages_send_notice', 'bp_core_clear_cache' );
41
add_action( 'messages_message_sent', 'bp_core_clear_cache' );
42
43
+ // Don't cache message inbox/sentbox/compose as it's too problematic.
44
add_action( 'messages_screen_compose', 'bp_core_clear_cache' );
45
add_action( 'messages_screen_sentbox', 'bp_core_clear_cache' );
46
add_action( 'messages_screen_inbox', 'bp_core_clear_cache' );
50
*
51
* @since 2.0.0
52
*
53
+ * @param BP_Messages_Message $message Message being saved.
54
*/
55
function bp_messages_clear_cache_on_message_save( BP_Messages_Message $message ) {
56
+ // Delete thread cache.
57
wp_cache_delete( $message->thread_id, 'bp_messages_threads' );
58
59
+ // Delete unread count for each recipient.
60
foreach ( (array) $message->recipients as $recipient ) {
61
wp_cache_delete( $recipient->user_id, 'bp_messages_unread_count' );
62
}
63
64
+ // Delete thread recipient cache.
65
wp_cache_delete( 'thread_recipients_' . $message->thread_id, 'bp_messages' );
66
}
67
add_action( 'messages_message_after_save', 'bp_messages_clear_cache_on_message_save' );
75
* Otherwise, an array of thread IDs.
76
*/
77
function bp_messages_clear_cache_on_message_delete( $thread_ids ) {
78
+ // Delete thread and thread recipient cache.
79
foreach( (array) $thread_ids as $thread_id ) {
80
wp_cache_delete( $thread_id, 'bp_messages_threads' );
81
wp_cache_delete( "thread_recipients_{$thread_id}", 'bp_messages' );
82
}
83
84
+ // Delete unread count for logged-in user.
85
wp_cache_delete( bp_loggedin_user_id(), 'bp_messages_unread_count' );
86
}
87
add_action( 'messages_delete_thread', 'bp_messages_clear_cache_on_message_delete' );
93
*
94
* @since 2.0.0
95
*
96
+ * @param BP_Messages_Notice $notice Notice that was saved.
97
*/
98
function bp_notices_clear_cache( $notice ) {
99
wp_cache_delete( 'active_notice', 'bp_messages' );
bp-messages/bp-messages-filters.php CHANGED
@@ -74,10 +74,11 @@ add_filter( 'bp_get_the_thread_subject', 'stripslashes_deep' );
74
* @see bp_has_message_threads() for description of parameters
75
*
76
* @param array|string $args See {@link bp_has_message_threads()}.
77
*/
78
function bp_messages_enforce_current_user( $args = array() ) {
79
80
- // Non-community moderators can only ever see their own messages
81
if ( is_user_logged_in() && ! bp_current_user_can( 'bp_moderate' ) ) {
82
$_user_id = (int) bp_loggedin_user_id();
83
if ( $_user_id !== (int) $args['user_id'] ) {
@@ -85,7 +86,7 @@ function bp_messages_enforce_current_user( $args = array() ) {
85
}
86
}
87
88
- // Return possibly modified $args array
89
return $args;
90
}
91
add_filter( 'bp_after_has_message_threads_parse_args', 'bp_messages_enforce_current_user', 5 );
74
* @see bp_has_message_threads() for description of parameters
75
*
76
* @param array|string $args See {@link bp_has_message_threads()}.
77
+ * @return array
78
*/
79
function bp_messages_enforce_current_user( $args = array() ) {
80
81
+ // Non-community moderators can only ever see their own messages.
82
if ( is_user_logged_in() && ! bp_current_user_can( 'bp_moderate' ) ) {
83
$_user_id = (int) bp_loggedin_user_id();
84
if ( $_user_id !== (int) $args['user_id'] ) {
86
}
87
}
88
89
+ // Return possibly modified $args array.
90
return $args;
91
}
92
add_filter( 'bp_after_has_message_threads_parse_args', 'bp_messages_enforce_current_user', 5 );
bp-messages/bp-messages-functions.php CHANGED
@@ -17,6 +17,8 @@ defined( 'ABSPATH' ) || exit;
17
/**
18
* Create a new message.
19
*
20
* @param array|string $args {
21
* Array of arguments.
22
* @type int $sender_id Optional. ID of the user who is sending the
@@ -31,27 +33,42 @@ defined( 'ABSPATH' ) || exit;
31
* threads, 'No Subject' will be used if no $subject is provided.
32
* @type string $content Content of the message. Cannot be empty.
33
* @type string $date_sent Date sent, in 'Y-m-d H:i:s' format. Default: current date/time.
34
* }
35
* @return int|bool ID of the message thread on success, false on failure.
36
*/
37
function messages_new_message( $args = '' ) {
38
39
- // Parse the default arguments
40
$r = bp_parse_args( $args, array(
41
'sender_id' => bp_loggedin_user_id(),
42
- 'thread_id' => false, // false for a new message, thread id for a reply to a thread.
43
'recipients' => array(), // Can be an array of usernames, user_ids or mixed.
44
'subject' => false,
45
'content' => false,
46
- 'date_sent' => bp_core_current_time()
47
), 'messages_new_message' );
48
49
- // Bail if no sender or no content
50
if ( empty( $r['sender_id'] ) || empty( $r['content'] ) ) {
51
- return false;
52
}
53
54
- // Create a new message object
55
$message = new BP_Messages_Message;
56
$message->thread_id = $r['thread_id'];
57
$message->sender_id = $r['sender_id'];
@@ -72,7 +89,7 @@ function messages_new_message( $args = '' ) {
72
unset( $message->recipients[ $r['sender_id'] ] );
73
}
74
75
- // Set a default reply subject if none was sent
76
if ( empty( $message->subject ) ) {
77
$message->subject = sprintf( __( 'Re: %s', 'buddypress' ), $thread->messages[0]->subject );
78
}
@@ -80,47 +97,51 @@ function messages_new_message( $args = '' ) {
80
// ...otherwise use the recipients passed
81
} else {
82
83
- // Bail if no recipients
84
if ( empty( $r['recipients'] ) ) {
85
- return false;
86
}
87
88
- // Set a default subject if none exists
89
if ( empty( $message->subject ) ) {
90
$message->subject = __( 'No Subject', 'buddypress' );
91
}
92
93
- // Setup the recipients array
94
$recipient_ids = array();
95
96
- // Invalid recipients are added to an array, for future enhancements
97
$invalid_recipients = array();
98
99
- // Loop the recipients and convert all usernames to user_ids where needed
100
foreach( (array) $r['recipients'] as $recipient ) {
101
102
- // Trim spaces and skip if empty
103
$recipient = trim( $recipient );
104
if ( empty( $recipient ) ) {
105
continue;
106
}
107
108
// Check user_login / nicename columns first
109
- // @see http://buddypress.trac.wordpress.org/ticket/5151
110
if ( bp_is_username_compatibility_mode() ) {
111
$recipient_id = bp_core_get_userid( urldecode( $recipient ) );
112
} else {
113
$recipient_id = bp_core_get_userid_from_nicename( $recipient );
114
}
115
116
- // Check against user ID column if no match and if passed recipient is numeric
117
if ( empty( $recipient_id ) && is_numeric( $recipient ) ) {
118
if ( bp_core_get_core_userdata( (int) $recipient ) ) {
119
$recipient_id = (int) $recipient;
120
}
121
}
122
123
- // Decide which group to add this recipient to
124
if ( empty( $recipient_id ) ) {
125
$invalid_recipients[] = $recipient;
126
} else {
@@ -135,20 +156,24 @@ function messages_new_message( $args = '' ) {
135
unset( $recipient_ids[ $self_send ] );
136
}
137
138
- // Remove duplicates & bail if no recipients
139
$recipient_ids = array_unique( $recipient_ids );
140
if ( empty( $recipient_ids ) ) {
141
- return false;
142
}
143
144
- // Format this to match existing recipients
145
foreach( (array) $recipient_ids as $i => $recipient_id ) {
146
$message->recipients[$i] = new stdClass;
147
$message->recipients[$i]->user_id = $recipient_id;
148
}
149
}
150
151
- // Bail if message failed to send
152
if ( ! $message->send() ) {
153
return false;
154
}
@@ -162,7 +187,7 @@ function messages_new_message( $args = '' ) {
162
*/
163
do_action_ref_array( 'messages_message_sent', array( &$message ) );
164
165
- // Return the thread ID
166
return $message->thread_id;
167
}
168
@@ -171,7 +196,6 @@ function messages_new_message( $args = '' ) {
171
*
172
* @param string $subject Subject of the notice.
173
* @param string $message Content of the notice.
174
- *
175
* @return bool True on success, false on failure.
176
*/
177
function messages_send_notice( $subject, $message ) {
@@ -185,7 +209,7 @@ function messages_send_notice( $subject, $message ) {
185
$notice->message = $message;
186
$notice->date_sent = bp_core_current_time();
187
$notice->is_active = 1;
188
- $notice->save(); // send it.
189
190
/**
191
* Fires after a notice has been successfully sent.
@@ -204,8 +228,7 @@ function messages_send_notice( $subject, $message ) {
204
/**
205
* Delete message thread(s).
206
*
207
- * @param int|array Thread ID or array of thread IDs.
208
- *
209
* @return bool True on success, false on failure.
210
*/
211
function messages_delete_thread( $thread_ids ) {
@@ -258,7 +281,6 @@ function messages_delete_thread( $thread_ids ) {
258
*
259
* @param int $thread_id ID of the thread.
260
* @param int $user_id Optional. ID of the user. Default: ID of the logged-in user.
261
- *
262
* @return int|null Message ID if the user has access, otherwise null.
263
*/
264
function messages_check_thread_access( $thread_id, $user_id = 0 ) {
@@ -323,7 +345,6 @@ function messages_remove_callback_values() {
323
* Get the unread messages count for a user.
324
*
325
* @param int $user_id Optional. ID of the user. Default: ID of the logged-in user.
326
- *
327
* @return int
328
*/
329
function messages_get_unread_count( $user_id = 0 ) {
@@ -339,7 +360,6 @@ function messages_get_unread_count( $user_id = 0 ) {
339
*
340
* @param int $user_id ID of the user.
341
* @param int $message_id ID of the message.
342
- *
343
* @return int|null Returns the ID of the message if the user is the
344
* sender, otherwise null.
345
*/
@@ -351,7 +371,6 @@ function messages_is_user_sender( $user_id, $message_id ) {
351
* Get the ID of the sender of a message.
352
*
353
* @param int $message_id ID of the message.
354
- *
355
* @return int|null The ID of the sender if found, otherwise null.
356
*/
357
function messages_get_message_sender( $message_id ) {
@@ -362,7 +381,6 @@ function messages_get_message_sender( $message_id ) {
362
* Check whether a message thread exists.
363
*
364
* @param int $thread_id ID of the thread.
365
- *
366
* @return int|null The message thread ID on success, null on failure.
367
*/
368
function messages_is_valid_thread( $thread_id ) {
@@ -400,23 +418,22 @@ function messages_get_message_thread_id( $message_id = 0 ) {
400
* @param string|bool $meta_key Meta key to delete. Default false.
401
* @param string|bool $meta_value Meta value to delete. Default false.
402
* @param bool $delete_all Whether or not to delete all meta data.
403
- *
404
* @return bool
405
*/
406
function bp_messages_delete_meta( $message_id, $meta_key = false, $meta_value = false, $delete_all = false ) {
407
- // Legacy - if no meta_key is passed, delete all for the item
408
if ( empty( $meta_key ) ) {
409
global $wpdb;
410
411
$keys = $wpdb->get_col( $wpdb->prepare( "SELECT meta_key FROM {$wpdb->messagemeta} WHERE message_id = %d", $message_id ) );
412
413
- // With no meta_key, ignore $delete_all
414
$delete_all = false;
415
} else {
416
$keys = array( $meta_key );
417
}
418
419
- // no keys, so stop now!
420
if ( empty( $keys ) ) {
421
return false;
422
}
@@ -442,7 +459,6 @@ function bp_messages_delete_meta( $message_id, $meta_key = false, $meta_value =
442
* @param int $message_id ID of the message to retrieve meta for.
443
* @param string $meta_key Meta key to retrieve. Default empty string.
444
* @param bool $single Whether or not to fetch all or a single value.
445
- *
446
* @return mixed
447
*/
448
function bp_messages_get_meta( $message_id, $meta_key = '', $single = true ) {
@@ -464,8 +480,7 @@ function bp_messages_get_meta( $message_id, $meta_key = '', $single = true ) {
464
* @param string|bool $meta_key Meta key to update.
465
* @param string|bool $meta_value Meta value to update.
466
* @param string $prev_value If specified, only update existing metadata entries with
467
- * the specified value. Otherwise, update all entries.
468
- *
469
* @return mixed
470
*/
471
function bp_messages_update_meta( $message_id, $meta_key, $meta_value, $prev_value = '' ) {
@@ -487,8 +502,8 @@ function bp_messages_update_meta( $message_id, $meta_key, $meta_value, $prev_val
487
* @param string|bool $meta_key Meta key to update.
488
* @param string|bool $meta_value Meta value to update.
489
* @param bool $unique Whether the specified metadata key should be
490
- * unique for the object. If true, and the object
491
- * already has a value for the specified metadata key,
492
* no change will be made.
493
* @return mixed
494
*/
17
/**
18
* Create a new message.
19
*
20
+ * @since 2.4.0 Added 'error_type' as an additional $args parameter.
21
+ *
22
* @param array|string $args {
23
* Array of arguments.
24
* @type int $sender_id Optional. ID of the user who is sending the
33
* threads, 'No Subject' will be used if no $subject is provided.
34
* @type string $content Content of the message. Cannot be empty.
35
* @type string $date_sent Date sent, in 'Y-m-d H:i:s' format. Default: current date/time.
36
+ * @type string $error_type Optional. Error type. Either 'bool' or 'wp_error'. Default: 'bool'.
37
* }
38
* @return int|bool ID of the message thread on success, false on failure.
39
*/
40
function messages_new_message( $args = '' ) {
41
42
+ // Parse the default arguments.
43
$r = bp_parse_args( $args, array(
44
'sender_id' => bp_loggedin_user_id(),
45
+ 'thread_id' => false, // False for a new message, thread id for a reply to a thread.
46
'recipients' => array(), // Can be an array of usernames, user_ids or mixed.
47
'subject' => false,
48
'content' => false,
49
+ 'date_sent' => bp_core_current_time(),
50
+ 'error_type' => 'bool'
51
), 'messages_new_message' );
52
53
+ // Bail if no sender or no content.
54
if ( empty( $r['sender_id'] ) || empty( $r['content'] ) ) {
55
+ if ( 'wp_error' === $r['error_type'] ) {
56
+ if ( empty( $r['sender_id'] ) ) {
57
+ $error_code = 'messages_empty_sender';
58
+ $feedback = __( 'Your message was not sent. Please use a valid sender.', 'buddypress' );
59
+ } else {
60
+ $error_code = 'messages_empty_content';
61
+ $feedback = __( 'Your message was not sent. Please enter some content.', 'buddypress' );
62
+ }
63
+
64
+ return new WP_Error( $error_code, $feedback );
65
+
66
+ } else {
67
+ return false;
68
+ }
69
}
70
71
+ // Create a new message object.
72
$message = new BP_Messages_Message;
73
$message->thread_id = $r['thread_id'];
74
$message->sender_id = $r['sender_id'];
89
unset( $message->recipients[ $r['sender_id'] ] );
90
}
91
92
+ // Set a default reply subject if none was sent.
93
if ( empty( $message->subject ) ) {
94
$message->subject = sprintf( __( 'Re: %s', 'buddypress' ), $thread->messages[0]->subject );
95
}
97
// ...otherwise use the recipients passed
98
} else {
99
100
+ // Bail if no recipients.
101
if ( empty( $r['recipients'] ) ) {
102
+ if ( 'wp_error' === $r['error_type'] ) {
103
+ return new WP_Error( 'message_empty_recipients', __( 'Message could not be sent. Please enter a recipient.', 'buddypress' ) );
104
+ } else {
105
+ return false;
106
+ }
107
}
108
109
+ // Set a default subject if none exists.
110
if ( empty( $message->subject ) ) {
111
$message->subject = __( 'No Subject', 'buddypress' );
112
}
113
114
+ // Setup the recipients array.
115
$recipient_ids = array();
116
117
+ // Invalid recipients are added to an array, for future enhancements.
118
$invalid_recipients = array();
119
120
+ // Loop the recipients and convert all usernames to user_ids where needed.
121
foreach( (array) $r['recipients'] as $recipient ) {
122
123
+ // Trim spaces and skip if empty.
124
$recipient = trim( $recipient );
125
if ( empty( $recipient ) ) {
126
continue;
127
}
128
129
// Check user_login / nicename columns first
130
+ // @see http://buddypress.trac.wordpress.org/ticket/5151.
131
if ( bp_is_username_compatibility_mode() ) {
132
$recipient_id = bp_core_get_userid( urldecode( $recipient ) );
133
} else {
134
$recipient_id = bp_core_get_userid_from_nicename( $recipient );
135
}
136
137
+ // Check against user ID column if no match and if passed recipient is numeric.
138
if ( empty( $recipient_id ) && is_numeric( $recipient ) ) {
139
if ( bp_core_get_core_userdata( (int) $recipient ) ) {
140
$recipient_id = (int) $recipient;
141
}
142
}
143
144
+ // Decide which group to add this recipient to.
145
if ( empty( $recipient_id ) ) {
146
$invalid_recipients[] = $recipient;
147
} else {
156
unset( $recipient_ids[ $self_send ] );
157
}
158