BuddyPress - Version 8.0.2

Version Description

= 8.0.0 = See: https://codex.buddypress.org/releases/version-8-0-0/

= 7.3.0 = See: https://codex.buddypress.org/releases/version-7-3-0/

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

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

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

= 7.0.0 = See: https://codex.buddypress.org/releases/version-7-0-0/

= 6.4.0 = See: https://codex.buddypress.org/releases/version-6-4-0/

= 6.3.0 = See: https://codex.buddypress.org/releases/version-6-3-0/

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

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

= 6.0.0 = See: https://codex.buddypress.org/releases/version-6-0-0/

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

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

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

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

= 5.0.0 = See: https://codex.buddypress.org/releases/version-5-0-0/

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

= 4.3.0 = See: https://codex.buddypress.org/releases/version-4-3-0/

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

= 4.1.0 = See: https://codex.buddypress.org/releases/version-4-1-0/

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

Download this release

Release Info

Developer imath
Plugin Icon 128x128 BuddyPress
Version 8.0.2
Comparing to
See all releases

Code changes from version 7.3.2 to 8.0.2

Files changed (190) hide show
  1. bp-activity/actions/feeds.php +44 -9
  2. bp-activity/admin/js/admin.min.js +1 -1
  3. bp-activity/bp-activity-cssjs.php +9 -3
  4. bp-activity/bp-activity-functions.php +21 -0
  5. bp-activity/bp-activity-notifications.php +1 -1
  6. bp-activity/classes/class-bp-activity-feed.php +80 -77
  7. bp-activity/classes/class-bp-rest-activity-endpoint.php +167 -142
  8. bp-activity/js/mentions.js +3 -2
  9. bp-activity/js/mentions.min.js +1 -1
  10. bp-blogs/bp-blogs-filters.php +1 -1
  11. bp-blogs/classes/class-bp-rest-attachments-blog-avatar-endpoint.php +24 -22
  12. bp-blogs/classes/class-bp-rest-blogs-endpoint.php +89 -86
  13. bp-core/admin/bp-core-admin-functions.php +92 -52
  14. bp-core/admin/bp-core-admin-optouts.php +471 -0
  15. bp-core/admin/bp-core-admin-schema.php +39 -0
  16. bp-core/admin/bp-core-admin-settings.php +21 -0
  17. bp-core/admin/bp-core-admin-slugs.php +32 -20
  18. bp-core/admin/bp-core-admin-tools.php +46 -15
  19. bp-core/admin/css/common-rtl.css +16 -0
  20. bp-core/admin/css/common-rtl.min.css +1 -1
  21. bp-core/admin/css/common.css +16 -0
  22. bp-core/admin/css/common.min.css +1 -1
  23. bp-core/admin/js/customizer-controls.min.js +1 -1
  24. bp-core/admin/js/customizer-receiver-emails.min.js +1 -1
  25. bp-core/admin/js/dismissible-admin-notices.min.js +1 -1
  26. bp-core/admin/js/hello.min.js +1 -1
  27. bp-core/admin/js/types-admin.min.js +1 -1
  28. bp-core/bp-core-adminbar.php +2 -21
  29. bp-core/bp-core-attachments.php +2 -1
  30. bp-core/bp-core-avatars.php +67 -3
  31. bp-core/bp-core-blocks.php +14 -1
  32. bp-core/bp-core-buddybar.php +0 -2
  33. bp-core/bp-core-cache.php +11 -0
  34. bp-core/bp-core-cssjs.php +4 -4
  35. bp-core/bp-core-filters.php +13 -4
  36. bp-core/bp-core-functions.php +564 -210
  37. bp-core/bp-core-options.php +0 -26
  38. bp-core/bp-core-template.php +98 -19
  39. bp-core/bp-core-update.php +116 -1
  40. bp-core/classes/class-bp-admin.php +108 -124
  41. bp-core/classes/class-bp-email.php +16 -0
  42. bp-core/classes/class-bp-invitation-manager.php +99 -36
  43. bp-core/classes/class-bp-invitation.php +81 -18
  44. bp-core/classes/class-bp-optout.php +828 -0
  45. bp-core/classes/class-bp-optouts-list-table.php +393 -0
  46. bp-core/classes/class-bp-rest-components-endpoint.php +31 -29
  47. bp-core/classes/trait-attachments.php +1 -1
  48. bp-core/css/admin-bar-rtl.css +13 -0
  49. bp-core/css/admin-bar-rtl.min.css +1 -1
  50. bp-core/css/admin-bar.css +13 -0
  51. bp-core/css/admin-bar.min.css +1 -1
  52. bp-core/css/buddybar-rtl.css +0 -235
  53. bp-core/css/buddybar-rtl.min.css +0 -1
  54. bp-core/css/buddybar.css +0 -235
  55. bp-core/css/buddybar.min.css +0 -1
  56. bp-core/deprecated/2.1.php +0 -413
  57. bp-core/deprecated/8.0.php +57 -0
  58. bp-core/images/bp-members-invitations-invite-screen.png +0 -0
  59. bp-core/images/bp-members-invitations-manage-admin-screen.png +0 -0
  60. bp-core/images/bp-new-blocks.png +0 -0
  61. bp-core/images/bp-nouveau-2021.png +0 -0
  62. bp-core/images/bp-types-illustration.png +0 -0
  63. bp-core/images/bp-xprofile-admin-signup-fields.png +0 -0
  64. bp-core/images/bp-xprofile-checkbox-acceptance-field-type.png +0 -0
  65. bp-core/images/bp-xprofile-wp-field-type.png +0 -0
  66. bp-core/js/avatar.js +3 -3
  67. bp-core/js/avatar.min.js +1 -1
  68. bp-core/js/block-components.js +1 -1
  69. bp-core/js/block-components.js.map +1 -1
  70. bp-core/js/bp-api-request.min.js +1 -1
  71. bp-core/js/bp-plupload.js +9 -6
  72. bp-core/js/bp-plupload.min.js +1 -1
  73. bp-core/js/confirm.js +1 -1
  74. bp-core/js/confirm.min.js +1 -1
  75. bp-core/js/cover-image.js +3 -3
  76. bp-core/js/cover-image.min.js +1 -1
  77. bp-core/js/jquery-query.min.js +1 -1
  78. bp-core/js/vendor/jquery-cookie.js +3 -3
  79. bp-core/js/vendor/jquery-cookie.min.js +1 -1
  80. bp-core/js/vendor/jquery-scroll-to.js +112 -102
  81. bp-core/js/vendor/jquery-scroll-to.min.js +1 -1
  82. bp-core/js/vendor/jquery.atwho.js +5 -5
  83. bp-core/js/vendor/jquery.atwho.min.js +1 -1
  84. bp-core/js/vendor/jquery.caret.min.js +1 -1
  85. bp-core/js/vendor/livestamp.min.js +1 -1
  86. bp-core/js/vendor/moment-js/locale/af.min.js +1 -1
  87. bp-core/js/vendor/moment-js/locale/ar-ly.min.js +1 -1
  88. bp-core/js/vendor/moment-js/locale/ar.min.js +1 -1
  89. bp-core/js/vendor/moment-js/locale/az.min.js +1 -1
  90. bp-core/js/vendor/moment-js/locale/be.min.js +1 -1
  91. bp-core/js/vendor/moment-js/locale/bg.min.js +1 -1
  92. bp-core/js/vendor/moment-js/locale/bn.min.js +1 -1
  93. bp-core/js/vendor/moment-js/locale/bo.min.js +1 -1
  94. bp-core/js/vendor/moment-js/locale/br.min.js +1 -1
  95. bp-core/js/vendor/moment-js/locale/bs.min.js +1 -1
  96. bp-core/js/vendor/moment-js/locale/ca.min.js +1 -1
  97. bp-core/js/vendor/moment-js/locale/cs.min.js +1 -1
  98. bp-core/js/vendor/moment-js/locale/cy.min.js +1 -1
  99. bp-core/js/vendor/moment-js/locale/de-at.min.js +1 -1
  100. bp-core/js/vendor/moment-js/locale/de.min.js +1 -1
  101. bp-core/js/vendor/moment-js/locale/el.min.js +1 -1
  102. bp-core/js/vendor/moment-js/locale/en-au.min.js +1 -1
  103. bp-core/js/vendor/moment-js/locale/en-ca.min.js +1 -1
  104. bp-core/js/vendor/moment-js/locale/en-gb.min.js +1 -1
  105. bp-core/js/vendor/moment-js/locale/en-ie.min.js +1 -1
  106. bp-core/js/vendor/moment-js/locale/en-nz.min.js +1 -1
  107. bp-core/js/vendor/moment-js/locale/eo.min.js +1 -1
  108. bp-core/js/vendor/moment-js/locale/es-do.min.js +1 -1
  109. bp-core/js/vendor/moment-js/locale/es.min.js +1 -1
  110. bp-core/js/vendor/moment-js/locale/et.min.js +1 -1
  111. bp-core/js/vendor/moment-js/locale/fi.min.js +1 -1
  112. bp-core/js/vendor/moment-js/locale/fy.min.js +1 -1
  113. bp-core/js/vendor/moment-js/locale/gd.min.js +1 -1
  114. bp-core/js/vendor/moment-js/locale/hi.min.js +1 -1
  115. bp-core/js/vendor/moment-js/locale/hr.min.js +1 -1
  116. bp-core/js/vendor/moment-js/locale/hu.min.js +1 -1
  117. bp-core/js/vendor/moment-js/locale/id.min.js +1 -1
  118. bp-core/js/vendor/moment-js/locale/is.min.js +1 -1
  119. bp-core/js/vendor/moment-js/locale/it.min.js +1 -1
  120. bp-core/js/vendor/moment-js/locale/jv.min.js +1 -1
  121. bp-core/js/vendor/moment-js/locale/kk.min.js +1 -1
  122. bp-core/js/vendor/moment-js/locale/ky.min.js +1 -1
  123. bp-core/js/vendor/moment-js/locale/lb.min.js +1 -1
  124. bp-core/js/vendor/moment-js/locale/lt.min.js +1 -1
  125. bp-core/js/vendor/moment-js/locale/lv.min.js +1 -1
  126. bp-core/js/vendor/moment-js/locale/me.min.js +1 -1
  127. bp-core/js/vendor/moment-js/locale/mk.min.js +1 -1
  128. bp-core/js/vendor/moment-js/locale/ml.min.js +1 -1
  129. bp-core/js/vendor/moment-js/locale/mr.min.js +1 -1
  130. bp-core/js/vendor/moment-js/locale/ms-my.min.js +1 -1
  131. bp-core/js/vendor/moment-js/locale/ms.min.js +1 -1
  132. bp-core/js/vendor/moment-js/locale/ne.min.js +1 -1
  133. bp-core/js/vendor/moment-js/locale/nl.min.js +1 -1
  134. bp-core/js/vendor/moment-js/locale/pa-in.min.js +1 -1
  135. bp-core/js/vendor/moment-js/locale/pl.min.js +1 -1
  136. bp-core/js/vendor/moment-js/locale/ro.min.js +1 -1
  137. bp-core/js/vendor/moment-js/locale/ru.min.js +1 -1
  138. bp-core/js/vendor/moment-js/locale/si.min.js +1 -1
  139. bp-core/js/vendor/moment-js/locale/sk.min.js +1 -1
  140. bp-core/js/vendor/moment-js/locale/sr-cyrl.min.js +1 -1
  141. bp-core/js/vendor/moment-js/locale/sr.min.js +1 -1
  142. bp-core/js/vendor/moment-js/locale/ss.min.js +1 -1
  143. bp-core/js/vendor/moment-js/locale/sv.min.js +1 -1
  144. bp-core/js/vendor/moment-js/locale/ta.min.js +1 -1
  145. bp-core/js/vendor/moment-js/locale/te.min.js +1 -1
  146. bp-core/js/vendor/moment-js/locale/tlh.min.js +1 -1
  147. bp-core/js/vendor/moment-js/locale/tr.min.js +1 -1
  148. bp-core/js/vendor/moment-js/locale/tzl.min.js +1 -1
  149. bp-core/js/vendor/moment-js/locale/uk.min.js +1 -1
  150. bp-core/js/vendor/moment-js/locale/x-pseudo.min.js +1 -1
  151. bp-core/js/vendor/moment-js/locale/zh-cn.min.js +1 -1
  152. bp-core/js/vendor/moment-js/locale/zh-hk.min.js +1 -1
  153. bp-core/js/vendor/moment-js/locale/zh-tw.min.js +1 -1
  154. bp-core/js/vendor/moment-js/moment.min.js +1 -1
  155. bp-core/js/webcam.js +3 -3
  156. bp-core/js/webcam.min.js +1 -1
  157. bp-core/js/widget-members.js +1 -1
  158. bp-core/js/widget-members.min.js +1 -1
  159. bp-friends/classes/class-bp-rest-friends-endpoint.php +38 -36
  160. bp-friends/js/widget-friends.min.js +1 -1
  161. bp-groups/admin/js/admin.min.js +1 -1
  162. bp-groups/bp-groups-filters.php +1 -1
  163. bp-groups/bp-groups-functions.php +11 -7
  164. bp-groups/bp-groups-notifications.php +1 -1
  165. bp-groups/bp-groups-template.php +2 -2
  166. bp-groups/classes/class-bp-groups-component.php +1 -1
  167. bp-groups/classes/class-bp-rest-attachments-group-avatar-endpoint.php +25 -21
  168. bp-groups/classes/class-bp-rest-attachments-group-cover-endpoint.php +18 -16
  169. bp-groups/classes/class-bp-rest-group-invites-endpoint.php +67 -65
  170. bp-groups/classes/class-bp-rest-group-membership-endpoint.php +68 -53
  171. bp-groups/classes/class-bp-rest-group-membership-request-endpoint.php +16 -11
  172. bp-groups/classes/class-bp-rest-groups-endpoint.php +169 -160
  173. bp-groups/js/manage-members.min.js +1 -1
  174. bp-groups/js/widget-groups.min.js +1 -1
  175. bp-loader.php +1 -1
  176. bp-members/actions/invitations-bulk-manage.php +82 -0
  177. bp-members/admin/bp-members-admin-classes.php +1 -0
  178. bp-members/admin/js/admin.min.js +1 -1
  179. bp-members/bp-members-activity.php +109 -5
  180. bp-members/bp-members-adminbar.php +63 -4
  181. bp-members/bp-members-filters.php +239 -0
  182. bp-members/bp-members-functions.php +342 -0
  183. bp-members/bp-members-invitations.php +165 -0
  184. bp-members/bp-members-notifications.php +231 -0
  185. bp-members/bp-members-template.php +648 -9
  186. bp-members/classes/class-bp-core-members-template.php +5 -3
  187. bp-members/classes/class-bp-members-admin.php +613 -8
  188. bp-members/classes/class-bp-members-component.php +43 -4
  189. bp-members/classes/class-bp-members-invitation-manager.php +179 -0
  190. bp-members/classes/class-bp-members-invitations-list-table.php +149 -0
bp-activity/actions/feeds.php CHANGED
@@ -17,8 +17,11 @@
17
  function bp_activity_action_sitewide_feed() {
18
  $bp = buddypress();
19
 
20
- if ( ! bp_is_activity_component() || ! bp_is_current_action( 'feed' ) || bp_is_user() || ! empty( $bp->groups->current_group ) )
21
  return false;
 
 
 
22
 
23
  // Setup the feed.
24
  buddypress()->activity->feed = new BP_Activity_Feed( array(
@@ -26,10 +29,14 @@ function bp_activity_action_sitewide_feed() {
26
 
27
  /* translators: %s Site Name */
28
  'title' => sprintf( __( '%s | Site-Wide Activity', 'buddypress' ), bp_get_site_name() ),
29
- 'link' => bp_get_activity_directory_permalink(),
30
  'description' => __( 'Activity feed for the entire site.', 'buddypress' ),
31
  'activity_args' => 'display_comments=threaded'
32
  ) );
 
 
 
 
33
  }
34
  add_action( 'bp_actions', 'bp_activity_action_sitewide_feed' );
35
 
@@ -45,18 +52,24 @@ function bp_activity_action_personal_feed() {
45
  return false;
46
  }
47
 
 
 
48
  // Setup the feed.
49
  buddypress()->activity->feed = new BP_Activity_Feed( array(
50
  'id' => 'personal',
51
 
52
  /* translators: 1: Site Name. 2: User Display Name. */
53
  'title' => sprintf( _x( '%1$s | %2$s | Activity', 'Personal activity feed title', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
54
- 'link' => trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() ),
55
 
56
  /* translators: %s: User Display Name */
57
  'description' => sprintf( __( 'Activity feed for %s.', 'buddypress' ), bp_get_displayed_user_fullname() ),
58
  'activity_args' => 'user_id=' . bp_displayed_user_id()
59
  ) );
 
 
 
 
60
  }
61
  add_action( 'bp_actions', 'bp_activity_action_personal_feed' );
62
 
@@ -72,18 +85,24 @@ function bp_activity_action_friends_feed() {
72
  return false;
73
  }
74
 
 
 
75
  // Setup the feed.
76
  buddypress()->activity->feed = new BP_Activity_Feed( array(
77
  'id' => 'friends',
78
 
79
  /* translators: 1: Site Name 2: User Display Name */
80
  'title' => sprintf( __( '%1$s | %2$s | Friends Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
81
- 'link' => trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() ),
82
 
83
  /* translators: %s: User Display Name */
84
  'description' => sprintf( __( "Activity feed for %s's friends.", 'buddypress' ), bp_get_displayed_user_fullname() ),
85
  'activity_args' => 'scope=friends'
86
  ) );
 
 
 
 
87
  }
88
  add_action( 'bp_actions', 'bp_activity_action_friends_feed' );
89
 
@@ -102,6 +121,7 @@ function bp_activity_action_my_groups_feed() {
102
  // Get displayed user's group IDs.
103
  $groups = groups_get_user_groups();
104
  $group_ids = implode( ',', $groups['groups'] );
 
105
 
106
  // Setup the feed.
107
  buddypress()->activity->feed = new BP_Activity_Feed( array(
@@ -109,7 +129,7 @@ function bp_activity_action_my_groups_feed() {
109
 
110
  /* translators: 1: Site Name 2: User Display Name */
111
  'title' => sprintf( __( '%1$s | %2$s | Group Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
112
- 'link' => trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() ),
113
 
114
  /* translators: %s: User Display Name */
115
  'description' => sprintf( __( "Public group activity feed of which %s is a member.", 'buddypress' ), bp_get_displayed_user_fullname() ),
@@ -119,6 +139,10 @@ function bp_activity_action_my_groups_feed() {
119
  'display_comments' => 'threaded'
120
  )
121
  ) );
 
 
 
 
122
  }
123
  add_action( 'bp_actions', 'bp_activity_action_my_groups_feed' );
124
 
@@ -134,17 +158,19 @@ function bp_activity_action_mentions_feed() {
134
  return false;
135
  }
136
 
137
- if ( !bp_is_user_activity() || ! bp_is_current_action( 'mentions' ) || ! bp_is_action_variable( 'feed', 0 ) ) {
138
  return false;
139
  }
140
 
 
 
141
  // Setup the feed.
142
  buddypress()->activity->feed = new BP_Activity_Feed( array(
143
  'id' => 'mentions',
144
 
145
  /* translators: 1: Site Name 2: User Display Name */
146
  'title' => sprintf( __( '%1$s | %2$s | Mentions', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
147
- 'link' => bp_displayed_user_domain() . bp_get_activity_slug() . '/mentions/',
148
 
149
  /* translators: %s: User Display Name */
150
  'description' => sprintf( __( "Activity feed mentioning %s.", 'buddypress' ), bp_get_displayed_user_fullname() ),
@@ -152,6 +178,10 @@ function bp_activity_action_mentions_feed() {
152
  'search_terms' => '@' . bp_core_get_username( bp_displayed_user_id() )
153
  )
154
  ) );
 
 
 
 
155
  }
156
  add_action( 'bp_actions', 'bp_activity_action_mentions_feed' );
157
 
@@ -168,8 +198,9 @@ function bp_activity_action_favorites_feed() {
168
  }
169
 
170
  // Get displayed user's favorite activity IDs.
171
- $favs = bp_activity_get_user_favorites( bp_displayed_user_id() );
172
  $fav_ids = implode( ',', (array) $favs );
 
173
 
174
  // Setup the feed.
175
  buddypress()->activity->feed = new BP_Activity_Feed( array(
@@ -177,11 +208,15 @@ function bp_activity_action_favorites_feed() {
177
 
178
  /* translators: 1: Site Name 2: User Display Name */
179
  'title' => sprintf( __( '%1$s | %2$s | Favorites', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
180
- 'link' => bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites/',
181
 
182
  /* translators: %s: User Display Name */
183
  'description' => sprintf( __( "Activity feed of %s's favorites.", 'buddypress' ), bp_get_displayed_user_fullname() ),
184
  'activity_args' => 'include=' . $fav_ids
185
  ) );
 
 
 
 
186
  }
187
  add_action( 'bp_actions', 'bp_activity_action_favorites_feed' );
17
  function bp_activity_action_sitewide_feed() {
18
  $bp = buddypress();
19
 
20
+ if ( ! bp_is_activity_component() || ! bp_is_current_action( 'feed' ) || bp_is_user() || ! empty( $bp->groups->current_group ) ) {
21
  return false;
22
+ }
23
+
24
+ $link = bp_get_activity_directory_permalink();
25
 
26
  // Setup the feed.
27
  buddypress()->activity->feed = new BP_Activity_Feed( array(
29
 
30
  /* translators: %s Site Name */
31
  'title' => sprintf( __( '%s | Site-Wide Activity', 'buddypress' ), bp_get_site_name() ),
32
+ 'link' => $link,
33
  'description' => __( 'Activity feed for the entire site.', 'buddypress' ),
34
  'activity_args' => 'display_comments=threaded'
35
  ) );
36
+
37
+ if ( ! buddypress()->activity->feed->enabled ) {
38
+ bp_core_redirect( $link );
39
+ }
40
  }
41
  add_action( 'bp_actions', 'bp_activity_action_sitewide_feed' );
42
 
52
  return false;
53
  }
54
 
55
+ $link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() );
56
+
57
  // Setup the feed.
58
  buddypress()->activity->feed = new BP_Activity_Feed( array(
59
  'id' => 'personal',
60
 
61
  /* translators: 1: Site Name. 2: User Display Name. */
62
  'title' => sprintf( _x( '%1$s | %2$s | Activity', 'Personal activity feed title', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
63
+ 'link' => $link,
64
 
65
  /* translators: %s: User Display Name */
66
  'description' => sprintf( __( 'Activity feed for %s.', 'buddypress' ), bp_get_displayed_user_fullname() ),
67
  'activity_args' => 'user_id=' . bp_displayed_user_id()
68
  ) );
69
+
70
+ if ( ! buddypress()->activity->feed->enabled ) {
71
+ bp_core_redirect( $link );
72
+ }
73
  }
74
  add_action( 'bp_actions', 'bp_activity_action_personal_feed' );
75
 
85
  return false;
86
  }
87
 
88
+ $link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() );
89
+
90
  // Setup the feed.
91
  buddypress()->activity->feed = new BP_Activity_Feed( array(
92
  'id' => 'friends',
93
 
94
  /* translators: 1: Site Name 2: User Display Name */
95
  'title' => sprintf( __( '%1$s | %2$s | Friends Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
96
+ 'link' => $link,
97
 
98
  /* translators: %s: User Display Name */
99
  'description' => sprintf( __( "Activity feed for %s's friends.", 'buddypress' ), bp_get_displayed_user_fullname() ),
100
  'activity_args' => 'scope=friends'
101
  ) );
102
+
103
+ if ( ! buddypress()->activity->feed->enabled ) {
104
+ bp_core_redirect( $link );
105
+ }
106
  }
107
  add_action( 'bp_actions', 'bp_activity_action_friends_feed' );
108
 
121
  // Get displayed user's group IDs.
122
  $groups = groups_get_user_groups();
123
  $group_ids = implode( ',', $groups['groups'] );
124
+ $link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() );
125
 
126
  // Setup the feed.
127
  buddypress()->activity->feed = new BP_Activity_Feed( array(
129
 
130
  /* translators: 1: Site Name 2: User Display Name */
131
  'title' => sprintf( __( '%1$s | %2$s | Group Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
132
+ 'link' => $link,
133
 
134
  /* translators: %s: User Display Name */
135
  'description' => sprintf( __( "Public group activity feed of which %s is a member.", 'buddypress' ), bp_get_displayed_user_fullname() ),
139
  'display_comments' => 'threaded'
140
  )
141
  ) );
142
+
143
+ if ( ! buddypress()->activity->feed->enabled ) {
144
+ bp_core_redirect( $link );
145
+ }
146
  }
147
  add_action( 'bp_actions', 'bp_activity_action_my_groups_feed' );
148
 
158
  return false;
159
  }
160
 
161
+ if ( ! bp_is_user_activity() || ! bp_is_current_action( 'mentions' ) || ! bp_is_action_variable( 'feed', 0 ) ) {
162
  return false;
163
  }
164
 
165
+ $link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/mentions' );
166
+
167
  // Setup the feed.
168
  buddypress()->activity->feed = new BP_Activity_Feed( array(
169
  'id' => 'mentions',
170
 
171
  /* translators: 1: Site Name 2: User Display Name */
172
  'title' => sprintf( __( '%1$s | %2$s | Mentions', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
173
+ 'link' => $link,
174
 
175
  /* translators: %s: User Display Name */
176
  'description' => sprintf( __( "Activity feed mentioning %s.", 'buddypress' ), bp_get_displayed_user_fullname() ),
178
  'search_terms' => '@' . bp_core_get_username( bp_displayed_user_id() )
179
  )
180
  ) );
181
+
182
+ if ( ! buddypress()->activity->feed->enabled ) {
183
+ bp_core_redirect( $link );
184
+ }
185
  }
186
  add_action( 'bp_actions', 'bp_activity_action_mentions_feed' );
187
 
198
  }
199
 
200
  // Get displayed user's favorite activity IDs.
201
+ $favs = bp_activity_get_user_favorites( bp_displayed_user_id() );
202
  $fav_ids = implode( ',', (array) $favs );
203
+ $link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites' );
204
 
205
  // Setup the feed.
206
  buddypress()->activity->feed = new BP_Activity_Feed( array(
208
 
209
  /* translators: 1: Site Name 2: User Display Name */
210
  'title' => sprintf( __( '%1$s | %2$s | Favorites', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
211
+ 'link' => $link,
212
 
213
  /* translators: %s: User Display Name */
214
  'description' => sprintf( __( "Activity feed of %s's favorites.", 'buddypress' ), bp_get_displayed_user_fullname() ),
215
  'activity_args' => 'include=' . $fav_ids
216
  ) );
217
+
218
+ if ( ! buddypress()->activity->feed->enabled ) {
219
+ bp_core_redirect( $link );
220
+ }
221
  }
222
  add_action( 'bp_actions', 'bp_activity_action_favorites_feed' );
bp-activity/admin/js/admin.min.js CHANGED
@@ -1 +1 @@
1
- !function(i){var t={init:function(){i(document).on("click",".row-actions a.reply",t.open),i(document).on("click","#bp-activities-container a.cancel",t.close),i(document).on("click","#bp-activities-container a.save",t.send),i(document).on("keyup","#bp-activities:visible",function(i){27===i.which&&t.close()})},open:function(){var t=i("#bp-activities-container").hide();return i(this).parents("tr").after(t),t.fadeIn("300"),i("#bp-activities").focus(),!1},close:function(){return i("#bp-activities-container").fadeOut("200",function(){i("#bp-activities").val("").blur(),i("#bp-replysubmit .error").html("").hide(),i("#bp-replysubmit .waiting").hide()}),!1},send:function(){i("#bp-replysubmit .error").hide(),i("#bp-replysubmit .waiting").show();var e={};return e["_ajax_nonce-bp-activity-admin-reply"]=i('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val(),e.action="bp-activity-admin-reply",e.content=i("#bp-activities").val(),e.parent_id=i("#bp-activities-container").prev().data("parent_id"),e.root_id=i("#bp-activities-container").prev().data("root_id"),i.ajax({data:e,type:"POST",url:ajaxurl,error:function(i){t.error(i)},success:function(i){t.show(i)}}),!1},error:function(t){var e=t.statusText;i("#bp-replysubmit .waiting").hide(),t.responseText&&(e=t.responseText.replace(/<.[^<>]*?>/g,"")),e&&i("#bp-replysubmit .error").html(e).show()},show:function(e){var n,a,r;return"string"==typeof e?(t.error({responseText:e}),!1):(r=wpAjax.parseAjaxResponse(e)).errors?(t.error({responseText:wpAjax.broken}),!1):(r=r.responses[0],void i("#bp-activities-container").fadeOut("200",function(){i("#bp-activities").val("").blur(),i("#bp-replysubmit .error").html("").hide(),i("#bp-replysubmit .waiting").hide(),i("#bp-activities-container").before(r.data),a=i("#activity-"+r.id),n=a.closest(".widefat").css("backgroundColor"),a.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:n},300)}))}};i(document).ready(function(){t.init(),i("#bp_activity_action h3, #bp_activity_content h3").unbind("click"),"undefined"!=typeof postboxes&&postboxes.add_postbox_toggles(bp_activity_admin_vars.page)})}(jQuery);
1
+ !function(a){var r={init:function(){a(document).on("click",".row-actions a.reply",r.open),a(document).on("click","#bp-activities-container a.cancel",r.close),a(document).on("click","#bp-activities-container a.save",r.send),a(document).on("keyup","#bp-activities:visible",function(i){27===i.which&&r.close()})},open:function(){var i=a("#bp-activities-container").hide();return a(this).parents("tr").after(i),i.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 i={};return i["_ajax_nonce-bp-activity-admin-reply"]=a('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val(),i.action="bp-activity-admin-reply",i.content=a("#bp-activities").val(),i.parent_id=a("#bp-activities-container").prev().data("parent_id"),i.root_id=a("#bp-activities-container").prev().data("root_id"),a.ajax({data:i,type:"POST",url:ajaxurl,error:function(i){r.error(i)},success:function(i){r.show(i)}}),!1},error:function(i){var t=i.statusText;a("#bp-replysubmit .waiting").hide(),(t=i.responseText?i.responseText.replace(/<.[^<>]*?>/g,""):t)&&a("#bp-replysubmit .error").html(t).show()},show:function(i){var t,e,n;return"string"==typeof i?(r.error({responseText:i}),!1):(n=wpAjax.parseAjaxResponse(i)).errors?(r.error({responseText:wpAjax.broken}),!1):(n=n.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(n.data),e=a("#activity-"+n.id),t=e.closest(".widefat").css("backgroundColor"),e.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:t},300)}))}};a(document).ready(function(){r.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-cssjs.php CHANGED
@@ -22,10 +22,16 @@ function bp_activity_mentions_script() {
22
 
23
  // Special handling for New/Edit screens in wp-admin.
24
  if ( is_admin() ) {
 
 
 
 
 
25
  if (
26
- ! get_current_screen() ||
27
- ! in_array( get_current_screen()->base, array( 'page', 'post' ) ) ||
28
- ! post_type_supports( get_current_screen()->post_type, 'editor' ) ) {
 
29
  return;
30
  }
31
  }
22
 
23
  // Special handling for New/Edit screens in wp-admin.
24
  if ( is_admin() ) {
25
+ $current_screen = null;
26
+ if ( function_exists( 'get_current_screen' ) ) {
27
+ $current_screen = get_current_screen();
28
+ }
29
+
30
  if (
31
+ ! $current_screen ||
32
+ ( isset( $current_screen->is_block_editor ) && $current_screen->is_block_editor ) ||
33
+ ! in_array( $current_screen->base, array( 'page', 'post' ) ) ||
34
+ ! post_type_supports( $current_screen->post_type, 'editor' ) ) {
35
  return;
36
  }
37
  }
bp-activity/bp-activity-functions.php CHANGED
@@ -4265,3 +4265,24 @@ function bp_activity_personal_data_exporter( $email_address, $page ) {
4265
  'done' => $done,
4266
  );
4267
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4265
  'done' => $done,
4266
  );
4267
  }
4268
+
4269
+ /**
4270
+ * Checks whether an activity feed is enabled.
4271
+ *
4272
+ * @since 8.0.0
4273
+ *
4274
+ * @param string $feed_id The feed identifier. Possible values are:
4275
+ * 'sitewide', 'personal', 'friends', 'mygroups', 'mentions', 'favorites'.
4276
+ */
4277
+ function bp_activity_is_feed_enable( $feed_id = '' ) {
4278
+ /**
4279
+ * Filters if BuddyPress should consider feeds enabled. If disabled, it will return early.
4280
+ *
4281
+ * @since 1.8.0
4282
+ * @since 8.0.0 Adds the `$feed_id` parameter.
4283
+ *
4284
+ * @param bool $value Defaults to true aka feeds are enabled.
4285
+ * @param string $feed_id The feed identifier.
4286
+ */
4287
+ return (bool) apply_filters( 'bp_activity_enable_feeds', true, $feed_id );
4288
+ }
bp-activity/bp-activity-notifications.php CHANGED
@@ -19,7 +19,7 @@ defined( 'ABSPATH' ) || exit;
19
  * @param int $item_id The activity ID.
20
  * @param int $secondary_item_id In the case of at-mentions, this is the mentioner's ID.
21
  * @param int $total_items The total number of notifications to format.
22
- * @param string $format 'string' to get a BuddyBar-compatible notification, 'array' otherwise.
23
  * @param int $id Optional. The notification ID.
24
  * @return string $return Formatted @mention notification.
25
  */
19
  * @param int $item_id The activity ID.
20
  * @param int $secondary_item_id In the case of at-mentions, this is the mentioner's ID.
21
  * @param int $total_items The total number of notifications to format.
22
+ * @param string $format 'string' for notification HTML link or 'array' for separate link and text.
23
  * @param int $id Optional. The notification ID.
24
  * @return string $return Formatted @mention notification.
25
  */
bp-activity/classes/class-bp-activity-feed.php CHANGED
@@ -87,94 +87,97 @@ class BP_Activity_Feed {
87
  * @param array $args Optional.
88
  */
89
  public function __construct( $args = array() ) {
 
90
 
91
- /**
92
- * Filters if BuddyPress should consider feeds enabled. If disabled, it will return early.
93
- *
94
- * @since 1.8.0
95
- *
96
- * @param bool true Default true aka feeds are enabled.
97
- */
98
- if ( false === (bool) apply_filters( 'bp_activity_enable_feeds', true ) ) {
99
  global $wp_query;
100
 
101
  // Set feed flag to false.
102
  $wp_query->is_feed = false;
103
 
104
- return false;
105
- }
106
-
107
- // Setup data.
108
- $this->data = wp_parse_args( $args, array(
109
- // Internal identifier for the RSS feed - should be alphanumeric only.
110
- 'id' => '',
111
-
112
- // RSS title - should be plain-text.
113
- 'title' => '',
114
-
115
- // Relevant link for the RSS feed.
116
- 'link' => '',
117
-
118
- // RSS description - should be plain-text.
119
- 'description' => '',
120
-
121
- // Time-to-live - number of minutes to cache the data before an aggregator
122
- // requests it again. This is only acknowledged if the RSS client supports it
123
- //
124
- // See: http://www.rssboard.org/rss-profile#element-channel-ttl.
125
- // See: http://www.kbcafe.com/rss/rssfeedstate.html#ttl.
126
- 'ttl' => '30',
127
-
128
- // Syndication module - similar to ttl, but not really supported by RSS
129
- // clients
130
- //
131
- // See: http://web.resource.org/rss/1.0/modules/syndication/#description.
132
- // See: http://www.kbcafe.com/rss/rssfeedstate.html#syndicationmodule.
133
- 'update_period' => 'hourly',
134
- 'update_frequency' => 2,
135
-
136
- // Number of items to display.
137
- 'max' => 50,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
 
139
- // Activity arguments passed to bp_has_activities().
140
- 'activity_args' => array()
141
- ) );
 
 
 
 
 
142
 
143
- /**
144
- * Fires before the feed is setup so plugins can modify.
145
- *
146
- * @since 1.8.0
147
- *
148
- * @param BP_Activity_Feed $this Current instance of activity feed. Passed by reference.
149
- */
150
- do_action_ref_array( 'bp_activity_feed_prefetch', array( &$this ) );
151
 
152
- // Setup class properties.
153
- $this->setup_properties();
154
 
155
- // Check if id is valid.
156
- if ( empty( $this->id ) ) {
157
- _doing_it_wrong( 'BP_Activity_Feed', __( "RSS feed 'id' must be defined", 'buddypress' ), 'BP 1.8' );
158
- return false;
159
  }
160
-
161
- /**
162
- * Fires after the feed is setup so plugins can modify.
163
- *
164
- * @since 1.8.0
165
- *
166
- * @param BP_Activity_Feed $this Current instance of activity feed. Passed by reference.
167
- */
168
- do_action_ref_array( 'bp_activity_feed_postfetch', array( &$this ) );
169
-
170
- // Setup feed hooks.
171
- $this->setup_hooks();
172
-
173
- // Output the feed.
174
- $this->output();
175
-
176
- // Kill the rest of the output.
177
- die();
178
  }
179
 
180
  /** SETUP ****************************************************************/
87
  * @param array $args Optional.
88
  */
89
  public function __construct( $args = array() ) {
90
+ $feed_id = '';
91
 
92
+ if ( isset( $args['id'] ) ) {
93
+ $feed_id = sanitize_key( $args['id'] );
94
+ }
95
+
96
+ if ( false === bp_activity_is_feed_enable( $feed_id ) ) {
 
 
 
97
  global $wp_query;
98
 
99
  // Set feed flag to false.
100
  $wp_query->is_feed = false;
101
 
102
+ $this->data = array(
103
+ 'enabled' => false,
104
+ );
105
+ } else {
106
+ // Setup data.
107
+ $this->data = wp_parse_args( $args, array(
108
+ // Internal identifier for the RSS feed - should be alphanumeric only.
109
+ 'id' => '',
110
+
111
+ // RSS title - should be plain-text.
112
+ 'title' => '',
113
+
114
+ // Relevant link for the RSS feed.
115
+ 'link' => '',
116
+
117
+ // RSS description - should be plain-text.
118
+ 'description' => '',
119
+
120
+ // Time-to-live - number of minutes to cache the data before an aggregator
121
+ // requests it again. This is only acknowledged if the RSS client supports it
122
+ //
123
+ // See: http://www.rssboard.org/rss-profile#element-channel-ttl.
124
+ // See: http://www.kbcafe.com/rss/rssfeedstate.html#ttl.
125
+ 'ttl' => '30',
126
+
127
+ // Syndication module - similar to ttl, but not really supported by RSS
128
+ // clients
129
+ //
130
+ // See: http://web.resource.org/rss/1.0/modules/syndication/#description.
131
+ // See: http://www.kbcafe.com/rss/rssfeedstate.html#syndicationmodule.
132
+ 'update_period' => 'hourly',
133
+ 'update_frequency' => 2,
134
+
135
+ // Number of items to display.
136
+ 'max' => 50,
137
+
138
+ // Activity arguments passed to bp_has_activities().
139
+ 'activity_args' => array(),
140
+
141
+ // The activity feed is enabled.
142
+ 'enabled' => false,
143
+ ) );
144
+
145
+ /**
146
+ * Fires before the feed is setup so plugins can modify.
147
+ *
148
+ * @since 1.8.0
149
+ *
150
+ * @param BP_Activity_Feed $this Current instance of activity feed. Passed by reference.
151
+ */
152
+ do_action_ref_array( 'bp_activity_feed_prefetch', array( &$this ) );
153
+
154
+ // Setup class properties.
155
+ $this->setup_properties();
156
+
157
+ // Check if id is valid.
158
+ if ( empty( $this->id ) ) {
159
+ _doing_it_wrong( 'BP_Activity_Feed', __( "RSS feed 'id' must be defined", 'buddypress' ), 'BP 1.8' );
160
+ return false;
161
+ }
162
 
163
+ /**
164
+ * Fires after the feed is setup so plugins can modify.
165
+ *
166
+ * @since 1.8.0
167
+ *
168
+ * @param BP_Activity_Feed $this Current instance of activity feed. Passed by reference.
169
+ */
170
+ do_action_ref_array( 'bp_activity_feed_postfetch', array( &$this ) );
171
 
172
+ // Setup feed hooks.
173
+ $this->setup_hooks();
 
 
 
 
 
 
174
 
175
+ // Output the feed.
176
+ $this->output();
177
 
178
+ // Kill the rest of the output.
179
+ die();
 
 
180
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  }
182
 
183
  /** SETUP ****************************************************************/
bp-activity/classes/class-bp-rest-activity-endpoint.php CHANGED
@@ -929,7 +929,7 @@ class BP_REST_Activity_Endpoint extends WP_REST_Controller {
929
  }
930
  }
931
 
932
- if ( ! empty( $schema['properties']['user_avatar'] ) ) {
933
  $data['user_avatar'] = array(
934
  'full' => bp_core_fetch_avatar(
935
  array(
@@ -1123,11 +1123,32 @@ class BP_REST_Activity_Endpoint extends WP_REST_Controller {
1123
  );
1124
  }
1125
 
 
1126
  if ( bp_is_active( 'groups' ) && 'groups' === $activity->component && ! empty( $activity->item_id ) ) {
1127
- $group = groups_get_group( $activity->item_id );
1128
-
1129
  $links['group'] = array(
1130
- 'href' => bp_get_group_permalink( $group ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1131
  'embeddable' => true,
1132
  );
1133
  }
@@ -1262,165 +1283,169 @@ class BP_REST_Activity_Endpoint extends WP_REST_Controller {
1262
  * @return array
1263
  */
1264
  public function get_item_schema() {
1265
- $schema = array(
1266
- '$schema' => 'http://json-schema.org/draft-04/schema#',
1267
- 'title' => 'bp_activity',
1268
- 'type' => 'object',
1269
- 'properties' => array(
1270
- 'id' => array(
1271
- 'context' => array( 'view', 'edit' ),
1272
- 'description' => __( 'A unique numeric ID for the activity.', 'buddypress' ),
1273
- 'readonly' => true,
1274
- 'type' => 'integer',
1275
- ),
1276
- 'primary_item_id' => array(
1277
- 'context' => array( 'view', 'edit' ),
1278
- 'description' => __( 'The ID of some other object primarily associated with this one.', 'buddypress' ),
1279
- 'type' => 'integer',
1280
- ),
1281
- 'secondary_item_id' => array(
1282
- 'context' => array( 'view', 'edit' ),
1283
- 'description' => __( 'The ID of some other object also associated with this one.', 'buddypress' ),
1284
- 'type' => 'integer',
1285
- ),
1286
- 'user_id' => array(
1287
- 'context' => array( 'view', 'edit' ),
1288
- 'description' => __( 'The ID for the author of the activity.', 'buddypress' ),
1289
- 'readonly' => true,
1290
- 'type' => 'integer',
1291
- ),
1292
- 'link' => array(
1293
- 'context' => array( 'view', 'edit' ),
1294
- 'description' => __( 'The permalink to this activity on the site.', 'buddypress' ),
1295
- 'format' => 'uri',
1296
- 'type' => 'string',
1297
- ),
1298
- 'component' => array(
1299
- 'context' => array( 'view', 'edit' ),
1300
- 'description' => __( 'The active BuddyPress component the activity relates to.', 'buddypress' ),
1301
- 'type' => 'string',
1302
- 'enum' => array_keys( buddypress()->active_components ),
1303
- 'arg_options' => array(
1304
- 'sanitize_callback' => 'sanitize_key',
1305
  ),
1306
- ),
1307
- 'type' => array(
1308
- 'context' => array( 'view', 'edit' ),
1309
- 'description' => __( 'The activity type of the activity.', 'buddypress' ),
1310
- 'type' => 'string',
1311
- 'enum' => array_keys( bp_activity_get_types() ),
1312
- 'arg_options' => array(
1313
- 'sanitize_callback' => 'sanitize_key',
1314
  ),
1315
- ),
1316
- 'title' => array(
1317
- 'context' => array( 'view', 'edit' ),
1318
- 'description' => __( 'The description of the activity\'s type (eg: Username posted an update)', 'buddypress' ),
1319
- 'type' => 'string',
1320
- 'readonly' => true,
1321
- 'arg_options' => array(
1322
- 'sanitize_callback' => 'sanitize_text_field',
1323
  ),
1324
- ),
1325
- 'content' => array(
1326
- 'context' => array( 'view', 'edit' ),
1327
- 'description' => __( 'Allowed HTML content for the activity.', 'buddypress' ),
1328
- 'type' => 'object',
1329
- 'arg_options' => array(
1330
- 'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database().
1331
- 'validate_callback' => null, // Note: validation implemented in self::prepare_item_for_database().
 
 
 
 
 
 
 
 
 
 
 
 
1332
  ),
1333
- 'properties' => array(
1334
- 'raw' => array(
1335
- 'description' => __( 'Content for the activity, as it exists in the database.', 'buddypress' ),
1336
- 'type' => 'string',
1337
- 'context' => array( 'edit' ),
 
 
1338
  ),
1339
- 'rendered' => array(
1340
- 'description' => __( 'HTML content for the activity, transformed for display.', 'buddypress' ),
1341
- 'type' => 'string',
1342
- 'context' => array( 'view', 'edit' ),
1343
- 'readonly' => true,
 
 
 
 
 
 
 
 
 
 
 
 
1344
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1345
  ),
1346
  ),
1347
- 'date' => array(
 
 
 
 
 
1348
  'context' => array( 'view', 'edit' ),
1349
- 'description' => __( "The date the activity was published, in the site's timezone.", 'buddypress' ),
 
1350
  'type' => 'string',
1351
- 'format' => 'date-time',
1352
- ),
1353
- 'status' => array(
 
1354
  'context' => array( 'view', 'edit' ),
1355
- 'description' => __( 'Whether the activity has been marked as spam or not.', 'buddypress' ),
 
1356
  'type' => 'string',
1357
- 'enum' => array( 'published', 'spam' ),
1358
- 'readonly' => true,
1359
- 'arg_options' => array(
1360
- 'sanitize_callback' => 'sanitize_key',
1361
- ),
1362
- ),
1363
- 'comments' => array(
1364
- 'context' => array( 'view', 'edit' ),
1365
- 'description' => __( 'A list of objects children of the activity object.', 'buddypress' ),
1366
- 'type' => 'array',
1367
- 'readonly' => true,
1368
- ),
1369
- 'comment_count' => array(
1370
- 'context' => array( 'view', 'edit' ),
1371
- 'description' => __( 'Total number of comments of the activity object.', 'buddypress' ),
1372
- 'type' => 'integer',
1373
- 'readonly' => true,
1374
- ),
1375
- 'hidden' => array(
1376
- 'context' => array( 'edit' ),
1377
- 'description' => __( 'Whether the activity object should be sitewide hidden or not.', 'buddypress' ),
1378
- 'type' => 'boolean',
1379
- ),
1380
- 'favorited' => array(
1381
  'context' => array( 'view', 'edit' ),
1382
- 'description' => __( 'Whether the activity object has been favorited by the current user.', 'buddypress' ),
1383
- 'type' => 'boolean',
1384
  'readonly' => true,
1385
- ),
1386
- ),
1387
- );
1388
-
1389
- // Avatars.
1390
- if ( true === buddypress()->avatar->show_avatars ) {
1391
- $avatar_properties = array();
1392
-
1393
- $avatar_properties['full'] = array(
1394
- 'context' => array( 'view', 'edit' ),
1395
- /* translators: 1: Full avatar width in pixels. 2: Full avatar height in pixels */
1396
- 'description' => sprintf( __( 'Avatar URL with full image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_full_width() ), number_format_i18n( bp_core_avatar_full_height() ) ),
1397
- 'type' => 'string',
1398
- 'format' => 'uri',
1399
- );
1400
-
1401
- $avatar_properties['thumb'] = array(
1402
- 'context' => array( 'view', 'edit' ),
1403
- /* translators: 1: Thumb avatar width in pixels. 2: Thumb avatar height in pixels */
1404
- 'description' => sprintf( __( 'Avatar URL with thumb image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_thumb_width() ), number_format_i18n( bp_core_avatar_thumb_height() ) ),
1405
- 'type' => 'string',
1406
- 'format' => 'uri',
1407
- );
1408
 
1409
- $schema['properties']['user_avatar'] = array(
1410
- 'context' => array( 'view', 'edit' ),
1411
- 'description' => __( 'Avatar URLs for the author of the activity.', 'buddypress' ),
1412
- 'type' => 'object',
1413
- 'readonly' => true,
1414
- 'properties' => $avatar_properties,
1415
- );
1416
  }
1417
 
1418
  /**
1419
  * Filters the activity schema.
1420
  *
1421
- * @param string $schema The endpoint schema.
1422
  */
1423
- return apply_filters( 'bp_rest_activity_schema', $this->add_additional_fields_schema( $schema ) );
1424
  }
1425
 
1426
  /**
929
  }
930
  }
931
 
932
+ if ( true === buddypress()->avatar->show_avatars ) {
933
  $data['user_avatar'] = array(
934
  'full' => bp_core_fetch_avatar(
935
  array(
1123
  );
1124
  }
1125
 
1126
+ // Embed Group.
1127
  if ( bp_is_active( 'groups' ) && 'groups' === $activity->component && ! empty( $activity->item_id ) ) {
 
 
1128
  $links['group'] = array(
1129
+ 'href' => rest_url(
1130
+ sprintf(
1131
+ '/%s/%s/%d',
1132
+ $this->namespace,
1133
+ buddypress()->groups->id,
1134
+ absint( $activity->item_id )
1135
+ )
1136
+ ),
1137
+ 'embeddable' => true,
1138
+ );
1139
+ }
1140
+
1141
+ // Embed Blog.
1142
+ if ( bp_is_active( 'blogs' ) && 'blogs' === $activity->component && ! empty( $activity->item_id ) ) {
1143
+ $links['blog'] = array(
1144
+ 'href' => rest_url(
1145
+ sprintf(
1146
+ '/%s/%s/%d',
1147
+ $this->namespace,
1148
+ buddypress()->blogs->id,
1149
+ absint( $activity->item_id )
1150
+ )
1151
+ ),
1152
  'embeddable' => true,
1153
  );
1154
  }
1283
  * @return array
1284
  */
1285
  public function get_item_schema() {
1286
+ if ( is_null( $this->schema ) ) {
1287
+ $schema = array(
1288
+ '$schema' => 'http://json-schema.org/draft-04/schema#',
1289
+ 'title' => 'bp_activity',
1290
+ 'type' => 'object',
1291
+ 'properties' => array(
1292
+ 'id' => array(
1293
+ 'context' => array( 'view', 'edit' ),
1294
+ 'description' => __( 'A unique numeric ID for the activity.', 'buddypress' ),
1295
+ 'readonly' => true,
1296
+ 'type' => 'integer',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1297
  ),
1298
+ 'primary_item_id' => array(
1299
+ 'context' => array( 'view', 'edit' ),
1300
+ 'description' => __( 'The ID of some other object primarily associated with this one.', 'buddypress' ),
1301
+ 'type' => 'integer',
 
 
 
 
1302
  ),
1303
+ 'secondary_item_id' => array(
1304
+ 'context' => array( 'view', 'edit' ),
1305
+ 'description' => __( 'The ID of some other object also associated with this one.', 'buddypress' ),
1306
+ 'type' => 'integer',
 
 
 
 
1307
  ),
1308
+ 'user_id' => array(
1309
+ 'context' => array( 'view', 'edit' ),
1310
+ 'description' => __( 'The ID for the author of the activity.', 'buddypress' ),
1311
+ 'readonly' => true,
1312
+ 'type' => 'integer',
1313
+ ),
1314
+ 'link' => array(
1315
+ 'context' => array( 'view', 'edit' ),
1316
+ 'description' => __( 'The permalink to this activity on the site.', 'buddypress' ),
1317
+ 'format' => 'uri',
1318
+ 'type' => 'string',
1319
+ ),
1320
+ 'component' => array(
1321
+ 'context' => array( 'view', 'edit' ),
1322
+ 'description' => __( 'The active BuddyPress component the activity relates to.', 'buddypress' ),
1323
+ 'type' => 'string',
1324
+ 'enum' => array_keys( buddypress()->active_components ),
1325
+ 'arg_options' => array(
1326
+ 'sanitize_callback' => 'sanitize_key',
1327
+ ),
1328
  ),
1329
+ 'type' => array(
1330
+ 'context' => array( 'view', 'edit' ),
1331
+ 'description' => __( 'The activity type of the activity.', 'buddypress' ),
1332
+ 'type' => 'string',
1333
+ 'enum' => array_keys( bp_activity_get_types() ),
1334
+ 'arg_options' => array(
1335
+ 'sanitize_callback' => 'sanitize_key',
1336
  ),
1337
+ ),
1338
+ 'title' => array(
1339
+ 'context' => array( 'view', 'edit' ),
1340
+ 'description' => __( 'The description of the activity\'s type (eg: Username posted an update)', 'buddypress' ),
1341
+ 'type' => 'string',
1342
+ 'readonly' => true,
1343
+ 'arg_options' => array(
1344
+ 'sanitize_callback' => 'sanitize_text_field',
1345
+ ),
1346
+ ),
1347
+ 'content' => array(
1348
+ 'context' => array( 'view', 'edit' ),
1349
+ 'description' => __( 'Allowed HTML content for the activity.', 'buddypress' ),
1350
+ 'type' => 'object',
1351
+ 'arg_options' => array(
1352
+ 'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database().
1353
+ 'validate_callback' => null, // Note: validation implemented in self::prepare_item_for_database().
1354
  ),
1355
+ 'properties' => array(
1356
+ 'raw' => array(
1357
+ 'description' => __( 'Content for the activity, as it exists in the database.', 'buddypress' ),
1358
+ 'type' => 'string',
1359
+ 'context' => array( 'edit' ),
1360
+ ),
1361
+ 'rendered' => array(
1362
+ 'description' => __( 'HTML content for the activity, transformed for display.', 'buddypress' ),
1363
+ 'type' => 'string',
1364
+ 'context' => array( 'view', 'edit' ),
1365
+ 'readonly' => true,
1366
+ ),
1367
+ ),
1368
+ ),
1369
+ 'date' => array(
1370
+ 'context' => array( 'view', 'edit' ),
1371
+ 'description' => __( "The date the activity was published, in the site's timezone.", 'buddypress' ),
1372
+ 'type' => 'string',
1373
+ 'format' => 'date-time',
1374
+ ),
1375
+ 'status' => array(
1376
+ 'context' => array( 'view', 'edit' ),
1377
+ 'description' => __( 'Whether the activity has been marked as spam or not.', 'buddypress' ),
1378
+ 'type' => 'string',
1379
+ 'enum' => array( 'published', 'spam' ),
1380
+ 'readonly' => true,
1381
+ 'arg_options' => array(
1382
+ 'sanitize_callback' => 'sanitize_key',
1383
+ ),
1384
+ ),
1385
+ 'comments' => array(
1386
+ 'context' => array( 'view', 'edit' ),
1387
+ 'description' => __( 'A list of objects children of the activity object.', 'buddypress' ),
1388
+ 'type' => 'array',
1389
+ 'readonly' => true,
1390
+ ),
1391
+ 'comment_count' => array(
1392
+ 'context' => array( 'view', 'edit' ),
1393
+ 'description' => __( 'Total number of comments of the activity object.', 'buddypress' ),
1394
+ 'type' => 'integer',
1395
+ 'readonly' => true,
1396
+ ),
1397
+ 'hidden' => array(
1398
+ 'context' => array( 'edit' ),
1399
+ 'description' => __( 'Whether the activity object should be sitewide hidden or not.', 'buddypress' ),
1400
+ 'type' => 'boolean',
1401
+ ),
1402
+ 'favorited' => array(
1403
+ 'context' => array( 'view', 'edit' ),
1404
+ 'description' => __( 'Whether the activity object has been favorited by the current user.', 'buddypress' ),
1405
+ 'type' => 'boolean',
1406
+ 'readonly' => true,
1407
  ),
1408
  ),
1409
+ );
1410
+
1411
+ if ( true === buddypress()->avatar->show_avatars ) {
1412
+ $avatar_properties = array();
1413
+
1414
+ $avatar_properties['full'] = array(
1415
  'context' => array( 'view', 'edit' ),
1416
+ /* translators: 1: Full avatar width in pixels. 2: Full avatar height in pixels */
1417
+ 'description' => sprintf( __( 'Avatar URL with full image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_full_width() ), number_format_i18n( bp_core_avatar_full_height() ) ),
1418
  'type' => 'string',
1419
+ 'format' => 'uri',
1420
+ );
1421
+
1422
+ $avatar_properties['thumb'] = array(
1423
  'context' => array( 'view', 'edit' ),
1424
+ /* translators: 1: Thumb avatar width in pixels. 2: Thumb avatar height in pixels */
1425
+ 'description' => sprintf( __( 'Avatar URL with thumb image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_thumb_width() ), number_format_i18n( bp_core_avatar_thumb_height() ) ),
1426
  'type' => 'string',
1427
+ 'format' => 'uri',
1428
+ );
1429
+
1430
+ $schema['properties']['user_avatar'] = array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1431
  'context' => array( 'view', 'edit' ),
1432
+ 'description' => __( 'Avatar URLs for the author of the activity.', 'buddypress' ),
1433
+ 'type' => 'object',
1434
  'readonly' => true,
1435
+ 'properties' => $avatar_properties,
1436
+ );
1437
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1438
 
1439
+ // Cache current schema here.
1440
+ $this->schema = $schema;
 
 
 
 
 
1441
  }
1442
 
1443
  /**
1444
  * Filters the activity schema.
1445
  *
1446
+ * @param array $schema The endpoint schema.
1447
  */
1448
+ return apply_filters( 'bp_rest_activity_schema', $this->add_additional_fields_schema( $this->schema ) );
1449
  }
1450
 
1451
  /**
bp-activity/js/mentions.js CHANGED
@@ -20,7 +20,7 @@ window.bp = window.bp || {};
20
  * @since 2.1.0
21
  */
22
  $.fn.bp_mentions = function( options ) {
23
- if ( $.isArray( options ) ) {
24
  options = { data: options };
25
  }
26
 
@@ -178,7 +178,8 @@ window.bp = window.bp || {};
178
 
179
  params = { 'action': 'bp_get_suggestions', 'term': query, 'type': 'members' };
180
 
181
- if ( $.isNumeric( this.$inputor.data( 'suggestions-group-id' ) ) ) {
 
182
  params['group-id'] = parseInt( this.$inputor.data( 'suggestions-group-id' ), 10 );
183
  }
184
 
20
  * @since 2.1.0
21
  */
22
  $.fn.bp_mentions = function( options ) {
23
+ if ( Array.isArray( options ) ) {
24
  options = { data: options };
25
  }
26
 
178
 
179
  params = { 'action': 'bp_get_suggestions', 'term': query, 'type': 'members' };
180
 
181
+ var groupId = this.$inputor.data( 'suggestions-group-id' );
182
+ if ( ( 'number' === typeof groupId || 'string' === typeof groupId ) && ! isNaN( groupId - parseFloat( groupId ) ) ) {
183
  params['group-id'] = parseInt( this.$inputor.data( 'suggestions-group-id' ), 10 );
184
  }
185
 
bp-activity/js/mentions.min.js CHANGED
@@ -1 +1 @@
1
- window.bp=window.bp||{},function(t,e,i){var n,s=[];t.mentions=t.mentions||{},t.mentions.users=window.bp.mentions.users||[],"object"==typeof window.BP_Suggestions&&(t.mentions.users=window.BP_Suggestions.friends||t.mentions.users),e.fn.bp_mentions=function(t){e.isArray(t)&&(t={data:t});var i={delay:200,hideWithoutSuffix:!0,insertTpl:"@${ID}",limit:10,startWithSpace:!1,suffix:"",callbacks:{filter:function(t,e,i){var n,s,r,o=[],a=new RegExp("^"+t+"| "+t,"ig");for(s=0,r=e.length;s<r;s++)(n=e[s])[i].toLowerCase().match(a)&&o.push(n);return o},highlighter:function(t,e){if(!e)return t;var i=new RegExp(">(\\s*|[\\w\\s]*)("+this.at.replace("+","\\+")+"?"+e.replace("+","\\+")+")([\\w ]*)\\s*<","ig");return t.replace(i,function(t,e,i,n){return">"+e+"<strong>"+i+"</strong>"+n+"<"})},before_reposition:function(t){var i,n,s,r,o=e("#atwho-ground-"+this.id+" .atwho-view"),a=e("body"),u=this.$inputor.data("atwho");"undefined"!==u&&"undefined"!==u.iframe&&null!==u.iframe?(i=this.$inputor.caret("offset",{iframe:u.iframe}),"undefined"!==(s=e(u.iframe).offset())&&(i.left+=s.left,i.top+=s.top)):i=this.$inputor.caret("offset"),i.left>a.width()/2?(o.addClass("right"),r=i.left-t.left-this.view.$el.width()):(o.removeClass("right"),r=i.left-t.left+1),a.width()<=400&&e(document).scrollTop(i.top-6),(!(n=parseInt(this.$inputor.css("line-height").substr(0,this.$inputor.css("line-height").length-2),10))||n<5)&&(n=19),t.top=i.top+n,t.left+=r},inserting_wrapper:function(t,e,i){return""+e+i}}},r={callbacks:{remoteFilter:function(t,i){var r=e(this),o={};"object"!=typeof(n=s[t])?(r.xhr&&r.xhr.abort(),o={action:"bp_get_suggestions",term:t,type:"members"},e.isNumeric(this.$inputor.data("suggestions-group-id"))&&(o["group-id"]=parseInt(this.$inputor.data("suggestions-group-id"),10)),r.xhr=e.getJSON(ajaxurl,o).done(function(n){if(n.success){var r=e.map(n.data,function(t){return t.search=t.search||t.ID+" "+t.name,t});s[t]=r,i(r)}})):i(n)}},data:e.map(t.data,function(t){return t.search=t.search||t.ID+" "+t.name,t}),at:"@",searchKey:"search",displayTpl:'<li data-value="@${ID}"><img src="${image}" alt="" /><span class="username">@${ID}</span><small>${name}</small></li>'},o=e.extend(!0,{},i,r,t);return e.fn.atwho.call(this,o)},e(document).ready(function(){e(".bp-suggestions, #comments form textarea, .wp-editor-area").bp_mentions(t.mentions.users)}),t.mentions.tinyMCEinit=function(){void 0!==window.tinyMCE&&null!==window.tinyMCE.activeEditor&&void 0!==window.tinyMCE.activeEditor&&e(window.tinyMCE.activeEditor.contentDocument.activeElement).atwho("setIframe",e(".wp-editor-wrap iframe")[0]).bp_mentions(t.mentions.users)}}(bp,jQuery);
1
+ window.bp=window.bp||{},function(t,r){var o,a=[];t.mentions=t.mentions||{},t.mentions.users=window.bp.mentions.users||[],"object"==typeof window.BP_Suggestions&&(t.mentions.users=window.BP_Suggestions.friends||t.mentions.users),r.fn.bp_mentions=function(t){Array.isArray(t)&&(t={data:t});var e={delay:200,hideWithoutSuffix:!0,insertTpl:"@${ID}",limit:10,startWithSpace:!1,suffix:"",callbacks:{filter:function(t,e,i){for(var n,s=[],r=new RegExp("^"+t+"| "+t,"ig"),o=0,a=e.length;o<a;o++)(n=e[o])[i].toLowerCase().match(r)&&s.push(n);return s},highlighter:function(t,e){if(!e)return t;e=new RegExp(">(\\s*|[\\w\\s]*)("+this.at.replace("+","\\+")+"?"+e.replace("+","\\+")+")([\\w ]*)\\s*<","ig");return t.replace(e,function(t,e,i,n){return">"+e+"<strong>"+i+"</strong>"+n+"<"})},before_reposition:function(t){var e,i=r("#atwho-ground-"+this.id+" .atwho-view"),n=r("body"),s=this.$inputor.data("atwho");"undefined"!==s&&"undefined"!==s.iframe&&null!==s.iframe?(e=this.$inputor.caret("offset",{iframe:s.iframe}),"undefined"!==(s=r(s.iframe).offset())&&(e.left+=s.left,e.top+=s.top)):e=this.$inputor.caret("offset"),i=e.left>n.width()/2?(i.addClass("right"),e.left-t.left-this.view.$el.width()):(i.removeClass("right"),e.left-t.left+1),n.width()<=400&&r(document).scrollTop(e.top-6),n=parseInt(this.$inputor.css("line-height").substr(0,this.$inputor.css("line-height").length-2),10),t.top=e.top+(n=!n||n<5?19:n),t.left+=i},inserting_wrapper:function(t,e,i){return""+e+i}}},i={callbacks:{remoteFilter:function(e,i){var t,n=r(this),s={};"object"!=typeof(o=a[e])?(n.xhr&&n.xhr.abort(),s={action:"bp_get_suggestions",term:e,type:"members"},"number"!=typeof(t=this.$inputor.data("suggestions-group-id"))&&"string"!=typeof t||isNaN(t-parseFloat(t))||(s["group-id"]=parseInt(this.$inputor.data("suggestions-group-id"),10)),n.xhr=r.getJSON(ajaxurl,s).done(function(t){t.success&&(t=r.map(t.data,function(t){return t.search=t.search||t.ID+" "+t.name,t}),a[e]=t,i(t))})):i(o)}},data:r.map(t.data,function(t){return t.search=t.search||t.ID+" "+t.name,t}),at:"@",searchKey:"search",displayTpl:'<li data-value="@${ID}"><img src="${image}" alt="" /><span class="username">@${ID}</span><small>${name}</small></li>'},t=r.extend(!0,{},e,i,t);return r.fn.atwho.call(this,t)},r(document).ready(function(){r(".bp-suggestions, #comments form textarea, .wp-editor-area").bp_mentions(t.mentions.users)}),t.mentions.tinyMCEinit=function(){void 0===window.tinyMCE||null===window.tinyMCE.activeEditor||void 0===window.tinyMCE.activeEditor||r(window.tinyMCE.activeEditor.contentDocument.activeElement).atwho("setIframe",r(".wp-editor-wrap iframe")[0]).bp_mentions(t.mentions.users)}}(bp,jQuery);
bp-blogs/bp-blogs-filters.php CHANGED
@@ -158,7 +158,7 @@ function bp_blogs_default_avatar( $avatar, $params ) {
158
 
159
  return $avatar;
160
  }
161
- add_filter( 'bp_core_avatar_default', 'bp_blogs_default_avatar', 10, 2 );
162
  add_filter( 'bp_core_avatar_default_thumb', 'bp_blogs_default_avatar', 10, 2 );
163
 
164
  /**
158
 
159
  return $avatar;
160
  }
161
+ add_filter( 'bp_core_default_avatar', 'bp_blogs_default_avatar', 10, 2 );
162
  add_filter( 'bp_core_avatar_default_thumb', 'bp_blogs_default_avatar', 10, 2 );
163
 
164
  /**
bp-blogs/classes/class-bp-rest-attachments-blog-avatar-endpoint.php CHANGED
@@ -245,34 +245,36 @@ class BP_REST_Attachments_Blog_Avatar_Endpoint extends WP_REST_Controller {
245
  * @return array
246
  */
247
  public function get_item_schema() {
248
- $schema = array(
249
- '$schema' => 'http://json-schema.org/draft-04/schema#',
250
- 'title' => 'bp_attachments_blog_avatar',
251
- 'type' => 'object',
252
- 'properties' => array(
253
- 'full' => array(
254
- 'context' => array( 'view', 'edit' ),
255
- 'description' => __( 'Full size of the image file.', 'buddypress' ),
256
- 'type' => 'string',
257
- 'format' => 'uri',
258
- 'readonly' => true,
259
- ),
260
- 'thumb' => array(
261
- 'context' => array( 'view', 'edit' ),
262
- 'description' => __( 'Thumb size of the image file.', 'buddypress' ),
263
- 'type' => 'string',
264
- 'format' => 'uri',
265
- 'readonly' => true,
 
 
266
  ),
267
- ),
268
- );
269
 
270
  /**
271
  * Filters the blog avatar schema.
272
  *
273
- * @param string $schema The endpoint schema.
274
  */
275
- return apply_filters( 'bp_rest_attachments_blog_avatar_schema', $this->add_additional_fields_schema( $schema ) );
276
  }
277
 
278
  /**
245
  * @return array
246
  */
247
  public function get_item_schema() {
248
+ if ( is_null( $this->schema ) ) {
249
+ $this->schema = array(
250
+ '$schema' => 'http://json-schema.org/draft-04/schema#',
251
+ 'title' => 'bp_attachments_blog_avatar',
252
+ 'type' => 'object',
253
+ 'properties' => array(
254
+ 'full' => array(
255
+ 'context' => array( 'view', 'edit' ),
256
+ 'description' => __( 'Full size of the image file.', 'buddypress' ),
257
+ 'type' => 'string',
258
+ 'format' => 'uri',
259
+ 'readonly' => true,
260
+ ),
261
+ 'thumb' => array(
262
+ 'context' => array( 'view', 'edit' ),
263
+ 'description' => __( 'Thumb size of the image file.', 'buddypress' ),
264
+ 'type' => 'string',
265
+ 'format' => 'uri',
266
+ 'readonly' => true,
267
+ ),
268
  ),
269
+ );
270
+ }
271
 
272
  /**
273
  * Filters the blog avatar schema.
274
  *
275
+ * @param array $schema The endpoint schema.
276
  */
277
+ return apply_filters( 'bp_rest_attachments_blog_avatar_schema', $this->add_additional_fields_schema( $this->schema ) );
278
  }
279
 
280
  /**
bp-blogs/classes/class-bp-rest-blogs-endpoint.php CHANGED
@@ -414,17 +414,15 @@ class BP_REST_Blogs_Endpoint extends WP_REST_Controller {
414
  'last_activity' => bp_rest_prepare_date_response( $blog->last_activity ),
415
  );
416
 
417
- // Get item schema.
418
- $schema = $this->get_item_schema();
419
-
420
  // Blog Avatars.
421
- if ( ! empty( $schema['properties']['avatar_urls'] ) ) {
422
  $data['avatar_urls'] = array(
423
  'thumb' => bp_get_blog_avatar(
424
  array(
425
  'type' => 'thumb',
426
  'blog_id' => $blog->blog_id,
427
  'admin_user_id' => $blog->admin_user_id,
 
428
  )
429
  ),
430
  'full' => bp_get_blog_avatar(
@@ -432,6 +430,7 @@ class BP_REST_Blogs_Endpoint extends WP_REST_Controller {
432
  'type' => 'full',
433
  'blog_id' => $blog->blog_id,
434
  'admin_user_id' => $blog->admin_user_id,
 
435
  )
436
  ),
437
  );
@@ -476,7 +475,7 @@ class BP_REST_Blogs_Endpoint extends WP_REST_Controller {
476
  'collection' => array(
477
  'href' => rest_url( $base ),
478
  ),
479
- 'user' => array(
480
  'href' => rest_url( bp_rest_get_user_url( $blog->admin_user_id ) ),
481
  'embeddable' => true,
482
  ),
@@ -620,93 +619,97 @@ class BP_REST_Blogs_Endpoint extends WP_REST_Controller {
620
  * @return array
621
  */
622
  public function get_item_schema() {
623
- $schema = array(
624
- '$schema' => 'http://json-schema.org/draft-04/schema#',
625
- 'title' => 'bp_blogs',
626
- 'type' => 'object',
627
- 'properties' => array(
628
- 'id' => array(
629
- 'context' => array( 'view', 'edit' ),
630
- 'description' => __( 'A unique numeric ID for the blog.', 'buddypress' ),
631
- 'readonly' => true,
632
- 'type' => 'integer',
633
- ),
634
- 'user_id' => array(
635
- 'context' => array( 'view', 'edit' ),
636
- 'description' => __( 'A unique numeric ID for the blog admin.', 'buddypress' ),
637
- 'readonly' => true,
638
- 'type' => 'integer',
639
- ),
640
- 'name' => array(
641
- 'context' => array( 'view', 'edit' ),
642
- 'description' => __( 'The name of the blog.', 'buddypress' ),
643
- 'readonly' => true,
644
- 'type' => 'string',
645
- 'arg_options' => array(
646
- 'sanitize_callback' => 'sanitize_text_field',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
647
  ),
648
  ),
649
- 'permalink' => array(
650
- 'context' => array( 'view', 'edit' ),
651
- 'description' => __( 'The permalink of the blog.', 'buddypress' ),
652
- 'readonly' => true,
 
 
 
 
653
  'type' => 'string',
654
  'format' => 'uri',
655
- ),
656
- 'description' => array(
657
- 'context' => array( 'view', 'edit' ),
658
- 'description' => __( 'The description of the blog.', 'buddypress' ),
659
- 'readonly' => true,
660
- 'type' => 'string',
661
- ),
662
- 'path' => array(
663
- 'context' => array( 'view', 'edit' ),
664
- 'description' => __( 'The path of the blog.', 'buddypress' ),
665
- 'readonly' => true,
666
- 'type' => 'string',
667
- ),
668
- 'domain' => array(
669
- 'context' => array( 'view', 'edit' ),
670
- 'description' => __( 'the domain of the blog.', 'buddypress' ),
671
- 'readonly' => true,
672
- 'type' => 'string',
673
- ),
674
- 'last_activity' => array(
675
- 'context' => array( 'view', 'edit' ),
676
- 'description' => __( "The last activity date from the blog, in the site's timezone.", 'buddypress' ),
677
- 'type' => 'string',
678
- 'format' => 'date-time',
679
- ),
680
- ),
681
- );
682
 
683
- // Blog Avatars.
684
- if ( buddypress()->avatar->show_avatars ) {
685
- $avatar_properties = array();
686
-
687
- $avatar_properties['full'] = array(
688
- /* translators: 1: Full avatar width in pixels. 2: Full avatar height in pixels */
689
- 'description' => sprintf( __( 'Avatar URL with full image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_full_width() ), number_format_i18n( bp_core_avatar_full_height() ) ),
690
- 'type' => 'string',
691
- 'format' => 'uri',
692
- 'context' => array( 'view', 'edit' ),
693
- );
694
 
695
- $avatar_properties['thumb'] = array(
696
- /* translators: 1: Thumb avatar width in pixels. 2: Thumb avatar height in pixels */
697
- 'description' => sprintf( __( 'Avatar URL with thumb image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_thumb_width() ), number_format_i18n( bp_core_avatar_thumb_height() ) ),
698
- 'type' => 'string',
699
- 'format' => 'uri',
700
- 'context' => array( 'view', 'edit' ),
701
- );
 
702
 
703
- $schema['properties']['avatar_urls'] = array(
704
- 'description' => __( 'Avatar URLs for the blog.', 'buddypress' ),
705
- 'type' => 'object',
706
- 'context' => array( 'view', 'edit' ),
707
- 'readonly' => true,
708
- 'properties' => $avatar_properties,
709
- );
710
  }
711
 
712
  /**
@@ -716,7 +719,7 @@ class BP_REST_Blogs_Endpoint extends WP_REST_Controller {
716
  *
717
  * @param array $schema The endpoint schema.
718
  */
719
- return apply_filters( 'bp_rest_blogs_schema', $this->add_additional_fields_schema( $schema ) );
720
  }
721
 
722
  /**
414
  'last_activity' => bp_rest_prepare_date_response( $blog->last_activity ),
415
  );
416
 
 
 
 
417
  // Blog Avatars.
418
+ if ( true === buddypress()->avatar->show_avatars ) {
419
  $data['avatar_urls'] = array(
420
  'thumb' => bp_get_blog_avatar(
421
  array(
422
  'type' => 'thumb',
423
  'blog_id' => $blog->blog_id,
424
  'admin_user_id' => $blog->admin_user_id,
425
+ 'html' => false,
426
  )
427
  ),
428
  'full' => bp_get_blog_avatar(
430
  'type' => 'full',
431
  'blog_id' => $blog->blog_id,
432
  'admin_user_id' => $blog->admin_user_id,
433
+ 'html' => false,
434
  )
435
  ),
436
  );
475
  'collection' => array(
476
  'href' => rest_url( $base ),
477
  ),
478
+ 'user' => array(
479
  'href' => rest_url( bp_rest_get_user_url( $blog->admin_user_id ) ),
480
  'embeddable' => true,
481
  ),
619
  * @return array
620
  */
621
  public function get_item_schema() {
622
+ if ( is_null( $this->schema ) ) {
623
+ $schema = array(
624
+ '$schema' => 'http://json-schema.org/draft-04/schema#',
625
+ 'title' => 'bp_blogs',
626
+ 'type' => 'object',
627
+ 'properties' => array(
628
+ 'id' => array(
629
+ 'context' => array( 'view', 'edit', 'embed' ),
630
+ 'description' => __( 'A unique numeric ID for the blog.', 'buddypress' ),
631
+ 'readonly' => true,
632
+ 'type' => 'integer',
633
+ ),
634
+ 'user_id' => array(
635
+ 'context' => array( 'view', 'edit', 'embed' ),
636
+ 'description' => __( 'A unique numeric ID for the blog admin.', 'buddypress' ),
637
+ 'readonly' => true,
638
+ 'type' => 'integer',
639
+ ),
640
+ 'name' => array(
641
+ 'context' => array( 'view', 'edit', 'embed' ),
642
+ 'description' => __( 'The name of the blog.', 'buddypress' ),
643
+ 'readonly' => true,
644
+ 'type' => 'string',
645
+ 'arg_options' => array(
646
+ 'sanitize_callback' => 'sanitize_text_field',
647
+ ),
648
+ ),
649
+ 'permalink' => array(
650
+ 'context' => array( 'view', 'edit', 'embed' ),
651
+ 'description' => __( 'The permalink of the blog.', 'buddypress' ),
652
+ 'readonly' => true,
653
+ 'type' => 'string',
654
+ 'format' => 'uri',
655
+ ),
656
+ 'description' => array(
657
+ 'context' => array( 'view', 'edit', 'embed' ),
658
+ 'description' => __( 'The description of the blog.', 'buddypress' ),
659
+ 'readonly' => true,
660
+ 'type' => 'string',
661
+ ),
662
+ 'path' => array(
663
+ 'context' => array( 'view', 'edit', 'embed' ),
664
+ 'description' => __( 'The path of the blog.', 'buddypress' ),
665
+ 'readonly' => true,
666
+ 'type' => 'string',
667
+ ),
668
+ 'domain' => array(
669
+ 'context' => array( 'view', 'edit', 'embed' ),
670
+ 'description' => __( 'the domain of the blog.', 'buddypress' ),
671
+ 'readonly' => true,
672
+ 'type' => 'string',
673
+ ),
674
+ 'last_activity' => array(
675
+ 'context' => array( 'view', 'edit', 'embed' ),
676
+ 'description' => __( "The last activity date from the blog, in the site's timezone.", 'buddypress' ),
677
+ 'type' => 'string',
678
+ 'format' => 'date-time',
679
  ),
680
  ),
681
+ );
682
+
683
+ if ( true === buddypress()->avatar->show_avatars ) {
684
+ $avatar_properties = array();
685
+
686
+ $avatar_properties['full'] = array(
687
+ /* translators: 1: Full avatar width in pixels. 2: Full avatar height in pixels */
688
+ 'description' => sprintf( __( 'Avatar URL with full image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_full_width() ), number_format_i18n( bp_core_avatar_full_height() ) ),
689
  'type' => 'string',
690
  'format' => 'uri',
691
+ 'context' => array( 'view', 'edit', 'embed' ),
692
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
693
 
694
+ $avatar_properties['thumb'] = array(
695
+ /* translators: 1: Thumb avatar width in pixels. 2: Thumb avatar height in pixels */
696
+ 'description' => sprintf( __( 'Avatar URL with thumb image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_thumb_width() ), number_format_i18n( bp_core_avatar_thumb_height() ) ),
697
+ 'type' => 'string',
698
+ 'format' => 'uri',
699
+ 'context' => array( 'view', 'edit', 'embed' ),
700
+ );
 
 
 
 
701
 
702
+ $schema['properties']['avatar_urls'] = array(
703
+ 'description' => __( 'Avatar URLs for the blog.', 'buddypress' ),
704
+ 'type' => 'object',
705
+ 'context' => array( 'view', 'edit', 'embed' ),
706
+ 'readonly' => true,
707
+ 'properties' => $avatar_properties,
708
+ );
709
+ }
710
 
711
+ // Cache current schema here.
712
+ $this->schema = $schema;
 
 
 
 
 
713
  }
714
 
715
  /**
719
  *
720
  * @param array $schema The endpoint schema.
721
  */
722
+ return apply_filters( 'bp_rest_blogs_schema', $this->add_additional_fields_schema( $this->schema ) );
723
  }
724
 
725
  /**
bp-core/admin/bp-core-admin-functions.php CHANGED
@@ -84,6 +84,11 @@ function bp_core_modify_admin_menu_highlight() {
84
  if ( in_array( $plugin_page, array( 'bp-tools', 'available-tools' ) ) ) {
85
  $submenu_file = $plugin_page;
86
  }
 
 
 
 
 
87
  }
88
 
89
  /**
@@ -279,7 +284,7 @@ function bp_core_activation_notice() {
279
 
280
  // Activate and Register are special cases. They are not components but they need WP pages.
281
  // If user registration is disabled, we can skip this step.
282
- if ( bp_get_signup_allowed() ) {
283
  $wp_page_components[] = array(
284
  'id' => 'activate',
285
  'name' => __( 'Activate', 'buddypress' ),
@@ -389,10 +394,13 @@ function bp_do_activation_redirect() {
389
  * Output the tabs in the admin area.
390
  *
391
  * @since 1.5.0
 
392
  *
393
  * @param string $active_tab Name of the tab that is active. Optional.
 
 
394
  */
395
- function bp_core_admin_tabs( $active_tab = '' ) {
396
  $tabs_html = '';
397
  $idle_class = 'nav-tab';
398
  $active_class = 'nav-tab nav-tab-active';
@@ -404,7 +412,7 @@ function bp_core_admin_tabs( $active_tab = '' ) {
404
  *
405
  * @param array $value Array of tabs to output to the admin area.
406
  */
407
- $tabs = apply_filters( 'bp_core_admin_tabs', bp_core_get_admin_tabs( $active_tab ) );
408
 
409
  // Loop through tabs and build navigation.
410
  foreach ( array_values( $tabs ) as $tab_data ) {
@@ -419,46 +427,78 @@ function bp_core_admin_tabs( $active_tab = '' ) {
419
  * Fires after the output of tabs for the admin area.
420
  *
421
  * @since 1.5.0
 
 
 
422
  */
423
- do_action( 'bp_admin_tabs' );
424
  }
425
 
426
  /**
427
  * Get the data for the tabs in the admin area.
428
  *
429
  * @since 2.2.0
 
430
  *
431
  * @param string $active_tab Name of the tab that is active. Optional.
 
 
432
  * @return string
433
  */
434
- function bp_core_get_admin_tabs( $active_tab = '' ) {
435
- $tabs = array(
436
- '0' => array(
437
- 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), 'admin.php' ) ),
438
- 'name' => __( 'Components', 'buddypress' ),
439
- ),
440
- '2' => array(
441
- 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ),
442
- 'name' => __( 'Options', 'buddypress' ),
443
- ),
444
- '1' => array(
445
- 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) ),
446
- 'name' => __( 'Pages', 'buddypress' ),
447
- ),
448
- '3' => array(
449
- 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-credits' ), 'admin.php' ) ),
450
- 'name' => __( 'Credits', 'buddypress' ),
451
- ),
452
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
453
 
454
  /**
455
  * Filters the tab data used in our wp-admin screens.
456
  *
457
  * @since 2.2.0
 
458
  *
459
- * @param array $tabs Tab data.
 
460
  */
461
- return apply_filters( 'bp_core_get_admin_tabs', $tabs );
462
  }
463
 
464
  /** Help **********************************************************************/
@@ -586,7 +626,7 @@ function bp_core_add_contextual_help_content( $tab = '' ) {
586
  break;
587
 
588
  case 'bp-profile-overview':
589
- $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' );
590
  break;
591
 
592
  default:
@@ -1264,33 +1304,20 @@ add_filter( 'admin_body_class', 'bp_core_admin_body_classes' );
1264
  * Adds a BuddyPress category to house BuddyPress blocks.
1265
  *
1266
  * @since 5.0.0
 
1267
  *
1268
- * @param array $categories Array of block categories.
1269
- * @param object $post Post being loaded.
1270
  */
1271
- function bp_block_category( $categories = array(), $post = null ) {
1272
- if ( ! ( $post instanceof WP_Post ) ) {
1273
- return $categories;
1274
- }
1275
-
1276
- /**
1277
- * Filter here to add/remove the supported post types for the BuddyPress blocks category.
1278
- *
1279
- * @since 5.0.0
1280
- *
1281
- * @param array $value The list of supported post types. Defaults to WordPress built-in ones.
1282
- */
1283
- $post_types = apply_filters( 'bp_block_category_post_types', array( 'post', 'page' ) );
1284
-
1285
- if ( ! $post_types ) {
1286
- return $categories;
1287
- }
1288
-
1289
- // Get the post type of the current item.
1290
- $post_type = get_post_type( $post );
1291
-
1292
- if ( ! in_array( $post_type, $post_types, true ) ) {
1293
- return $categories;
1294
  }
1295
 
1296
  return array_merge(
@@ -1304,4 +1331,17 @@ function bp_block_category( $categories = array(), $post = null ) {
1304
  )
1305
  );
1306
  }
1307
- add_filter( 'block_categories', 'bp_block_category', 1, 2 );
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  if ( in_array( $plugin_page, array( 'bp-tools', 'available-tools' ) ) ) {
85
  $submenu_file = $plugin_page;
86
  }
87
+
88
+ // Keep the BuddyPress tools menu highlighted when using a tools tab.
89
+ if ( 'bp-optouts' === $plugin_page || 'bp-members-invitations' === $plugin_page ) {
90
+ $submenu_file = 'bp-tools';
91
+ }
92
  }
93
 
94
  /**
284
 
285
  // Activate and Register are special cases. They are not components but they need WP pages.
286
  // If user registration is disabled, we can skip this step.
287
+ if ( bp_get_signup_allowed() || bp_get_members_invitations_allowed() ) {
288
  $wp_page_components[] = array(
289
  'id' => 'activate',
290
  'name' => __( 'Activate', 'buddypress' ),
394
  * Output the tabs in the admin area.
395
  *
396
  * @since 1.5.0
397
+ * @since 8.0.0 Adds the `$context` parameter.
398
  *
399
  * @param string $active_tab Name of the tab that is active. Optional.
400
+ * @param string $context The context of use for the tabs. Defaults to 'settings'.
401
+ * Possible values are 'settings' & 'tools'.
402
  */
403
+ function bp_core_admin_tabs( $active_tab = '', $context = 'settings' ) {
404
  $tabs_html = '';
405
  $idle_class = 'nav-tab';
406
  $active_class = 'nav-tab nav-tab-active';
412
  *
413
  * @param array $value Array of tabs to output to the admin area.
414
  */
415
+ $tabs = apply_filters( 'bp_core_admin_tabs', bp_core_get_admin_tabs( $active_tab, $context ) );
416
 
417
  // Loop through tabs and build navigation.
418
  foreach ( array_values( $tabs ) as $tab_data ) {
427
  * Fires after the output of tabs for the admin area.
428
  *
429
  * @since 1.5.0
430
+ * @since 8.0.0 Adds the `$context` parameter.
431
+ *
432
+ * @param string $context The context of use for the tabs.
433
  */
434
+ do_action( 'bp_admin_tabs', $context );
435
  }
436
 
437
  /**
438
  * Get the data for the tabs in the admin area.
439
  *
440
  * @since 2.2.0
441
+ * @since 8.0.0 Adds the `$context` parameter.
442
  *
443
  * @param string $active_tab Name of the tab that is active. Optional.
444
+ * @param string $context The context of use for the tabs. Defaults to 'settings'.
445
+ * Possible values are 'settings' & 'tools'.
446
  * @return string
447
  */
448
+ function bp_core_get_admin_tabs( $active_tab = '', $context = 'settings' ) {
449
+ $tabs = array();
450
+
451
+ if ( 'settings' === $context ) {
452
+ $tabs = array(
453
+ '0' => array(
454
+ 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), 'admin.php' ) ),
455
+ 'name' => __( 'Components', 'buddypress' ),
456
+ ),
457
+ '2' => array(
458
+ 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ),
459
+ 'name' => __( 'Options', 'buddypress' ),
460
+ ),
461
+ '1' => array(
462
+ 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) ),
463
+ 'name' => __( 'Pages', 'buddypress' ),
464
+ ),
465
+ '3' => array(
466
+ 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-credits' ), 'admin.php' ) ),
467
+ 'name' => __( 'Credits', 'buddypress' ),
468
+ ),
469
+ );
470
+ } elseif ( 'tools' === $context ) {
471
+ $tools_page = 'tools.php';
472
+ if ( bp_core_do_network_admin() ) {
473
+ $tools_page = 'admin.php';
474
+ }
475
+
476
+ $tabs = array(
477
+ '0' => array(
478
+ 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-tools' ), $tools_page ) ),
479
+ 'name' => __( 'Repair', 'buddypress' ),
480
+ ),
481
+ '1' => array(
482
+ 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-members-invitations' ), $tools_page ) ),
483
+ 'name' => __( 'Manage Invitations', 'buddypress' ),
484
+ ),
485
+ '2' => array(
486
+ 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-optouts' ), $tools_page ) ),
487
+ 'name' => __( 'Manage Opt-outs', 'buddypress' ),
488
+ ),
489
+ );
490
+ }
491
 
492
  /**
493
  * Filters the tab data used in our wp-admin screens.
494
  *
495
  * @since 2.2.0
496
+ * @since 8.0.0 Adds the `$context` parameter.
497
  *
498
+ * @param array $tabs Tab data.
499
+ * @param string $context The context of use for the tabs.
500
  */
501
+ return apply_filters( 'bp_core_get_admin_tabs', $tabs, $context );
502
  }
503
 
504
  /** Help **********************************************************************/
626
  break;
627
 
628
  case 'bp-profile-overview':
629
+ $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: Drag fields from other groups and drop them on the "Signup Fields" tab to include them into your registration form.', 'buddypress' );
630
  break;
631
 
632
  default:
1304
  * Adds a BuddyPress category to house BuddyPress blocks.
1305
  *
1306
  * @since 5.0.0
1307
+ * @since 8.0.0 The `bp_block_category_post_types` filter has been deprecated.
1308
  *
1309
+ * @param array $categories Array of block categories.
1310
+ * @param string|WP_Post $post Post being loaded.
1311
  */
1312
+ function bp_block_category( $categories = array(), $editor_name_or_post = null ) {
1313
+ if ( $editor_name_or_post instanceof WP_Post ) {
1314
+ $post_types = array( 'post', 'page' );
1315
+
1316
+ /*
1317
+ * As blocks are always loaded even if the category is not available, there's no more interest
1318
+ * in disabling the BuddyPress category.
1319
+ */
1320
+ apply_filters_deprecated( 'bp_block_category_post_types', array( $post_types ), '8.0.0' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1321
  }
1322
 
1323
  return array_merge(
1331
  )
1332
  );
1333
  }
1334
+
1335
+ /**
1336
+ * Select the right `block_categories` filter according to WP version.
1337
+ *
1338
+ * @since 8.0.0
1339
+ */
1340
+ function bp_block_init_category_filter() {
1341
+ if ( function_exists( 'get_default_block_categories' ) ) {
1342
+ add_filter( 'block_categories_all', 'bp_block_category', 1, 2 );
1343
+ } else {
1344
+ add_filter( 'block_categories', 'bp_block_category', 1, 2 );
1345
+ }
1346
+ }
1347
+ add_action( 'bp_init', 'bp_block_init_category_filter' );
bp-core/admin/bp-core-admin-optouts.php ADDED
@@ -0,0 +1,471 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * BuddyPress Opt-outs management.
4
+ *
5
+ * @package BuddyPress
6
+ * @subpackage Core
7
+ * @since 8.0.0
8
+ */
9
+
10
+ // Exit if accessed directly.
11
+ defined( 'ABSPATH' ) || exit;
12
+
13
+ /**
14
+ * Set up the Opt-outs admin page.
15
+ *
16
+ * Loaded before the page is rendered, this function does all initial
17
+ * setup, including: processing form requests, registering contextual
18
+ * help, and setting up screen options.
19
+ *
20
+ * @since 8.0.0
21
+ *
22
+ * @global $bp_optouts_list_table
23
+ */
24
+ function bp_core_optouts_admin_load() {
25
+ global $bp_optouts_list_table;
26
+
27
+ // Build redirection URL.
28
+ $redirect_to = remove_query_arg( array( 'action', 'error', 'updated', 'activated', 'notactivated', 'deleted', 'notdeleted', 'resent', 'notresent', 'do_delete', 'do_resend', 'do_activate', '_wpnonce', 'signup_ids' ), $_SERVER['REQUEST_URI'] );
29
+ $doaction = bp_admin_list_table_current_bulk_action();
30
+
31
+ /**
32
+ * Fires at the start of the nonmember opt-outs admin load.
33
+ *
34
+ * @since 8.0.0
35
+ *
36
+ * @param string $doaction Current bulk action being processed.
37
+ * @param array $_REQUEST Current $_REQUEST global.
38
+ */
39
+ do_action( 'bp_optouts_admin_load', $doaction, $_REQUEST );
40
+
41
+ /**
42
+ * Filters the allowed actions for use in the nonmember opt-outs admin page.
43
+ *
44
+ * @since 8.0.0
45
+ *
46
+ * @param array $value Array of allowed actions to use.
47
+ */
48
+ $allowed_actions = apply_filters( 'bp_optouts_admin_allowed_actions', array( 'do_delete', 'do_resend' ) );
49
+
50
+ if ( ! in_array( $doaction, $allowed_actions ) || ( -1 == $doaction ) ) {
51
+
52
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-users-list-table.php' );
53
+ $bp_optouts_list_table = new BP_Optouts_List_Table();
54
+
55
+ // The per_page screen option.
56
+ add_screen_option( 'per_page', array( 'label' => _x( 'Nonmember opt-outs', 'Nonmember opt-outs per page (screen options)', 'buddypress' ) ) );
57
+
58
+ // Current screen.
59
+ $current_screen = get_current_screen();
60
+
61
+ $current_screen->add_help_tab(
62
+ array(
63
+ 'id' => 'bp-optouts-overview',
64
+ 'title' => __( 'Overview', 'buddypress' ),
65
+ 'content' =>
66
+ '<p>' . __( 'This is the administration screen for nonmember opt-outs on your site.', 'buddypress' ) . '</p>' .
67
+ '<p>' . __( 'From the screen options, you can customize the displayed columns and the pagination of this screen.', 'buddypress' ) . '</p>' .
68
+ '<p>' . __( 'You can reorder the list of opt-outs by clicking on the Email Sender, Email Type or Date Modified column headers.', 'buddypress' ) . '</p>' .
69
+ '<p>' . __( 'Using the search form, you can search for an opt-out to a specific email address.', 'buddypress' ) . '</p>',
70
+ )
71
+ );
72
+
73
+ $current_screen->add_help_tab(
74
+ array(
75
+ 'id' => 'bp-optouts-actions',
76
+ 'title' => __( 'Actions', 'buddypress' ),
77
+ 'content' =>
78
+ '<p>' . __( 'Hovering over a row in the opt-outs list will display action links that allow you to manage the opt-out. You can perform the following actions:', 'buddypress' ) . '</p>' .
79
+ '<ul><li>' . __( '"Delete" allows you to delete the record of an opt-out. You will be asked to confirm this deletion.', 'buddypress' ) . '</li></ul>' .
80
+ '<p>' . __( 'Bulk actions allow you to perform these actions for the selected rows.', 'buddypress' ) . '</p>',
81
+ )
82
+ );
83
+
84
+ // Help panel - sidebar links.
85
+ $current_screen->set_help_sidebar(
86
+ '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
87
+ '<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
88
+ );
89
+
90
+ // Add accessible hidden headings and text for the Pending Users screen.
91
+ $current_screen->set_screen_reader_content(
92
+ array(
93
+ /* translators: accessibility text */
94
+ 'heading_views' => __( 'Filter opt-outs list', 'buddypress' ),
95
+ /* translators: accessibility text */
96
+ 'heading_pagination' => __( 'Opt-out list navigation', 'buddypress' ),
97
+ /* translators: accessibility text */
98
+ 'heading_list' => __( 'Opt-outs list', 'buddypress' ),
99
+ )
100
+ );
101
+
102
+ } else {
103
+ if ( empty( $_REQUEST['optout_ids' ] ) ) {
104
+ return;
105
+ }
106
+ $optout_ids = wp_parse_id_list( $_REQUEST['optout_ids' ] );
107
+
108
+ // Handle optout deletion.
109
+ if ( 'do_delete' == $doaction ) {
110
+
111
+ // Nonce check.
112
+ check_admin_referer( 'optouts_delete' );
113
+
114
+ $success = 0;
115
+ foreach ( $optout_ids as $optout_id ) {
116
+ if ( bp_delete_optout_by_id( $optout_id ) ) {
117
+ $success++;
118
+ }
119
+ }
120
+
121
+ $query_arg = array( 'updated' => 'deleted' );
122
+
123
+ if ( ! empty( $success ) ) {
124
+ $query_arg['deleted'] = $success;
125
+ }
126
+
127
+ $notdeleted = count( $optout_ids ) - $success;
128
+ if ( $notdeleted > 0 ) {
129
+ $query_arg['notdeleted'] = $notdeleted;
130
+ }
131
+
132
+ $redirect_to = add_query_arg( $query_arg, $redirect_to );
133
+
134
+ bp_core_redirect( $redirect_to );
135
+
136
+ // Plugins can update other stuff from here.
137
+ } else {
138
+
139
+ /**
140
+ * Fires at end of opt-outs admin load
141
+ * if doaction does not match any actions.
142
+ *
143
+ * @since 2.0.0
144
+ *
145
+ * @param string $doaction Current bulk action being processed.
146
+ * @param array $_REQUEST Current $_REQUEST global.
147
+ * @param string $redirect Determined redirect url to send user to.
148
+ */
149
+ do_action( 'bp_core_admin_update_optouts', $doaction, $_REQUEST, $redirect_to );
150
+
151
+ bp_core_redirect( $redirect_to );
152
+ }
153
+ }
154
+ }
155
+ add_action( "load-tools_page_bp-optouts", 'bp_core_optouts_admin_load' );
156
+
157
+ /**
158
+ * Get admin notice when viewing the optouts management page.
159
+ *
160
+ * @since 8.0.0
161
+ *
162
+ * @return array
163
+ */
164
+ function bp_core_get_optouts_notice() {
165
+
166
+ // Setup empty notice for return value.
167
+ $notice = array();
168
+
169
+ // Updates.
170
+ if ( ! empty( $_REQUEST['updated'] ) && 'deleted' === $_REQUEST['updated'] ) {
171
+ $notice = array(
172
+ 'class' => 'updated',
173
+ 'message' => ''
174
+ );
175
+
176
+ if ( ! empty( $_REQUEST['deleted'] ) ) {
177
+ $deleted = absint( $_REQUEST['deleted'] );
178
+ $notice['message'] .= sprintf(
179
+ _nx(
180
+ /* translators: %s: number of deleted optouts */
181
+ '%s opt-out successfully deleted!', '%s opt-outs successfully deleted!',
182
+ $deleted,
183
+ 'nonmembers opt-out deleted',
184
+ 'buddypress'
185
+ ),
186
+ number_format_i18n( absint( $_REQUEST['deleted'] ) )
187
+ );
188
+ }
189
+
190
+ if ( ! empty( $_REQUEST['notdeleted'] ) ) {
191
+ $notdeleted = absint( $_REQUEST['notdeleted'] );
192
+ $notice['message'] .= sprintf(
193
+ _nx(
194
+ /* translators: %s: number of optouts that failed to be deleted */
195
+ '%s opt-out was not deleted.', '%s opt-outs were not deleted.',
196
+ $notdeleted,
197
+ 'nonmembers opt-out not deleted',
198
+ 'buddypress'
199
+ ),
200
+ number_format_i18n( $notdeleted )
201
+ );
202
+
203
+ if ( empty( $_REQUEST['deleted'] ) ) {
204
+ $notice['class'] = 'error';
205
+ }
206
+ }
207
+ }
208
+
209
+ // Errors.
210
+ if ( ! empty( $_REQUEST['error'] ) && 'do_delete' === $_REQUEST['error'] ) {
211
+ $notice = array(
212
+ 'class' => 'error',
213
+ 'message' => esc_html__( 'There was a problem deleting opt-outs. Please try again.', 'buddypress' ),
214
+ );
215
+ }
216
+
217
+ return $notice;
218
+ }
219
+
220
+ /**
221
+ * Opt-outs admin page router.
222
+ *
223
+ * Depending on the context, display
224
+ * - the list of optouts,
225
+ * - or the delete confirmation screen,
226
+ *
227
+ * Also prepare the admin notices.
228
+ *
229
+ * @since 8.0.0
230
+ */
231
+ function bp_core_optouts_admin() {
232
+ $doaction = bp_admin_list_table_current_bulk_action();
233
+
234
+ // Prepare notices for admin.
235
+ $notice = bp_core_get_optouts_notice();
236
+
237
+ // Display notices.
238
+ if ( ! empty( $notice ) ) :
239
+ if ( 'updated' === $notice['class'] ) : ?>
240
+
241
+ <div id="message" class="<?php echo esc_attr( $notice['class'] ); ?> notice is-dismissible">
242
+
243
+ <?php else: ?>
244
+
245
+ <div class="<?php echo esc_attr( $notice['class'] ); ?> notice is-dismissible">
246
+
247
+ <?php endif; ?>
248
+
249
+ <p><?php echo esc_html( $notice['message'] ); ?></p>
250
+ </div>
251
+
252
+ <?php endif;
253
+
254
+ // Show the proper screen.
255
+ switch ( $doaction ) {
256
+ case 'delete' :
257
+ bp_core_optouts_admin_manage( $doaction );
258
+ break;
259
+
260
+ default:
261
+ bp_core_optouts_admin_index();
262
+ break;
263
+ }
264
+ }
265
+
266
+ /**
267
+ * This is the list of optouts.
268
+ *
269
+ * @since 8.0.0
270
+ *
271
+ * @global $plugin_page
272
+ * @global $bp_optouts_list_table
273
+ */
274
+ function bp_core_optouts_admin_index() {
275
+ global $plugin_page, $bp_optouts_list_table;
276
+
277
+ $usersearch = ! empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '';
278
+
279
+ // Prepare the group items for display.
280
+ $bp_optouts_list_table->prepare_items();
281
+
282
+ if ( is_network_admin() ) {
283
+ $form_url = network_admin_url( 'admin.php' );
284
+ } else {
285
+ $form_url = bp_get_admin_url( 'tools.php' );
286
+ }
287
+
288
+ $form_url = add_query_arg(
289
+ array(
290
+ 'page' => 'bp-optouts',
291
+ ),
292
+ $form_url
293
+ );
294
+
295
+ $search_form_url = remove_query_arg(
296
+ array(
297
+ 'action',
298
+ 'deleted',
299
+ 'notdeleted',
300
+ 'error',
301
+ 'updated',
302
+ 'delete',
303
+ 'activate',
304
+ 'activated',
305
+ 'notactivated',
306
+ 'resend',
307
+ 'resent',
308
+ 'notresent',
309
+ 'do_delete',
310
+ 'do_activate',
311
+ 'do_resend',
312
+ 'action2',
313
+ '_wpnonce',
314
+ 'optout_ids'
315
+ ),
316
+ $_SERVER['REQUEST_URI']
317
+ );
318
+
319
+ ?>
320
+
321
+ <div class="wrap">
322
+ <h1 class="wp-heading-inline"><?php esc_html_e( 'BuddyPress tools', 'buddypress' ); ?></h1>
323
+ <hr class="wp-header-end">
324
+
325
+ <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Manage Opt-outs', 'buddypress' ), 'tools' ); ?></h2>
326
+
327
+ <?php
328
+ if ( $usersearch ) {
329
+ $num_results = (int) $bp_optouts_list_table->total_items;
330
+ printf(
331
+ '<p><span class="subtitle">%s</span></p>',
332
+ sprintf(
333
+ esc_html(
334
+ /* translators: %s: the searched email. */
335
+ _n( 'Opt-out with an email address matching &#8220;%s&#8221;', 'Opt-outs with an email address matching &#8220;%s&#8221;', $num_results, 'buddypress' )
336
+ ),
337
+ esc_html( $usersearch )
338
+ )
339
+ );
340
+ }
341
+ ?>
342
+ <p><?php esc_html_e( 'This table shows opt-out requests from people who are not members of this site, but have been contacted via communication from this site, and wish to receive no further communications.', 'buddypress' ); ?></p>
343
+
344
+ <?php // Display each opt-out on its own row. ?>
345
+ <?php $bp_optouts_list_table->views(); ?>
346
+
347
+ <form id="bp-optouts-search-form" action="<?php echo esc_url( $search_form_url ) ;?>">
348
+ <input type="hidden" name="page" value="<?php echo esc_attr( $plugin_page ); ?>" />
349
+ <?php $bp_optouts_list_table->search_box( esc_html__( 'Search for a specific email address', 'buddypress' ), 'bp-optouts' ); ?>
350
+ </form>
351
+
352
+ <form id="bp-optouts-form" action="<?php echo esc_url( $form_url );?>" method="post">
353
+ <?php $bp_optouts_list_table->display(); ?>
354
+ </form>
355
+ </div>
356
+ <?php
357
+ }
358
+
359
+ /**
360
+ * This is the confirmation screen for actions.
361
+ *
362
+ * @since 8.0.0
363
+ *
364
+ * @param string $action Delete or resend optout.
365
+ *
366
+ * @return null|false
367
+ */
368
+ function bp_core_optouts_admin_manage( $action = '' ) {
369
+ $capability = bp_core_do_network_admin() ? 'manage_network_options' : 'manage_options';
370
+ if ( ! current_user_can( $capability ) || empty( $action ) ) {
371
+ die( '-1' );
372
+ }
373
+
374
+ // Get the IDs from the URL.
375
+ $ids = false;
376
+ if ( ! empty( $_POST['optout_ids'] ) ) {
377
+ $ids = wp_parse_id_list( $_POST['optout_ids'] );
378
+ } elseif ( ! empty( $_GET['optout_id'] ) ) {
379
+ $ids = absint( $_GET['optout_id'] );
380
+ }
381
+
382
+ if ( empty( $ids ) ) {
383
+ return false;
384
+ }
385
+
386
+ // Query for matching optouts, and filter out bad IDs.
387
+ $args = array(
388
+ 'id' => $ids,
389
+ );
390
+ $optouts = bp_get_optouts( $args );
391
+ $optout_ids = wp_list_pluck( $optouts, 'id' );
392
+
393
+ // Check optout IDs and set up strings.
394
+ switch ( $action ) {
395
+ case 'delete' :
396
+ if ( 0 === count( $optouts ) ) {
397
+ $helper_text = __( 'No opt-out requests were found.', 'buddypress' );
398
+ } else {
399
+ $helper_text = _n( 'You are about to delete the following opt-out request:', 'You are about to delete the following opt-out requests:', count( $optouts ), 'buddypress' );
400
+ }
401
+ break;
402
+ }
403
+
404
+ // These arguments are added to all URLs.
405
+ $url_args = array( 'page' => 'bp-optouts' );
406
+
407
+ // These arguments are only added when performing an action.
408
+ $action_args = array(
409
+ 'action' => 'do_' . $action,
410
+ 'optout_ids' => implode( ',', $optout_ids )
411
+ );
412
+
413
+ if ( is_network_admin() ) {
414
+ $base_url = network_admin_url( 'admin.php' );
415
+ } else {
416
+ $base_url = bp_get_admin_url( 'tools.php' );
417
+ }
418
+
419
+ $cancel_url = add_query_arg( $url_args, $base_url );
420
+ $action_url = wp_nonce_url(
421
+ add_query_arg(
422
+ array_merge( $url_args, $action_args ),
423
+ $base_url
424
+ ),
425
+ 'optouts_' . $action
426
+ );
427
+
428
+ ?>
429
+
430
+ <div class="wrap">
431
+ <h1 class="wp-heading-inline"><?php esc_html_e( 'BuddyPress tools', 'buddypress' ); ?></h1>
432
+ <hr class="wp-header-end">
433
+
434
+ <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Manage Opt-outs', 'buddypress' ), 'tools' ); ?></h2>
435
+
436
+ <p><?php echo esc_html( $helper_text ); ?></p>
437
+
438
+ <ol class="bp-optouts-list">
439
+ <?php foreach ( $optouts as $optout ) : ?>
440
+
441
+ <li>
442
+ <strong><?php echo esc_html( $optout->email_address ) ?></strong>
443
+ <p class="description">
444
+ <?php
445
+ $last_modified = mysql2date( 'Y/m/d g:i:s a', $optout->date_modified );
446
+ /* translators: %s: modification date */
447
+ printf( esc_html__( 'Date modified: %s', 'buddypress'), $last_modified );
448
+ ?>
449
+ </p>
450
+ </li>
451
+
452
+ <?php endforeach; ?>
453
+ </ol>
454
+
455
+ <?php if ( 'delete' === $action && count( $optouts ) ) : ?>
456
+
457
+ <p><strong><?php esc_html_e( 'This action cannot be undone.', 'buddypress' ) ?></strong></p>
458
+
459
+ <?php endif ; ?>
460
+
461
+ <?php if ( count( $optouts ) ) : ?>
462
+
463
+ <a class="button-primary" href="<?php echo esc_url( $action_url ); ?>"><?php esc_html_e( 'Confirm', 'buddypress' ); ?></a>
464
+
465
+ <?php endif; ?>
466
+
467
+ <a class="button" href="<?php echo esc_url( $cancel_url ); ?>"><?php esc_html_e( 'Cancel', 'buddypress' ) ?></a>
468
+ </div>
469
+
470
+ <?php
471
+ }
bp-core/admin/bp-core-admin-schema.php CHANGED
@@ -40,6 +40,9 @@ function bp_core_install( $active_components = false ) {
40
  // Install the invitations table.
41
  bp_core_install_invitations();
42
 
 
 
 
43
  // Notifications.
44
  if ( !empty( $active_components['notifications'] ) ) {
45
  bp_core_install_notifications();
@@ -389,6 +392,7 @@ function bp_core_install_extended_profiles() {
389
  // Make sure the custom visibility is disabled for the default field.
390
  if ( ! $wpdb->get_var( "SELECT id FROM {$bp_prefix}bp_xprofile_meta WHERE id = 1" ) ) {
391
  $insert_sql[] = "INSERT INTO {$bp_prefix}bp_xprofile_meta ( object_id, object_type, meta_key, meta_value ) VALUES ( 1, 'field', 'allow_custom_visibility', 'disabled' );";
 
392
  }
393
  }
394
 
@@ -589,3 +593,38 @@ function bp_core_install_invitations() {
589
  */
590
  do_action( 'bp_core_install_invitations' );
591
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  // Install the invitations table.
41
  bp_core_install_invitations();
42
 
43
+ // Install the nonmember opt-outs table.
44
+ bp_core_install_nonmember_opt_outs();
45
+
46
  // Notifications.
47
  if ( !empty( $active_components['notifications'] ) ) {
48
  bp_core_install_notifications();
392
  // Make sure the custom visibility is disabled for the default field.
393
  if ( ! $wpdb->get_var( "SELECT id FROM {$bp_prefix}bp_xprofile_meta WHERE id = 1" ) ) {
394
  $insert_sql[] = "INSERT INTO {$bp_prefix}bp_xprofile_meta ( object_id, object_type, meta_key, meta_value ) VALUES ( 1, 'field', 'allow_custom_visibility', 'disabled' );";
395
+ $insert_sql[] = "INSERT INTO {$bp_prefix}bp_xprofile_meta ( object_id, object_type, meta_key, meta_value ) VALUES ( 1, 'field', 'signup_position', 1 );";
396
  }
397
  }
398
 
593
  */
594
  do_action( 'bp_core_install_invitations' );
595
  }
596
+
597
+ /**
598
+ * Install database tables to store opt-out requests from nonmembers.
599
+ *
600
+ * @since 8.0.0
601
+ *
602
+ * @uses bp_core_set_charset()
603
+ * @uses bp_core_get_table_prefix()
604
+ * @uses dbDelta()
605
+ */
606
+ function bp_core_install_nonmember_opt_outs() {
607
+ $sql = array();
608
+ $charset_collate = $GLOBALS['wpdb']->get_charset_collate();
609
+ $bp_prefix = bp_core_get_table_prefix();
610
+ $optouts_class = new BP_Optout();
611
+ $table_name = $optouts_class->get_table_name();
612
+ $sql = "CREATE TABLE {$table_name} (
613
+ id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
614
+ email_address_hash varchar(255) NOT NULL,
615
+ user_id bigint(20) NOT NULL,
616
+ email_type varchar(255) NOT NULL,
617
+ date_modified datetime NOT NULL,
618
+ KEY user_id (user_id),
619
+ KEY email_type (email_type),
620
+ KEY date_modified (date_modified)
621
+ ) {$charset_collate};";
622
+ dbDelta( $sql );
623
+
624
+ /**
625
+ * Fires after BuddyPress adds the nonmember opt-outs table.
626
+ *
627
+ * @since 8.0.0
628
+ */
629
+ do_action( 'bp_core_install_nonmember_opt_outs' );
630
+ }
bp-core/admin/bp-core-admin-settings.php CHANGED
@@ -182,6 +182,27 @@ function bp_admin_setting_callback_cover_image_uploads() {
182
  <?php
183
  }
184
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
  /** XProfile ******************************************************************/
186
 
187
  /**
182
  <?php
183
  }
184
 
185
+ /**
186
+ * Allow members to invite non-members to the network.
187
+ *
188
+ * @since 8.0.0
189
+ */
190
+ function bp_admin_setting_callback_members_invitations() {
191
+ ?>
192
+ <input id="bp-enable-members-invitations" name="bp-enable-members-invitations" type="checkbox" value="1" <?php checked( bp_get_members_invitations_allowed() ); ?> />
193
+ <label for="bp-enable-members-invitations"><?php _e( 'Allow registered members to invite people to join this network', 'buddypress' ); ?></label>
194
+ <?php if ( ! bp_get_signup_allowed() ) : ?>
195
+ <p class="description"><?php _e( 'Public registration is currently disabled. However, invitees will still be able to register if network invitations are enabled.', 'buddypress' ); ?></p>
196
+ <?php endif; ?>
197
+ <?php
198
+ /**
199
+ * Fires after the output of the invitations settings section.
200
+ *
201
+ * @since 8.0.0
202
+ */
203
+ do_action( 'bp_admin_settings_after_members_invitations' );
204
+ }
205
+
206
  /** XProfile ******************************************************************/
207
 
208
  /**
bp-core/admin/bp-core-admin-slugs.php CHANGED
@@ -117,11 +117,11 @@ function bp_core_admin_slugs_options() {
117
  // Set up an array of components (along with component names) that have directory pages.
118
  $directory_pages = bp_core_admin_get_directory_pages();
119
 
120
- if ( !empty( $directory_pages ) ) : ?>
121
 
122
- <h3><?php _e( 'Directories', 'buddypress' ); ?></h3>
123
 
124
- <p><?php _e( 'Associate a WordPress Page with each BuddyPress component directory.', 'buddypress' ); ?></p>
125
 
126
  <table class="form-table">
127
  <tbody>
@@ -141,13 +141,13 @@ function bp_core_admin_slugs_options() {
141
  'name' => 'bp_pages[' . esc_attr( $name ) . ']',
142
  'echo' => false,
143
  'show_option_none' => __( '- None -', 'buddypress' ),
144
- 'selected' => !empty( $existing_pages[$name] ) ? $existing_pages[$name] : false
145
  ) ); ?>
146
 
147
  <?php if ( ! empty( $existing_pages[ $name ] ) && get_post( $existing_pages[ $name ] ) ) : ?>
148
 
149
  <a href="<?php echo esc_url( get_permalink( $existing_pages[$name] ) ); ?>" class="button-secondary" target="_bp">
150
- <?php _e( 'View', 'buddypress' ); ?> <span class="dashicons dashicons-external" aria-hidden="true"></span>
151
  <span class="screen-reader-text"><?php esc_html_e( '(opens in a new tab)', 'buddypress' ); ?></span>
152
  </a>
153
 
@@ -185,23 +185,40 @@ function bp_core_admin_slugs_options() {
185
 
186
  if ( !empty( $static_pages ) ) : ?>
187
 
188
- <h3><?php _e( 'Registration', 'buddypress' ); ?></h3>
189
 
190
- <?php if ( bp_get_signup_allowed() ) : ?>
191
- <p><?php _e( 'Associate WordPress Pages with the following BuddyPress Registration pages.', 'buddypress' ); ?></p>
 
 
 
192
  <?php else : ?>
193
  <?php if ( is_multisite() ) : ?>
194
  <p>
195
  <?php
196
- /* translators: %s: the link to the Network settings page */
197
- printf( __( 'Registration is currently disabled. Before associating a page is allowed, please enable registration by selecting either the "User accounts may be registered" or "Both sites and user accounts can be registered" option on <a href="%s">this page</a>.', 'buddypress' ), network_admin_url( 'settings.php' ) );
 
 
 
 
 
 
 
198
  ?>
199
  </p>
200
  <?php else : ?>
201
  <p>
202
  <?php
203
- /* translators: %s: the link to the Site settings page */
204
- printf( __( 'Registration is currently disabled. Before associating a page is allowed, please enable registration by clicking on the "Anyone can register" checkbox on <a href="%s">this page</a>.', 'buddypress' ), admin_url( 'options-general.php' ) );
 
 
 
 
 
 
 
205
  ?>
206
  </p>
207
  <?php endif; ?>
@@ -210,7 +227,7 @@ function bp_core_admin_slugs_options() {
210
  <table class="form-table">
211
  <tbody>
212
 
213
- <?php if ( bp_get_signup_allowed() ) : foreach ( $static_pages as $name => $label ) : ?>
214
 
215
  <tr valign="top">
216
  <th scope="row">
@@ -228,12 +245,6 @@ function bp_core_admin_slugs_options() {
228
  'selected' => !empty( $existing_pages[$name] ) ? $existing_pages[$name] : false
229
  ) ) ?>
230
 
231
- <?php if ( ! empty( $existing_pages[ $name ] ) && get_post( $existing_pages[ $name ] ) ) : ?>
232
-
233
- <a href="<?php echo get_permalink( $existing_pages[$name] ); ?>" class="button-secondary" target="_bp"><?php _e( 'View', 'buddypress' ); ?></a>
234
-
235
- <?php endif; ?>
236
-
237
  <?php if ( ! bp_is_root_blog() ) restore_current_blog(); ?>
238
 
239
  </td>
@@ -266,8 +277,9 @@ function bp_core_admin_slugs_options() {
266
  function bp_core_admin_slugs_setup_handler() {
267
 
268
  if ( isset( $_POST['bp-admin-pages-submit'] ) ) {
269
- if ( !check_admin_referer( 'bp-admin-pages-setup' ) )
270
  return false;
 
271
 
272
  // Then, update the directory pages.
273
  if ( isset( $_POST['bp_pages'] ) ) {
117
  // Set up an array of components (along with component names) that have directory pages.
118
  $directory_pages = bp_core_admin_get_directory_pages();
119
 
120
+ if ( ! empty( $directory_pages ) ) : ?>
121
 
122
+ <h3><?php esc_html_e( 'Directories', 'buddypress' ); ?></h3>
123
 
124
+ <p><?php esc_html_e( 'Associate a WordPress Page with each BuddyPress component directory.', 'buddypress' ); ?></p>
125
 
126
  <table class="form-table">
127
  <tbody>
141
  'name' => 'bp_pages[' . esc_attr( $name ) . ']',
142
  'echo' => false,
143
  'show_option_none' => __( '- None -', 'buddypress' ),
144
+ 'selected' => ! empty( $existing_pages[$name] ) ? $existing_pages[$name] : false
145
  ) ); ?>
146
 
147
  <?php if ( ! empty( $existing_pages[ $name ] ) && get_post( $existing_pages[ $name ] ) ) : ?>
148
 
149
  <a href="<?php echo esc_url( get_permalink( $existing_pages[$name] ) ); ?>" class="button-secondary" target="_bp">
150
+ <?php esc_html_e( 'View', 'buddypress' ); ?> <span class="dashicons dashicons-external" aria-hidden="true"></span>
151
  <span class="screen-reader-text"><?php esc_html_e( '(opens in a new tab)', 'buddypress' ); ?></span>
152
  </a>
153
 
185
 
186
  if ( !empty( $static_pages ) ) : ?>
187
 
188
+ <h3><?php esc_html_e( 'Registration', 'buddypress' ); ?></h3>
189
 
190
+ <?php if ( bp_get_signup_allowed() || bp_get_members_invitations_allowed() ) : ?>
191
+ <p>
192
+ <?php esc_html_e( 'Associate WordPress Pages with the following BuddyPress Registration pages.', 'buddypress' ); ?>
193
+ <?php esc_html_e( 'These pages will only be reachable by users who are not logged in.', 'buddypress' ); ?>
194
+ </p>
195
  <?php else : ?>
196
  <?php if ( is_multisite() ) : ?>
197
  <p>
198
  <?php
199
+ printf(
200
+ /* translators: %s: the link to the Network settings page */
201
+ esc_html_x( 'Registration is currently disabled. Before associating a page is allowed, please enable registration by selecting either the "User accounts may be registered" or "Both sites and user accounts can be registered" option on %s.', 'Disabled registration message for multisite config', 'buddypress' ),
202
+ sprintf(
203
+ '<a href="%1$s">%2$s</a>',
204
+ esc_url( network_admin_url( 'settings.php' ) ),
205
+ esc_html_x( 'this page', 'Link text for the Multisite’s network settings page', 'buddypress' )
206
+ )
207
+ );
208
  ?>
209
  </p>
210
  <?php else : ?>
211
  <p>
212
  <?php
213
+ printf(
214
+ /* translators: %s: the link to the Site general options page */
215
+ esc_html_x( 'Registration is currently disabled. Before associating a page is allowed, please enable registration by clicking on the "Anyone can register" checkbox on %s.', 'Disabled registration message for regular site config', 'buddypress' ),
216
+ sprintf(
217
+ '<a href="%1$s">%2$s</a>',
218
+ esc_url( admin_url( 'options-general.php' ) ),
219
+ esc_html_x( 'this page', 'Link text for the Site’s general options page', 'buddypress' )
220
+ )
221
+ );
222
  ?>
223
  </p>
224
  <?php endif; ?>
227
  <table class="form-table">
228
  <tbody>
229
 
230
+ <?php if ( bp_get_signup_allowed() || bp_get_members_invitations_allowed() ) : foreach ( $static_pages as $name => $label ) : ?>
231
 
232
  <tr valign="top">
233
  <th scope="row">
245
  'selected' => !empty( $existing_pages[$name] ) ? $existing_pages[$name] : false
246
  ) ) ?>
247
 
 
 
 
 
 
 
248
  <?php if ( ! bp_is_root_blog() ) restore_current_blog(); ?>
249
 
250
  </td>
277
  function bp_core_admin_slugs_setup_handler() {
278
 
279
  if ( isset( $_POST['bp-admin-pages-submit'] ) ) {
280
+ if ( ! check_admin_referer( 'bp-admin-pages-setup' ) ) {
281
  return false;
282
+ }
283
 
284
  // Then, update the directory pages.
285
  if ( isset( $_POST['bp_pages'] ) ) {
bp-core/admin/bp-core-admin-tools.php CHANGED
@@ -22,13 +22,14 @@ function bp_core_admin_tools() {
22
  <h1 class="wp-heading-inline"><?php esc_html_e( 'BuddyPress Tools', 'buddypress' ) ?></h1>
23
  <hr class="wp-header-end">
24
 
 
 
25
  <p><?php esc_html_e( 'BuddyPress keeps track of various relationships between members, groups, and activity items.', 'buddypress' ); ?></p>
26
  <p><?php esc_html_e( 'Occasionally these relationships become out of sync, most often after an import, update, or migration.', 'buddypress' ); ?></p>
27
  <p><?php esc_html_e( 'Use the tools below to manually recalculate these relationships.', 'buddypress' ); ?>
28
  </p>
29
- <p class="attention"><?php esc_html_e( 'Some of these tools create substantial database overhead. Avoid running more than one repair job at a time.', 'buddypress' ); ?></p>
30
 
31
- <h2><?php esc_html_e( 'Activate checkboxe(s) to select the operation(s) to perform', 'buddypress' ); ?></h2>
32
 
33
  <form class="settings" method="post" action="">
34
 
@@ -38,7 +39,7 @@ function bp_core_admin_tools() {
38
  <?php foreach ( bp_admin_repair_list() as $item ) : ?>
39
  <p>
40
  <label for="<?php echo esc_attr( str_replace( '_', '-', $item[0] ) ); ?>">
41
- <input type="checkbox" class="checkbox" name="<?php echo esc_attr( $item[0] ) . '" id="' . esc_attr( str_replace( '_', '-', $item[0] ) ); ?>" value="1" /> <?php echo esc_html( $item[1] ); ?>
42
  </label>
43
  </p>
44
  <?php endforeach; ?>
@@ -79,7 +80,7 @@ function bp_admin_repair_handler() {
79
  $messages = array();
80
 
81
  foreach ( (array) bp_admin_repair_list() as $item ) {
82
- if ( isset( $item[2] ) && isset( $_POST[$item[0]] ) && 1 === absint( $_POST[$item[0]] ) && is_callable( $item[2] ) ) {
83
  $messages[] = call_user_func( $item[2] );
84
  }
85
  }
@@ -541,18 +542,48 @@ function bp_core_admin_available_tools_intro() {
541
  $page = bp_core_do_network_admin() ? 'admin.php' : 'tools.php' ;
542
  $url = add_query_arg( $query_arg, bp_get_admin_url( $page ) );
543
  ?>
544
- <div class="card tool-box">
545
  <h2><?php esc_html_e( 'BuddyPress Tools', 'buddypress' ) ?></h2>
546
- <p>
547
- <?php esc_html_e( 'BuddyPress keeps track of various relationships between users, groups, and activity items. Occasionally these relationships become out of sync, most often after an import, update, or migration.', 'buddypress' ); ?>
548
- <?php
549
- printf(
550
- /* translators: %s: the link to the BuddyPress repair tools */
551
- esc_html_x( 'Use the %s to repair these relationships.', 'buddypress tools intro', 'buddypress' ),
552
- '<a href="' . esc_url( $url ) . '">' . esc_html__( 'BuddyPress Tools', 'buddypress' ) . '</a>'
553
- );
554
- ?>
555
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
556
  </div>
557
  <?php
558
  }
22
  <h1 class="wp-heading-inline"><?php esc_html_e( 'BuddyPress Tools', 'buddypress' ) ?></h1>
23
  <hr class="wp-header-end">
24
 
25
+ <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Repair', 'buddypress' ), 'tools' ); ?></h2>
26
+
27
  <p><?php esc_html_e( 'BuddyPress keeps track of various relationships between members, groups, and activity items.', 'buddypress' ); ?></p>
28
  <p><?php esc_html_e( 'Occasionally these relationships become out of sync, most often after an import, update, or migration.', 'buddypress' ); ?></p>
29
  <p><?php esc_html_e( 'Use the tools below to manually recalculate these relationships.', 'buddypress' ); ?>
30
  </p>
 
31
 
32
+ <h2><?php esc_html_e( 'Select the operation to perform', 'buddypress' ); ?></h2>
33
 
34
  <form class="settings" method="post" action="">
35
 
39
  <?php foreach ( bp_admin_repair_list() as $item ) : ?>
40
  <p>
41
  <label for="<?php echo esc_attr( str_replace( '_', '-', $item[0] ) ); ?>">
42
+ <input type="radio" class="radio" name="bp-tools-run[]" id="<?php echo esc_attr( str_replace( '_', '-', $item[0] ) ); ?>" value="<?php echo esc_attr( $item[0] ); ?>" /> <?php echo esc_html( $item[1] ); ?>
43
  </label>
44
  </p>
45
  <?php endforeach; ?>
80
  $messages = array();
81
 
82
  foreach ( (array) bp_admin_repair_list() as $item ) {
83
+ if ( isset( $item[2] ) && isset( $_POST['bp-tools-run'] ) && in_array( $item[0], (array) $_POST['bp-tools-run'], true ) && is_callable( $item[2] ) ) {
84
  $messages[] = call_user_func( $item[2] );
85
  }
86
  }
542
  $page = bp_core_do_network_admin() ? 'admin.php' : 'tools.php' ;
543
  $url = add_query_arg( $query_arg, bp_get_admin_url( $page ) );
544
  ?>
545
+ <div class="card tool-box bp-tools">
546
  <h2><?php esc_html_e( 'BuddyPress Tools', 'buddypress' ) ?></h2>
547
+
548
+ <dl>
549
+ <dt><?php esc_html_e( 'Repair Tools', 'buddypress' ) ?></dt>
550
+ <dd>
551
+ <?php esc_html_e( 'BuddyPress keeps track of various relationships between users, groups, and activity items. Occasionally these relationships become out of sync, most often after an import, update, or migration.', 'buddypress' ); ?>
552
+ <?php
553
+ printf(
554
+ /* translators: %s: the link to the BuddyPress repair tools */
555
+ esc_html_x( 'Use the %s to repair these relationships.', 'buddypress tools intro', 'buddypress' ),
556
+ '<a href="' . esc_url( $url ) . '">' . esc_html__( 'BuddyPress Repair Tools', 'buddypress' ) . '</a>'
557
+ );
558
+ ?>
559
+ </dd>
560
+
561
+ <dt><?php esc_html_e( 'Manage Invitations', 'buddypress' ) ?></dt>
562
+ <dd>
563
+ <?php esc_html_e( 'When enabled, BuddyPress allows your users to invite nonmembers to join your site.', 'buddypress' ); ?>
564
+ <?php
565
+ $url = add_query_arg( 'page', 'bp-members-invitations', bp_get_admin_url( $page ) );
566
+ printf(
567
+ /* translators: %s: the link to the BuddyPress Invitations management tool screen */
568
+ esc_html_x( 'Visit %s to manage your site&rsquo;s invitations.', 'buddypress invitations tool intro', 'buddypress' ),
569
+ '<a href="' . esc_url( $url ) . '">' . esc_html__( 'Invitations', 'buddypress' ) . '</a>'
570
+ );
571
+ ?>
572
+ </dd>
573
+
574
+ <dt><?php esc_html_e( 'Manage Opt-outs', 'buddypress' ) ?></dt>
575
+ <dd>
576
+ <?php esc_html_e( 'BuddyPress stores opt-out requests from people who are not members of this site, but have been contacted via communication from this site, and wish to opt-out from future communication.', 'buddypress' ); ?>
577
+ <?php
578
+ $url = add_query_arg( 'page', 'bp-optouts', bp_get_admin_url( $page ) );
579
+ printf(
580
+ /* translators: %s: the link to the BuddyPress Nonmember Opt-outs management tool screen */
581
+ esc_html_x( 'Visit %s to manage your site&rsquo;s opt-out requests.', 'buddypress opt-outs intro', 'buddypress' ),
582
+ '<a href="' . esc_url( $url ) . '">' . esc_html__( 'Nonmember Opt-outs', 'buddypress' ) . '</a>'
583
+ );
584
+ ?>
585
+ </dd>
586
+ </dl>
587
  </div>
588
  <?php
589
  }
bp-core/admin/css/common-rtl.css CHANGED
@@ -306,6 +306,22 @@ TABLE OF CONTENTS:
306
  content: "";
307
  }
308
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
309
  /*
310
  * 2.4 Tooltips
311
  */
306
  content: "";
307
  }
308
 
309
+ body.tools-php .bp-tools dt {
310
+ font-size: 1.1em;
311
+ color: #646970;
312
+ font-weight: 600;
313
+ margin: 1em 0 0.5em 0;
314
+ }
315
+
316
+ body.tools-php .bp-tools dd {
317
+ margin: 0;
318
+ }
319
+
320
+ body.tools_page_bp-members-invitations .nav-tab-wrapper,
321
+ body.tools_page_bp-optouts .nav-tab-wrapper {
322
+ margin-bottom: 1em;
323
+ }
324
+
325
  /*
326
  * 2.4 Tooltips
327
  */
bp-core/admin/css/common-rtl.min.css CHANGED
@@ -1 +1 @@
1
- .bp-badge{color:#d84800;display:inline-block;font:400 150px/1 dashicons!important}.bp-badge:before{content:"\f448"}.index_page_bp-about code,.settings_page_bp-credits code{background-color:#e0e0e0;color:#636363;font-size:1em}.bp-about-wrap{position:relative;max-width:1050px;font-size:15px}.bp-about-wrap img{margin:0;max-width:100%;height:auto;vertical-align:middle}.bp-about-wrap p{line-height:1.5;font-size:14px}.bp-about-wrap h2{margin:40px 0 .6em;font-size:2.7em;line-height:1.3;font-weight:300;text-align:center}.bp-about-wrap h3{margin:1.25em 0 .6em;font-size:1.4em;line-height:1.5}.bp-about-wrap code{font-size:14px;font-weight:400}.bp-about-wrap .about-description{margin-top:1.4em;font-weight:400;line-height:1.6;font-size:19px}.bp-about-wrap h3.wp-people-group{margin:2.6em 0 1.33em;padding:0;font-size:16px;line-height:inherit}.bp-about-wrap .wp-people-group{padding:0 5px;margin:0 -5px 0 -15px}.bp-about-wrap .compact{margin-bottom:0}.bp-about-wrap .wp-person{display:inline-block;vertical-align:top;margin-left:10px;padding-bottom:15px;height:70px;width:280px}.bp-about-wrap .compact .wp-person{height:auto;width:180px;padding-bottom:0;margin-bottom:0}.bp-about-wrap .wp-person .gravatar{float:right;margin:0 0 10px 10px;padding:1px;width:60px;height:60px}.bp-about-wrap .compact .wp-person .gravatar{width:30px;height:30px}.bp-about-wrap .wp-person .web{margin:6px 0 2px;font-size:16px;font-weight:400;line-height:2;text-decoration:none}.bp-about-wrap .wp-person .title{display:block}.bp-about-wrap p.wp-credits-list a{white-space:nowrap}@media only screen and (max-width:500px){.bp-about-wrap{margin-left:20px;margin-right:10px}.bp-about-wrap .bp-about-wrap h1{margin-left:0}}#adminmenu #toplevel_page_bp-activity .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_user .wp-menu-image:before{content:"\f452"}#adminmenu #toplevel_page_bp-groups .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_user .wp-menu-image:before{content:"\f456"}#adminmenu #toplevel_page_bp-notifications .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_user .wp-menu-image:before{content:"\f439"}#adminmenu #toplevel_page_bp-messages .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_user .wp-menu-image:before{content:"\f457"}#adminmenu #toplevel_page_bp-friends .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_user .wp-menu-image:before{content:"\f454"}#adminmenu #toplevel_page_bp-settings .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_user .wp-menu-image:before{content:"\f108"}#adminmenu li.toplevel_page_bp-components .wp-menu-image,#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{content:"\f448"}.settings_page_bp-components td.plugin-title span{float:right;width:18px;height:18px;margin-left:5px}.settings_page_bp-components td.plugin-title span:before{font-family:dashicons;font-size:18px}.settings_page_bp-components tr.activity td.plugin-title span:before{content:"\f452"}.settings_page_bp-components tr.notifications td.plugin-title span:before{content:"\f339"}.settings_page_bp-components tr.xprofile td.plugin-title span:before{content:"\f336"}.settings_page_bp-components tr.settings td.plugin-title span:before{content:"\f108"}.settings_page_bp-components tr.groups td.plugin-title span:before{content:"\f456"}.settings_page_bp-components tr.messages td.plugin-title span:before{content:"\f457"}.settings_page_bp-components tr.blogs td.plugin-title span:before{content:"\f120"}.settings_page_bp-components tr.friends td.plugin-title span:before{content:"\f454"}.settings_page_bp-components tr.core td.plugin-title span:before{content:"\f448"}.settings_page_bp-components tr.members td.plugin-title span:before{content:"\f307"}.settings_page_bp-page-settings .button-secondary .dashicons{position:relative;top:3px}#bp-admin-component-form .wp-list-table.plugins .plugin-title{width:25%}@media screen and (max-width:782px){.settings_page_bp-components td.plugin-title span{margin-top:5px}#bp-admin-component-form .wp-list-table.plugins .plugin-title{display:block;width:auto}#bp-admin-component-form .subsubsub{margin-bottom:0;padding-bottom:35px}}#adminmenu .toplevel_page_network-tools div.wp-menu-image:before{content:""}.bp-tooltip{position:relative}.bp-tooltip:after{background:#fff;border:1px solid #aaa;border-collapse:separate;border-radius:1px;box-shadow:-1px 1px 0 1px rgba(132,132,132,.3);color:#000;content:attr(data-bp-tooltip);display:none;font-family:sans-serif;font-size:11px;font-weight:400;letter-spacing:normal;line-height:1.5;margin-top:10px;max-width:240px;opacity:0;padding:3px 6px;position:absolute;left:50%;text-align:center;text-decoration:none;text-shadow:none;text-transform:none;top:100%;transform:translateX(-50%);transition:opacity 2s ease-out;white-space:pre;word-wrap:break-word;z-index:998}.bp-hello-close .bp-tooltip:after{left:0;text-align:left;transform:translateX(0)}.bp-hello-social .bp-tooltip:after{bottom:120%;margin-bottom:20px;margin-top:0;top:auto;transform:translateX(-15%)}.bp-tooltip:active:after,.bp-tooltip:focus:after,.bp-tooltip:hover:after{display:inline-block;opacity:1;overflow:visible;text-decoration:none;z-index:999}body.site-users-php th#role,body.users-php th#role,body.users_page_bp-signups th#count_sent{width:10%}body.site-users-php th#email,body.site-users-php th#name,body.users-php th#email,body.users-php th#name,body.users-php th#registered,body.users_page_bp-signups th#date_sent,body.users_page_bp-signups th#email,body.users_page_bp-signups th#name,body.users_page_bp-signups th#registered{width:15%}body.users-php th#blogs,body.users_page_bp-signups th#blogs{width:20%}body.users_page_bp-signups td.count_sent,body.users_page_bp-signups th.column-count_sent{text-align:center}.bp-signups-list table{margin:1em 0}.bp-signups-list .column-fields{font-weight:700}.bp-new-notice-panel{background:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);font-size:13px;line-height:2.1;margin:1.5em 0 3em;overflow:auto;padding:10px 25px 25px;position:relative}.bp-new-notice-panel label{clear:both;float:right;margin-left:3%;width:20%}.bp-new-notice-panel input,.bp-new-notice-panel textarea{clear:none;margin-bottom:1em;width:75%}.bp-new-notice-panel input[type=text]:after,.bp-new-notice-panel textarea:after{clear:both;content:" ";display:table}.bp-new-notice-panel .button-primary{margin-right:23%;width:auto}.bp-notice-about{font-size:1em;margin-bottom:1em}.bp-new-notice{margin-bottom:1em;margin-top:0}.bp-notices-list{margin-bottom:0}@media screen and (max-width:782px){.bp-new-notice-panel{margin-bottom:1.5em}.bp-new-notice-panel input,.bp-new-notice-panel textarea{margin-right:0;width:100%}.bp-new-notice-panel .button-primary{margin-right:0;width:auto}.bp-new-notice-panel .button{max-width:45%;word-wrap:break-word}.bp-notice-about{margin-top:0;margin-bottom:1em}.bp-new-notice{margin-bottom:.5em}}body.post-type-bp-email #excerpt{height:auto}body.post-type-bp-email th#situation{width:20%}body.post-type-bp-email td.column-situation ul{margin:0}body.post-type-bp-email .categorydiv label{display:block;float:right;padding-right:25px;text-indent:-25px}#buddypress-update.not-shiny .update-message{border-right:0;padding-right:36px}#buddypress-update.not-shiny .update-message:before{content:"\f534"}
1
+ .bp-badge{color:#d84800;display:inline-block;font:400 150px/1 dashicons!important}.bp-badge:before{content:"\f448"}.index_page_bp-about code,.settings_page_bp-credits code{background-color:#e0e0e0;color:#636363;font-size:1em}.bp-about-wrap{position:relative;max-width:1050px;font-size:15px}.bp-about-wrap img{margin:0;max-width:100%;height:auto;vertical-align:middle}.bp-about-wrap p{line-height:1.5;font-size:14px}.bp-about-wrap h2{margin:40px 0 .6em;font-size:2.7em;line-height:1.3;font-weight:300;text-align:center}.bp-about-wrap h3{margin:1.25em 0 .6em;font-size:1.4em;line-height:1.5}.bp-about-wrap code{font-size:14px;font-weight:400}.bp-about-wrap .about-description{margin-top:1.4em;font-weight:400;line-height:1.6;font-size:19px}.bp-about-wrap h3.wp-people-group{margin:2.6em 0 1.33em;padding:0;font-size:16px;line-height:inherit}.bp-about-wrap .wp-people-group{padding:0 5px;margin:0 -5px 0 -15px}.bp-about-wrap .compact{margin-bottom:0}.bp-about-wrap .wp-person{display:inline-block;vertical-align:top;margin-left:10px;padding-bottom:15px;height:70px;width:280px}.bp-about-wrap .compact .wp-person{height:auto;width:180px;padding-bottom:0;margin-bottom:0}.bp-about-wrap .wp-person .gravatar{float:right;margin:0 0 10px 10px;padding:1px;width:60px;height:60px}.bp-about-wrap .compact .wp-person .gravatar{width:30px;height:30px}.bp-about-wrap .wp-person .web{margin:6px 0 2px;font-size:16px;font-weight:400;line-height:2;text-decoration:none}.bp-about-wrap .wp-person .title{display:block}.bp-about-wrap p.wp-credits-list a{white-space:nowrap}@media only screen and (max-width:500px){.bp-about-wrap{margin-left:20px;margin-right:10px}.bp-about-wrap .bp-about-wrap h1{margin-left:0}}#adminmenu #toplevel_page_bp-activity .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_user .wp-menu-image:before{content:"\f452"}#adminmenu #toplevel_page_bp-groups .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_user .wp-menu-image:before{content:"\f456"}#adminmenu #toplevel_page_bp-notifications .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_user .wp-menu-image:before{content:"\f439"}#adminmenu #toplevel_page_bp-messages .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_user .wp-menu-image:before{content:"\f457"}#adminmenu #toplevel_page_bp-friends .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_user .wp-menu-image:before{content:"\f454"}#adminmenu #toplevel_page_bp-settings .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_user .wp-menu-image:before{content:"\f108"}#adminmenu li.toplevel_page_bp-components .wp-menu-image,#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{content:"\f448"}.settings_page_bp-components td.plugin-title span{float:right;width:18px;height:18px;margin-left:5px}.settings_page_bp-components td.plugin-title span:before{font-family:dashicons;font-size:18px}.settings_page_bp-components tr.activity td.plugin-title span:before{content:"\f452"}.settings_page_bp-components tr.notifications td.plugin-title span:before{content:"\f339"}.settings_page_bp-components tr.xprofile td.plugin-title span:before{content:"\f336"}.settings_page_bp-components tr.settings td.plugin-title span:before{content:"\f108"}.settings_page_bp-components tr.groups td.plugin-title span:before{content:"\f456"}.settings_page_bp-components tr.messages td.plugin-title span:before{content:"\f457"}.settings_page_bp-components tr.blogs td.plugin-title span:before{content:"\f120"}.settings_page_bp-components tr.friends td.plugin-title span:before{content:"\f454"}.settings_page_bp-components tr.core td.plugin-title span:before{content:"\f448"}.settings_page_bp-components tr.members td.plugin-title span:before{content:"\f307"}.settings_page_bp-page-settings .button-secondary .dashicons{position:relative;top:3px}#bp-admin-component-form .wp-list-table.plugins .plugin-title{width:25%}@media screen and (max-width:782px){.settings_page_bp-components td.plugin-title span{margin-top:5px}#bp-admin-component-form .wp-list-table.plugins .plugin-title{display:block;width:auto}#bp-admin-component-form .subsubsub{margin-bottom:0;padding-bottom:35px}}#adminmenu .toplevel_page_network-tools div.wp-menu-image:before{content:""}body.tools-php .bp-tools dt{font-size:1.1em;color:#646970;font-weight:600;margin:1em 0 .5em 0}body.tools-php .bp-tools dd{margin:0}body.tools_page_bp-members-invitations .nav-tab-wrapper,body.tools_page_bp-optouts .nav-tab-wrapper{margin-bottom:1em}.bp-tooltip{position:relative}.bp-tooltip:after{background:#fff;border:1px solid #aaa;border-collapse:separate;border-radius:1px;box-shadow:-1px 1px 0 1px rgba(132,132,132,.3);color:#000;content:attr(data-bp-tooltip);display:none;font-family:sans-serif;font-size:11px;font-weight:400;letter-spacing:normal;line-height:1.5;margin-top:10px;max-width:240px;opacity:0;padding:3px 6px;position:absolute;left:50%;text-align:center;text-decoration:none;text-shadow:none;text-transform:none;top:100%;transform:translateX(-50%);transition:opacity 2s ease-out;white-space:pre;word-wrap:break-word;z-index:998}.bp-hello-close .bp-tooltip:after{left:0;text-align:left;transform:translateX(0)}.bp-hello-social .bp-tooltip:after{bottom:120%;margin-bottom:20px;margin-top:0;top:auto;transform:translateX(-15%)}.bp-tooltip:active:after,.bp-tooltip:focus:after,.bp-tooltip:hover:after{display:inline-block;opacity:1;overflow:visible;text-decoration:none;z-index:999}body.site-users-php th#role,body.users-php th#role,body.users_page_bp-signups th#count_sent{width:10%}body.site-users-php th#email,body.site-users-php th#name,body.users-php th#email,body.users-php th#name,body.users-php th#registered,body.users_page_bp-signups th#date_sent,body.users_page_bp-signups th#email,body.users_page_bp-signups th#name,body.users_page_bp-signups th#registered{width:15%}body.users-php th#blogs,body.users_page_bp-signups th#blogs{width:20%}body.users_page_bp-signups td.count_sent,body.users_page_bp-signups th.column-count_sent{text-align:center}.bp-signups-list table{margin:1em 0}.bp-signups-list .column-fields{font-weight:700}.bp-new-notice-panel{background:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);font-size:13px;line-height:2.1;margin:1.5em 0 3em;overflow:auto;padding:10px 25px 25px;position:relative}.bp-new-notice-panel label{clear:both;float:right;margin-left:3%;width:20%}.bp-new-notice-panel input,.bp-new-notice-panel textarea{clear:none;margin-bottom:1em;width:75%}.bp-new-notice-panel input[type=text]:after,.bp-new-notice-panel textarea:after{clear:both;content:" ";display:table}.bp-new-notice-panel .button-primary{margin-right:23%;width:auto}.bp-notice-about{font-size:1em;margin-bottom:1em}.bp-new-notice{margin-bottom:1em;margin-top:0}.bp-notices-list{margin-bottom:0}@media screen and (max-width:782px){.bp-new-notice-panel{margin-bottom:1.5em}.bp-new-notice-panel input,.bp-new-notice-panel textarea{margin-right:0;width:100%}.bp-new-notice-panel .button-primary{margin-right:0;width:auto}.bp-new-notice-panel .button{max-width:45%;word-wrap:break-word}.bp-notice-about{margin-top:0;margin-bottom:1em}.bp-new-notice{margin-bottom:.5em}}body.post-type-bp-email #excerpt{height:auto}body.post-type-bp-email th#situation{width:20%}body.post-type-bp-email td.column-situation ul{margin:0}body.post-type-bp-email .categorydiv label{display:block;float:right;padding-right:25px;text-indent:-25px}#buddypress-update.not-shiny .update-message{border-right:0;padding-right:36px}#buddypress-update.not-shiny .update-message:before{content:"\f534"}
bp-core/admin/css/common.css CHANGED
@@ -306,6 +306,22 @@ TABLE OF CONTENTS:
306
  content: "";
307
  }
308
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
309
  /*
310
  * 2.4 Tooltips
311
  */
306
  content: "";
307
  }
308
 
309
+ body.tools-php .bp-tools dt {
310
+ font-size: 1.1em;
311
+ color: #646970;
312
+ font-weight: 600;
313
+ margin: 1em 0 0.5em 0;
314
+ }
315
+
316
+ body.tools-php .bp-tools dd {
317
+ margin: 0;
318
+ }
319
+
320
+ body.tools_page_bp-members-invitations .nav-tab-wrapper,
321
+ body.tools_page_bp-optouts .nav-tab-wrapper {
322
+ margin-bottom: 1em;
323
+ }
324
+
325
  /*
326
  * 2.4 Tooltips
327
  */
bp-core/admin/css/common.min.css CHANGED
@@ -1 +1 @@
1
- .bp-badge{color:#d84800;display:inline-block;font:400 150px/1 dashicons!important}.bp-badge:before{content:"\f448"}.index_page_bp-about code,.settings_page_bp-credits code{background-color:#e0e0e0;color:#636363;font-size:1em}.bp-about-wrap{position:relative;max-width:1050px;font-size:15px}.bp-about-wrap img{margin:0;max-width:100%;height:auto;vertical-align:middle}.bp-about-wrap p{line-height:1.5;font-size:14px}.bp-about-wrap h2{margin:40px 0 .6em;font-size:2.7em;line-height:1.3;font-weight:300;text-align:center}.bp-about-wrap h3{margin:1.25em 0 .6em;font-size:1.4em;line-height:1.5}.bp-about-wrap code{font-size:14px;font-weight:400}.bp-about-wrap .about-description{margin-top:1.4em;font-weight:400;line-height:1.6;font-size:19px}.bp-about-wrap h3.wp-people-group{margin:2.6em 0 1.33em;padding:0;font-size:16px;line-height:inherit}.bp-about-wrap .wp-people-group{padding:0 5px;margin:0 -15px 0 -5px}.bp-about-wrap .compact{margin-bottom:0}.bp-about-wrap .wp-person{display:inline-block;vertical-align:top;margin-right:10px;padding-bottom:15px;height:70px;width:280px}.bp-about-wrap .compact .wp-person{height:auto;width:180px;padding-bottom:0;margin-bottom:0}.bp-about-wrap .wp-person .gravatar{float:left;margin:0 10px 10px 0;padding:1px;width:60px;height:60px}.bp-about-wrap .compact .wp-person .gravatar{width:30px;height:30px}.bp-about-wrap .wp-person .web{margin:6px 0 2px;font-size:16px;font-weight:400;line-height:2;text-decoration:none}.bp-about-wrap .wp-person .title{display:block}.bp-about-wrap p.wp-credits-list a{white-space:nowrap}@media only screen and (max-width:500px){.bp-about-wrap{margin-right:20px;margin-left:10px}.bp-about-wrap .bp-about-wrap h1{margin-right:0}}#adminmenu #toplevel_page_bp-activity .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_user .wp-menu-image:before{content:"\f452"}#adminmenu #toplevel_page_bp-groups .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_user .wp-menu-image:before{content:"\f456"}#adminmenu #toplevel_page_bp-notifications .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_user .wp-menu-image:before{content:"\f439"}#adminmenu #toplevel_page_bp-messages .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_user .wp-menu-image:before{content:"\f457"}#adminmenu #toplevel_page_bp-friends .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_user .wp-menu-image:before{content:"\f454"}#adminmenu #toplevel_page_bp-settings .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_user .wp-menu-image:before{content:"\f108"}#adminmenu li.toplevel_page_bp-components .wp-menu-image,#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{content:"\f448"}.settings_page_bp-components td.plugin-title span{float:left;width:18px;height:18px;margin-right:5px}.settings_page_bp-components td.plugin-title span:before{font-family:dashicons;font-size:18px}.settings_page_bp-components tr.activity td.plugin-title span:before{content:"\f452"}.settings_page_bp-components tr.notifications td.plugin-title span:before{content:"\f339"}.settings_page_bp-components tr.xprofile td.plugin-title span:before{content:"\f336"}.settings_page_bp-components tr.settings td.plugin-title span:before{content:"\f108"}.settings_page_bp-components tr.groups td.plugin-title span:before{content:"\f456"}.settings_page_bp-components tr.messages td.plugin-title span:before{content:"\f457"}.settings_page_bp-components tr.blogs td.plugin-title span:before{content:"\f120"}.settings_page_bp-components tr.friends td.plugin-title span:before{content:"\f454"}.settings_page_bp-components tr.core td.plugin-title span:before{content:"\f448"}.settings_page_bp-components tr.members td.plugin-title span:before{content:"\f307"}.settings_page_bp-page-settings .button-secondary .dashicons{position:relative;top:3px}#bp-admin-component-form .wp-list-table.plugins .plugin-title{width:25%}@media screen and (max-width:782px){.settings_page_bp-components td.plugin-title span{margin-top:5px}#bp-admin-component-form .wp-list-table.plugins .plugin-title{display:block;width:auto}#bp-admin-component-form .subsubsub{margin-bottom:0;padding-bottom:35px}}#adminmenu .toplevel_page_network-tools div.wp-menu-image:before{content:""}.bp-tooltip{position:relative}.bp-tooltip:after{background:#fff;border:1px solid #aaa;border-collapse:separate;border-radius:1px;box-shadow:1px 1px 0 1px rgba(132,132,132,.3);color:#000;content:attr(data-bp-tooltip);display:none;font-family:sans-serif;font-size:11px;font-weight:400;letter-spacing:normal;line-height:1.5;margin-top:10px;max-width:240px;opacity:0;padding:3px 6px;position:absolute;right:50%;text-align:center;text-decoration:none;text-shadow:none;text-transform:none;top:100%;transform:translateX(50%);transition:opacity 2s ease-out;white-space:pre;word-wrap:break-word;z-index:998}.bp-hello-close .bp-tooltip:after{right:0;text-align:right;transform:translateX(0)}.bp-hello-social .bp-tooltip:after{bottom:120%;margin-bottom:20px;margin-top:0;top:auto;transform:translateX(15%)}.bp-tooltip:active:after,.bp-tooltip:focus:after,.bp-tooltip:hover:after{display:inline-block;opacity:1;overflow:visible;text-decoration:none;z-index:999}body.site-users-php th#role,body.users-php th#role,body.users_page_bp-signups th#count_sent{width:10%}body.site-users-php th#email,body.site-users-php th#name,body.users-php th#email,body.users-php th#name,body.users-php th#registered,body.users_page_bp-signups th#date_sent,body.users_page_bp-signups th#email,body.users_page_bp-signups th#name,body.users_page_bp-signups th#registered{width:15%}body.users-php th#blogs,body.users_page_bp-signups th#blogs{width:20%}body.users_page_bp-signups td.count_sent,body.users_page_bp-signups th.column-count_sent{text-align:center}.bp-signups-list table{margin:1em 0}.bp-signups-list .column-fields{font-weight:700}.bp-new-notice-panel{background:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);font-size:13px;line-height:2.1;margin:1.5em 0 3em;overflow:auto;padding:10px 25px 25px;position:relative}.bp-new-notice-panel label{clear:both;float:left;margin-right:3%;width:20%}.bp-new-notice-panel input,.bp-new-notice-panel textarea{clear:none;margin-bottom:1em;width:75%}.bp-new-notice-panel input[type=text]:after,.bp-new-notice-panel textarea:after{clear:both;content:" ";display:table}.bp-new-notice-panel .button-primary{margin-left:23%;width:auto}.bp-notice-about{font-size:1em;margin-bottom:1em}.bp-new-notice{margin-bottom:1em;margin-top:0}.bp-notices-list{margin-bottom:0}@media screen and (max-width:782px){.bp-new-notice-panel{margin-bottom:1.5em}.bp-new-notice-panel input,.bp-new-notice-panel textarea{margin-left:0;width:100%}.bp-new-notice-panel .button-primary{margin-left:0;width:auto}.bp-new-notice-panel .button{max-width:45%;word-wrap:break-word}.bp-notice-about{margin-top:0;margin-bottom:1em}.bp-new-notice{margin-bottom:.5em}}body.post-type-bp-email #excerpt{height:auto}body.post-type-bp-email th#situation{width:20%}body.post-type-bp-email td.column-situation ul{margin:0}body.post-type-bp-email .categorydiv label{display:block;float:left;padding-left:25px;text-indent:-25px}#buddypress-update.not-shiny .update-message{border-left:0;padding-left:36px}#buddypress-update.not-shiny .update-message:before{content:"\f534"}
1
+ .bp-badge{color:#d84800;display:inline-block;font:400 150px/1 dashicons!important}.bp-badge:before{content:"\f448"}.index_page_bp-about code,.settings_page_bp-credits code{background-color:#e0e0e0;color:#636363;font-size:1em}.bp-about-wrap{position:relative;max-width:1050px;font-size:15px}.bp-about-wrap img{margin:0;max-width:100%;height:auto;vertical-align:middle}.bp-about-wrap p{line-height:1.5;font-size:14px}.bp-about-wrap h2{margin:40px 0 .6em;font-size:2.7em;line-height:1.3;font-weight:300;text-align:center}.bp-about-wrap h3{margin:1.25em 0 .6em;font-size:1.4em;line-height:1.5}.bp-about-wrap code{font-size:14px;font-weight:400}.bp-about-wrap .about-description{margin-top:1.4em;font-weight:400;line-height:1.6;font-size:19px}.bp-about-wrap h3.wp-people-group{margin:2.6em 0 1.33em;padding:0;font-size:16px;line-height:inherit}.bp-about-wrap .wp-people-group{padding:0 5px;margin:0 -15px 0 -5px}.bp-about-wrap .compact{margin-bottom:0}.bp-about-wrap .wp-person{display:inline-block;vertical-align:top;margin-right:10px;padding-bottom:15px;height:70px;width:280px}.bp-about-wrap .compact .wp-person{height:auto;width:180px;padding-bottom:0;margin-bottom:0}.bp-about-wrap .wp-person .gravatar{float:left;margin:0 10px 10px 0;padding:1px;width:60px;height:60px}.bp-about-wrap .compact .wp-person .gravatar{width:30px;height:30px}.bp-about-wrap .wp-person .web{margin:6px 0 2px;font-size:16px;font-weight:400;line-height:2;text-decoration:none}.bp-about-wrap .wp-person .title{display:block}.bp-about-wrap p.wp-credits-list a{white-space:nowrap}@media only screen and (max-width:500px){.bp-about-wrap{margin-right:20px;margin-left:10px}.bp-about-wrap .bp-about-wrap h1{margin-right:0}}#adminmenu #toplevel_page_bp-activity .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_user .wp-menu-image:before{content:"\f452"}#adminmenu #toplevel_page_bp-groups .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_user .wp-menu-image:before{content:"\f456"}#adminmenu #toplevel_page_bp-notifications .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_user .wp-menu-image:before{content:"\f439"}#adminmenu #toplevel_page_bp-messages .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_user .wp-menu-image:before{content:"\f457"}#adminmenu #toplevel_page_bp-friends .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_user .wp-menu-image:before{content:"\f454"}#adminmenu #toplevel_page_bp-settings .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_user .wp-menu-image:before{content:"\f108"}#adminmenu li.toplevel_page_bp-components .wp-menu-image,#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{content:"\f448"}.settings_page_bp-components td.plugin-title span{float:left;width:18px;height:18px;margin-right:5px}.settings_page_bp-components td.plugin-title span:before{font-family:dashicons;font-size:18px}.settings_page_bp-components tr.activity td.plugin-title span:before{content:"\f452"}.settings_page_bp-components tr.notifications td.plugin-title span:before{content:"\f339"}.settings_page_bp-components tr.xprofile td.plugin-title span:before{content:"\f336"}.settings_page_bp-components tr.settings td.plugin-title span:before{content:"\f108"}.settings_page_bp-components tr.groups td.plugin-title span:before{content:"\f456"}.settings_page_bp-components tr.messages td.plugin-title span:before{content:"\f457"}.settings_page_bp-components tr.blogs td.plugin-title span:before{content:"\f120"}.settings_page_bp-components tr.friends td.plugin-title span:before{content:"\f454"}.settings_page_bp-components tr.core td.plugin-title span:before{content:"\f448"}.settings_page_bp-components tr.members td.plugin-title span:before{content:"\f307"}.settings_page_bp-page-settings .button-secondary .dashicons{position:relative;top:3px}#bp-admin-component-form .wp-list-table.plugins .plugin-title{width:25%}@media screen and (max-width:782px){.settings_page_bp-components td.plugin-title span{margin-top:5px}#bp-admin-component-form .wp-list-table.plugins .plugin-title{display:block;width:auto}#bp-admin-component-form .subsubsub{margin-bottom:0;padding-bottom:35px}}#adminmenu .toplevel_page_network-tools div.wp-menu-image:before{content:""}body.tools-php .bp-tools dt{font-size:1.1em;color:#646970;font-weight:600;margin:1em 0 .5em 0}body.tools-php .bp-tools dd{margin:0}body.tools_page_bp-members-invitations .nav-tab-wrapper,body.tools_page_bp-optouts .nav-tab-wrapper{margin-bottom:1em}.bp-tooltip{position:relative}.bp-tooltip:after{background:#fff;border:1px solid #aaa;border-collapse:separate;border-radius:1px;box-shadow:1px 1px 0 1px rgba(132,132,132,.3);color:#000;content:attr(data-bp-tooltip);display:none;font-family:sans-serif;font-size:11px;font-weight:400;letter-spacing:normal;line-height:1.5;margin-top:10px;max-width:240px;opacity:0;padding:3px 6px;position:absolute;right:50%;text-align:center;text-decoration:none;text-shadow:none;text-transform:none;top:100%;transform:translateX(50%);transition:opacity 2s ease-out;white-space:pre;word-wrap:break-word;z-index:998}.bp-hello-close .bp-tooltip:after{right:0;text-align:right;transform:translateX(0)}.bp-hello-social .bp-tooltip:after{bottom:120%;margin-bottom:20px;margin-top:0;top:auto;transform:translateX(15%)}.bp-tooltip:active:after,.bp-tooltip:focus:after,.bp-tooltip:hover:after{display:inline-block;opacity:1;overflow:visible;text-decoration:none;z-index:999}body.site-users-php th#role,body.users-php th#role,body.users_page_bp-signups th#count_sent{width:10%}body.site-users-php th#email,body.site-users-php th#name,body.users-php th#email,body.users-php th#name,body.users-php th#registered,body.users_page_bp-signups th#date_sent,body.users_page_bp-signups th#email,body.users_page_bp-signups th#name,body.users_page_bp-signups th#registered{width:15%}body.users-php th#blogs,body.users_page_bp-signups th#blogs{width:20%}body.users_page_bp-signups td.count_sent,body.users_page_bp-signups th.column-count_sent{text-align:center}.bp-signups-list table{margin:1em 0}.bp-signups-list .column-fields{font-weight:700}.bp-new-notice-panel{background:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);font-size:13px;line-height:2.1;margin:1.5em 0 3em;overflow:auto;padding:10px 25px 25px;position:relative}.bp-new-notice-panel label{clear:both;float:left;margin-right:3%;width:20%}.bp-new-notice-panel input,.bp-new-notice-panel textarea{clear:none;margin-bottom:1em;width:75%}.bp-new-notice-panel input[type=text]:after,.bp-new-notice-panel textarea:after{clear:both;content:" ";display:table}.bp-new-notice-panel .button-primary{margin-left:23%;width:auto}.bp-notice-about{font-size:1em;margin-bottom:1em}.bp-new-notice{margin-bottom:1em;margin-top:0}.bp-notices-list{margin-bottom:0}@media screen and (max-width:782px){.bp-new-notice-panel{margin-bottom:1.5em}.bp-new-notice-panel input,.bp-new-notice-panel textarea{margin-left:0;width:100%}.bp-new-notice-panel .button-primary{margin-left:0;width:auto}.bp-new-notice-panel .button{max-width:45%;word-wrap:break-word}.bp-notice-about{margin-top:0;margin-bottom:1em}.bp-new-notice{margin-bottom:.5em}}body.post-type-bp-email #excerpt{height:auto}body.post-type-bp-email th#situation{width:20%}body.post-type-bp-email td.column-situation ul{margin:0}body.post-type-bp-email .categorydiv label{display:block;float:left;padding-left:25px;text-indent:-25px}#buddypress-update.not-shiny .update-message{border-left:0;padding-left:36px}#buddypress-update.not-shiny .update-message:before{content:"\f534"}
bp-core/admin/js/customizer-controls.min.js CHANGED
@@ -1 +1 @@
1
- !function(n){n(window).on("load",function(){n(".customize-control-range input").on("input",function(){var t=n(this);t.siblings("output").text(t.val())})})}(jQuery);
1
+ !function(t){t(window).on("load",function(){t(".customize-control-range input").on("input",function(){var n=t(this);n.siblings("output").text(n.val())})})}(jQuery);
bp-core/admin/js/customizer-receiver-emails.min.js CHANGED
@@ -1 +1 @@
1
- !function(o){wp.customize("bp_email_options[email_bg]",function(t){t.bind(function(t){t.length&&(o(".email_bg").attr("bgcolor",t),o("hr").attr("color",t))})}),wp.customize("bp_email_options[header_bg]",function(t){t.bind(function(t){t.length&&o(".header_bg").attr("bgcolor",t)})}),wp.customize("bp_email_options[header_text_size]",function(t){t.bind(function(t){t.length&&o(".header_text_size").css("font-size",t+"px")})}),wp.customize("bp_email_options[header_text_color]",function(t){t.bind(function(t){t.length&&o(".header_text_color").css("color",t)})}),wp.customize("bp_email_options[highlight_color]",function(t){t.bind(function(t){t.length&&(o(".header_bg").css("border-top-color",t),o("a").css("color",t),o("hr").attr("color",t))})}),wp.customize("bp_email_options[body_bg]",function(t){t.bind(function(t){t.length&&o(".body_bg").attr("bgcolor",t)})}),wp.customize("bp_email_options[body_text_size]",function(t){t.bind(function(t){t.length&&(o(".body_text_size").css("font-size",t+"px").css("line-height",Math.floor(1.618*t)+"px"),o(".welcome").css("font-size",Math.floor(1.35*t)+"px"))})}),wp.customize("bp_email_options[body_text_color]",function(t){t.bind(function(t){t.length&&o(".body_text_color").css("color",t)})}),wp.customize("bp_email_options[footer_bg]",function(t){t.bind(function(t){t.length&&o(".footer_bg").attr("bgcolor",t)})}),wp.customize("bp_email_options[footer_text_size]",function(t){t.bind(function(t){t.length&&o(".footer_text_size").css("font-size",t+"px").css("line-height",Math.floor(1.618*t)+"px")})}),wp.customize("bp_email_options[footer_text_color]",function(t){t.bind(function(t){t.length&&o(".footer_text_color").css("color",t)})}),wp.customize("bp_email_options[footer_text]",function(t){t.bind(function(t){o(".footer_text").html(t)})})}(jQuery);
1
+ !function(t){wp.customize("bp_email_options[email_bg]",function(o){o.bind(function(o){o.length&&(t(".email_bg").attr("bgcolor",o),t("hr").attr("color",o))})}),wp.customize("bp_email_options[header_bg]",function(o){o.bind(function(o){o.length&&t(".header_bg").attr("bgcolor",o)})}),wp.customize("bp_email_options[header_text_size]",function(o){o.bind(function(o){o.length&&t(".header_text_size").css("font-size",o+"px")})}),wp.customize("bp_email_options[header_text_color]",function(o){o.bind(function(o){o.length&&t(".header_text_color").css("color",o)})}),wp.customize("bp_email_options[highlight_color]",function(o){o.bind(function(o){o.length&&(t(".header_bg").css("border-top-color",o),t("a").css("color",o),t("hr").attr("color",o))})}),wp.customize("bp_email_options[body_bg]",function(o){o.bind(function(o){o.length&&t(".body_bg").attr("bgcolor",o)})}),wp.customize("bp_email_options[body_text_size]",function(o){o.bind(function(o){o.length&&(t(".body_text_size").css("font-size",o+"px").css("line-height",Math.floor(1.618*o)+"px"),t(".welcome").css("font-size",Math.floor(1.35*o)+"px"))})}),wp.customize("bp_email_options[body_text_color]",function(o){o.bind(function(o){o.length&&t(".body_text_color").css("color",o)})}),wp.customize("bp_email_options[footer_bg]",function(o){o.bind(function(o){o.length&&t(".footer_bg").attr("bgcolor",o)})}),wp.customize("bp_email_options[footer_text_size]",function(o){o.bind(function(o){o.length&&t(".footer_text_size").css("font-size",o+"px").css("line-height",Math.floor(1.618*o)+"px")})}),wp.customize("bp_email_options[footer_text_color]",function(o){o.bind(function(o){o.length&&t(".footer_text_color").css("color",o)})}),wp.customize("bp_email_options[footer_text]",function(o){o.bind(function(o){t(".footer_text").html(o)})})}(jQuery);
bp-core/admin/js/dismissible-admin-notices.min.js CHANGED
@@ -1 +1 @@
1
- !function(i){i(document).ready(function(){i(".bp-is-dismissible .notice-dismiss").click(function(){var n=i(this).closest(".notice"),s=n.data("noticeid");i.post({url:ajaxurl,data:{action:"bp_dismiss_notice",nonce:i("#bp-dismissible-nonce-"+s).val(),notice_id:n.data("noticeid")}})})})}(jQuery);
1
+ !function(s){s(document).ready(function(){s(".bp-is-dismissible .notice-dismiss").click(function(){var i=s(this).closest(".notice"),n=i.data("noticeid");s.post({url:ajaxurl,data:{action:"bp_dismiss_notice",nonce:s("#bp-dismissible-nonce-"+n).val(),notice_id:i.data("noticeid")}})})})}(jQuery);
bp-core/admin/js/hello.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,n){if("undefined"!=typeof bpHelloStrings){var t=function(){if("function"!=typeof window.tb_show)return!1;window.tb_show("BuddyPress","#TB_inline?inlineId=bp-hello-container"),e("#TB_window").attr({role:"dialog","aria-label":bpHelloStrings.modalLabel}).addClass("plugin-details-modal").removeClass("thickbox-loading"),e("#TB_ajaxContent").prop("style","height: 100%; width: auto; padding: 0; border: none;");var n=e(":tabbable","#TB_ajaxContent").last();e("#TB_window").on("keydown",function(t){9!==t.keyCode||t.shiftKey||e(n).prop("classList").value!==e(t.target).prop("classList").value||(t.preventDefault(),e("#TB_closeWindowButton").focus()),9===t.keyCode&&t.shiftKey&&"TB_closeWindowButton"===e(t.target).prop("id")&&(t.preventDefault(),e(n).focus())})},o=function(n){n||(n=bpHelloStrings.pageNotFound),e("#dynamic-content").html(e("<div></div>").prop("id","message").addClass("notice notice-error error").html(e("<p></p>").html(n)))};e("#plugin-information-tabs").on("click","a",function(t){t.preventDefault();var a=e(t.currentTarget),i=e("#dynamic-content");a.hasClass("dynamic")?(e("#top-features").hide(),i.html(""),i.addClass("show"),e("#TB_window").addClass("thickbox-loading"),n.apiRequest({url:a.data("endpoint"),type:"GET",beforeSend:function(e,n){n.url=n.url.replace("&_wpnonce=none","")},data:{context:"view",slug:a.data("slug"),_wpnonce:"none"}}).done(function(e){var n=_.first(e);n&&n.content?i.html(n.content.rendered):o()}).fail(function(e){if(!e||!e.message)return!1;o(e.message)}).always(function(){e("#TB_window").removeClass("thickbox-loading")})):(e("#top-features").show(),i.html(""),i.removeClass("show"))}),e(document).ready(function(){t()})}}(jQuery,window.bp||{});
1
+ !function(o,t){var a;"undefined"!=typeof bpHelloStrings&&(a=function(e){e=e||bpHelloStrings.pageNotFound,o("#dynamic-content").html(o("<div></div>").prop("id","message").addClass("notice notice-error error").html(o("<p></p>").html(e)))},o("#plugin-information-tabs").on("click","a",function(e){e.preventDefault();var e=o(e.currentTarget),n=o("#dynamic-content");e.hasClass("dynamic")?(o("#top-features").hide(),n.html(""),n.addClass("show"),o("#TB_window").addClass("thickbox-loading"),t.apiRequest({url:e.data("endpoint"),type:"GET",beforeSend:function(e,n){n.url=n.url.replace("&_wpnonce=none","")},data:{context:"view",slug:e.data("slug"),_wpnonce:"none"}}).done(function(e){e=_.first(e);e&&e.content?n.html(e.content.rendered):a()}).fail(function(e){return!(!e||!e.message)&&void a(e.message)}).always(function(){o("#TB_window").removeClass("thickbox-loading")})):(o("#top-features").show(),n.html(""),n.removeClass("show"))}),o(document).ready(function(){!function(){if("function"!=typeof window.tb_show)return;window.tb_show("BuddyPress","#TB_inline?inlineId=bp-hello-container"),o("#TB_window").attr({role:"dialog","aria-label":bpHelloStrings.modalLabel}).addClass("plugin-details-modal").removeClass("thickbox-loading"),o("#TB_ajaxContent").prop("style","height: 100%; width: auto; padding: 0; border: none;");var n=o(":tabbable","#TB_ajaxContent").last();o("#TB_window").on("keydown",function(e){9!==e.keyCode||e.shiftKey||o(n).prop("classList").value!==o(e.target).prop("classList").value||(e.preventDefault(),o("#TB_closeWindowButton").focus()),9===e.keyCode&&e.shiftKey&&"TB_closeWindowButton"===o(e.target).prop("id")&&(e.preventDefault(),o(n).focus())})}()}))}(jQuery,window.bp||{});
bp-core/admin/js/types-admin.min.js CHANGED
@@ -1 +1 @@
1
- !function(){var e=function(){document.querySelector('#addtag input[name="post_type"]')&&document.querySelector('#addtag input[name="post_type"]').remove(),document.querySelectorAll(".form-field")&&document.querySelectorAll(".form-field").forEach(function(e){-1===e.classList.value.indexOf("bp-types-form")&&e.remove()}),document.querySelector("#bp_type_has_directory")&&(!0===document.querySelector("#bp_type_has_directory").checked&&document.querySelector(".term-bp_type_directory_slug-wrap").classList.add("bp-set-directory-slug"),document.querySelector("#bp_type_has_directory").addEventListener("change",function(e){!0===e.target.checked?(document.querySelector(".term-bp_type_directory_slug-wrap").classList.add("bp-set-directory-slug"),document.querySelector("#bp_type_directory_slug").removeAttribute("disabled")):(document.querySelector(".term-bp_type_directory_slug-wrap").classList.remove("bp-set-directory-slug"),document.querySelector("#bp_type_directory_slug").setAttribute("disabled","disabled"))})),document.querySelector("#delete-link")&&document.querySelector("#delete-link").remove()};"loading"===document.readyState&&document.addEventListener("DOMContentLoaded",e)}();
1
+ !function(){function e(){document.querySelector('#addtag input[name="post_type"]')&&document.querySelector('#addtag input[name="post_type"]').remove(),document.querySelectorAll(".form-field")&&document.querySelectorAll(".form-field").forEach(function(e){-1===e.classList.value.indexOf("bp-types-form")&&e.remove()}),document.querySelector("#bp_type_has_directory")&&(!0===document.querySelector("#bp_type_has_directory").checked&&document.querySelector(".term-bp_type_directory_slug-wrap").classList.add("bp-set-directory-slug"),document.querySelector("#bp_type_has_directory").addEventListener("change",function(e){!0===e.target.checked?(document.querySelector(".term-bp_type_directory_slug-wrap").classList.add("bp-set-directory-slug"),document.querySelector("#bp_type_directory_slug").removeAttribute("disabled")):(document.querySelector(".term-bp_type_directory_slug-wrap").classList.remove("bp-set-directory-slug"),document.querySelector("#bp_type_directory_slug").setAttribute("disabled","disabled"))})),document.querySelector("#delete-link")&&document.querySelector("#delete-link").remove()}"loading"===document.readyState&&document.addEventListener("DOMContentLoaded",e)}();
bp-core/bp-core-adminbar.php CHANGED
@@ -44,39 +44,20 @@ function bp_admin_bar_my_account_root() {
44
  add_action( 'admin_bar_menu', 'bp_admin_bar_my_account_root', 100 );
45
 
46
  /**
47
- * Handle the Toolbar/BuddyBar business.
48
  *
49
  * @since 1.2.0
50
  */
51
  function bp_core_load_admin_bar() {
52
-
53
  // Show the Toolbar for logged out users.
54
  if ( ! is_user_logged_in() && (int) bp_get_option( 'hide-loggedout-adminbar' ) != 1 ) {
55
  show_admin_bar( true );
56
  }
57
 
58
- // Hide the WordPress Toolbar and show the BuddyBar.
59
  if ( ! bp_use_wp_admin_bar() ) {
60
- _doing_it_wrong( __FUNCTION__, __( 'The BuddyBar is no longer supported. Please migrate to the WordPress toolbar as soon as possible.', 'buddypress' ), '2.1.0' );
61
-
62
- // Load deprecated code if not available.
63
- if ( ! function_exists( 'bp_core_admin_bar' ) ) {
64
- require buddypress()->plugin_dir . 'bp-core/deprecated/2.1.php';
65
- }
66
-
67
  // Keep the WP Toolbar from loading.
68
  show_admin_bar( false );
69
-
70
- // Actions used to build the BP Toolbar.
71
- add_action( 'bp_adminbar_logo', 'bp_adminbar_logo' );
72
- add_action( 'bp_adminbar_menus', 'bp_adminbar_login_menu', 2 );
73
- add_action( 'bp_adminbar_menus', 'bp_adminbar_account_menu', 4 );
74
- add_action( 'bp_adminbar_menus', 'bp_adminbar_thisblog_menu', 6 );
75
- add_action( 'bp_adminbar_menus', 'bp_adminbar_random_menu', 100 );
76
-
77
- // Actions used to append BP Toolbar to footer.
78
- add_action( 'wp_footer', 'bp_core_admin_bar', 8 );
79
- add_action( 'admin_footer', 'bp_core_admin_bar' );
80
  }
81
  }
82
  add_action( 'init', 'bp_core_load_admin_bar', 9 );
44
  add_action( 'admin_bar_menu', 'bp_admin_bar_my_account_root', 100 );
45
 
46
  /**
47
+ * Toggle the display of the toolbar based on certain conditions.
48
  *
49
  * @since 1.2.0
50
  */
51
  function bp_core_load_admin_bar() {
 
52
  // Show the Toolbar for logged out users.
53
  if ( ! is_user_logged_in() && (int) bp_get_option( 'hide-loggedout-adminbar' ) != 1 ) {
54
  show_admin_bar( true );
55
  }
56
 
57
+ // Hide the WordPress Toolbar.
58
  if ( ! bp_use_wp_admin_bar() ) {
 
 
 
 
 
 
 
59
  // Keep the WP Toolbar from loading.
60
  show_admin_bar( false );
 
 
 
 
 
 
 
 
 
 
 
61
  }
62
  }
63
  add_action( 'init', 'bp_core_load_admin_bar', 9 );
bp-core/bp-core-attachments.php CHANGED
@@ -467,8 +467,9 @@ function bp_attachments_get_attachment( $data = 'url', $args = array() ) {
467
  * Defaults to 'cover-image'
468
  * @type string $file The name of the file.
469
  * }
 
470
  */
471
- $pre_filter = apply_filters( 'bp_attachments_pre_get_attachment', null, $r );
472
  if ( $pre_filter !== null ) {
473
  return $pre_filter;
474
  }
467
  * Defaults to 'cover-image'
468
  * @type string $file The name of the file.
469
  * }
470
+ * @param string $data The requested data `url` or `path`.
471
  */
472
+ $pre_filter = apply_filters( 'bp_attachments_pre_get_attachment', null, $r, $data );
473
  if ( $pre_filter !== null ) {
474
  return $pre_filter;
475
  }
bp-core/bp-core-avatars.php CHANGED
@@ -95,6 +95,39 @@ function bp_core_set_avatar_globals() {
95
  }
96
  add_action( 'bp_setup_globals', 'bp_core_set_avatar_globals' );
97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  /**
99
  * Get an avatar for a BuddyPress object.
100
  *
@@ -362,7 +395,10 @@ function bp_core_fetch_avatar( $args = '' ) {
362
  }
363
 
364
  // Extra attributes.
365
- $extra_attr = ! empty( $args['extra_attr'] ) ? ' ' . $args['extra_attr'] : '';
 
 
 
366
 
367
  // Set CSS ID and create html string.
368
  $html_css_id = '';
@@ -641,15 +677,29 @@ function bp_core_fetch_avatar( $args = '' ) {
641
  $url_args['r'] = strtolower( $params['rating'] );
642
  }
643
 
 
 
 
 
 
 
 
 
 
 
 
 
 
644
  /**
645
  * Filters the Gravatar "d" parameter.
646
  *
647
  * @since 2.6.0
 
648
  *
649
  * @param string $default_grav The avatar default.
650
  * @param array $params The avatar's data.
651
  */
652
- $default_grav = apply_filters( 'bp_core_avatar_default', $default_grav, $params );
653
 
654
  // Only set default image if 'Gravatar Logo' is not requested.
655
  if ( ! $params['force_default'] && 'gravatar_default' !== $default_grav ) {
@@ -1838,16 +1888,30 @@ function bp_core_avatar_default( $type = 'gravatar', $params = array() ) {
1838
  $avatar = '//www.gravatar.com/avatar/00000000000000000000000000000000?d=mm&amp;s=' . $size;
1839
  }
1840
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1841
  /**
1842
  * Filters the URL of the 'full' default avatar.
1843
  *
1844
  * @since 1.5.0
1845
  * @since 2.6.0 Added `$params`.
 
1846
  *
1847
  * @param string $avatar URL of the default avatar.
1848
  * @param array $params Params provided to bp_core_fetch_avatar().
1849
  */
1850
- return apply_filters( 'bp_core_avatar_default', $avatar, $params );
1851
  }
1852
 
1853
  /**
95
  }
96
  add_action( 'bp_setup_globals', 'bp_core_set_avatar_globals' );
97
 
98
+ /**
99
+ * Checks whether a given gravatar is one of the default ones.
100
+ *
101
+ * @since 8.0.0
102
+ *
103
+ * @param string $d The name of the default gravatar.
104
+ * @return bool True if it's a default gravatar. False otherwise.
105
+ */
106
+ function bp_core_is_default_gravatar( $d = '' ) {
107
+ if ( ! $d ) {
108
+ return false;
109
+ }
110
+
111
+ /** this filter is documented in wp-admin/options-discussion.php */
112
+ $gravatar_defaults = apply_filters(
113
+ 'avatar_defaults',
114
+ array_fill_keys(
115
+ array(
116
+ 'mystery',
117
+ 'blank',
118
+ 'gravatar_default',
119
+ 'identicon',
120
+ 'wavatar',
121
+ 'monsterid',
122
+ 'retro',
123
+ ),
124
+ ''
125
+ )
126
+ );
127
+
128
+ return isset( $gravatar_defaults[ $d ] );
129
+ }
130
+
131
  /**
132
  * Get an avatar for a BuddyPress object.
133
  *
395
  }
396
 
397
  // Extra attributes.
398
+ $extra_attr = '';
399
+ if ( ! empty( $params['extra_attr'] ) ) {
400
+ $extra_attr = ' ' . $params['extra_attr'];
401
+ }
402
 
403
  // Set CSS ID and create html string.
404
  $html_css_id = '';
677
  $url_args['r'] = strtolower( $params['rating'] );
678
  }
679
 
680
+ /** This filter is documented in wp-includes/deprecated.php */
681
+ $d = apply_filters_deprecated(
682
+ 'bp_core_avatar_default',
683
+ array( $default_grav, $params ),
684
+ '8.0.0',
685
+ 'bp_core_avatar_gravatar_default||bp_core_default_avatar',
686
+ __( 'This filter was used for 2 different purposes. If your goal was to filter the default *Gravatar*, please use `bp_core_avatar_gravatar_default` instead. Otherwise, please use `bp_core_default_avatar` instead.', 'buddypress' )
687
+ );
688
+
689
+ if ( bp_core_is_default_gravatar( $d ) ) {
690
+ $default_grav = $d;
691
+ }
692
+
693
  /**
694
  * Filters the Gravatar "d" parameter.
695
  *
696
  * @since 2.6.0
697
+ * @since 8.0.0 The name of the filter was changed to `bp_core_avatar_gravatar_default`.
698
  *
699
  * @param string $default_grav The avatar default.
700
  * @param array $params The avatar's data.
701
  */
702
+ $default_grav = apply_filters( 'bp_core_avatar_gravatar_default', $default_grav, $params );
703
 
704
  // Only set default image if 'Gravatar Logo' is not requested.
705
  if ( ! $params['force_default'] && 'gravatar_default' !== $default_grav ) {
1888
  $avatar = '//www.gravatar.com/avatar/00000000000000000000000000000000?d=mm&amp;s=' . $size;
1889
  }
1890
 
1891
+ /** This filter is documented in wp-includes/deprecated.php */
1892
+ $a = apply_filters_deprecated(
1893
+ 'bp_core_avatar_default',
1894
+ array( $avatar, $params ),
1895
+ '8.0.0',
1896
+ 'bp_core_avatar_gravatar_default||bp_core_default_avatar',
1897
+ __( 'This filter was used for 2 different purposes. If your goal was to filter the default *Gravatar*, please use `bp_core_avatar_gravatar_default` instead. Otherwise, please use `bp_core_default_avatar` instead.', 'buddypress' )
1898
+ );
1899
+
1900
+ if ( ! bp_core_is_default_gravatar( $a ) && false !== strpos( $avatar, '//' ) ) {
1901
+ $avatar = $a;
1902
+ }
1903
+
1904
  /**
1905
  * Filters the URL of the 'full' default avatar.
1906
  *
1907
  * @since 1.5.0
1908
  * @since 2.6.0 Added `$params`.
1909
+ * @since 8.0.0 The name of the filter was changed to `bp_core_default_avatar`.
1910
  *
1911
  * @param string $avatar URL of the default avatar.
1912
  * @param array $params Params provided to bp_core_fetch_avatar().
1913
  */
1914
+ return apply_filters( 'bp_core_default_avatar', $avatar, $params );
1915
  }
1916
 
1917
  /**
bp-core/bp-core-blocks.php CHANGED
@@ -67,7 +67,20 @@ function bp_blocks_editor_settings( $editor_settings = array() ) {
67
 
68
  return $editor_settings;
69
  }
70
- add_filter( 'block_editor_settings', 'bp_blocks_editor_settings' );
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
  /**
73
  * Register a BuddyPress block type.
67
 
68
  return $editor_settings;
69
  }
70
+
71
+ /**
72
+ * Select the right `block_editor_settings` filter according to WP version.
73
+ *
74
+ * @since 8.0.0
75
+ */
76
+ function bp_block_init_editor_settings_filter() {
77
+ if ( function_exists( 'get_block_editor_settings' ) ) {
78
+ add_filter( 'block_editor_settings_all', 'bp_blocks_editor_settings' );
79
+ } else {
80
+ add_filter( 'block_editor_settings', 'bp_blocks_editor_settings' );
81
+ }
82
+ }
83
+ add_action( 'bp_init', 'bp_block_init_editor_settings_filter' );
84
 
85
  /**
86
  * Register a BuddyPress block type.
bp-core/bp-core-buddybar.php CHANGED
@@ -5,8 +5,6 @@
5
  * @package BuddyPress
6
  * @subpackage Core
7
  * @since 1.5.0
8
- *
9
- * @todo Deprecate BuddyBar functions.
10
  */
11
 
12
  // Exit if accessed directly.
5
  * @package BuddyPress
6
  * @subpackage Core
7
  * @since 1.5.0
 
 
8
  */
9
 
10
  // Exit if accessed directly.
bp-core/bp-core-cache.php CHANGED
@@ -415,3 +415,14 @@ function bp_clear_object_type_terms_cache( $type_id = 0, $taxonomy = '' ) {
415
  add_action( 'bp_type_inserted', 'bp_clear_object_type_terms_cache' );
416
  add_action( 'bp_type_updated', 'bp_clear_object_type_terms_cache' );
417
  add_action( 'bp_type_deleted', 'bp_clear_object_type_terms_cache' );
 
 
 
 
 
 
 
 
 
 
 
415
  add_action( 'bp_type_inserted', 'bp_clear_object_type_terms_cache' );
416
  add_action( 'bp_type_updated', 'bp_clear_object_type_terms_cache' );
417
  add_action( 'bp_type_deleted', 'bp_clear_object_type_terms_cache' );
418
+
419
+ /**
420
+ * Resets all incremented bp_optout caches.
421
+ *
422
+ * @since 8.0.0
423
+ */
424
+ function bp_optouts_reset_cache_incrementor() {
425
+ bp_core_reset_incrementor( 'bp_optouts' );
426
+ }
427
+ add_action( 'bp_optout_after_save', 'bp_optouts_reset_cache_incrementor' );
428
+ add_action( 'bp_optout_after_delete', 'bp_optouts_reset_cache_incrementor' );
bp-core/bp-core-cssjs.php CHANGED
@@ -300,14 +300,14 @@ function bp_core_add_cropper_inline_js() {
300
  ?>
301
 
302
  <script type="text/javascript">
303
- jQuery(window).load( function(){
304
- jQuery('#avatar-to-crop').Jcrop({
305
  onChange: showPreview,
306
  onSelect: updateCoords,
307
  aspectRatio: <?php echo (int) $aspect_ratio; ?>,
308
  setSelect: [ <?php echo (int) $crop_left; ?>, <?php echo (int) $crop_top; ?>, <?php echo (int) $crop_right; ?>, <?php echo (int) $crop_bottom; ?> ]
309
- });
310
- });
311
 
312
  function updateCoords(c) {
313
  jQuery('#x').val(c.x);
300
  ?>
301
 
302
  <script type="text/javascript">
303
+ jQuery( window ).on( 'load', function() {
304
+ jQuery( '#avatar-to-crop' ).Jcrop( {
305
  onChange: showPreview,
306
  onSelect: updateCoords,
307
  aspectRatio: <?php echo (int) $aspect_ratio; ?>,
308
  setSelect: [ <?php echo (int) $crop_left; ?>, <?php echo (int) $crop_top; ?>, <?php echo (int) $crop_right; ?>, <?php echo (int) $crop_bottom; ?> ]
309
+ } );
310
+ } );
311
 
312
  function updateCoords(c) {
313
  jQuery('#x').val(c.x);
bp-core/bp-core-filters.php CHANGED
@@ -1067,12 +1067,21 @@ function bp_email_set_default_headers( $headers, $property, $transform, $email )
1067
 
1068
  // Add 'List-Unsubscribe' header if applicable.
1069
  if ( ! empty( $tokens['unsubscribe'] ) && $tokens['unsubscribe'] !== wp_login_url() ) {
1070
- $user = get_user_by( 'email', $tokens['recipient.email'] );
 
1071
 
1072
- $link = bp_email_get_unsubscribe_link( array(
1073
- 'user_id' => $user->ID,
1074
  'notification_type' => $email->get( 'type' ),
1075
- ) );
 
 
 
 
 
 
 
 
1076
 
1077
  if ( ! empty( $link ) ) {
1078
  $headers['List-Unsubscribe'] = sprintf( '<%s>', esc_url_raw( $link ) );
1067
 
1068
  // Add 'List-Unsubscribe' header if applicable.
1069
  if ( ! empty( $tokens['unsubscribe'] ) && $tokens['unsubscribe'] !== wp_login_url() ) {
1070
+ $user = get_user_by( 'email', $tokens['recipient.email'] );
1071
+ $user_id = isset( $user->ID ) ? $user->ID : 0;
1072
 
1073
+ $args = array(
1074
+ 'user_id' => $user_id,
1075
  'notification_type' => $email->get( 'type' ),
1076
+ );
1077
+
1078
+ // If this email is not to a current member, include the nonmember's email address and the Inviter ID.
1079
+ if ( ! $user_id ) {
1080
+ $args['email_address'] = $tokens['recipient.email'];
1081
+ $args['member_id'] = bp_loggedin_user_id();
1082
+ }
1083
+
1084
+ $link = bp_email_get_unsubscribe_link( $args );
1085
 
1086
  if ( ! empty( $link ) ) {
1087
  $headers['List-Unsubscribe'] = sprintf( '<%s>', esc_url_raw( $link ) );
bp-core/bp-core-functions.php CHANGED
@@ -433,16 +433,12 @@ function bp_is_username_compatibility_mode() {
433
  */
434
  function bp_use_wp_admin_bar() {
435
 
436
- // Default to true (to avoid loading deprecated BuddyBar code).
437
  $use_admin_bar = true;
438
 
439
  // Has the WP Toolbar constant been explicitly opted into?
440
  if ( defined( 'BP_USE_WP_ADMIN_BAR' ) ) {
441
  $use_admin_bar = (bool) BP_USE_WP_ADMIN_BAR;
442
-
443
- // ...or is the old BuddyBar being forced back into use?
444
- } elseif ( bp_force_buddybar( false ) ) {
445
- $use_admin_bar = false;
446
  }
447
 
448
  /**
@@ -706,7 +702,7 @@ function bp_core_add_page_mappings( $components, $existing = 'keep' ) {
706
 
707
  // Register and Activate are not components, but need pages when
708
  // registration is enabled.
709
- if ( bp_get_signup_allowed() ) {
710
  foreach ( array( 'register', 'activate' ) as $slug ) {
711
  if ( ! isset( $pages[ $slug ] ) ) {
712
  $pages_to_create[ $slug ] = $page_titles[ $slug ];
@@ -949,6 +945,54 @@ function bp_core_get_component_search_query_arg( $component = null ) {
949
  return apply_filters( 'bp_core_get_component_search_query_arg', $query_arg, $component );
950
  }
951
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
952
  /**
953
  * Determine whether BuddyPress should register the bp-themes directory.
954
  *
@@ -1133,75 +1177,31 @@ function bp_core_current_time( $gmt = true, $type = 'mysql' ) {
1133
  }
1134
 
1135
  /**
1136
- * Get an English-language representation of the time elapsed since a given date.
1137
  *
1138
  * Based on function created by Dunstan Orchard - http://1976design.com
1139
  *
1140
- * This function will return an English representation of the time elapsed
1141
- * since a given date.
1142
- * eg: 2 hours and 50 minutes
1143
- * eg: 4 days
1144
- * eg: 4 weeks and 6 days
1145
  *
1146
- * Note that fractions of minutes are not represented in the return string. So
1147
- * an interval of 3 minutes will be represented by "3 minutes ago", as will an
1148
- * interval of 3 minutes 59 seconds.
1149
- *
1150
- * @since 1.0.0
1151
  *
1152
- * @param int|string $older_date The earlier time from which you're calculating
1153
- * the time elapsed. Enter either as an integer Unix timestamp,
1154
- * or as a date string of the format 'Y-m-d h:i:s'.
1155
- * @param int|bool $newer_date Optional. Unix timestamp of date to compare older
1156
- * date to. Default: false (current time).
1157
- * @return string String representing the time since the older date, eg
1158
- * "2 hours and 50 minutes".
1159
  */
1160
- function bp_core_time_since( $older_date, $newer_date = false ) {
1161
-
1162
- /**
1163
- * Filters whether or not to bypass BuddyPress' time_since calculations.
1164
- *
1165
- * @since 1.7.0
1166
- *
1167
- * @param bool $value Whether or not to bypass.
1168
- * @param string $older_date Earlier time from which we're calculating time elapsed.
1169
- * @param string $newer_date Unix timestamp of date to compare older time to.
1170
- */
1171
- $pre_value = apply_filters( 'bp_core_time_since_pre', false, $older_date, $newer_date );
1172
- if ( false !== $pre_value ) {
1173
- return $pre_value;
1174
- }
1175
-
1176
- /**
1177
- * Filters the value to use if the time since is unknown.
1178
- *
1179
- * @since 1.5.0
1180
- *
1181
- * @param string $value String representing the time since the older date.
1182
- */
1183
- $unknown_text = apply_filters( 'bp_core_time_since_unknown_text', __( 'sometime', 'buddypress' ) );
1184
-
1185
- /**
1186
- * Filters the value to use if the time since is right now.
1187
- *
1188
- * @since 1.5.0
1189
- *
1190
- * @param string $value String representing the time since the older date.
1191
- */
1192
- $right_now_text = apply_filters( 'bp_core_time_since_right_now_text', __( 'right now', 'buddypress' ) );
1193
-
1194
- /**
1195
- * Filters the value to use if the time since is some time ago.
1196
- *
1197
- * @since 1.5.0
1198
- *
1199
- * @param string $value String representing the time since the older date.
1200
- */
1201
- $ago_text = apply_filters(
1202
- 'bp_core_time_since_ago_text',
1203
- /* translators: %s: the human time diff. */
1204
- __( '%s ago', 'buddypress' )
1205
  );
1206
 
1207
  // Array of time period chunks.
@@ -1215,134 +1215,218 @@ function bp_core_time_since( $older_date, $newer_date = false ) {
1215
  1
1216
  );
1217
 
1218
- if ( !empty( $older_date ) && !is_numeric( $older_date ) ) {
1219
- $time_chunks = explode( ':', str_replace( ' ', ':', $older_date ) );
1220
- $date_chunks = explode( '-', str_replace( ' ', '-', $older_date ) );
1221
- $older_date = gmmktime( (int) $time_chunks[1], (int) $time_chunks[2], (int) $time_chunks[3], (int) $date_chunks[1], (int) $date_chunks[2], (int) $date_chunks[0] );
1222
- }
1223
 
1224
- /**
1225
- * $newer_date will equal false if we want to know the time elapsed between
1226
- * a date and the current time. $newer_date will have a value if we want to
1227
- * work out time elapsed between two known dates.
1228
- */
1229
- $newer_date = ( !$newer_date ) ? bp_core_current_time( true, 'timestamp' ) : $newer_date;
 
 
 
 
 
 
 
1230
 
1231
  // Difference in seconds.
1232
- $since = $newer_date - $older_date;
1233
-
1234
- // Something went wrong with date calculation and we ended up with a negative date.
1235
- if ( 0 > $since ) {
1236
- $output = $unknown_text;
1237
 
1238
  /**
1239
- * We only want to output two chunks of time here, eg:
1240
- * x years, xx months
1241
- * x days, xx hours
1242
- * so there's only two bits of calculation below:
1243
  */
1244
- } else {
1245
-
1246
  // Step one: the first chunk.
1247
  for ( $i = 0, $j = count( $chunks ); $i < $j; ++$i ) {
1248
  $seconds = $chunks[$i];
1249
 
1250
  // Finding the biggest chunk (if the chunk fits, break).
1251
- $count = floor( $since / $seconds );
1252
  if ( 0 != $count ) {
1253
  break;
1254
  }
1255
  }
1256
 
1257
- // If $i iterates all the way to $j, then the event happened 0 seconds ago.
1258
- if ( !isset( $chunks[$i] ) ) {
1259
- $output = $right_now_text;
1260
 
1261
- } else {
1262
-
1263
- // Set output var.
1264
  switch ( $seconds ) {
1265
  case YEAR_IN_SECONDS :
1266
  /* translators: %s: the number of years. */
1267
- $output = sprintf( _n( '%s year', '%s years', $count, 'buddypress' ), $count );
1268
  break;
1269
  case 30 * DAY_IN_SECONDS :
1270
  /* translators: %s: the number of months. */
1271
- $output = sprintf( _n( '%s month', '%s months', $count, 'buddypress' ), $count );
1272
  break;
1273
  case WEEK_IN_SECONDS :
1274
  /* translators: %s: the number of weeks. */
1275
- $output = sprintf( _n( '%s week', '%s weeks', $count, 'buddypress' ), $count );
1276
  break;
1277
  case DAY_IN_SECONDS :
1278
  /* translators: %s: the number of days. */
1279
- $output = sprintf( _n( '%s day', '%s days', $count, 'buddypress' ), $count );
1280
  break;
1281
  case HOUR_IN_SECONDS :
1282
  /* translators: %s: the number of hours. */
1283
- $output = sprintf( _n( '%s hour', '%s hours', $count, 'buddypress' ), $count );
1284
  break;
1285
  case MINUTE_IN_SECONDS :
1286
  /* translators: %s: the number of minutes. */
1287
- $output = sprintf( _n( '%s minute', '%s minutes', $count, 'buddypress' ), $count );
1288
  break;
1289
  default:
1290
  /* translators: %s: the number of seconds. */
1291
- $output = sprintf( _n( '%s second', '%s seconds', $count, 'buddypress' ), $count );
1292
  }
1293
 
1294
- // Step two: the second chunk
1295
- // A quirk in the implementation means that this
1296
- // condition fails in the case of minutes and seconds.
1297
- // We've left the quirk in place, since fractions of a
1298
- // minute are not a useful piece of information for our
1299
- // purposes.
1300
- if ( $i + 2 < $j ) {
 
1301
  $seconds2 = $chunks[$i + 1];
1302
- $count2 = floor( ( $since - ( $seconds * $count ) ) / $seconds2 );
1303
 
1304
- // Add to output var.
1305
- if ( 0 != $count2 ) {
1306
- $output .= _x( ',', 'Separator in time since', 'buddypress' ) . ' ';
1307
 
1308
  switch ( $seconds2 ) {
1309
  case 30 * DAY_IN_SECONDS :
1310
  /* translators: %s: the number of months. */
1311
- $output .= sprintf( _n( '%s month', '%s months', $count2, 'buddypress' ), $count2 );
1312
  break;
1313
  case WEEK_IN_SECONDS :
1314
  /* translators: %s: the number of weeks. */
1315
- $output .= sprintf( _n( '%s week', '%s weeks', $count2, 'buddypress' ), $count2 );
1316
  break;
1317
  case DAY_IN_SECONDS :
1318
  /* translators: %s: the number of days. */
1319
- $output .= sprintf( _n( '%s day', '%s days', $count2, 'buddypress' ), $count2 );
1320
  break;
1321
  case HOUR_IN_SECONDS :
1322
  /* translators: %s: the number of hours. */
1323
- $output .= sprintf( _n( '%s hour', '%s hours', $count2, 'buddypress' ), $count2 );
1324
  break;
1325
  case MINUTE_IN_SECONDS :
1326
  /* translators: %s: the number of minutes. */
1327
- $output .= sprintf( _n( '%s minute', '%s minutes', $count2, 'buddypress' ), $count2 );
1328
  break;
1329
  default:
1330
  /* translators: %s: the number of seconds. */
1331
- $output .= sprintf( _n( '%s second', '%s seconds', $count2, 'buddypress' ), $count2 );
1332
  }
1333
  }
1334
  }
1335
-
1336
- // No output, so happened right now.
1337
- if ( ! (int) trim( $output ) ) {
1338
- $output = $right_now_text;
1339
- }
1340
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1341
  }
1342
 
1343
- // Append 'ago' to the end of time-since if not 'right now'.
1344
- if ( $output != $right_now_text ) {
1345
- $output = sprintf( $ago_text, $output );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1346
  }
1347
 
1348
  /**
@@ -1357,6 +1441,42 @@ function bp_core_time_since( $older_date, $newer_date = false ) {
1357
  return apply_filters( 'bp_core_time_since', $output, $older_date, $newer_date );
1358
  }
1359
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1360
  /**
1361
  * Output an ISO-8601 date from a date string.
1362
  *
@@ -3428,6 +3548,9 @@ function bp_send_email( $email_type, $to, $args = array() ) {
3428
  // From, subject, content are set automatically.
3429
  if ( 'settings-verify-email-change' === $email_type && isset( $args['tokens']['displayname'] ) ) {
3430
  $email->set_to( $to, $args['tokens']['displayname'] );
 
 
 
3431
  } else {
3432
  $email->set_to( $to );
3433
  }
@@ -3684,6 +3807,14 @@ function bp_email_get_schema() {
3684
  * @param array $emails The array of emails schema.
3685
  */
3686
  return (array) apply_filters( 'bp_email_get_schema', array(
 
 
 
 
 
 
 
 
3687
  'activity-comment' => array(
3688
  /* translators: do not remove {} brackets or translate its contents. */
3689
  'post_title' => __( '[{{{site.name}}}] {{poster.name}} replied to one of your updates', 'buddypress' ),
@@ -3763,9 +3894,9 @@ function bp_email_get_schema() {
3763
  /* translators: do not remove {} brackets or translate its contents. */
3764
  'post_title' => __( '[{{{site.name}}}] You have an invitation to the group: "{{group.name}}"', 'buddypress' ),
3765
  /* translators: do not remove {} brackets or translate its contents. */
3766
- 'post_content' => __( "<a href=\"{{{inviter.url}}}\">{{inviter.name}}</a> has invited you to join the group: &quot;{{group.name}}&quot;.\n{{invite.message}}\n<a href=\"{{{invites.url}}}\">Go here to accept your invitation</a> or <a href=\"{{{group.url}}}\">visit the group</a> to learn more.", 'buddypress' ),
3767
  /* translators: do not remove {} brackets or translate its contents. */
3768
- 'post_excerpt' => __( "{{inviter.name}} has invited you to join the group: \"{{group.name}}\".\n\nTo accept your invitation, visit: {{{invites.url}}}\n\nTo learn more about the group, visit: {{{group.url}}}.\nTo view {{inviter.name}}'s profile, visit: {{{inviter.url}}}", 'buddypress' ),
3769
  ),
3770
  'groups-member-promoted' => array(
3771
  /* translators: do not remove {} brackets or translate its contents. */
@@ -3815,6 +3946,14 @@ function bp_email_get_schema() {
3815
  /* translators: do not remove {} brackets or translate its contents. */
3816
  'post_excerpt' => __( "Your membership request for the group \"{{group.name}}\" has been rejected.\n\nTo request membership again, visit: {{{group.url}}}", 'buddypress' ),
3817
  ),
 
 
 
 
 
 
 
 
3818
  ) );
3819
  }
3820
 
@@ -3838,121 +3977,152 @@ function bp_email_get_schema() {
3838
  */
3839
  function bp_email_get_type_schema( $field = 'description' ) {
3840
  $activity_comment = array(
3841
- 'description' => __( 'A member has replied to an activity update that the recipient posted.', 'buddypress' ),
3842
- 'unsubscribe' => array(
3843
- 'meta_key' => 'notification_activity_new_reply',
3844
- 'message' => __( 'You will no longer receive emails when someone replies to an update or comment you posted.', 'buddypress' ),
 
3845
  ),
3846
  );
3847
 
3848
  $activity_comment_author = array(
3849
- 'description' => __( 'A member has replied to a comment on an activity update that the recipient posted.', 'buddypress' ),
3850
- 'unsubscribe' => array(
3851
- 'meta_key' => 'notification_activity_new_reply',
3852
- 'message' => __( 'You will no longer receive emails when someone replies to an update or comment you posted.', 'buddypress' ),
 
3853
  ),
3854
  );
3855
 
3856
  $activity_at_message = array(
3857
- 'description' => __( 'Recipient was mentioned in an activity update.', 'buddypress' ),
3858
- 'unsubscribe' => array(
3859
- 'meta_key' => 'notification_activity_new_mention',
3860
- 'message' => __( 'You will no longer receive emails when someone mentions you in an update.', 'buddypress' ),
 
3861
  ),
3862
  );
3863
 
3864
  $groups_at_message = array(
3865
- 'description' => __( 'Recipient was mentioned in a group activity update.', 'buddypress' ),
3866
- 'unsubscribe' => array(
3867
- 'meta_key' => 'notification_activity_new_mention',
3868
- 'message' => __( 'You will no longer receive emails when someone mentions you in an update.', 'buddypress' ),
 
3869
  ),
3870
  );
3871
 
3872
  $core_user_registration = array(
3873
- 'description' => __( 'Recipient has registered for an account.', 'buddypress' ),
3874
- 'unsubscribe' => false,
 
3875
  );
3876
 
3877
  $core_user_registration_with_blog = array(
3878
- 'description' => __( 'Recipient has registered for an account and site.', 'buddypress' ),
3879
- 'unsubscribe' => false,
 
3880
  );
3881
 
3882
  $friends_request = array(
3883
- 'description' => __( 'A member has sent a friend request to the recipient.', 'buddypress' ),
3884
- 'unsubscribe' => array(
3885
- 'meta_key' => 'notification_friends_friendship_request',
3886
- 'message' => __( 'You will no longer receive emails when someone sends you a friend request.', 'buddypress' ),
 
3887
  ),
3888
  );
3889
 
3890
  $friends_request_accepted = array(
3891
- 'description' => __( 'Recipient has had a friend request accepted by a member.', 'buddypress' ),
3892
- 'unsubscribe' => array(
3893
- 'meta_key' => 'notification_friends_friendship_accepted',
3894
- 'message' => __( 'You will no longer receive emails when someone accepts your friendship request.', 'buddypress' ),
 
3895
  ),
3896
  );
3897
 
3898
  $groups_details_updated = array(
3899
- 'description' => __( "A group's details were updated.", 'buddypress' ),
3900
- 'unsubscribe' => array(
3901
- 'meta_key' => 'notification_groups_group_updated',
3902
- 'message' => __( 'You will no longer receive emails when one of your groups is updated.', 'buddypress' ),
 
3903
  ),
3904
  );
3905
 
3906
  $groups_invitation = array(
3907
- 'description' => __( 'A member has sent a group invitation to the recipient.', 'buddypress' ),
3908
- 'unsubscribe' => array(
3909
- 'meta_key' => 'notification_groups_invite',
3910
- 'message' => __( 'You will no longer receive emails when you are invited to join a group.', 'buddypress' ),
 
3911
  ),
3912
  );
3913
 
3914
  $groups_member_promoted = array(
3915
- 'description' => __( "Recipient's status within a group has changed.", 'buddypress' ),
3916
- 'unsubscribe' => array(
3917
- 'meta_key' => 'notification_groups_admin_promotion',
3918
- 'message' => __( 'You will no longer receive emails when you have been promoted in a group.', 'buddypress' ),
 
3919
  ),
3920
  );
3921
 
3922
  $groups_membership_request = array(
3923
- 'description' => __( 'A member has requested permission to join a group.', 'buddypress' ),
3924
- 'unsubscribe' => array(
3925
- 'meta_key' => 'notification_groups_membership_request',
3926
- 'message' => __( 'You will no longer receive emails when someone requests to be a member of your group.', 'buddypress' ),
 
3927
  ),
3928
  );
3929
 
3930
  $messages_unread = array(
3931
- 'description' => __( 'Recipient has received a private message.', 'buddypress' ),
3932
- 'unsubscribe' => array(
3933
- 'meta_key' => 'notification_messages_new_message',
3934
- 'message' => __( 'You will no longer receive emails when someone sends you a message.', 'buddypress' ),
 
3935
  ),
3936
  );
3937
 
3938
  $settings_verify_email_change = array(
3939
- 'description' => __( 'Recipient has changed their email address.', 'buddypress' ),
3940
- 'unsubscribe' => false,
 
3941
  );
3942
 
3943
  $groups_membership_request_accepted = array(
3944
- 'description' => __( 'Recipient had requested to join a group, which was accepted.', 'buddypress' ),
3945
- 'unsubscribe' => array(
3946
- 'meta_key' => 'notification_membership_request_completed',
3947
- 'message' => __( 'You will no longer receive emails when your request to join a group has been accepted or denied.', 'buddypress' ),
 
3948
  ),
3949
  );
3950
 
3951
  $groups_membership_request_rejected = array(
3952
- 'description' => __( 'Recipient had requested to join a group, which was rejected.', 'buddypress' ),
3953
- 'unsubscribe' => array(
3954
- 'meta_key' => 'notification_membership_request_completed',
3955
- 'message' => __( 'You will no longer receive emails when your request to join a group has been accepted or denied.', 'buddypress' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3956
  ),
3957
  );
3958
 
@@ -3973,6 +4143,8 @@ function bp_email_get_type_schema( $field = 'description' ) {
3973
  'settings-verify-email-change' => $settings_verify_email_change,
3974
  'groups-membership-request-accepted' => $groups_membership_request_accepted,
3975
  'groups-membership-request-rejected' => $groups_membership_request_rejected,
 
 
3976
  );
3977
 
3978
  if ( $field !== 'all' ) {
@@ -3992,10 +4164,19 @@ function bp_email_unsubscribe_handler() {
3992
  $raw_email_type = ! empty( $_GET['nt'] ) ? $_GET['nt'] : '';
3993
  $raw_hash = ! empty( $_GET['nh'] ) ? $_GET['nh'] : '';
3994
  $raw_user_id = ! empty( $_GET['uid'] ) ? absint( $_GET['uid'] ) : 0;
3995
- $new_hash = hash_hmac( 'sha1', "{$raw_email_type}:{$raw_user_id}", bp_email_get_salt() );
 
 
 
 
 
 
 
 
 
3996
 
3997
  // Check required values.
3998
- if ( ! $raw_user_id || ! $raw_email_type || ! $raw_hash || ! array_key_exists( $raw_email_type, $emails ) ) {
3999
  $redirect_to = wp_login_url();
4000
  $result_msg = __( 'Something has gone wrong.', 'buddypress' );
4001
  $unsub_msg = __( 'Please log in and go to your settings to unsubscribe from notification emails.', 'buddypress' );
@@ -4021,6 +4202,25 @@ function bp_email_unsubscribe_handler() {
4021
  $redirect_to = bp_core_get_user_domain( get_current_user_id() );
4022
  }
4023
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4024
  } else {
4025
  if ( bp_is_active( 'settings' ) ) {
4026
  $redirect_to = sprintf(
@@ -4040,17 +4240,29 @@ function bp_email_unsubscribe_handler() {
4040
  $unsub_msg = __( 'You can change this or any other email notification preferences in your email settings.', 'buddypress' );
4041
  }
4042
 
4043
- $message = sprintf(
4044
- '%1$s <a href="%2$s">%3$s</a>',
4045
- $result_msg,
4046
- esc_url( $redirect_to ),
4047
- esc_html( $unsub_msg )
4048
- );
 
4049
 
4050
- bp_core_add_message( $message );
4051
- bp_core_redirect( bp_core_get_user_domain( $raw_user_id ) );
 
4052
 
4053
- exit;
 
 
 
 
 
 
 
 
 
 
4054
  }
4055
 
4056
  /**
@@ -4065,6 +4277,7 @@ function bp_email_unsubscribe_handler() {
4065
  * @type string $notification_type Which notification type is being sent.
4066
  * @type string $user_id The ID of the user to whom the notification is sent.
4067
  * @type string $redirect_to Optional. The url to which the user will be redirected. Default is the activity directory.
 
4068
  * }
4069
  * @return string The unsubscribe link.
4070
  */
@@ -4084,15 +4297,34 @@ function bp_email_get_unsubscribe_link( $args ) {
4084
  return '';
4085
  }
4086
 
4087
- $link = add_query_arg(
4088
- array(
4089
- 'action' => 'unsubscribe',
4090
- 'nh' => hash_hmac( 'sha1', "{$email_type}:{$user_id}", bp_email_get_salt() ),
4091
- 'nt' => $args['notification_type'],
4092
- 'uid' => $user_id,
4093
- ),
4094
- $redirect_to
4095
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4096
 
4097
  /**
4098
  * Filters the unsubscribe link.
@@ -4136,6 +4368,27 @@ function bp_email_get_unsubscribe_type_schema() {
4136
  return (array) apply_filters( 'bp_email_get_unsubscribe_type_schema', $emails );
4137
  }
4138
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4139
  /**
4140
  * Get BuddyPress content allowed tags.
4141
  *
@@ -4232,3 +4485,104 @@ function bp_get_widget_max_count_limit( $widget_class = '' ) {
4232
  */
4233
  return apply_filters( 'bp_get_widget_max_count_limit', 50, $widget_class );
4234
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
433
  */
434
  function bp_use_wp_admin_bar() {
435
 
436
+ // Default to true.
437
  $use_admin_bar = true;
438
 
439
  // Has the WP Toolbar constant been explicitly opted into?
440
  if ( defined( 'BP_USE_WP_ADMIN_BAR' ) ) {
441
  $use_admin_bar = (bool) BP_USE_WP_ADMIN_BAR;
 
 
 
 
442
  }
443
 
444
  /**
702
 
703
  // Register and Activate are not components, but need pages when
704
  // registration is enabled.
705
+ if ( bp_get_signup_allowed() || bp_get_members_invitations_allowed() ) {
706
  foreach ( array( 'register', 'activate' ) as $slug ) {
707
  if ( ! isset( $pages[ $slug ] ) ) {
708
  $pages_to_create[ $slug ] = $page_titles[ $slug ];
945
  return apply_filters( 'bp_core_get_component_search_query_arg', $query_arg, $component );
946
  }
947
 
948
+ /**
949
+ * Get a list of all active component objects.
950
+ *
951
+ * @since 8.0.0
952
+ *
953
+ * @param array $args {
954
+ * Optional. An array of key => value arguments to match against the component objects.
955
+ * Default empty array.
956
+ *
957
+ * @type string $name Translatable name for the component.
958
+ * @type string $id Unique ID for the component.
959
+ * @type string $slug Unique slug for the component, for use in query strings and URLs.
960
+ * @type bool $has_directory True if the component has a top-level directory. False otherwise.
961
+ * @type string $root_slug Slug used by the component's directory page.
962
+ * }
963
+ * @param string $output Optional. The type of output to return. Accepts 'ids'
964
+ * or 'objects'. Default 'ids'.
965
+ * @param string $operator Optional. The logical operation to perform. 'or' means only one
966
+ * element from the array needs to match; 'and' means all elements
967
+ * must match. Accepts 'or' or 'and'. Default 'and'.
968
+ * @return array A list of component ids or objects.
969
+ */
970
+ function bp_core_get_active_components( $args = array(), $output = 'ids', $operator = 'and' ) {
971
+ $bp = buddypress();
972
+
973
+ $active_components = array_keys( $bp->active_components );
974
+
975
+ $xprofile_id = array_search( 'xprofile', $active_components, true );
976
+ if ( false !== $xprofile_id ) {
977
+ $active_components[ $xprofile_id ] = 'profile';
978
+ }
979
+
980
+ $components = array();
981
+ foreach ( $active_components as $id ) {
982
+ if ( isset( $bp->{$id} ) && $bp->{$id} instanceof BP_Component ) {
983
+ $components[ $id ] = $bp->{$id};
984
+ }
985
+ }
986
+
987
+ $components = wp_filter_object_list( $components, $args, $operator );
988
+
989
+ if ( 'ids' === $output ) {
990
+ $components = wp_list_pluck( $components, 'id' );
991
+ }
992
+
993
+ return $components;
994
+ }
995
+
996
  /**
997
  * Determine whether BuddyPress should register the bp-themes directory.
998
  *
1177
  }
1178
 
1179
  /**
1180
+ * Calculate the human time difference between two dates.
1181
  *
1182
  * Based on function created by Dunstan Orchard - http://1976design.com
1183
  *
1184
+ * @since 8.0.0
 
 
 
 
1185
  *
1186
+ * @param array $args {
1187
+ * An array of arguments. All arguments are technically optional.
 
 
 
1188
  *
1189
+ * @type int|string $older_date An integer Unix timestamp or a date string of the format 'Y-m-d h:i:s'.
1190
+ * @type int|string $newer_date An integer Unix timestamp or a date string of the format 'Y-m-d h:i:s'.
1191
+ * @type int $time_chunks The number of time chunks to get (1 or 2).
1192
+ * }
1193
+ * @return null|array|false Null if there's no time diff. An array containing 1 or 2 chunks
1194
+ * of human time. False if travelling into the future.
 
1195
  */
1196
+ function bp_core_time_diff( $args = array() ) {
1197
+ $retval = null;
1198
+ $r = wp_parse_args(
1199
+ $args,
1200
+ array(
1201
+ 'older_date' => 0,
1202
+ 'newer_date' => bp_core_current_time( true, 'timestamp' ),
1203
+ 'time_chunks' => 2,
1204
+ )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1205
  );
1206
 
1207
  // Array of time period chunks.
1215
  1
1216
  );
1217
 
1218
+ foreach ( array( 'older_date', 'newer_date' ) as $date ) {
1219
+ if ( ! $r[ $date ] ) {
1220
+ continue;
1221
+ }
 
1222
 
1223
+ if ( ! is_numeric( $r[ $date ] ) ) {
1224
+ $time_chunks = explode( ':', str_replace( ' ', ':', $r[ $date ] ) );
1225
+ $date_chunks = explode( '-', str_replace( ' ', '-', $r[ $date ] ) );
1226
+ $r[ $date ] = gmmktime(
1227
+ (int) $time_chunks[1],
1228
+ (int) $time_chunks[2],
1229
+ (int) $time_chunks[3],
1230
+ (int) $date_chunks[1],
1231
+ (int) $date_chunks[2],
1232
+ (int) $date_chunks[0]
1233
+ );
1234
+ }
1235
+ }
1236
 
1237
  // Difference in seconds.
1238
+ $diff = $r['newer_date'] - $r['older_date'];
 
 
 
 
1239
 
1240
  /**
1241
+ * We only want to return one or two chunks of time here, eg:
1242
+ * - `array( 'x years', 'xx months' )`,
1243
+ * - `array( 'x days', 'xx hours' )`.
1244
+ * So there's only two bits of calculation below.
1245
  */
1246
+ if ( 0 <= $diff && (int) $r['time_chunks'] ) {
 
1247
  // Step one: the first chunk.
1248
  for ( $i = 0, $j = count( $chunks ); $i < $j; ++$i ) {
1249
  $seconds = $chunks[$i];
1250
 
1251
  // Finding the biggest chunk (if the chunk fits, break).
1252
+ $count = floor( $diff / $seconds );
1253
  if ( 0 != $count ) {
1254
  break;
1255
  }
1256
  }
1257
 
1258
+ // Add the first chunk of time diff.
1259
+ if ( isset( $chunks[ $i ] ) ) {
1260
+ $retval = array();
1261
 
 
 
 
1262
  switch ( $seconds ) {
1263
  case YEAR_IN_SECONDS :
1264
  /* translators: %s: the number of years. */
1265
+ $retval[] = sprintf( _n( '%s year', '%s years', $count, 'buddypress' ), $count );
1266
  break;
1267
  case 30 * DAY_IN_SECONDS :
1268
  /* translators: %s: the number of months. */
1269
+ $retval[] = sprintf( _n( '%s month', '%s months', $count, 'buddypress' ), $count );
1270
  break;
1271
  case WEEK_IN_SECONDS :
1272
  /* translators: %s: the number of weeks. */
1273
+ $retval[]= sprintf( _n( '%s week', '%s weeks', $count, 'buddypress' ), $count );
1274
  break;
1275
  case DAY_IN_SECONDS :
1276
  /* translators: %s: the number of days. */
1277
+ $retval[] = sprintf( _n( '%s day', '%s days', $count, 'buddypress' ), $count );
1278
  break;
1279
  case HOUR_IN_SECONDS :
1280
  /* translators: %s: the number of hours. */
1281
+ $retval[] = sprintf( _n( '%s hour', '%s hours', $count, 'buddypress' ), $count );
1282
  break;
1283
  case MINUTE_IN_SECONDS :
1284
  /* translators: %s: the number of minutes. */
1285
+ $retval[] = sprintf( _n( '%s minute', '%s minutes', $count, 'buddypress' ), $count );
1286
  break;
1287
  default:
1288
  /* translators: %s: the number of seconds. */
1289
+ $retval[] = sprintf( _n( '%s second', '%s seconds', $count, 'buddypress' ), $count );
1290
  }
1291
 
1292
+ /**
1293
+ * Step two: the second chunk.
1294
+ *
1295
+ * A quirk in the implementation means that this condition fails in the case of minutes and seconds.
1296
+ * We've left the quirk in place, since fractions of a minute are not a useful piece of information
1297
+ * for our purposes.
1298
+ */
1299
+ if ( 2 === (int) $r['time_chunks'] && $i + 2 < $j ) {
1300
  $seconds2 = $chunks[$i + 1];
1301
+ $count2 = floor( ( $diff - ( $seconds * $count ) ) / $seconds2 );
1302
 
1303
+ // Add the second chunk of time diff.
1304
+ if ( 0 !== (int) $count2 ) {
 
1305
 
1306
  switch ( $seconds2 ) {
1307
  case 30 * DAY_IN_SECONDS :
1308
  /* translators: %s: the number of months. */
1309
+ $retval[] = sprintf( _n( '%s month', '%s months', $count2, 'buddypress' ), $count2 );
1310
  break;
1311
  case WEEK_IN_SECONDS :
1312
  /* translators: %s: the number of weeks. */
1313
+ $retval[] = sprintf( _n( '%s week', '%s weeks', $count2, 'buddypress' ), $count2 );
1314
  break;
1315
  case DAY_IN_SECONDS :
1316
  /* translators: %s: the number of days. */
1317
+ $retval[] = sprintf( _n( '%s day', '%s days', $count2, 'buddypress' ), $count2 );
1318
  break;
1319
  case HOUR_IN_SECONDS :
1320
  /* translators: %s: the number of hours. */
1321
+ $retval[] = sprintf( _n( '%s hour', '%s hours', $count2, 'buddypress' ), $count2 );
1322
  break;
1323
  case MINUTE_IN_SECONDS :
1324
  /* translators: %s: the number of minutes. */
1325
+ $retval[] = sprintf( _n( '%s minute', '%s minutes', $count2, 'buddypress' ), $count2 );
1326
  break;
1327
  default:
1328
  /* translators: %s: the number of seconds. */
1329
+ $retval[] = sprintf( _n( '%s second', '%s seconds', $count2, 'buddypress' ), $count2 );
1330
  }
1331
  }
1332
  }
 
 
 
 
 
1333
  }
1334
+ } else {
1335
+ // Something went wrong with date calculation and we ended up with a negative date.
1336
+ $retval = false;
1337
+ }
1338
+
1339
+ return $retval;
1340
+ }
1341
+
1342
+ /**
1343
+ * Get an English-language representation of the time elapsed since a given date.
1344
+ *
1345
+ * This function will return an English representation of the time elapsed
1346
+ * since a given date.
1347
+ * eg: 2 hours, 50 minutes
1348
+ * eg: 4 days
1349
+ * eg: 4 weeks, 6 days
1350
+ *
1351
+ * Note that fractions of minutes are not represented in the return string. So
1352
+ * an interval of 3 minutes will be represented by "3 minutes ago", as will an
1353
+ * interval of 3 minutes 59 seconds.
1354
+ *
1355
+ * @since 1.0.0
1356
+ * @since 8.0.0 Move the time difference calculation into `bp_core_time_diff()`.
1357
+ *
1358
+ * @param int|string $older_date The earlier time from which you're calculating
1359
+ * the time elapsed. Enter either as an integer Unix timestamp,
1360
+ * or as a date string of the format 'Y-m-d h:i:s'.
1361
+ * @param int|bool $newer_date Optional. Unix timestamp of date to compare older
1362
+ * date to. Default: false (current time).
1363
+ * @return string String representing the time since the older date, eg
1364
+ * "2 hours, 50 minutes".
1365
+ */
1366
+ function bp_core_time_since( $older_date, $newer_date = false ) {
1367
+
1368
+ /**
1369
+ * Filters whether or not to bypass BuddyPress' time_since calculations.
1370
+ *
1371
+ * @since 1.7.0
1372
+ *
1373
+ * @param bool $value Whether or not to bypass.
1374
+ * @param string $older_date Earlier time from which we're calculating time elapsed.
1375
+ * @param string $newer_date Unix timestamp of date to compare older time to.
1376
+ */
1377
+ $pre_value = apply_filters( 'bp_core_time_since_pre', false, $older_date, $newer_date );
1378
+ if ( false !== $pre_value ) {
1379
+ return $pre_value;
1380
  }
1381
 
1382
+ $newer_date = (int) $newer_date;
1383
+ $args = array(
1384
+ 'older_date' => $older_date,
1385
+ );
1386
+
1387
+ if ( $newer_date) {
1388
+ $args['newer_date'] = $newer_date;
1389
+ }
1390
+
1391
+ // Calculate the time difference.
1392
+ $time_diff = bp_core_time_diff( $args );
1393
+
1394
+ /**
1395
+ * Filters the value to use if the time since is some time ago.
1396
+ *
1397
+ * @since 1.5.0
1398
+ *
1399
+ * @param string $value String representing the time since the older date.
1400
+ */
1401
+ $ago_text = apply_filters(
1402
+ 'bp_core_time_since_ago_text',
1403
+ /* translators: %s: the human time diff. */
1404
+ __( '%s ago', 'buddypress' )
1405
+ );
1406
+
1407
+ /**
1408
+ * Filters the value to use if the time since is right now.
1409
+ *
1410
+ * @since 1.5.0
1411
+ *
1412
+ * @param string $value String representing the time since the older date.
1413
+ */
1414
+ $output = apply_filters( 'bp_core_time_since_right_now_text', __( 'right now', 'buddypress' ) );
1415
+
1416
+ if ( is_array( $time_diff ) ) {
1417
+ $separator = _x( ',', 'Separator in time since', 'buddypress' ) . ' ';
1418
+ $diff_text = implode( $separator, $time_diff );
1419
+ $output = sprintf( $ago_text, $diff_text );
1420
+ } elseif ( false === $time_diff ) {
1421
+ /**
1422
+ * Filters the value to use if the time since is unknown.
1423
+ *
1424
+ * @since 1.5.0
1425
+ *
1426
+ * @param string $value String representing the time since the older date.
1427
+ */
1428
+ $unknown_text = apply_filters( 'bp_core_time_since_unknown_text', __( 'sometime', 'buddypress' ) );
1429
+ $output = sprintf( $ago_text, $unknown_text );
1430
  }
1431
 
1432
  /**
1441
  return apply_filters( 'bp_core_time_since', $output, $older_date, $newer_date );
1442
  }
1443
 
1444
+ /**
1445
+ * Get an age to display according to the birth date.
1446
+ *
1447
+ * @since 8.0.0
1448
+ *
1449
+ * @param int|string $birth_date A timestamp or a MySQL formatted date.
1450
+ * @return string The age to display.
1451
+ */
1452
+ function bp_core_time_old( $birth_date ) {
1453
+ $time_diff = bp_core_time_diff( array( 'older_date' => $birth_date, 'time_chunks' => 1 ) );
1454
+ $retval = '&mdash;';
1455
+
1456
+ if ( $time_diff ) {
1457
+ $age = reset( $time_diff );
1458
+
1459
+ /**
1460
+ * Filters the value to use to display the age.
1461
+ *
1462
+ * @since 8.0.0
1463
+ *
1464
+ * @param string $value String representing the time since the older date.
1465
+ * @param int $age The age.
1466
+ */
1467
+ $age_text = apply_filters(
1468
+ 'bp_core_time_old_text',
1469
+ /* translators: %d: the age . */
1470
+ __( '%s old', 'buddypress' ),
1471
+ $age
1472
+ );
1473
+
1474
+ $retval = sprintf( $age_text, $age );
1475
+ }
1476
+
1477
+ return $retval;
1478
+ }
1479
+
1480
  /**
1481
  * Output an ISO-8601 date from a date string.
1482
  *
3548
  // From, subject, content are set automatically.
3549
  if ( 'settings-verify-email-change' === $email_type && isset( $args['tokens']['displayname'] ) ) {
3550
  $email->set_to( $to, $args['tokens']['displayname'] );
3551
+ // Emails sent to nonmembers will have no recipient.name populated.
3552
+ } else if ( 'bp-members-invitation' === $email_type ) {
3553
+ $email->set_to( $to, $to );
3554
  } else {
3555
  $email->set_to( $to );
3556
  }
3807
  * @param array $emails The array of emails schema.
3808
  */
3809
  return (array) apply_filters( 'bp_email_get_schema', array(
3810
+ 'core-user-activation' => array(
3811
+ /* translators: do not remove {} brackets or translate its contents. */
3812
+ 'post_title' => __( '[{{{site.name}}}] Welcome!', 'buddypress' ),
3813
+ /* translators: do not remove {} brackets or translate its contents. */
3814
+ 'post_content' => __( "Welcome to {{site.name}}!\n\nVisit your <a href=\"{{{profile.url}}}\">profile</a>, where you can tell us more about yourself, change your preferences, or make new connections, to get started.\n\nForgot your password? Don't worry, you can reset it with your email address from <a href=\"{{{lostpassword.url}}}\">this page</a> of our site", 'buddypress' ),
3815
+ /* translators: do not remove {} brackets or translate its contents. */
3816
+ 'post_excerpt' => __( "Welcome to {{site.name}}!\n\nVisit your profile, where you can tell us more about yourself, change your preferences, or make new connections, to get started: {{{profile.url}}}\n\nForgot your password? Don't worry, you can reset it with your email address from this page of our site: {{{lostpassword.url}}}", 'buddypress' ),
3817
+ ),
3818
  'activity-comment' => array(
3819
  /* translators: do not remove {} brackets or translate its contents. */
3820
  'post_title' => __( '[{{{site.name}}}] {{poster.name}} replied to one of your updates', 'buddypress' ),
3894
  /* translators: do not remove {} brackets or translate its contents. */
3895
  'post_title' => __( '[{{{site.name}}}] You have an invitation to the group: "{{group.name}}"', 'buddypress' ),
3896
  /* translators: do not remove {} brackets or translate its contents. */
3897
+ 'post_content' => __( "<a href=\"{{{inviter.url}}}\">{{inviter.name}}</a> has invited you to join the group: &quot;{{group.name}}&quot;.\n\n{{invite.message}}\n\n<a href=\"{{{invites.url}}}\">Go here to accept your invitation</a> or <a href=\"{{{group.url}}}\">visit the group</a> to learn more.", 'buddypress' ),
3898
  /* translators: do not remove {} brackets or translate its contents. */
3899
+ 'post_excerpt' => __( "{{inviter.name}} has invited you to join the group: \"{{group.name}}\".\n\n{{invite.message}}\n\nTo accept your invitation, visit: {{{invites.url}}}\n\nTo learn more about the group, visit: {{{group.url}}}.\nTo view {{inviter.name}}'s profile, visit: {{{inviter.url}}}", 'buddypress' ),
3900
  ),
3901
  'groups-member-promoted' => array(
3902
  /* translators: do not remove {} brackets or translate its contents. */
3946
  /* translators: do not remove {} brackets or translate its contents. */
3947
  'post_excerpt' => __( "Your membership request for the group \"{{group.name}}\" has been rejected.\n\nTo request membership again, visit: {{{group.url}}}", 'buddypress' ),
3948
  ),
3949
+ 'bp-members-invitation' => array(
3950
+ /* translators: do not remove {} brackets or translate its contents. */
3951
+ 'post_title' => __( '{{inviter.name}} has invited you to join {{site.name}}', 'buddypress' ),
3952
+ /* translators: do not remove {} brackets or translate its contents. */
3953
+ 'post_content' => __( "<a href=\"{{{inviter.url}}}\">{{inviter.name}}</a> has invited you to join the site: &quot;{{site.name}}&quot;.\n\n{{usermessage}}\n\n<a href=\"{{{invite.accept_url}}}\">Accept your invitation</a> or <a href=\"{{{site.url}}}\">visit the site</a> to learn more.", 'buddypress' ),
3954
+ /* translators: do not remove {} brackets or translate its contents. */
3955
+ 'post_excerpt' => __( "{{inviter.name}} has invited you to join the site \"{{site.name}}\".\n\n{{usermessage}}\n\nTo accept your invitation, visit: {{{invite.accept_url}}}\n\nTo learn more about the site, visit: {{{site.url}}}.\nTo view {{inviter.name}}'s profile, visit: {{{inviter.url}}}", 'buddypress' ),
3956
+ ),
3957
  ) );
3958
  }
3959
 
3977
  */
3978
  function bp_email_get_type_schema( $field = 'description' ) {
3979
  $activity_comment = array(
3980
+ 'description' => __( 'A member has replied to an activity update that the recipient posted.', 'buddypress' ),
3981
+ 'named_salutation' => true,
3982
+ 'unsubscribe' => array(
3983
+ 'meta_key' => 'notification_activity_new_reply',
3984
+ 'message' => __( 'You will no longer receive emails when someone replies to an update or comment you posted.', 'buddypress' ),
3985
  ),
3986
  );
3987
 
3988
  $activity_comment_author = array(
3989
+ 'description' => __( 'A member has replied to a comment on an activity update that the recipient posted.', 'buddypress' ),
3990
+ 'named_salutation' => true,
3991
+ 'unsubscribe' => array(
3992
+ 'meta_key' => 'notification_activity_new_reply',
3993
+ 'message' => __( 'You will no longer receive emails when someone replies to an update or comment you posted.', 'buddypress' ),
3994
  ),
3995
  );
3996
 
3997
  $activity_at_message = array(
3998
+ 'description' => __( 'Recipient was mentioned in an activity update.', 'buddypress' ),
3999
+ 'named_salutation' => true,
4000
+ 'unsubscribe' => array(
4001
+ 'meta_key' => 'notification_activity_new_mention',
4002
+ 'message' => __( 'You will no longer receive emails when someone mentions you in an update.', 'buddypress' ),
4003
  ),
4004
  );
4005
 
4006
  $groups_at_message = array(
4007
+ 'description' => __( 'Recipient was mentioned in a group activity update.', 'buddypress' ),
4008
+ 'named_salutation' => true,
4009
+ 'unsubscribe' => array(
4010
+ 'meta_key' => 'notification_activity_new_mention',
4011
+ 'message' => __( 'You will no longer receive emails when someone mentions you in an update.', 'buddypress' ),
4012
  ),
4013
  );
4014
 
4015
  $core_user_registration = array(
4016
+ 'description' => __( 'Recipient has registered for an account.', 'buddypress' ),
4017
+ 'named_salutation' => true,
4018
+ 'unsubscribe' => false,
4019
  );
4020
 
4021
  $core_user_registration_with_blog = array(
4022
+ 'description' => __( 'Recipient has registered for an account and site.', 'buddypress' ),
4023
+ 'named_salutation' => true,
4024
+ 'unsubscribe' => false,
4025
  );
4026
 
4027
  $friends_request = array(
4028
+ 'description' => __( 'A member has sent a friend request to the recipient.', 'buddypress' ),
4029
+ 'named_salutation' => true,
4030
+ 'unsubscribe' => array(
4031
+ 'meta_key' => 'notification_friends_friendship_request',
4032
+ 'message' => __( 'You will no longer receive emails when someone sends you a friend request.', 'buddypress' ),
4033
  ),
4034
  );
4035
 
4036
  $friends_request_accepted = array(
4037
+ 'description' => __( 'Recipient has had a friend request accepted by a member.', 'buddypress' ),
4038
+ 'named_salutation' => true,
4039
+ 'unsubscribe' => array(
4040
+ 'meta_key' => 'notification_friends_friendship_accepted',
4041
+ 'message' => __( 'You will no longer receive emails when someone accepts your friendship request.', 'buddypress' ),
4042
  ),
4043
  );
4044
 
4045
  $groups_details_updated = array(
4046
+ 'description' => __( "A group's details were updated.", 'buddypress' ),
4047
+ 'named_salutation' => true,
4048
+ 'unsubscribe' => array(
4049
+ 'meta_key' => 'notification_groups_group_updated',
4050
+ 'message' => __( 'You will no longer receive emails when one of your groups is updated.', 'buddypress' ),
4051
  ),
4052
  );
4053
 
4054
  $groups_invitation = array(
4055
+ 'description' => __( 'A member has sent a group invitation to the recipient.', 'buddypress' ),
4056
+ 'named_salutation' => true,
4057
+ 'unsubscribe' => array(
4058
+ 'meta_key' => 'notification_groups_invite',
4059
+ 'message' => __( 'You will no longer receive emails when you are invited to join a group.', 'buddypress' ),
4060
  ),
4061
  );
4062
 
4063
  $groups_member_promoted = array(
4064
+ 'description' => __( "Recipient's status within a group has changed.", 'buddypress' ),
4065
+ 'named_salutation' => true,
4066
+ 'unsubscribe' => array(
4067
+ 'meta_key' => 'notification_groups_admin_promotion',
4068
+ 'message' => __( 'You will no longer receive emails when you have been promoted in a group.', 'buddypress' ),
4069
  ),
4070
  );
4071
 
4072
  $groups_membership_request = array(
4073
+ 'description' => __( 'A member has requested permission to join a group.', 'buddypress' ),
4074
+ 'named_salutation' => true,
4075
+ 'unsubscribe' => array(
4076
+ 'meta_key' => 'notification_groups_membership_request',
4077
+ 'message' => __( 'You will no longer receive emails when someone requests to be a member of your group.', 'buddypress' ),
4078
  ),
4079
  );
4080
 
4081
  $messages_unread = array(
4082
+ 'description' => __( 'Recipient has received a private message.', 'buddypress' ),
4083
+ 'named_salutation' => true,
4084
+ 'unsubscribe' => array(
4085
+ 'meta_key' => 'notification_messages_new_message',
4086
+ 'message' => __( 'You will no longer receive emails when someone sends you a message.', 'buddypress' ),
4087
  ),
4088
  );
4089
 
4090
  $settings_verify_email_change = array(
4091
+ 'description' => __( 'Recipient has changed their email address.', 'buddypress' ),
4092
+ 'named_salutation' => true,
4093
+ 'unsubscribe' => false,
4094
  );
4095
 
4096
  $groups_membership_request_accepted = array(
4097
+ 'description' => __( 'Recipient had requested to join a group, which was accepted.', 'buddypress' ),
4098
+ 'named_salutation' => true,
4099
+ 'unsubscribe' => array(
4100
+ 'meta_key' => 'notification_membership_request_completed',
4101
+ 'message' => __( 'You will no longer receive emails when your request to join a group has been accepted or denied.', 'buddypress' ),
4102
  ),
4103
  );
4104
 
4105
  $groups_membership_request_rejected = array(
4106
+ 'description' => __( 'Recipient had requested to join a group, which was rejected.', 'buddypress' ),
4107
+ 'named_salutation' => true,
4108
+ 'unsubscribe' => array(
4109
+ 'meta_key' => 'notification_membership_request_completed',
4110
+ 'message' => __( 'You will no longer receive emails when your request to join a group has been accepted or denied.', 'buddypress' ),
4111
+ ),
4112
+ );
4113
+
4114
+ $core_user_activation = array(
4115
+ 'description' => __( 'Recipient has successfully activated an account.', 'buddypress' ),
4116
+ 'named_salutation' => true,
4117
+ 'unsubscribe' => false,
4118
+ );
4119
+
4120
+ $members_invitation = array(
4121
+ 'description' => __( 'A site member has sent a site invitation to the recipient.', 'buddypress' ),
4122
+ 'named_salutation' => false,
4123
+ 'unsubscribe' => array(
4124
+ 'meta_key' => 'notification_bp_members_invite',
4125
+ 'message' => __( 'You will no longer receive emails when you are invited to join this site.', 'buddypress' ),
4126
  ),
4127
  );
4128
 
4143
  'settings-verify-email-change' => $settings_verify_email_change,
4144
  'groups-membership-request-accepted' => $groups_membership_request_accepted,
4145
  'groups-membership-request-rejected' => $groups_membership_request_rejected,
4146
+ 'core-user-activation' => $core_user_activation,
4147
+ 'bp-members-invitation' => $members_invitation,
4148
  );
4149
 
4150
  if ( $field !== 'all' ) {
4164
  $raw_email_type = ! empty( $_GET['nt'] ) ? $_GET['nt'] : '';
4165
  $raw_hash = ! empty( $_GET['nh'] ) ? $_GET['nh'] : '';
4166
  $raw_user_id = ! empty( $_GET['uid'] ) ? absint( $_GET['uid'] ) : 0;
4167
+ $raw_user_email = ! empty( $_GET['uem'] ) ? $_GET['uem'] : '';
4168
+ $raw_member_id = ! empty( $_GET['mid'] ) ? absint( $_GET['mid'] ) : 0;
4169
+ $redirect_to = '';
4170
+
4171
+ $new_hash = '';
4172
+ if ( ! empty( $raw_user_id ) ) {
4173
+ $new_hash = hash_hmac( 'sha1', "{$raw_email_type}:{$raw_user_id}", bp_email_get_salt() );
4174
+ } else if ( ! empty( $raw_user_email ) ) {
4175
+ $new_hash = hash_hmac( 'sha1', "{$raw_email_type}:{$raw_user_email}", bp_email_get_salt() );
4176
+ }
4177
 
4178
  // Check required values.
4179
+ if ( ( ! $raw_user_id && ! $raw_user_email ) || ! $raw_email_type || ! $raw_hash || ! array_key_exists( $raw_email_type, $emails ) ) {
4180
  $redirect_to = wp_login_url();
4181
  $result_msg = __( 'Something has gone wrong.', 'buddypress' );
4182
  $unsub_msg = __( 'Please log in and go to your settings to unsubscribe from notification emails.', 'buddypress' );
4202
  $redirect_to = bp_core_get_user_domain( get_current_user_id() );
4203
  }
4204
 
4205
+ // This is an unsubscribe request from a nonmember.
4206
+ } else if ( $raw_user_email ) {
4207
+ // Unsubscribe.
4208
+ if ( bp_user_has_opted_out() ) {
4209
+ $result_msg = $emails[ $raw_email_type ]['unsubscribe']['message'];
4210
+ $unsub_msg = __( 'You have already unsubscribed from all communication from this site.', 'buddypress' );
4211
+ } else {
4212
+ $optout_args = array(
4213
+ 'email_address' => $raw_user_email,
4214
+ 'user_id' => $raw_member_id,
4215
+ 'email_type' => $raw_email_type,
4216
+ 'date_modified' => bp_core_current_time(),
4217
+ );
4218
+ bp_add_optout( $optout_args );
4219
+ $result_msg = $emails[ $raw_email_type ]['unsubscribe']['message'];
4220
+ $unsub_msg = __( 'You have been unsubscribed.', 'buddypress' );
4221
+ }
4222
+
4223
+ // This is an unsubscribe request from a current member.
4224
  } else {
4225
  if ( bp_is_active( 'settings' ) ) {
4226
  $redirect_to = sprintf(
4240
  $unsub_msg = __( 'You can change this or any other email notification preferences in your email settings.', 'buddypress' );
4241
  }
4242
 
4243
+ if ( $raw_user_id && $redirect_to ) {
4244
+ $message = sprintf(
4245
+ '%1$s <a href="%2$s">%3$s</a>',
4246
+ $result_msg,
4247
+ esc_url( $redirect_to ),
4248
+ esc_html( $unsub_msg )
4249
+ );
4250
 
4251
+ // Template notices are only displayed on BP pages.
4252
+ bp_core_add_message( $message );
4253
+ bp_core_redirect( bp_core_get_user_domain( $raw_user_id ) );
4254
 
4255
+ exit;
4256
+ } else {
4257
+ wp_die(
4258
+ sprintf( '%1$s %2$s', esc_html( $unsub_msg ), esc_html( $result_msg ) ),
4259
+ esc_html( $unsub_msg ),
4260
+ array(
4261
+ 'link_url' => home_url(),
4262
+ 'link_text' => __( 'Go to website\'s home page.', 'buddypress' ),
4263
+ )
4264
+ );
4265
+ }
4266
  }
4267
 
4268
  /**
4277
  * @type string $notification_type Which notification type is being sent.
4278
  * @type string $user_id The ID of the user to whom the notification is sent.
4279
  * @type string $redirect_to Optional. The url to which the user will be redirected. Default is the activity directory.
4280
+ * @type string $email Optional. The email address of the user to whom the notification is sent.
4281
  * }
4282
  * @return string The unsubscribe link.
4283
  */
4297
  return '';
4298
  }
4299
 
4300
+ $link = '';
4301
+ // Case where the recipient is a member of the site.
4302
+ if ( ! empty( $user_id ) ) {
4303
+ $link = add_query_arg(
4304
+ array(
4305
+ 'action' => 'unsubscribe',
4306
+ 'nh' => hash_hmac( 'sha1', "{$email_type}:{$user_id}", bp_email_get_salt() ),
4307
+ 'nt' => $args['notification_type'],
4308
+ 'uid' => $user_id,
4309
+ ),
4310
+ $redirect_to
4311
+ );
4312
+
4313
+ // Case where the recipient is not a member of the site.
4314
+ } else if ( ! empty( $args['email_address'] ) ) {
4315
+ $email_address = $args['email_address'];
4316
+ $member_id = (int) $args['member_id'];
4317
+ $link = add_query_arg(
4318
+ array(
4319
+ 'action' => 'unsubscribe',
4320
+ 'nh' => hash_hmac( 'sha1', "{$email_type}:{$email_address}", bp_email_get_salt() ),
4321
+ 'nt' => $args['notification_type'],
4322
+ 'mid' => $member_id,
4323
+ 'uem' => $email_address,
4324
+ ),
4325
+ $redirect_to
4326
+ );
4327
+ }
4328
 
4329
  /**
4330
  * Filters the unsubscribe link.
4368
  return (array) apply_filters( 'bp_email_get_unsubscribe_type_schema', $emails );
4369
  }
4370
 
4371
+ /**
4372
+ * Gets the BP Email type of a BP Email ID or object.
4373
+ *
4374
+ * @since 8.0.0
4375
+ *
4376
+ * @param int|WP_Post $email Optional. BP Email ID or BP Email object. Defaults to global $post.
4377
+ * @return string The type of the BP Email object.
4378
+ */
4379
+ function bp_email_get_type( $email = null ) {
4380
+ $email = get_post( $email );
4381
+
4382
+ if ( ! $email ) {
4383
+ return '';
4384
+ }
4385
+
4386
+ $types = bp_get_object_terms( $email->ID, bp_get_email_tax_type(), array( 'fields' => 'slugs' ) );
4387
+ $type = reset( $types );
4388
+
4389
+ return $type;
4390
+ }
4391
+
4392
  /**
4393
  * Get BuddyPress content allowed tags.
4394
  *
4485
  */
4486
  return apply_filters( 'bp_get_widget_max_count_limit', 50, $widget_class );
4487
  }
4488
+
4489
+ /**
4490
+ * Add a new BP_Optout.
4491
+ *
4492
+ * @since 8.0.0
4493
+ *
4494
+ * @param array $args {
4495
+ * An array of arguments describing the new opt-out.
4496
+ * @type string $email_address Email address of user who has opted out.
4497
+ * @type int $user_id Optional. ID of user whose communication
4498
+ * prompted the user to opt-out.
4499
+ * @type string $email_type Optional. Name of the email type that
4500
+ * prompted the user to opt-out.
4501
+ * @type string $date_modified Optional. Specify a time, else now will be used.
4502
+ * }
4503
+ * @return false|int False on failure, ID of new (or existing) opt-out if successful.
4504
+ */
4505
+ function bp_add_optout( $args = array() ) {
4506
+ $optout = new BP_Optout();
4507
+ $r = bp_parse_args(
4508
+ $args, array(
4509
+ 'email_address' => '',
4510
+ 'user_id' => 0,
4511
+ 'email_type' => '',
4512
+ 'date_modified' => bp_core_current_time(),
4513
+ ),
4514
+ 'add_optout'
4515
+ );
4516
+
4517
+ // Opt-outs must have an email address.
4518
+ if ( empty( $r['email_address'] ) ) {
4519
+ return false;
4520
+ }
4521
+
4522
+ // Avoid creating duplicate opt-outs.
4523
+ $optout_id = $optout->optout_exists(
4524
+ array(
4525
+ 'email_address' => $r['email_address'],
4526
+ 'user_id' => $r['user_id'],
4527
+ 'email_type' => $r['email_type'],
4528
+ )
4529
+ );
4530
+
4531
+ if ( ! $optout_id ) {
4532
+ // Set up the new opt-out.
4533
+ $optout->email_address = $r['email_address'];
4534
+ $optout->user_id = $r['user_id'];
4535
+ $optout->email_type = $r['email_type'];
4536
+ $optout->date_modified = $r['date_modified'];
4537
+
4538
+ $optout_id = $optout->save();
4539
+ }
4540
+
4541
+ return $optout_id;
4542
+ }
4543
+
4544
+ /**
4545
+ * Find matching BP_Optouts.
4546
+ *
4547
+ * @since 8.0.0
4548
+ *
4549
+ * @see BP_Optout::get() for a description of parameters and return values.
4550
+ *
4551
+ * @param array $args See {@link BP_Optout::get()}.
4552
+ * @return array See {@link BP_Optout::get()}.
4553
+ */
4554
+ function bp_get_optouts( $args = array() ) {
4555
+ $optout_class = new BP_Optout();
4556
+ return $optout_class::get( $args );
4557
+ }
4558
+
4559
+ /**
4560
+ * Check an email address to see if that individual has opted out.
4561
+ *
4562
+ * @since 8.0.0
4563
+ *
4564
+ * @param string $email_address Email address to check.
4565
+ * @return bool True if the user has opted out, false otherwise.
4566
+ */
4567
+ function bp_user_has_opted_out( $email_address = '' ) {
4568
+ $optout_class = new BP_Optout();
4569
+ $optout_id = $optout_class->optout_exists(
4570
+ array(
4571
+ 'email_address' => $email_address,
4572
+ )
4573
+ );
4574
+ return (bool) $optout_id;
4575
+ }
4576
+
4577
+ /**
4578
+ * Delete a BP_Optout by ID.
4579
+ *
4580
+ * @since 8.0.0
4581
+ *
4582
+ * @param int $id ID of the optout to delete.
4583
+ * @return bool True on success, false on failure.
4584
+ */
4585
+ function bp_delete_optout_by_id( $id = 0 ) {
4586
+ $optout_class = new BP_Optout();
4587
+ return $optout_class::delete_by_id( $id );
4588
+ }
bp-core/bp-core-options.php CHANGED
@@ -90,11 +90,6 @@ function bp_get_default_options() {
90
  // HeartBeat is on to refresh activities.
91
  '_bp_enable_heartbeat_refresh' => true,
92
 
93
- /* BuddyBar **********************************************************/
94
-
95
- // Force the BuddyBar.
96
- '_bp_force_buddybar' => false,
97
-
98
  /* Legacy *********************************************/
99
 
100
  // Do not register the bp-default themes directory.
@@ -667,27 +662,6 @@ function bp_restrict_group_creation( $default = true ) {
667
  return (bool) apply_filters( 'bp_restrict_group_creation', (bool) bp_get_option( 'bp_restrict_group_creation', $default ) );
668
  }
669
 
670
- /**
671
- * Should the old BuddyBar be forced in place of the WP admin bar?
672
- *
673
- * @since 1.6.0
674
- *
675
- * @param bool $default Optional. Fallback value if not found in the database.
676
- * Default: true.
677
- * @return bool True if the BuddyBar should be forced on, otherwise false.
678
- */
679
- function bp_force_buddybar( $default = true ) {
680
-
681
- /**
682
- * Filters whether or not BuddyBar should be forced in place of WP Admin Bar.
683
- *
684
- * @since 1.6.0
685
- *
686
- * @param bool $value Whether or not BuddyBar should be forced in place of WP Admin Bar.
687
- */
688
- return (bool) apply_filters( 'bp_force_buddybar', (bool) bp_get_option( '_bp_force_buddybar', $default ) );
689
- }
690
-
691
  /**
692
  * Check whether Akismet is enabled.
693
  *
90
  // HeartBeat is on to refresh activities.
91
  '_bp_enable_heartbeat_refresh' => true,
92
 
 
 
 
 
 
93
  /* Legacy *********************************************/
94
 
95
  // Do not register the bp-default themes directory.
662
  return (bool) apply_filters( 'bp_restrict_group_creation', (bool) bp_get_option( 'bp_restrict_group_creation', $default ) );
663
  }
664
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
665
  /**
666
  * Check whether Akismet is enabled.
667
  *
bp-core/bp-core-template.php CHANGED
@@ -2247,6 +2247,17 @@ function bp_is_settings_component() {
2247
  return (bool) bp_is_current_component( 'settings' );
2248
  }
2249
 
 
 
 
 
 
 
 
 
 
 
 
2250
  /**
2251
  * Is the current component an active core component?
2252
  *
@@ -2647,6 +2658,45 @@ function bp_is_user_settings_profile() {
2647
  return (bool) ( bp_is_user_settings() && bp_is_current_action( 'profile' ) );
2648
  }
2649
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2650
  /** Groups ********************************************************************/
2651
 
2652
  /**
@@ -3750,30 +3800,59 @@ function bp_email_the_salutation( $settings = array() ) {
3750
  * Gets the Recipient Salutation.
3751
  *
3752
  * @since 2.5.0
 
3753
  *
3754
  * @param array $settings Email Settings.
3755
  * @return string The Recipient Salutation.
3756
  */
3757
  function bp_email_get_salutation( $settings = array() ) {
3758
- $token = '{{recipient.name}}';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3759
 
3760
- /**
3761
- * Filters The Recipient Salutation inside the Email Template.
3762
- *
3763
- * @since 2.5.0
3764
- *
3765
- * @param string $value The Recipient Salutation.
3766
- * @param array $settings Email Settings.
3767
- * @param string $token The Recipient token.
3768
- */
3769
- return apply_filters(
3770
- 'bp_email_get_salutation',
3771
- sprintf(
3772
- /* translators: %s: the email token for the recipient name */
3773
- _x( 'Hi %s,', 'recipient salutation', 'buddypress' ),
 
 
 
 
 
 
 
3774
  $token
3775
- ),
3776
- $settings,
3777
- $token
3778
- );
3779
  }
2247
  return (bool) bp_is_current_component( 'settings' );
2248
  }
2249
 
2250
+ /**
2251
+ * Check whether the current page is an Invitations screen.
2252
+ *
2253
+ * @since 8.0.0
2254
+ *
2255
+ * @return bool True if the current page is an Invitations screen.
2256
+ */
2257
+ function bp_is_members_invitations_screen() {
2258
+ return (bool) bp_is_current_component( bp_get_members_invitations_slug() );
2259
+ }
2260
+
2261
  /**
2262
  * Is the current component an active core component?
2263
  *
2658
  return (bool) ( bp_is_user_settings() && bp_is_current_action( 'profile' ) );
2659
  }
2660
 
2661
+ /**
2662
+ * Is the current page a user's community invitations page?
2663
+ *
2664
+ * Eg http://example.com/members/cassie/invitations/ (or a subpage thereof).
2665
+ *
2666
+ * @since 8.0.0
2667
+ *
2668
+ * @return bool True if the current page is a user's community invitations page.
2669
+ */
2670
+ function bp_is_user_members_invitations() {
2671
+ return (bool) ( bp_is_user() && bp_is_members_invitations_screen() );
2672
+ }
2673
+
2674
+ /**
2675
+ * Is the current page a user's List Invites page?
2676
+ *
2677
+ * Eg http://example.com/members/cassie/invitations/list-invites/.
2678
+ *
2679
+ * @since 8.0.0
2680
+ *
2681
+ * @return bool True if the current page is a user's List Invites page.
2682
+ */
2683
+ function bp_is_user_members_invitations_list() {
2684
+ return (bool) ( bp_is_user_members_invitations() && bp_is_current_action( 'list-invites' ) );
2685
+ }
2686
+
2687
+ /**
2688
+ * Is the current page a user's Send Invites page?
2689
+ *
2690
+ * Eg http://example.com/members/cassie/invitations/send-invites/.
2691
+ *
2692
+ * @since 8.0.0
2693
+ *
2694
+ * @return bool True if the current page is a user's Send Invites page.
2695
+ */
2696
+ function bp_is_user_members_invitations_send_screen() {
2697
+ return (bool) ( bp_is_user_members_invitations() && bp_is_current_action( 'send-invites' ) );
2698
+ }
2699
+
2700
  /** Groups ********************************************************************/
2701
 
2702
  /**
3800
  * Gets the Recipient Salutation.
3801
  *
3802
  * @since 2.5.0
3803
+ * @since 8.0.0 Checks current BP Email type schema to eventually use the unnamed salutation.
3804
  *
3805
  * @param array $settings Email Settings.
3806
  * @return string The Recipient Salutation.
3807
  */
3808
  function bp_email_get_salutation( $settings = array() ) {
3809
+ $email_type = bp_email_get_type();
3810
+ $salutation = '';
3811
+
3812
+ if ( $email_type ) {
3813
+ $types_schema = bp_email_get_type_schema( 'named_salutation' );
3814
+
3815
+ if ( isset( $types_schema[ $email_type ] ) && false === $types_schema[ $email_type ] ) {
3816
+ /**
3817
+ * Filters The Recipient Unnamed Salutation inside the Email Template.
3818
+ *
3819
+ * @since 8.0.0
3820
+ *
3821
+ * @param string $value The Recipient Salutation.
3822
+ * @param array $settings Email Settings.
3823
+ */
3824
+ $salutation = apply_filters(
3825
+ 'bp_email_get_unnamed_salutation',
3826
+ _x( 'Hi,', 'Unnamed recipient salutation', 'buddypress' ),
3827
+ $settings
3828
+ );
3829
+ }
3830
+ }
3831
 
3832
+ // Named salutations are default.
3833
+ if ( ! $salutation ) {
3834
+ $token = '{{recipient.name}}';
3835
+
3836
+ /**
3837
+ * Filters The Recipient Named Salutation inside the Email Template.
3838
+ *
3839
+ * @since 2.5.0
3840
+ *
3841
+ * @param string $value The Recipient Salutation.
3842
+ * @param array $settings Email Settings.
3843
+ * @param string $token The Recipient token.
3844
+ */
3845
+ $salutation = apply_filters(
3846
+ 'bp_email_get_salutation',
3847
+ sprintf(
3848
+ /* translators: %s: the email token for the recipient name */
3849
+ _x( 'Hi %s,', 'Named recipient salutation', 'buddypress' ),
3850
+ $token
3851
+ ),
3852
+ $settings,
3853
  $token
3854
+ );
3855
+ }
3856
+
3857
+ return $salutation;
3858
  }
bp-core/bp-core-update.php CHANGED
@@ -273,6 +273,11 @@ function bp_version_updater() {
273
  if ( $raw_db_version < 12385 ) {
274
  bp_update_to_5_0();
275
  }
 
 
 
 
 
276
  }
277
 
278
  /* All done! *************************************************************/
@@ -547,6 +552,24 @@ function bp_update_to_2_7() {
547
  bp_add_option( '_bp_ignore_deprecated_code', false );
548
  }
549
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
550
  /**
551
  * 5.0.0 update routine.
552
  *
@@ -564,7 +587,7 @@ function bp_update_to_5_0() {
564
  */
565
  global $wpdb;
566
  $bp_prefix = bp_core_get_table_prefix();
567
- $field_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp_prefix}bp_xprofile_fields WHERE name = %s", addslashes( bp_get_option( 'bp-xprofile-fullname-field-name' ) ) ) );
568
 
569
  $wpdb->insert(
570
  $bp_prefix . 'bp_xprofile_meta',
@@ -589,6 +612,98 @@ function bp_update_to_5_0() {
589
  }
590
  }
591
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
592
  /**
593
  * Updates the component field for new_members type.
594
  *
273
  if ( $raw_db_version < 12385 ) {
274
  bp_update_to_5_0();
275
  }
276
+
277
+ // Version 8.0.0.
278
+ if ( $raw_db_version < 12850 ) {
279
+ bp_update_to_8_0();
280
+ }
281
  }
282
 
283
  /* All done! *************************************************************/
552
  bp_add_option( '_bp_ignore_deprecated_code', false );
553
  }
554
 
555
+ /**
556
+ * Retuns needed the fullname field ID for an update task.
557
+ *
558
+ * @since 8.0.0
559
+ *
560
+ * @return int The fullname field ID.
561
+ */
562
+ function bp_get_fullname_field_id_for_update() {
563
+ /**
564
+ * The xProfile component is active by default on new installs, even if it
565
+ * might be inactive during this update, we need to set the custom visibility
566
+ * for the default field, in case the Administrator decides to reactivate it.
567
+ */
568
+ global $wpdb;
569
+ $bp_prefix = bp_core_get_table_prefix();
570
+ return (int) $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp_prefix}bp_xprofile_fields WHERE name = %s", addslashes( bp_get_option( 'bp-xprofile-fullname-field-name' ) ) ) );
571
+ }
572
+
573
  /**
574
  * 5.0.0 update routine.
575
  *
587
  */
588
  global $wpdb;
589
  $bp_prefix = bp_core_get_table_prefix();
590
+ $field_id = bp_get_fullname_field_id_for_update();
591
 
592
  $wpdb->insert(
593
  $bp_prefix . 'bp_xprofile_meta',
612
  }
613
  }
614
 
615
+ /**
616
+ * 8.0.0 update routine.
617
+ *
618
+ * - Edit the `new_avatar` activity type's component to `members`.
619
+ * - Upgrade Primary xProfile Group's fields to signup fields.
620
+ *
621
+ * @since 8.0.0
622
+ */
623
+ function bp_update_to_8_0() {
624
+ global $wpdb;
625
+ $bp_prefix = bp_core_get_table_prefix();
626
+
627
+ // Install welcome email to email list.
628
+ add_filter( 'bp_email_get_schema', 'bp_core_get_8_0_upgrade_email_schema' );
629
+
630
+ bp_core_install_emails();
631
+
632
+ remove_filter( 'bp_email_get_schema', 'bp_core_get_8_0_upgrade_email_schema' );
633
+
634
+ // Update the `new_avatar` activity type's component to `members`.
635
+ $wpdb->update(
636
+ $bp_prefix . 'bp_activity',
637
+ array(
638
+ 'component' => 'members',
639
+ ),
640
+ array(
641
+ 'type' => 'new_avatar',
642
+ ),
643
+ array(
644
+ '%s',
645
+ ),
646
+ array(
647
+ '%s',
648
+ )
649
+ );
650
+
651
+ // Check if we need to create default signup fields.
652
+ $field_id = bp_get_fullname_field_id_for_update();
653
+ $has_signup_position = (bool) $wpdb->get_var( $wpdb->prepare( "SELECT meta_value FROM {$bp_prefix}bp_xprofile_meta WHERE meta_key = 'signup_position' AND object_type = 'field' AND object_id = %d", $field_id ) );
654
+ if ( bp_get_signup_allowed() && ! $has_signup_position ) {
655
+ // Get the Primary Group's fields.
656
+ $signup_fields = $wpdb->get_col( "SELECT id FROM {$bp_prefix}bp_xprofile_fields WHERE group_id = 1 ORDER BY field_order ASC" );
657
+
658
+ // Migrate potential signup fields.
659
+ if ( $signup_fields ) {
660
+ $signup_position = 0;
661
+ foreach ( $signup_fields as $signup_field_id ) {
662
+ $signup_position += 1;
663
+
664
+ $wpdb->insert(
665
+ $bp_prefix . 'bp_xprofile_meta',
666
+ array(
667
+ 'object_id' => $signup_field_id,
668
+ 'object_type' => 'field',
669
+ 'meta_key' => 'signup_position',
670
+ 'meta_value' => $signup_position,
671
+ ),
672
+ array(
673
+ '%d',
674
+ '%s',
675
+ '%s',
676
+ '%d',
677
+ )
678
+ );
679
+ }
680
+ }
681
+ }
682
+
683
+ bp_core_install_nonmember_opt_outs();
684
+ }
685
+
686
+ /**
687
+ * Select only the emails that need to be installed with version 8.0.
688
+ *
689
+ * @since 8.0.0
690
+ *
691
+ * @param array $emails The array of emails schema.
692
+ */
693
+ function bp_core_get_8_0_upgrade_email_schema( $emails ) {
694
+ $new_emails = array();
695
+
696
+ if ( isset( $emails['core-user-activation'] ) ) {
697
+ $new_emails['core-user-activation'] = $emails['core-user-activation'];
698
+ }
699
+
700
+ if ( isset( $emails['bp-members-invitation'] ) ) {
701
+ $new_emails['bp-members-invitation'] = $emails['bp-members-invitation'];
702
+ }
703
+
704
+ return $new_emails;
705
+ }
706
+
707
  /**
708
  * Updates the component field for new_members type.
709
  *
bp-core/classes/class-bp-admin.php CHANGED
@@ -123,6 +123,7 @@ class BP_Admin {
123
  require( $this->admin_dir . 'bp-core-admin-components.php' );
124
  require( $this->admin_dir . 'bp-core-admin-slugs.php' );
125
  require( $this->admin_dir . 'bp-core-admin-tools.php' );
 
126
  }
127
 
128
  /**
@@ -301,6 +302,15 @@ class BP_Admin {
301
  'bp_core_admin_tools'
302
  );
303
 
 
 
 
 
 
 
 
 
 
304
  // For network-wide configs, add a link to (the root site's) Emails screen.
305
  if ( is_network_admin() && bp_is_network_activated() ) {
306
  $email_labels = bp_get_email_post_type_labels();
@@ -378,17 +388,6 @@ class BP_Admin {
378
  add_settings_field( 'hide-loggedout-adminbar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_admin_bar', 'buddypress', 'bp_main' );
379
  register_setting( 'buddypress', 'hide-loggedout-adminbar', 'intval' );
380
 
381
- // Only show 'switch to Toolbar' option if the user chose to retain the BuddyBar during the 1.6 upgrade.
382
- if ( (bool) bp_get_option( '_bp_force_buddybar', false ) ) {
383
- // Load deprecated code if not available.
384
- if ( ! function_exists( 'bp_admin_setting_callback_force_buddybar' ) ) {
385
- require buddypress()->plugin_dir . 'bp-core/deprecated/2.1.php';
386
- }
387
-
388
- add_settings_field( '_bp_force_buddybar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_force_buddybar', 'buddypress', 'bp_main' );
389
- register_setting( 'buddypress', '_bp_force_buddybar', 'bp_admin_sanitize_callback_force_buddybar' );
390
- }
391
-
392
  // Allow account deletion.
393
  add_settings_field( 'bp-disable-account-deletion', __( 'Account Deletion', 'buddypress' ), 'bp_admin_setting_callback_account_deletion', 'buddypress', 'bp_main' );
394
  register_setting( 'buddypress', 'bp-disable-account-deletion', 'intval' );
@@ -412,6 +411,12 @@ class BP_Admin {
412
  register_setting( 'buddypress', 'bp-disable-cover-image-uploads', 'intval' );
413
  }
414
 
 
 
 
 
 
 
415
  /* XProfile Section **************************************************/
416
 
417
  if ( bp_is_active( 'xprofile' ) ) {
@@ -534,6 +539,13 @@ class BP_Admin {
534
  // About and Credits pages.
535
  remove_submenu_page( 'index.php', 'bp-about' );
536
  remove_submenu_page( 'index.php', 'bp-credits' );
 
 
 
 
 
 
 
537
  }
538
 
539
  /**
@@ -656,115 +668,94 @@ class BP_Admin {
656
  <div class="bp-hello-content">
657
  <div id="dynamic-content"></div>
658
  <div id="top-features">
659
- <h2><?php esc_html_e( 'Manage Member Types and Group Types right from your WordPress Dashboard.', 'buddypress' ); ?></h2>
660
- <figure class="bp-hello-aligncenter">
661
- <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/images/bp-types-illustration.png' ); ?>" alt="<?php esc_attr_e( 'Illustration showing how to access to the BP Types Admin areas.', 'buddypress' ); ?>" />
662
- </figure>
663
  <p>
664
- <?php esc_html_e( 'Playing with BP Types just became much easier! The Member Types and Group Types were primarily introduced in BuddyPress as features for advanced users, just like the WordPress Custom Post Type feature.', 'buddypress' ); ?>
665
- <?php printf(
666
- /* translators: %s is the placeholder for the link to the BP Types Admin developer note. */
667
- esc_html__( 'Thanks to the two new %s, adding, editing and deleting Member & Group Types has never been so easy!', 'buddypress' ),
668
- sprintf(
669
- '<a href="%1$s">%2$s</a>',
670
- esc_url( 'https://bpdevel.wordpress.com/2020/09/21/bp-types-admin-ui/' ),
671
- esc_html__( 'WordPress Administration Screens', 'buddypress' )
672
- )
673
- ); ?>
674
- <?php esc_html_e( 'Now you can set up BP Types using custom code or by simply using the Administration interfaces.', 'buddypress' ); ?>
675
  </p>
676
- <h3><?php esc_html_e( 'Multiple Member Type assignment.', 'buddypress' ); ?></h3>
 
 
 
 
 
 
677
  <p>
 
678
  <?php printf(
679
- /* translators: %s is the placeholder for the link to the BP Types Admin developer note. */
680
- esc_html__( 'As we were pretty hot on the subject, we also improved Member Types assignment. You can now %s to users from their extended profile in the WordPress Dashboard.', 'buddypress' ),
681
  sprintf(
682
  '<a href="%1$s">%2$s</a>',
683
- esc_url( 'https://bpdevel.wordpress.com/2020/10/26/assigning-multiple-member-types-to-a-user/' ),
684
- esc_html__( 'add more than one member type', 'buddypress' )
685
  )
686
  ); ?>
687
  </p>
688
 
689
  <hr class="bp-hello-divider"/>
690
 
691
- <h2><?php esc_html_e( 'The BP Blocks category now includes 5 blocks!', 'buddypress' ); ?></h2>
692
- <figure class="bp-hello-aligncenter">
693
- <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/images/bp-new-blocks.png' ); ?>" alt="<?php esc_attr_e( 'Illustration showing the BuddyPress Blocks category inside the Block Editor Inserter.', 'buddypress' ); ?>" />
694
- </figure>
695
  <p>
696
- <?php esc_html_e( '3 new BP Blocks are now available via your WordPress Editor.', 'buddypress' ); ?>
697
- <?php esc_html_e( 'From the BuddyPress blocks category of the WordPress Block Inserter, you can pick a BP Block to feature a list of members, a list of groups or embed a public BuddyPress Activity into your post or page.', 'buddypress' ); ?>
698
  <?php printf(
699
- /* translators: %s is the placeholder for the link to the BP Blocks developer note. */
700
- esc_html__( 'Read more about it in this %s.', 'buddypress' ),
701
  sprintf(
702
  '<a href="%1$s">%2$s</a>',
703
- esc_url( 'https://bpdevel.wordpress.com/2020/10/14/three-new-blocks-to-expect-in-buddypress-7-0-0/' ),
704
- esc_html__( 'development note', 'buddypress' )
705
  )
706
  ); ?>
707
  </p>
708
-
709
- <hr class="bp-hello-divider"/>
710
-
711
- <h2><?php esc_html_e( 'Get the best of the BP REST API improvements!', 'buddypress' ); ?></h2>
712
- <figure class="bp-hello-alignright">
713
- <div class="dashicons dashicons-rest-api big"></div>
714
  </figure>
715
  <p>
 
716
  <?php printf(
717
- /* translators: %s is the placeholder for the link to the BP REST API documentation. */
718
- esc_html__( 'The %s has been updated according to the latest improvements we’ve brought to the BuddyPress REST API.', 'buddypress' ),
719
  sprintf(
720
  '<a href="%1$s">%2$s</a>',
721
- esc_url( 'https://developer.buddypress.org/bp-rest-api/' ),
722
- esc_html__( 'Developer documentation', 'buddypress' )
723
  )
724
  ); ?>
725
  </p>
 
 
 
726
  <p>
727
- <?php esc_html_e( 'To name two: get the groups the logged in user is a member of, and create a blog when BuddyPress is activated on a network of WordPress sites.', 'buddypress' ); ?>
 
728
  <?php printf(
729
- /* translators: %s is the placeholder for the link to the BP REST API developer note. */
730
- esc_html__( 'Read this %s to learn about all the others.', 'buddypress' ),
731
  sprintf(
732
  '<a href="%1$s">%2$s</a>',
733
- esc_url( 'https://bpdevel.wordpress.com/2020/11/14/buddypress-rest-api-whats-new-in-7-0-0/' ),
734
- esc_html__( 'development note', 'buddypress' )
735
  )
736
  ); ?>
737
  </p>
738
 
739
  <hr class="bp-hello-divider"/>
740
 
741
- <h2><?php esc_html_e( 'BP Nouveau is ready for Twenty Twenty-One', 'buddypress' ); ?></h2>
742
  <p>
743
- <?php esc_html_e( 'You love the latest default WordPress Theme, so do we!', 'buddypress' ); ?>
744
- <?php esc_html_e( 'It’s important for us to make sure the BP Nouveau template pack looks great in the default themes included in the WordPress package.', 'buddypress' ); ?>
745
- <?php esc_html_e( 'This is the first of the many improvements we are bringing to our default Template Pack.', 'buddypress' ); ?>
746
  </p>
747
  <figure class="bp-hello-aligncenter">
748
- <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/images/bp-nouveau-2021.png' ); ?>" alt="<?php esc_attr_e( 'Screenshot of the BuddyPress Members directory', 'buddypress' ); ?>" />
749
- </figure>
750
-
751
- <hr class="bp-hello-divider"/>
752
-
753
- <h2><?php esc_html_e( 'Improved support for WP CLI.', 'buddypress' ); ?></h2>
754
- <figure class="bp-hello-alignleft">
755
- <div class="dashicons dashicons-arrow-right-alt2 big"></div>
756
  </figure>
757
  <p>
758
- <?php esc_html_e( 'WP-CLI is the command-line interface for WordPress. You can update plugins, configure multisite installs, and much more, all without using a web browser.', 'buddypress' ); ?>
759
- <?php esc_html_e( 'In 7.0.0, you will be able to use new BuddyPress CLI commands to manage BuddyPress Group Meta, BuddyPress Activity Meta, activate or deactivate the BuddyPress signup feature and create BuddyPress-specific testing code for plugins.', 'buddypress' ); ?>
760
- </p>
761
- <p>
762
  <?php printf(
763
- /* translators: %s is the placeholder for the link to the WP BP CLI developer note. */
764
- esc_html__( 'Discover more about it from this %s.', 'buddypress' ),
765
  sprintf(
766
  '<a href="%1$s">%2$s</a>',
767
- esc_url( 'https://bpdevel.wordpress.com/2020/10/09/wp-cli-buddypress-2-0/' ),
768
  esc_html__( 'developer note', 'buddypress' )
769
  )
770
  ); ?>
@@ -774,7 +765,8 @@ class BP_Admin {
774
 
775
  <h2><?php esc_html_e( 'Under the hood', 'buddypress' ); ?></h2>
776
  <p>
777
- <?php esc_html_e( '7.0.0 includes more than 65 changes to improve your BuddyPress experience as users, and as contributors to our project; click on the “Changelog” tab to discover them all!', 'buddypress' ); ?>
 
778
  </p>
779
  <figure class="bp-hello-aligncenter">
780
  <div class="dashicons dashicons-buddicons-buddypress-logo big"></div>
@@ -812,7 +804,7 @@ class BP_Admin {
812
  _n( 'Built with %1$s by <a href="%2$s">%3$d volunteer</a>.', 'Built with %1$s by <a href="%2$s">%3$d volunteers</a>.', 55, 'buddypress' ),
813
  '<span class="dashicons dashicons-heart"></span>',
814
  esc_url( bp_get_admin_url( 'admin.php?page=bp-credits' ) ),
815
- number_format_i18n( 55 )
816
  );
817
  ?>
818
  </p>
@@ -972,18 +964,18 @@ class BP_Admin {
972
  ?>
973
  </h3>
974
  <ul class="wp-people-group " id="wp-people-group-noteworthy">
 
 
 
 
 
 
 
 
975
  <li class="wp-person" id="wp-person-oztaser">
976
  <a class="web" href="https://profiles.wordpress.org/oztaser/"><img alt="" class="gravatar" src="//gravatar.com/avatar/06eb4dd13c0113bf826968ae16a13e52?s=120">
977
  Adil Oztaser</a>
978
  </li>
979
- <li class="wp-person" id="wp-person-iamthewebb">
980
- <a class="web" href="https://profiles.wordpress.org/iamthewebb/"><img alt="" class="gravatar" src="//gravatar.com/avatar/990bac871caf6d6e179b2753226d8f4a?s=120&d=mm">
981
- IAmTheWebb</a>
982
- </li>
983
- <li class="wp-person" id="wp-person-vapvarun">
984
- <a class="web" href="https://profiles.wordpress.org/vapvarun"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/78a3bf7eb3a1132fc667f96f2631e448?s=120">
985
- Varun Dubey</a>
986
- </li>
987
  </ul>
988
 
989
  <h3 class="wp-people-group">
@@ -997,60 +989,52 @@ class BP_Admin {
997
  </h3>
998
  <p class="wp-credits-list">
999
  <a href="https://profiles.wordpress.org/oztaser/">Adil Oztaser (oztaser)</a>,
 
 
1000
  <a href="https://profiles.wordpress.org/boonebgorges/">Boone B Gorges (boonebgorges)</a>,
1001
  <a href="https://profiles.wordpress.org/sbrajesh/">Brajesh Singh (sbrajesh)</a>,
1002
- <a href="https://profiles.wordpress.org/corsky/">corsky</a>,
 
 
1003
  <a href="https://profiles.wordpress.org/dancaragea/">Dan Caragea (dancaragea)</a>,
1004
  <a href="https://profiles.wordpress.org/dcavins/">David Cavins (dcavins)</a>,
1005
- <a href="https://profiles.wordpress.org/devnik/">devnik</a>,
1006
- <a href="https://profiles.wordpress.org/dilipbheda/">Dilip Bheda</a>,
1007
- <a href="https://profiles.wordpress.org/dd32/">Dion Hulse (dd32)</a>,
1008
- <a href="https://profiles.wordpress.org/dragoeco/">dragoeco</a>,
1009
- <a href="https://profiles.wordpress.org/kebbet/">Erik Betshammar (kebbet)</a>,
1010
- <a href="https://profiles.wordpress.org/etatus/">etatus</a>,
1011
- <a href="https://github.com/ExoGeek/">Didier Saintes (ExoGeek)</a>,
1012
- <a href="https://profiles.wordpress.org/f2010525/">诗语 (f2010525)</a>,
1013
- <a href="https://profiles.wordpress.org/mamaduka/">George Mamadashvili</a>,
1014
  <a href="https://profiles.wordpress.org/mociofiletto/">Giuseppe (mociofiletto)</a>,
1015
- <a href="https://profiles.wordpress.org/hareesh-pillai/">Hareesh</a>,
1016
- <a href="https://profiles.wordpress.org/iamthewebb/">iamthewebb</a>,
 
1017
  <a href="https://profiles.wordpress.org/nobnob/">Javier Esteban (nobnob)</a>,
1018
- <a href="https://profiles.wordpress.org/audrasjb/">Jb Audras (audrasjb)</a>,
1019
  <a href="https://profiles.wordpress.org/johnjamesjacoby/">John James Jacoby (johnjamesjacoby)</a>,
1020
- <a href="https://profiles.wordpress.org/joost-abrahams/">Joost Abrahams (joost-abrahams)</a>,
1021
- <a href="https://profiles.wordpress.org/k3690/">k3690</a>,
1022
- <a href="https://profiles.wordpress.org/knutsp/">Knut Sparhell (knutsp)</a>,
1023
- <a href="https://profiles.wordpress.org/laxman-prajapati/">Laxman Prajapati</a>,
1024
- <a href="https://profiles.wordpress.org/lidialab/">Lidia Pellizzaro (lidialab)</a>,
1025
- <a href="https://profiles.wordpress.org/marbaque/">marbaque</a>,
1026
- <a href="https://github.com/geckse/">Marcel Claus (geckse)</a>,
1027
- <a href="https://profiles.wordpress.org/marioshtika/">marioshtika</a>,
1028
  <a href="https://profiles.wordpress.org/markscottrobson/">Mark Robson (markscottrobson)</a>,
1029
  <a href="https://profiles.wordpress.org/imath/">Mathieu Viet (imath)</a>,
1030
- <a href="https://profiles.wordpress.org/mercime/">mercime</a>,
1031
- <a href="https://profiles.wordpress.org/immeet94/">Meet Makadia</a>,
1032
- <a href="https://profiles.wordpress.org/tw2113/">Michael Beckwith</a>,
1033
- <a href="https://profiles.wordpress.org/man4toman/">Morteza Geransayeh (man4toman)</a>,
1034
- <a href="https://profiles.wordpress.org/morenolq/">morenolq</a>,
1035
- <a href="https://profiles.wordpress.org/n33d/">N33D</a>,
1036
- <a href="https://profiles.wordpress.org/oddev56/">oddev56</a>,
1037
  <a href="https://profiles.wordpress.org/DJPaul/">Paul Gibbs (DJPaul)</a>,
1038
- <a href="https://profiles.wordpress.org/walbo/">Petter Walbø Johnsgård (walbo)</a>,
1039
  <a href="https://profiles.wordpress.org/psmits1567/">Peter Smits (psmits1567)</a>,
1040
- <a href="https://profiles.wordpress.org/pooja1210/">Pooja N Muchandikar (pooja1210)</a>,
1041
- <a href="https://profiles.wordpress.org/raruto/">Raruto</a>,
1042
  <a href="https://profiles.wordpress.org/r-a-y/">r-a-y</a>,
1043
  <a href="https://profiles.wordpress.org/espellcaste/">Renato Alves (espellcaste)</a>,
1044
- <a href="https://profiles.wordpress.org/scipi/">scipi</a>,
1045
- <a href="https://profiles.wordpress.org/scottopolis/">Scott Bolinger (scottopolis)</a>,
1046
- <a href="https://profiles.wordpress.org/shanebp/">shanebp</a>,
1047
- <a href="https://profiles.wordpress.org/shawfactor/">shawfactor</a>,
1048
- <a href="https://profiles.wordpress.org/sjregan/">sjregan</a>,
1049
  <a href="https://profiles.wordpress.org/netweb/">Stephen Edgar (netweb)</a>,
1050
- <a href="https://profiles.wordpress.org/tharsheblows/">tharsheblows</a>,
1051
- <a href="https://profiles.wordpress.org/tobifjellner/">Tor-Bjorn Fjellner (tobifjellner)</a>,
 
 
 
1052
  <a href="https://profiles.wordpress.org/vapvarun/">Varun Dubey (vapvarun)</a>,
1053
- <a href="https://profiles.wordpress.org/podporawebu/">wp24.cz (podporawebu)</a>.
 
 
1054
  </p>
1055
 
1056
  <h3 class="wp-people-group"><?php esc_html_e( 'With our thanks to these Open Source projects', 'buddypress' ); ?></h3>
123
  require( $this->admin_dir . 'bp-core-admin-components.php' );
124
  require( $this->admin_dir . 'bp-core-admin-slugs.php' );
125
  require( $this->admin_dir . 'bp-core-admin-tools.php' );
126
+ require( $this->admin_dir . 'bp-core-admin-optouts.php' );
127
  }
128
 
129
  /**
302
  'bp_core_admin_tools'
303
  );
304
 
305
+ $hooks[] = add_submenu_page(
306
+ $tools_parent,
307
+ __( 'Manage Opt-outs', 'buddypress' ),
308
+ __( 'Manage Opt-outs', 'buddypress' ),
309
+ $this->capability,
310
+ 'bp-optouts',
311
+ 'bp_core_optouts_admin'
312
+ );
313
+
314
  // For network-wide configs, add a link to (the root site's) Emails screen.
315
  if ( is_network_admin() && bp_is_network_activated() ) {
316
  $email_labels = bp_get_email_post_type_labels();
388
  add_settings_field( 'hide-loggedout-adminbar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_admin_bar', 'buddypress', 'bp_main' );
389
  register_setting( 'buddypress', 'hide-loggedout-adminbar', 'intval' );
390
 
 
 
 
 
 
 
 
 
 
 
 
391
  // Allow account deletion.
392
  add_settings_field( 'bp-disable-account-deletion', __( 'Account Deletion', 'buddypress' ), 'bp_admin_setting_callback_account_deletion', 'buddypress', 'bp_main' );
393
  register_setting( 'buddypress', 'bp-disable-account-deletion', 'intval' );
411
  register_setting( 'buddypress', 'bp-disable-cover-image-uploads', 'intval' );
412
  }
413
 
414
+ // Community Invitations.
415
+ if ( bp_is_active( 'members', 'invitations' ) ) {
416
+ add_settings_field( 'bp-enable-members-invitations', __( 'Invitations', 'buddypress' ), 'bp_admin_setting_callback_members_invitations', 'buddypress', 'bp_members' );
417
+ register_setting( 'buddypress', 'bp-enable-members-invitations', 'intval' );
418
+ }
419
+
420
  /* XProfile Section **************************************************/
421
 
422
  if ( bp_is_active( 'xprofile' ) ) {
539
  // About and Credits pages.
540
  remove_submenu_page( 'index.php', 'bp-about' );
541
  remove_submenu_page( 'index.php', 'bp-credits' );
542
+
543
+ // Nonmembers Opt-outs page.
544
+ if ( is_network_admin() ) {
545
+ remove_submenu_page( 'network-tools', 'bp-optouts' );
546
+ } else {
547
+ remove_submenu_page( 'tools.php', 'bp-optouts' );
548
+ }
549
  }
550
 
551
  /**
668
  <div class="bp-hello-content">
669
  <div id="dynamic-content"></div>
670
  <div id="top-features">
671
+ <h2><?php esc_html_e( 'Your current members are the best way to recruit fantastic new members for your community.', 'buddypress' ); ?></h2>
 
 
 
672
  <p>
673
+ <?php esc_html_e( 'Whether public registration is enabled or not, you can activate this great new opt-in feature from your site\'s BuddyPress settings; with it, your trusted members will handpick new members who will enrich your community', 'buddypress' ); ?>
 
 
 
 
 
 
 
 
 
 
674
  </p>
675
+ <figure class="bp-hello-aligncenter">
676
+ <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/images/bp-members-invitations-invite-screen.png' ); ?>" alt="<?php esc_attr_e( 'Illustration showing the Members Invite Screen.', 'buddypress' ); ?>" />
677
+ </figure>
678
+ <p><?php esc_html_e( 'Once activated, each member will be able to send new Member Invitation emails and manage the pending invitations directly from his or her profile area.', 'buddypress' ); ?>
679
+ <figure class="bp-hello-aligncenter">
680
+ <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/images/bp-members-invitations-manage-admin-screen.png' ); ?>" alt="<?php esc_attr_e( 'Illustration showing the Members Invite Screen.', 'buddypress' ); ?>" />
681
+ </figure>
682
  <p>
683
+ <?php esc_html_e( 'You keep control of everything thanks to two new screens we added to the BuddyPress Tools dashboard: invitations and opt-outs management.', 'buddypress' ); ?>
684
  <?php printf(
685
+ /* translators: %s is the placeholder for the link to the BP Members Invitations developer note. */
686
+ esc_html__( 'Read more about the feature in this %s.', 'buddypress' ),
687
  sprintf(
688
  '<a href="%1$s">%2$s</a>',
689
+ esc_url( 'https://bpdevel.wordpress.com/2021/05/26/bp-8-0-introduces-site-membership-invitations/' ),
690
+ esc_html__( 'developer note', 'buddypress' )
691
  )
692
  ); ?>
693
  </p>
694
 
695
  <hr class="bp-hello-divider"/>
696
 
697
+ <h2><?php esc_html_e( 'Improved registration experience.', 'buddypress' ); ?></h2>
 
 
 
698
  <p>
699
+ <?php esc_html_e( 'First, you can select any xProfile field from any xProfile field group to use on your site\'s registration form.', 'buddypress' ); ?>
 
700
  <?php printf(
701
+ /* translators: %s is the placeholder for the link to the Selectable Signup Fields developer note. */
702
+ esc_html__( 'Learn more about it reading this %s.', 'buddypress' ),
703
  sprintf(
704
  '<a href="%1$s">%2$s</a>',
705
+ esc_url( 'https://bpdevel.wordpress.com/2021/05/06/selectable-xprofile-sign-up-fields-in-8-0-0/' ),
706
+ esc_html__( 'developer note', 'buddypress' )
707
  )
708
  ); ?>
709
  </p>
710
+ <figure class="bp-hello-aligncenter">
711
+ <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/images/bp-xprofile-admin-signup-fields.png' ); ?>" alt="<?php esc_attr_e( 'Illustration showing the xProfile Administration Screen.', 'buddypress' ); ?>" />
 
 
 
 
712
  </figure>
713
  <p>
714
+ <?php esc_html_e( 'Second, if your site requires that users accept specific rules such as terms of service or a code of conduct, you can now take advantage of the new Checkbox Acceptance xProfile Field type to record their agreement.', 'buddypress' ); ?>
715
  <?php printf(
716
+ /* translators: %s is the placeholder for the link to the Checkbox Acceptance field type developer note. */
717
+ esc_html__( 'This %s will teach you more about it.', 'buddypress' ),
718
  sprintf(
719
  '<a href="%1$s">%2$s</a>',
720
+ esc_url( 'https://bpdevel.wordpress.com/2021/05/05/new-xprofile-field-type-checkbox-acceptance-will-be-introduced-in-buddypress-8-0-0/' ),
721
+ esc_html__( 'developer note', 'buddypress' )
722
  )
723
  ); ?>
724
  </p>
725
+ <figure class="bp-hello-aligncenter">
726
+ <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/images/bp-xprofile-checkbox-acceptance-field-type.png' ); ?>" alt="<?php esc_attr_e( 'Illustration showing an example of Checkbox Acceptance xProfile field type display.', 'buddypress' ); ?>" />
727
+ </figure>
728
  <p>
729
+ <?php esc_html_e( 'Third, once a user activates his or her account, BuddyPress will send a welcome email to help get him or her engaged with your community.', 'buddypress' ); ?>
730
+ <?php esc_html_e( 'You can customize the content of this email from the Emails menu of your WordPress dashboard.', 'buddypress' ); ?>
731
  <?php printf(
732
+ /* translators: %s is the placeholder for the link to the Welcome Email developer note. */
733
+ esc_html__( 'Have a look to this %s to find out more about it.', 'buddypress' ),
734
  sprintf(
735
  '<a href="%1$s">%2$s</a>',
736
+ esc_url( 'https://bpdevel.wordpress.com/2021/05/24/8-0-0-will-include-a-bp-email-to-welcome-new-community-members/' ),
737
+ esc_html__( 'developer note', 'buddypress' )
738
  )
739
  ); ?>
740
  </p>
741
 
742
  <hr class="bp-hello-divider"/>
743
 
744
+ <h2><?php esc_html_e( 'WP xProfile field types.', 'buddypress' ); ?></h2>
745
  <p>
746
+ <?php esc_html_e( 'Two new field types can now be used to include WordPress-specific information about the member in xProfile field loops without duplicating data.', 'buddypress' ); ?>
 
 
747
  </p>
748
  <figure class="bp-hello-aligncenter">
749
+ <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/images/bp-xprofile-wp-field-type.png' ); ?>" alt="<?php esc_attr_e( 'Illustration showing the xProfile Field Edit Screen.', 'buddypress' ); ?>" />
 
 
 
 
 
 
 
750
  </figure>
751
  <p>
752
+ <?php esc_html_e( 'The WP Biography field type lets you include the user\'s Biographical Info and thanks to the WP Textbox field you can include the first & last name, the Website URL as well as any of the custom contact methods of your users.', 'buddypress' ); ?>
 
 
 
753
  <?php printf(
754
+ /* translators: %s is the placeholder for the link to the WP xProfile Field Type developer note. */
755
+ esc_html__( 'Read more about it in this %s.', 'buddypress' ),
756
  sprintf(
757
  '<a href="%1$s">%2$s</a>',
758
+ esc_url( 'https://bpdevel.wordpress.com/2021/03/24/wordpress-xprofile-field-types/' ),
759
  esc_html__( 'developer note', 'buddypress' )
760
  )
761
  ); ?>
765
 
766
  <h2><?php esc_html_e( 'Under the hood', 'buddypress' ); ?></h2>
767
  <p>
768
+ <?php esc_html_e( '8.0.0 includes more than 45 changes to improve the Activity component, BP Nouveau Template pack, the BP REST API and many more components and features.', 'buddypress' ); ?>
769
+ <?php esc_html_e( 'Click on the "Changelog" tab to discover them all!', 'buddypress' ); ?>
770
  </p>
771
  <figure class="bp-hello-aligncenter">
772
  <div class="dashicons dashicons-buddicons-buddypress-logo big"></div>
804
  _n( 'Built with %1$s by <a href="%2$s">%3$d volunteer</a>.', 'Built with %1$s by <a href="%2$s">%3$d volunteers</a>.', 55, 'buddypress' ),
805
  '<span class="dashicons dashicons-heart"></span>',
806
  esc_url( bp_get_admin_url( 'admin.php?page=bp-credits' ) ),
807
+ number_format_i18n( 47 )
808
  );
809
  ?>
810
  </p>
964
  ?>
965
  </h3>
966
  <ul class="wp-people-group " id="wp-people-group-noteworthy">
967
+ <li class="wp-person" id="wp-person-vapvarun">
968
+ <a class="web" href="https://profiles.wordpress.org/vapvarun"><img alt="" class="gravatar" src="//gravatar.com/avatar/78a3bf7eb3a1132fc667f96f2631e448?s=120">
969
+ Varun Dubey</a>
970
+ </li>
971
+ <li class="wp-person" id="wp-person-sbrajesh">
972
+ <a class="web" href="https://profiles.wordpress.org/sbrajesh/"><img alt="" class="gravatar" src="//gravatar.com/avatar/2106622ee90d53d15ac1402806616aca?s=120">
973
+ Brajesh Singh</a>
974
+ </li>
975
  <li class="wp-person" id="wp-person-oztaser">
976
  <a class="web" href="https://profiles.wordpress.org/oztaser/"><img alt="" class="gravatar" src="//gravatar.com/avatar/06eb4dd13c0113bf826968ae16a13e52?s=120">
977
  Adil Oztaser</a>
978
  </li>
 
 
 
 
 
 
 
 
979
  </ul>
980
 
981
  <h3 class="wp-people-group">
989
  </h3>
990
  <p class="wp-credits-list">
991
  <a href="https://profiles.wordpress.org/oztaser/">Adil Oztaser (oztaser)</a>,
992
+ <a href="https://profiles.wordpress.org/chaion07/">Ahmed Chaion (chaion07)</a>,
993
+ <a href="https://profiles.wordpress.org/dontdream/">Andrea Tarantini (dontdream)</a>,
994
  <a href="https://profiles.wordpress.org/boonebgorges/">Boone B Gorges (boonebgorges)</a>,
995
  <a href="https://profiles.wordpress.org/sbrajesh/">Brajesh Singh (sbrajesh)</a>,
996
+ <a href="https://profiles.wordpress.org/thee17/">Charles E. Frees-Melvin (thee17)</a>,
997
+ <a href="https://profiles.wordpress.org/needle/">Christian Wach (needle)</a>,
998
+ <a href="https://profiles.wordpress.org/comminski/">comminski</a>,
999
  <a href="https://profiles.wordpress.org/dancaragea/">Dan Caragea (dancaragea)</a>,
1000
  <a href="https://profiles.wordpress.org/dcavins/">David Cavins (dcavins)</a>,
1001
+ <a href="https://github.com/dominic-ks/">dominic-ks</a>,
1002
+ <a href="https://github.com/edusperoni/">Eduardo Speroni (edusperoni)</a>,
1003
+ <a href="https://profiles.wordpress.org/fernandot/">Fernando Tellado (fernandot)</a>,
 
 
 
 
 
 
1004
  <a href="https://profiles.wordpress.org/mociofiletto/">Giuseppe (mociofiletto)</a>,
1005
+ <a href="https://profiles.wordpress.org/hz_i3/">hz_i3</a>,
1006
+ <a href="https://profiles.wordpress.org/ianbarnes/">Ian Barnes (ianbarnes)</a>,
1007
+ <a href="https://profiles.wordpress.org/atxamart/">Iker Garaialde (atxamart)</a>,
1008
  <a href="https://profiles.wordpress.org/nobnob/">Javier Esteban (nobnob)</a>,
 
1009
  <a href="https://profiles.wordpress.org/johnjamesjacoby/">John James Jacoby (johnjamesjacoby)</a>,
1010
+ <a href="https://profiles.wordpress.org/krupajnanda/">Krupa (krupajnanda)</a>,
1011
+ <a href="https://profiles.wordpress.org/offereins/">Laurens Offereins</a>,
1012
+ <a href="https://profiles.wordpress.org/mahdiar/">mahdiar</a>,
 
 
 
 
 
1013
  <a href="https://profiles.wordpress.org/markscottrobson/">Mark Robson (markscottrobson)</a>,
1014
  <a href="https://profiles.wordpress.org/imath/">Mathieu Viet (imath)</a>,
1015
+ <a href="https://profiles.wordpress.org/mattneil/">mattneil</a>,
1016
+ <a href="https://profiles.wordpress.org/meijioro/">meijioro</a>,
1017
+ <a href="https://profiles.wordpress.org/kalich5/">Michal Janata (kalich5)</a>,
1018
+ <a href="https://profiles.wordpress.org/modemlooper/">modemlooper</a>,
 
 
 
1019
  <a href="https://profiles.wordpress.org/DJPaul/">Paul Gibbs (DJPaul)</a>,
1020
+ <a href="https://profiles.wordpress.org/podporawebu/">podporawebu</a>,
1021
  <a href="https://profiles.wordpress.org/psmits1567/">Peter Smits (psmits1567)</a>,
1022
+ <a href="https://profiles.wordpress.org/nekojonez/">Pieterjan Deneys (nekojonez)</a>,
 
1023
  <a href="https://profiles.wordpress.org/r-a-y/">r-a-y</a>,
1024
  <a href="https://profiles.wordpress.org/espellcaste/">Renato Alves (espellcaste)</a>,
1025
+ <a href="https://profiles.wordpress.org/renegade1/">renegade1</a>,
1026
+ <a href="https://profiles.wordpress.org/slaffik/">Slava Abakumov (slaffik)</a>,
1027
+ <a href="https://profiles.wordpress.org/sabernhardt/">Stephen Bernhardt (sabernhardt)</a>,
 
 
1028
  <a href="https://profiles.wordpress.org/netweb/">Stephen Edgar (netweb)</a>,
1029
+ <a href="https://profiles.wordpress.org/studiocrafted/">studiocrafted</a>,
1030
+ <a href="https://profiles.wordpress.org/sippis/">Timi Wahalahti (sippis)</a>,
1031
+ <a href="https://profiles.wordpress.org/mobby2561/">Tomas (mobby2561)</a>,
1032
+ <a href="https://profiles.wordpress.org/topher1kenobe/">Topher (topher1kenobe)</a>,
1033
+ <a href="https://profiles.wordpress.org/utsav72640/">Utsav tilava (utsav72640)</a>,
1034
  <a href="https://profiles.wordpress.org/vapvarun/">Varun Dubey (vapvarun)</a>,
1035
+ <a href="https://profiles.wordpress.org/venutius/">Venutius</a>,
1036
+ <a href="https://profiles.wordpress.org/weddywood/">WeddyWood</a>,
1037
+ <a href="https://profiles.wordpress.org/yordansoares/">Yordan Soares (yordansoares)</a>.
1038
  </p>
1039
 
1040
  <h3 class="wp-people-group"><?php esc_html_e( 'With our thanks to these Open Source projects', 'buddypress' ); ?></h3>
bp-core/classes/class-bp-email.php CHANGED
@@ -790,8 +790,16 @@ class BP_Email {
790
  // Load the template.
791
  add_filter( 'bp_locate_template_and_load', '__return_true' );
792
 
 
 
 
 
 
793
  bp_locate_template( bp_email_get_template( $this->post_object ), true, false );
794
 
 
 
 
795
  remove_filter( 'bp_locate_template_and_load', '__return_true' );
796
 
797
  $this->set_template( ob_get_contents() );
@@ -999,6 +1007,14 @@ class BP_Email {
999
  $retval = new WP_Error( 'missing_parameter', __CLASS__, $this );
1000
  }
1001
 
 
 
 
 
 
 
 
 
1002
  /**
1003
  * Filters whether the email passes basic validation checks.
1004
  *
790
  // Load the template.
791
  add_filter( 'bp_locate_template_and_load', '__return_true' );
792
 
793
+ // Set up the `$post` global.
794
+ global $post;
795
+ $reset_post = $post;
796
+ $post = $this->post_object;
797
+
798
  bp_locate_template( bp_email_get_template( $this->post_object ), true, false );
799
 
800
+ // Reset the `$post` global.
801
+ $post = $reset_post;
802
+
803
  remove_filter( 'bp_locate_template_and_load', '__return_true' );
804
 
805
  $this->set_template( ob_get_contents() );
1007
  $retval = new WP_Error( 'missing_parameter', __CLASS__, $this );
1008
  }
1009
 
1010
+ // Has the user opted out of receiving any email from this site?
1011
+ $recipient_to = $this->get_to();
1012
+ $recipient_to_first = array_shift( $recipient_to );
1013
+ $recipient_address = $recipient_to_first->get_address();
1014
+ if ( bp_user_has_opted_out( $recipient_address ) ) {
1015
+ $retval = new WP_Error( 'user_has_opted_out', __( 'The email recipient has opted out from receiving communication from this site.', 'buddypress' ), $recipient_address );
1016
+ }
1017
+
1018
  /**
1019
  * Filters whether the email passes basic validation checks.
1020
  *
bp-core/classes/class-bp-invitation-manager.php CHANGED
@@ -99,6 +99,11 @@ abstract class BP_Invitation_Manager {
99
  return false;
100
  }
101
 
 
 
 
 
 
102
  /**
103
  * Is this user allowed to extend invitations in this situation?
104
  *
@@ -139,7 +144,7 @@ abstract class BP_Invitation_Manager {
139
 
140
  // "Send" the invite if necessary.
141
  if ( $invite_id && $r['send_invite'] ) {
142
- $sent = $this->send_invitation_by_id( $invite_id );
143
  if ( ! $sent ) {
144
  return false;
145
  }
@@ -154,11 +159,12 @@ abstract class BP_Invitation_Manager {
154
  * @since 5.0.0
155
  * @access public
156
  *
157
- * @param int $invitation_id ID of invitation to send.
 
158
  *
159
- * @return int|bool The number of rows updated, or false on error.
160
  */
161
- public function send_invitation_by_id( $invitation_id = 0 ) {
162
  $updated = false;
163
 
164
  $invitation = new BP_Invitation( $invitation_id );
@@ -194,11 +200,13 @@ abstract class BP_Invitation_Manager {
194
  }
195
 
196
  // Perform the send action.
197
- $this->run_send_action( $invitation );
198
 
199
- $updated = BP_Invitation::mark_sent( $invitation->id );
 
 
200
 
201
- return $updated;
202
  }
203
 
204
  /**
@@ -305,11 +313,12 @@ abstract class BP_Invitation_Manager {
305
  * @since 5.0.0
306
  * @access public
307
  *
308
- * @param int $request_id ID of request to send.
 
309
  *
310
- * @return int|bool The number of rows updated, or false on error.
311
  */
312
- public function send_request_notification_by_id( $request_id = 0 ) {
313
  $updated = false;
314
 
315
  $request = new BP_Invitation( $request_id );
@@ -325,26 +334,28 @@ abstract class BP_Invitation_Manager {
325
  * Before sending notifications, check for outstanding invitations to the same item.
326
  * A sent invitation + a request = acceptance.
327
  */
328
- $args = array(
329
  'user_id' => $request->user_id,
330
  'invitee_email' => $request->invitee_email,
331
  'item_id' => $request->item_id,
332
  'secondary_item_id' => $request->secondary_item_id,
333
  'invite_sent' => 'sent'
334
  );
335
- $invites = $this->invitation_exists( $args );
336
 
337
  if ( ! empty( $invites ) ) {
338
  // Accept the request.
339
- return $this->accept_invitation( $args );
340
  }
341
 
342
  // Perform the send action.
343
- $this->run_send_action( $request );
344
 
345
- $updated = BP_Invitation::mark_sent( $request->id );
 
 
346
 
347
- return $updated;
348
  }
349
 
350
  /** Retrieve ******************************************************************/
@@ -381,6 +392,26 @@ abstract class BP_Invitation_Manager {
381
  return BP_Invitation::get( $args );
382
  }
383
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
384
  /**
385
  * Get requests, based on provided filter parameters.
386
  *
@@ -452,29 +483,38 @@ abstract class BP_Invitation_Manager {
452
  * @see BP_Invitation::get() for a description of
453
  * accepted update/where arguments.
454
  *
455
- * @param array $update_args Associative array of fields to update,
456
- * and the values to update them to. Of the format
457
- * array( 'user_id' => 4 )
 
 
 
 
 
 
 
 
 
 
 
 
458
  *
459
  * @return int|bool Number of rows updated on success, false on failure.
460
  */
461
  public function accept_invitation( $args = array() ) {
462
 
463
- /*
464
- * Some basic info is required to accept an invitation,
465
- * because we'll need to mark all similar invitations and requests.
466
- * The following, except the optional 'secondary_item_id', are required.
467
- */
468
  $r = bp_parse_args( $args, array(
 
469
  'user_id' => 0,
470
  'invitee_email' => '',
471
  'item_id' => null,
472
  'secondary_item_id' => null,
473
  'invite_sent' => 'sent',
 
474
  ), 'accept_invitation' );
475
  $r['class'] = $this->class_name;
476
 
477
- if ( ! ( ( $r['user_id'] || $r['invitee_email'] ) && $r['class'] && $r['item_id'] ) ) {
478
  return false;
479
  }
480
 
@@ -501,22 +541,26 @@ abstract class BP_Invitation_Manager {
501
  * @see BP_Invitation::get() for a description of
502
  * accepted update/where arguments.
503
  *
504
- * @param array $update_args Associative array of fields to update,
505
- * and the values to update them to. Of the format
506
- * array( 'user_id' => 4 )
 
 
 
 
 
 
 
507
  *
508
  * @return bool Number of rows updated on success, false on failure.
509
  */
510
  public function accept_request( $args = array() ) {
511
- /*
512
- * Some basic info is required to accept an invitation,
513
- * because we'll need to accept all similar invitations and requests.
514
- * The following, except the optional 'secondary_item_id', are required.
515
- */
516
  $r = bp_parse_args( $args, array(
517
  'user_id' => 0,
518
  'item_id' => null,
519
  'secondary_item_id' => null,
 
520
  ), 'accept_request' );
521
  $r['class'] = $this->class_name;
522
 
@@ -618,11 +662,12 @@ abstract class BP_Invitation_Manager {
618
  *
619
  * @since 5.0.0
620
  *
621
- * @param int $id The ID of the invitation to mark as sent.
 
622
  * @return bool True on success, false on failure.
623
  */
624
- public function mark_accepted_by_id( $id ) {
625
- return BP_Invitation::mark_accepted( $id );
626
  }
627
 
628
  /**
@@ -688,6 +733,24 @@ abstract class BP_Invitation_Manager {
688
  ) );
689
  }
690
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
691
  /**
692
  * This is where custom actions are added (in child classes)
693
  * to determine whether an invitation should be allowed.
99
  return false;
100
  }
101
 
102
+ // If an email address is specified, it must be a valid email address.
103
+ if ( $r['invitee_email'] && ! is_email( $r['invitee_email'] ) ) {
104
+ return false;
105
+ }
106
+
107
  /**
108
  * Is this user allowed to extend invitations in this situation?
109
  *
144
 
145
  // "Send" the invite if necessary.
146
  if ( $invite_id && $r['send_invite'] ) {
147
+ $sent = $this->send_invitation_by_id( $invite_id, $r );
148
  if ( ! $sent ) {
149
  return false;
150
  }
159
  * @since 5.0.0
160
  * @access public
161
  *
162
+ * @param int $invitation_id ID of invitation to send.
163
+ * @param array $args See BP_Invitation::mark_sent().
164
  *
165
+ * @return bool The result of `run_send_action()`.
166
  */
167
+ public function send_invitation_by_id( $invitation_id = 0, $args = array() ) {
168
  $updated = false;
169
 
170
  $invitation = new BP_Invitation( $invitation_id );
200
  }
201
 
202
  // Perform the send action.
203
+ $success = $this->run_send_action( $invitation );
204
 
205
+ if ( $success ) {
206
+ BP_Invitation::mark_sent( $invitation->id, $args );
207
+ }
208
 
209
+ return $success;
210
  }
211
 
212
  /**
313
  * @since 5.0.0
314
  * @access public
315
  *
316
+ * @param int $request_id ID of request to send.
317
+ * @param array $args See BP_Invitation::mark_sent().
318
  *
319
+ * @return bool The result of `run_send_action()`.
320
  */
321
+ public function send_request_notification_by_id( $request_id = 0, $args = array() ) {
322
  $updated = false;
323
 
324
  $request = new BP_Invitation( $request_id );
334
  * Before sending notifications, check for outstanding invitations to the same item.
335
  * A sent invitation + a request = acceptance.
336
  */
337
+ $invite_args = array(
338
  'user_id' => $request->user_id,
339
  'invitee_email' => $request->invitee_email,
340
  'item_id' => $request->item_id,
341
  'secondary_item_id' => $request->secondary_item_id,
342
  'invite_sent' => 'sent'
343
  );
344
+ $invites = $this->invitation_exists( $invite_args );
345
 
346
  if ( ! empty( $invites ) ) {
347
  // Accept the request.
348
+ return $this->accept_invitation( $invite_args );
349
  }
350
 
351
  // Perform the send action.
352
+ $success = $this->run_send_action( $request );
353
 
354
+ if ( $success ) {
355
+ BP_Invitation::mark_sent( $request->id, $args );
356
+ }
357
 
358
+ return $success;
359
  }
360
 
361
  /** Retrieve ******************************************************************/
392
  return BP_Invitation::get( $args );
393
  }
394
 
395
+ /**
396
+ * Get a count of the number of invitations that match provided filter parameters.
397
+ *
398
+ * @since 8.0.0
399
+ *
400
+ * @see BP_Invitation::get_total_count() for a description of accepted parameters.
401
+ *
402
+ * @return int Total number of invitations.
403
+ */
404
+ public function get_invitations_total_count( $args = array() ) {
405
+ // Default to returning invitations, not requests.
406
+ if ( empty( $args['type'] ) ) {
407
+ $args['type'] = 'invite';
408
+ }
409
+ // Use the class_name property value.
410
+ $args['class'] = $this->class_name;
411
+
412
+ return BP_Invitation::get_total_count( $args );
413
+ }
414
+
415
  /**
416
  * Get requests, based on provided filter parameters.
417
  *
483
  * @see BP_Invitation::get() for a description of
484
  * accepted update/where arguments.
485
  *
486
+ * @param array $args {
487
+ * Invitation characteristics. Some basic info is required to accept an invitation,
488
+ * because we'll need to accept all similar invitations and requests.
489
+ *
490
+ * @type int $user_id User ID of the invitee.
491
+ * Either 'user_id' or 'invitee_email' is required.
492
+ * @type string $invitee_email Email address of the invitee.
493
+ * Either 'user_id' or 'invitee_email' is required.
494
+ * @type int $item_id Item ID of the invitation to accept.
495
+ * @type int $secondary_item_id Optional. Secondary item ID if needed.
496
+ * @type string $invite_sent Optional. Defaults to only allowing the
497
+ * acceptance of sent invitations.
498
+ * @type string $date_modified Modified time in 'Y-m-d h:i:s' format, GMT.
499
+ * Defaults to current time if not specified.
500
+ * }
501
  *
502
  * @return int|bool Number of rows updated on success, false on failure.
503
  */
504
  public function accept_invitation( $args = array() ) {
505
 
 
 
 
 
 
506
  $r = bp_parse_args( $args, array(
507
+ 'id' => false,
508
  'user_id' => 0,
509
  'invitee_email' => '',
510
  'item_id' => null,
511
  'secondary_item_id' => null,
512
  'invite_sent' => 'sent',
513
+ 'date_modified' => bp_core_current_time(),
514
  ), 'accept_invitation' );
515
  $r['class'] = $this->class_name;
516
 
517
+ if ( ! $r['id'] && ! ( ( $r['user_id'] || $r['invitee_email'] ) && $r['class'] && $r['item_id'] ) ) {
518
  return false;
519
  }
520
 
541
  * @see BP_Invitation::get() for a description of
542
  * accepted update/where arguments.
543
  *
544
+ * @param array $args {
545
+ * Invitation characteristics. Some basic info is required to accept an invitation,
546
+ * because we'll need to accept all similar invitations and requests.
547
+ *
548
+ * @type int $user_id User ID of the invitee.
549
+ * @type int $item_id Item ID of the invitation to accept.
550
+ * @type int $secondary_item_id Optional. Secondary item ID if needed.
551
+ * @type string $date_modified Modified time in 'Y-m-d h:i:s' format, GMT.
552
+ * Defaults to current time if not specified.
553
+ * }
554
  *
555
  * @return bool Number of rows updated on success, false on failure.
556
  */
557
  public function accept_request( $args = array() ) {
558
+
 
 
 
 
559
  $r = bp_parse_args( $args, array(
560
  'user_id' => 0,
561
  'item_id' => null,
562
  'secondary_item_id' => null,
563
+ 'date_modified' => bp_core_current_time(),
564
  ), 'accept_request' );
565
  $r['class'] = $this->class_name;
566
 
662
  *
663
  * @since 5.0.0
664
  *
665
+ * @see BP_Invitation::mark_accepted()
666
+ * for a description of arguments.
667
  * @return bool True on success, false on failure.
668
  */
669
+ public function mark_accepted_by_id( $id, $args ) {
670
+ return BP_Invitation::mark_accepted( $id, $args );
671
  }
672
 
673
  /**
733
  ) );
734
  }
735
 
736
+ /**
737
+ * Delete an invitation by id.
738
+ *
739
+ * @since 8.0.0
740
+ *
741
+ * @param int $id ID of the invitation to delete.
742
+ * @return int|bool Number of rows deleted on success, false on failure.
743
+ */
744
+ public function delete_by_id( $id ) {
745
+ // Ensure that the invitation exists and was created by this class.
746
+ $invite = new BP_Invitation( $id );
747
+ if ( ! $invite->id || sanitize_key( $this->class_name ) !== $invite->class ) {
748
+ return false;
749
+ }
750
+
751
+ return BP_Invitation::delete_by_id( $id );
752
+ }
753
+
754
  /**
755
  * This is where custom actions are added (in child classes)
756
  * to determine whether an invitation should be allowed.
bp-core/classes/class-bp-invitation.php CHANGED
@@ -444,7 +444,7 @@ class BP_Invitation {
444
  * invite_sent
445
  * Only create a where statement if something less than "all" has been
446
  * specifically requested.
447
- */
448
  if ( ! empty( $args['invite_sent'] ) && 'all' !== $args['invite_sent'] ) {
449
  if ( $args['invite_sent'] == 'draft' ) {
450
  $where_conditions['invite_sent'] = "invite_sent = 0";
@@ -465,7 +465,7 @@ class BP_Invitation {
465
  // search_terms.
466
  if ( ! empty( $args['search_terms'] ) ) {
467
  $search_terms_like = '%' . bp_esc_like( $args['search_terms'] ) . '%';
468
- $where_conditions['search_terms'] = $wpdb->prepare( "( class LIKE %s )", $search_terms_like, $search_terms_like );
469
  }
470
 
471
  // Custom WHERE.
@@ -670,6 +670,12 @@ class BP_Invitation {
670
  }
671
  }
672
 
 
 
 
 
 
 
673
  return $where_clauses;
674
  }
675
 
@@ -684,7 +690,7 @@ class BP_Invitation {
684
  * Associative array of arguments. All arguments but $page and
685
  * $per_page can be treated as filter values for get_where_sql()
686
  * and get_query_clauses(). All items are optional.
687
- * @type int|array $id ID of invitation being updated.
688
  * Can be an array of IDs.
689
  * @type int|array $user_id ID of user being queried. Can be an
690
  * Can be an array of IDs.
@@ -724,9 +730,9 @@ class BP_Invitation {
724
  * @type int $per_page Number of items to show per page.
725
  * Default: false (no pagination,
726
  * all items).
727
- * @type string $fields Which fields to return. Specify 'item_ids' to fetch a list of Item_IDs.
728
- * Specify 'ids' to fetch a list of Invitation IDs.
729
- * Default: 'all' (return BP_Invitation objects).
730
  * }
731
  *
732
  * @return array BP_Invitation objects | IDs of found invite.
@@ -860,10 +866,29 @@ class BP_Invitation {
860
  global $wpdb;
861
  $invites_table_name = BP_Invitation_Manager::get_table_name();
862
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
863
  // Build the query
864
  $select_sql = "SELECT COUNT(*)";
865
  $from_sql = "FROM {$invites_table_name}";
866
- $where_sql = self::get_where_sql( $args );
867
  $sql = "{$select_sql} {$from_sql} {$where_sql}";
868
 
869
  // Return the queried results
@@ -922,7 +947,7 @@ class BP_Invitation {
922
  */
923
  do_action( 'bp_invitation_after_update', $where_args, $update_args );
924
 
925
- return $retval;
926
  }
927
 
928
  /**
@@ -998,9 +1023,17 @@ class BP_Invitation {
998
  *
999
  * @since 5.0.0
1000
  *
1001
- * @param int $id The ID of the invitation to mark as sent.
 
 
 
 
 
 
 
 
1002
  */
1003
- public static function mark_sent( $id = 0 ) {
1004
 
1005
  if ( ! $id ) {
1006
  return false;
@@ -1008,8 +1041,13 @@ class BP_Invitation {
1008
 
1009
  // Values to be updated.
1010
  $update_args = array(
1011
- 'invite_sent' => 'sent',
 
1012
  );
 
 
 
 
1013
 
1014
  // WHERE clauses.
1015
  $where_args = array(
@@ -1025,14 +1063,20 @@ class BP_Invitation {
1025
  *
1026
  * @since 5.0.0
1027
  *
1028
- * @param array $args See BP_Invitation::update().
 
1029
  */
1030
  public static function mark_sent_by_data( $args ) {
1031
 
1032
  // Values to be updated.
1033
  $update_args = array(
1034
- 'invite_sent' => 'sent',
 
1035
  );
 
 
 
 
1036
 
1037
  return self::update( $update_args, $args );
1038
  }
@@ -1044,9 +1088,17 @@ class BP_Invitation {
1044
  *
1045
  * @since 5.0.0
1046
  *
1047
- * @param int $id The ID of the invitation to mark as sent.
 
 
 
 
 
 
 
 
1048
  */
1049
- public static function mark_accepted( $id = 0 ) {
1050
 
1051
  if ( ! $id ) {
1052
  return false;
@@ -1054,8 +1106,13 @@ class BP_Invitation {
1054
 
1055
  // Values to be updated.
1056
  $update_args = array(
1057
- 'accepted' => 'accepted',
 
1058
  );
 
 
 
 
1059
 
1060
  // WHERE clauses.
1061
  $where_args = array(
@@ -1071,14 +1128,20 @@ class BP_Invitation {
1071
  *
1072
  * @since 5.0.0
1073
  *
1074
- * @param array $args See BP_Invitation::update().
 
1075
  */
1076
  public static function mark_accepted_by_data( $args ) {
1077
 
1078
  // Values to be updated.
1079
  $update_args = array(
1080
- 'accepted' => 'accepted',
 
1081
  );
 
 
 
 
1082
 
1083
  return self::update( $update_args, $args );
1084
  }
444
  * invite_sent
445
  * Only create a where statement if something less than "all" has been
446
  * specifically requested.
447
+ */
448
  if ( ! empty( $args['invite_sent'] ) && 'all' !== $args['invite_sent'] ) {
449
  if ( $args['invite_sent'] == 'draft' ) {
450
  $where_conditions['invite_sent'] = "invite_sent = 0";
465
  // search_terms.
466
  if ( ! empty( $args['search_terms'] ) ) {
467
  $search_terms_like = '%' . bp_esc_like( $args['search_terms'] ) . '%';
468
+ $where_conditions['search_terms'] = $wpdb->prepare( '( invitee_email LIKE %s OR content LIKE %s )', $search_terms_like, $search_terms_like );
469
  }
470
 
471
  // Custom WHERE.
670
  }
671
  }
672
 
673
+ // date_modified
674
+ if ( ! empty( $args['date_modified'] ) ) {
675
+ $where_clauses['data']['date_modified'] = $args['date_modified'];
676
+ $where_clauses['format'][] = '%s';
677
+ }
678
+
679
  return $where_clauses;
680
  }
681
 
690
  * Associative array of arguments. All arguments but $page and
691
  * $per_page can be treated as filter values for get_where_sql()
692
  * and get_query_clauses(). All items are optional.
693
+ * @type int|array $id ID of invitation being fetched.
694
  * Can be an array of IDs.
695
  * @type int|array $user_id ID of user being queried. Can be an
696
  * Can be an array of IDs.
730
  * @type int $per_page Number of items to show per page.
731
  * Default: false (no pagination,
732
  * all items).
733
+ * @type string $fields Which fields to return. Specify 'item_ids' to fetch a list of Item_IDs.
734
+ * Specify 'ids' to fetch a list of Invitation IDs.
735
+ * Default: 'all' (return BP_Invitation objects).
736
  * }
737
  *
738
  * @return array BP_Invitation objects | IDs of found invite.
866
  global $wpdb;
867
  $invites_table_name = BP_Invitation_Manager::get_table_name();
868
 
869
+ $r = bp_parse_args( $args, array(
870
+ 'id' => false,
871
+ 'user_id' => false,
872
+ 'inviter_id' => false,
873
+ 'invitee_email' => false,
874
+ 'class' => false,
875
+ 'item_id' => false,
876
+ 'secondary_item_id' => false,
877
+ 'type' => 'all',
878
+ 'invite_sent' => 'all',
879
+ 'accepted' => 'pending',
880
+ 'search_terms' => '',
881
+ 'order_by' => false,
882
+ 'sort_order' => false,
883
+ 'page' => false,
884
+ 'per_page' => false,
885
+ 'fields' => 'all',
886
+ ), 'bp_invitations_invitation_get_total_count' );
887
+
888
  // Build the query
889
  $select_sql = "SELECT COUNT(*)";
890
  $from_sql = "FROM {$invites_table_name}";
891
+ $where_sql = self::get_where_sql( $r );
892
  $sql = "{$select_sql} {$from_sql} {$where_sql}";
893
 
894
  // Return the queried results
947
  */
948
  do_action( 'bp_invitation_after_update', $where_args, $update_args );
949
 
950
+ return $retval;
951
  }
952
 
953
  /**
1023
  *
1024
  * @since 5.0.0
1025
  *
1026
+ * @param int $id The ID of the invitation to mark as sent.
1027
+ * @param array $args {
1028
+ * Optional. Invitation characteristics used
1029
+ * to override certain sending behaviors.
1030
+ *
1031
+ * @type string $date_modified Modified time in 'Y-m-d h:i:s' format, GMT.
1032
+ * Defaults to current time if not specified.
1033
+ * }
1034
+ * @return int|bool The number of rows updated, or false on error.
1035
  */
1036
+ public static function mark_sent( $id = 0, $args = array() ) {
1037
 
1038
  if ( ! $id ) {
1039
  return false;
1041
 
1042
  // Values to be updated.
1043
  $update_args = array(
1044
+ 'invite_sent' => 'sent',
1045
+ 'date_modified' => bp_core_current_time(),
1046
  );
1047
+ // Respect a specified `date-modified`.
1048
+ if ( ! empty( $args['date_modified'] ) ) {
1049
+ $update_args['date_modified'] = $args['date_modified'];
1050
+ }
1051
 
1052
  // WHERE clauses.
1053
  $where_args = array(
1063
  *
1064
  * @since 5.0.0
1065
  *
1066
+ * @param array $args See BP_Invitation::update().
1067
+ * @return int|bool The number of rows updated, or false on error.
1068
  */
1069
  public static function mark_sent_by_data( $args ) {
1070
 
1071
  // Values to be updated.
1072
  $update_args = array(
1073
+ 'invite_sent' => 'sent',
1074
+ 'date_modified' => bp_core_current_time(),
1075
  );
1076
+ // Respect a specified `date-modified`.
1077
+ if ( ! empty( $args['date_modified'] ) ) {
1078
+ $update_args['date_modified'] = $args['date_modified'];
1079
+ }
1080
 
1081
  return self::update( $update_args, $args );
1082
  }
1088
  *
1089
  * @since 5.0.0
1090
  *
1091
+ * @param int $id The ID of the invitation to mark as sent.
1092
+ * @param array $args {
1093
+ * Optional. Invitation characteristics used
1094
+ * to override certain sending behaviors.
1095
+ *
1096
+ * @type string $date_modified Modified time in 'Y-m-d h:i:s' format, GMT.
1097
+ * Defaults to current time if not specified.
1098
+ * }
1099
+ * @return int|bool The number of rows updated, or false on error.
1100
  */
1101
+ public static function mark_accepted( $id = 0, $args = array() ) {
1102
 
1103
  if ( ! $id ) {
1104
  return false;
1106
 
1107
  // Values to be updated.
1108
  $update_args = array(
1109
+ 'accepted' => 'accepted',
1110
+ 'date_modified' => bp_core_current_time(),
1111
  );
1112
+ // Respect a specified `date-modified`.
1113
+ if ( ! empty( $args['date_modified'] ) ) {
1114
+ $update_args['date_modified'] = $args['date_modified'];
1115
+ }
1116
 
1117
  // WHERE clauses.
1118
  $where_args = array(
1128
  *
1129
  * @since 5.0.0
1130
  *
1131
+ * @param array $args See BP_Invitation::update().
1132
+ * @return int|bool The number of rows updated, or false on error.
1133
  */
1134
  public static function mark_accepted_by_data( $args ) {
1135
 
1136
  // Values to be updated.
1137
  $update_args = array(
1138
+ 'accepted' => 'accepted',
1139
+ 'date_modified' => bp_core_current_time(),
1140
  );
1141
+ // Respect a specified `date-modified`.
1142
+ if ( ! empty( $args['date_modified'] ) ) {
1143
+ $update_args['date_modified'] = $args['date_modified'];
1144
+ }
1145
 
1146
  return self::update( $update_args, $args );
1147
  }
bp-core/classes/class-bp-optout.php ADDED
@@ -0,0 +1,828 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * BuddyPress Nonmember Opt-out Class
4
+ *
5
+ * @package BuddyPress
6
+ * @subpackage Nonmember Opt-outs
7
+ *
8
+ * @since 8.0.0
9
+ */
10
+
11
+ // Exit if accessed directly.
12
+ defined( 'ABSPATH' ) || exit;
13
+
14
+ /**
15
+ * BuddyPress opt-outs.
16
+ *
17
+ * Use this class to create, access, edit, or delete BuddyPress Nonmember Opt-outs.
18
+ *
19
+ * @since 8.0.0
20
+ */
21
+ class BP_Optout {
22
+
23
+ /**
24
+ * The opt-out ID.
25
+ *
26
+ * @since 8.0.0
27
+ * @access public
28
+ * @var int
29
+ */
30
+ public $id;
31
+
32
+ /**
33
+ * The hashed email address of the user that wishes to opt out of
34
+ * communications from this site.
35
+ *
36
+ * @since 8.0.0
37
+ * @access public
38
+ * @var string
39
+ */
40
+ public $email_address;
41
+
42
+ /**
43
+ * The ID of the user that generated the contact that resulted in the opt-out.
44
+ *
45
+ * @since 8.0.0
46
+ * @access public
47
+ * @var int
48
+ */
49
+ public $user_id;
50
+
51
+ /**
52
+ * The type of email contact that resulted in the opt-out.
53
+ * This should be one of the known BP_Email types.
54
+ *
55
+ * @since 8.0.0
56
+ * @access public
57
+ * @var string
58
+ */
59
+ public $email_type;
60
+
61
+ /**
62
+ * The date the opt-out was last modified.
63
+ *
64
+ * @since 8.0.0
65
+ * @access public
66
+ * @var string
67
+ */
68
+ public $date_modified;
69
+
70
+ /** Public Methods ****************************************************/
71
+
72
+ /**
73
+ * Constructor method.
74
+ *
75
+ * @since 8.0.0
76
+ *
77
+ * @param int $id Optional. Provide an ID to access an existing
78
+ * optout item.
79
+ */
80
+ public function __construct( $id = 0 ) {
81
+ if ( ! empty( $id ) ) {
82
+ $this->id = (int) $id;
83
+ $this->populate();
84
+ }
85
+ }
86
+
87
+ /**
88
+ * Get the opt-outs table name.
89
+ *
90
+ * @since 8.0.0
91
+ * @access public
92
+ * @return string
93
+ */
94
+ public static function get_table_name() {
95
+ return buddypress()->members->table_name_optouts;
96
+ }
97
+
98
+ /**
99
+ * Update or insert opt-out details into the database.
100
+ *
101
+ * @since 8.0.0
102
+ *
103
+ * @global wpdb $wpdb WordPress database object.
104
+ *
105
+ * @return bool True on success, false on failure.
106
+ */
107
+ public function save() {
108
+
109
+ // Return value
110
+ $retval = false;
111
+
112
+ // Default data and format
113
+ $data = array(
114
+ 'email_address_hash' => $this->email_address,
115
+ 'user_id' => $this->user_id,
116
+ 'email_type' => sanitize_key( $this->email_type ),
117
+ 'date_modified' => $this->date_modified,
118
+ );
119
+ $data_format = array( '%s', '%d', '%s', '%s' );
120
+
121
+ /**
122
+ * Fires before an opt-out is saved.
123
+ *
124
+ * @since 8.0.0
125
+ *
126
+ * @param BP_Optout object $this Characteristics of the opt-out to be saved.
127
+ */
128
+ do_action_ref_array( 'bp_optout_before_save', array( &$this ) );
129
+
130
+ // Update.
131
+ if ( ! empty( $this->id ) ) {
132
+ $result = self::_update( $data, array( 'ID' => $this->id ), $data_format, array( '%d' ) );
133
+ // Insert.
134
+ } else {
135
+ $result = self::_insert( $data, $data_format );
136
+ }
137
+
138
+ // Set the opt-out ID if successful.
139
+ if ( ! empty( $result ) && ! is_wp_error( $result ) ) {
140
+ global $wpdb;
141
+
142
+ $this->id = $wpdb->insert_id;
143
+ $retval = $wpdb->insert_id;
144
+ }
145
+
146
+ wp_cache_delete( $this->id, 'bp_optouts' );
147
+
148
+ /**
149
+ * Fires after an optout is saved.
150
+ *
151
+ * @since 8.0.0
152
+ *
153
+ * @param BP_optout object $this Characteristics of the opt-out just saved.
154
+ */
155
+ do_action_ref_array( 'bp_optout_after_save', array( &$this ) );
156
+
157
+ // Return the result.
158
+ return $retval;
159
+ }
160
+
161
+ /**
162
+ * Fetch data for an existing opt-out from the database.
163
+ *
164
+ * @since 8.0.0
165
+ *
166
+ * @global BuddyPress $bp The one true BuddyPress instance.
167
+ * @global wpdb $wpdb WordPress database object.
168
+ */
169
+ public function populate() {
170
+ global $wpdb;
171
+ $optouts_table_name = $this->get_table_name();
172
+
173
+ // Check cache for optout data.
174
+ $optout = wp_cache_get( $this->id, 'bp_optouts' );
175
+
176
+ // Cache missed, so query the DB.
177
+ if ( false === $optout ) {
178
+ $optout = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$optouts_table_name} WHERE id = %d", $this->id ) );
179
+ wp_cache_set( $this->id, $optout, 'bp_optouts' );
180
+ }
181
+
182
+ // No optout found so set the ID and bail.
183
+ if ( empty( $optout ) || is_wp_error( $optout ) ) {
184
+ $this->id = 0;
185
+ return;
186
+ }
187
+
188
+ $this->email_address = $optout->email_address_hash;
189
+ $this->user_id = (int) $optout->user_id;
190
+ $this->email_type = sanitize_key( $optout->email_type );
191
+ $this->date_modified = $optout->date_modified;
192
+
193
+ }
194
+
195
+ /** Protected Static Methods ******************************************/
196
+
197
+ /**
198
+ * Create an opt-out entry.
199
+ *
200
+ * @since 8.0.0
201
+ *
202
+ * @param array $data {
203
+ * Array of optout data, passed to {@link wpdb::insert()}.
204
+ * @type string $email_address The hashed email address of the user that wishes to opt out of
205
+ * communications from this site.
206
+ * @type int $user_id The ID of the user that generated the contact that resulted in the opt-out.
207
+ * @type string $email_type The type of email contact that resulted in the opt-out.
208
+ * @type string $date_modified Date the opt-out was last modified.
209
+ * }
210
+ * @param array $data_format See {@link wpdb::insert()}.
211
+ * @return int|false The number of rows inserted, or false on error.
212
+ */
213
+ protected static function _insert( $data = array(), $data_format = array() ) {
214
+ global $wpdb;
215
+ // We must lowercase and hash the email address at insert.
216
+ $email = strtolower( $data['email_address_hash'] );
217
+ $data['email_address_hash'] = wp_hash( $email );
218
+ return $wpdb->insert( BP_Optout::get_table_name(), $data, $data_format );
219
+ }
220
+
221
+ /**
222
+ * Update opt-outs.
223
+ *
224
+ * @since 8.0.0
225
+ *
226
+ * @see wpdb::update() for further description of paramater formats.
227
+ *
228
+ * @param array $data Array of opt-out data to update, passed to
229
+ * {@link wpdb::update()}. Accepts any property of a
230
+ * BP_optout object.
231
+ * @param array $where The WHERE params as passed to wpdb::update().
232
+ * Typically consists of array( 'ID' => $id ) to specify the ID
233
+ * of the item being updated. See {@link wpdb::update()}.
234
+ * @param array $data_format See {@link wpdb::insert()}.
235
+ * @param array $where_format See {@link wpdb::insert()}.
236
+ * @return int|false The number of rows updated, or false on error.
237
+ */
238
+ protected static function _update( $data = array(), $where = array(), $data_format = array(), $where_format = array() ) {
239
+ global $wpdb;
240
+
241
+ // Ensure that a passed email address is lowercased and hashed.
242
+ if ( ! empty( $data['email_address_hash'] ) && is_email( $data['email_address_hash'] ) ) {
243
+ $email = strtolower( $data['email_address_hash'] );
244
+ $data['email_address_hash'] = wp_hash( $email );
245
+ }
246
+
247
+ return $wpdb->update( BP_Optout::get_table_name(), $data, $where, $data_format, $where_format );
248
+ }
249
+
250
+ /**
251
+ * Delete opt-outs.
252
+ *
253
+ * @since 8.0.0
254
+ *
255
+ * @see wpdb::update() for further description of paramater formats.
256
+ *
257
+ * @param array $where Array of WHERE clauses to filter by, passed to
258
+ * {@link wpdb::delete()}. Accepts any property of a
259
+ * BP_optout object.
260
+ * @param array $where_format See {@link wpdb::insert()}.
261
+ * @return int|false The number of rows updated, or false on error.
262
+ */
263
+ protected static function _delete( $where = array(), $where_format = array() ) {
264
+ global $wpdb;
265
+ return $wpdb->delete( BP_Optout::get_table_name(), $where, $where_format );
266
+ }
267
+
268
+ /**
269
+ * Assemble the WHERE clause of a get() SQL statement.
270
+ *
271
+ * Used by BP_optout::get() to create its WHERE
272
+ * clause.
273
+ *
274
+ * @since 8.0.0
275
+ *
276
+ * @param array $args See {@link BP_optout::get()} for more details.
277
+ * @return string WHERE clause.
278
+ */
279
+ protected static function get_where_sql( $args = array() ) {
280
+ global $wpdb;
281
+
282
+ $where_conditions = array();
283
+ $where = '';
284
+
285
+ // id.
286
+ if ( false !== $args['id'] ) {
287
+ $id_in = implode( ',', wp_parse_id_list( $args['id'] ) );
288
+ $where_conditions['id'] = "id IN ({$id_in})";
289
+ }
290
+
291
+ // email_address.
292
+ if ( ! empty( $args['email_address'] ) ) {
293
+ if ( ! is_array( $args['email_address'] ) ) {
294
+ $emails = explode( ',', $args['email_address'] );
295
+ } else {
296
+ $emails = $args['email_address'];
297
+ }
298
+
299
+ $email_clean = array();
300
+ foreach ( $emails as $email ) {
301
+ $email = strtolower( $email );
302
+ $email_hash = wp_hash( $email );
303
+ $email_clean[] = $wpdb->prepare( '%s', $email_hash );
304
+ }
305
+
306
+ $email_in = implode( ',', $email_clean );
307
+ $where_conditions['email_address'] = "email_address_hash IN ({$email_in})";
308
+ }
309
+
310
+ // user_id.
311
+ if ( ! empty( $args['user_id'] ) ) {
312
+ $user_id_in = implode( ',', wp_parse_id_list( $args['user_id'] ) );
313
+ $where_conditions['user_id'] = "user_id IN ({$user_id_in})";
314
+ }
315
+
316
+ // email_type.
317
+ if ( ! empty( $args['email_type'] ) ) {
318
+ if ( ! is_array( $args['email_type'] ) ) {
319
+ $email_types = explode( ',', $args['email_type'] );
320
+ } else {
321
+ $email_types = $args['email_type'];
322
+ }
323
+
324
+ $et_clean = array();
325
+ foreach ( $email_types as $et ) {
326
+ $et_clean[] = $wpdb->prepare( '%s', sanitize_key( $et ) );
327
+ }
328
+
329
+ $et_in = implode( ',', $et_clean );
330
+ $where_conditions['email_type'] = "email_type IN ({$et_in})";
331
+ }
332
+
333
+ // search_terms.
334
+ if ( ! empty( $args['search_terms'] ) ) {
335
+ // Matching email_address is an exact match because of the hashing.
336
+ $args['search_terms'] = strtolower( $args['search_terms'] );
337
+ $search_terms_like = wp_hash( $args['search_terms'] );
338
+ $where_conditions['search_terms'] = $wpdb->prepare( '( email_address_hash LIKE %s )', $search_terms_like );
339
+ }
340
+
341
+ // Custom WHERE.
342
+ if ( ! empty( $where_conditions ) ) {
343
+ $where = 'WHERE ' . implode( ' AND ', $where_conditions );
344
+ }
345
+
346
+ return $where;
347
+ }
348
+
349
+ /**
350
+ * Assemble the ORDER BY clause of a get() SQL statement.
351
+ *
352
+ * Used by BP_Optout::get() to create its ORDER BY
353
+ * clause.
354
+ *
355
+ * @since 8.0.0
356
+ *
357
+ * @param array $args See {@link BP_optout::get()} for more details.
358
+ * @return string ORDER BY clause.
359
+ */
360
+ protected static function get_order_by_sql( $args = array() ) {
361
+
362
+ $conditions = array();
363
+ $retval = '';
364
+
365
+ // Order by.
366
+ if ( ! empty( $args['order_by'] ) ) {
367
+ $order_by_clean = array();
368
+ $columns = array( 'id', 'email_address_hash', 'user_id', 'email_type', 'date_modified' );
369
+ foreach ( (array) $args['order_by'] as $key => $value ) {
370
+ if ( in_array( $value, $columns, true ) ) {
371
+ $order_by_clean[] = $value;
372
+ }
373
+ }
374
+ if ( ! empty( $order_by_clean ) ) {
375
+ $order_by = implode( ', ', $order_by_clean );
376
+ $conditions['order_by'] = "{$order_by}";
377
+ }
378
+ }
379
+
380
+ // Sort order direction.
381
+ if ( ! empty( $args['sort_order'] ) ) {
382
+ $sort_order = bp_esc_sql_order( $args['sort_order'] );
383
+ $conditions['sort_order'] = "{$sort_order}";
384
+ }
385
+
386
+ // Custom ORDER BY.
387
+ if ( ! empty( $conditions['order_by'] ) ) {
388
+ $retval = 'ORDER BY ' . implode( ' ', $conditions );
389
+ }
390
+
391
+ return $retval;
392
+ }
393
+
394
+ /**
395
+ * Assemble the LIMIT clause of a get() SQL statement.
396
+ *
397
+ * Used by BP_Optout::get() to create its LIMIT clause.
398
+ *
399
+ * @since 8.0.0
400
+ *
401
+ * @param array $args See {@link BP_optout::get()} for more details.
402
+ * @return string LIMIT clause.
403
+ */
404
+ protected static function get_paged_sql( $args = array() ) {
405
+ global $wpdb;
406
+
407
+ // Setup local variable.
408
+ $retval = '';
409
+
410
+ // Custom LIMIT.
411
+ if ( ! empty( $args['page'] ) && ! empty( $args['per_page'] ) ) {
412
+ $page = absint( $args['page'] );
413
+ $per_page = absint( $args['per_page'] );
414
+ $offset = $per_page * ( $page - 1 );
415
+ $retval = $wpdb->prepare( "LIMIT %d, %d", $offset, $per_page );
416
+ }
417
+
418
+ return $retval;
419
+ }
420
+
421
+ /**
422
+ * Assemble query clauses, based on arguments, to pass to $wpdb methods.
423
+ *
424
+ * The insert(), update(), and delete() methods of {@link wpdb} expect
425
+ * arguments of the following forms:
426
+ *
427
+ * - associative arrays whose key/value pairs are column => value, to
428
+ * be used in WHERE, SET, or VALUES clauses
429
+ * - arrays of "formats", which tell $wpdb->prepare() which type of
430
+ * value to expect when sanitizing (eg, array( '%s', '%d' ))
431
+ *
432
+ * This utility method can be used to assemble both kinds of params,
433
+ * out of a single set of associative array arguments, such as:
434
+ *
435
+ * $args = array(
436
+ * 'user_id' => 4,
437
+ * 'email_type' => 'type_string',
438
+ * );
439
+ *
440
+ * This will be converted to:
441
+ *
442
+ * array(
443
+ * 'data' => array(
444
+ * 'user_id' => 4,
445
+ * 'email_type' => 'type_string',
446
+ * ),
447
+ * 'format' => array(
448
+ * '%d',
449
+ * '%s',
450
+ * ),
451
+ * )
452
+ *
453
+ * which can easily be passed as arguments to the $wpdb methods.
454
+ *
455
+ * @since 8.0.0
456
+ *
457
+ * @param array $args Associative array of filter arguments.
458
+ * See {@BP_optout::get()} for a breakdown.
459
+ * @return array Associative array of 'data' and 'format' args.
460
+ */
461
+ protected static function get_query_clauses( $args = array() ) {
462
+ $where_clauses = array(
463
+ 'data' => array(),
464
+ 'format' => array(),
465
+ );
466
+
467
+ // id.
468
+ if ( ! empty( $args['id'] ) ) {
469
+ $where_clauses['data']['id'] = absint( $args['id'] );
470
+ $where_clauses['format'][] = '%d';
471
+ }
472
+
473
+ // email_address.
474
+ if ( ! empty( $args['email_address'] ) ) {
475
+ $where_clauses['data']['email_address_hash'] = $args['email_address'];
476
+ $where_clauses['format'][] = '%s';
477
+ }
478
+
479
+ // user_id.
480
+ if ( ! empty( $args['user_id'] ) ) {
481
+ $where_clauses['data']['user_id'] = absint( $args['user_id'] );
482
+ $where_clauses['format'][] = '%d';
483
+ }
484
+
485
+ // email_type.
486
+ if ( ! empty( $args['email_type'] ) ) {
487
+ $where_clauses['data']['email_type'] = $args['email_type'];
488
+ $where_clauses['format'][] = '%s';
489
+ }
490
+
491
+ return $where_clauses;
492
+ }
493
+
494
+ /** Public Static Methods *********************************************/
495
+
496
+ /**
497
+ * Get opt-outs, based on provided filter parameters.
498
+ *
499
+ * @since 8.0.0
500
+ *
501
+ * @param array $args {
502
+ * Associative array of arguments. All arguments but $page and
503
+ * $per_page can be treated as filter values for get_where_sql()
504
+ * and get_query_clauses(). All items are optional.
505
+ * @type int|array $id ID of opt-out.
506
+ * Can be an array of IDs.
507
+ * @type string|array $email_address Email address of users who have opted out
508
+ * being queried. Can be an array of addresses.
509
+ * @type int|array $user_id ID of user whose communication prompted the
510
+ * opt-out. Can be an array of IDs.
511
+ * @type string|array $email_type Name of the emil type to filter by.
512
+ * Can be an array of email types.
513
+ * @type string $search_terms Term to match against email_address field.
514
+ * @type string $order_by Database column to order by.
515
+ * @type string $sort_order Either 'ASC' or 'DESC'.
516
+ * @type int $page Number of the current page of results.
517
+ * Default: false (no pagination,
518
+ * all items).
519
+ * @type int $per_page Number of items to show per page.
520
+ * Default: false (no pagination,
521
+ * all items).
522
+ * @type string $fields Which fields to return. Specify 'email_addresses' to
523
+ * fetch a list of opt-out email_addresses.
524
+ * Specify 'user_ids' to
525
+ * fetch a list of opt-out user_ids.
526
+ * Specify 'ids' to fetch a list of opt-out IDs.
527
+ * Default: 'all' (return BP_Optout objects).
528
+ * }
529
+ *
530
+ * @return array BP_Optout objects | IDs of found opt-outs | Email addresses of matches.
531
+ */
532
+ public static function get( $args = array() ) {
533
+ global $wpdb;
534
+ $optouts_table_name = BP_Optout::get_table_name();
535
+
536
+ // Parse the arguments.
537
+ $r = bp_parse_args(
538
+ $args,
539
+ array(
540
+ 'id' => false,
541
+ 'email_address' => false,
542
+ 'user_id' => false,
543
+ 'email_type' => false,
544
+ 'search_terms' => '',
545
+ 'order_by' => false,
546
+ 'sort_order' => false,
547
+ 'page' => false,
548
+ 'per_page' => false,
549
+ 'fields' => 'all',
550
+ ),
551
+ 'bp_optout_get'
552
+ );
553
+
554
+ $sql = array(
555
+ 'select' => "SELECT",
556
+ 'fields' => '',
557
+ 'from' => "FROM {$optouts_table_name} o",
558
+ 'where' => '',
559
+ 'orderby' => '',
560
+ 'pagination' => '',
561
+ );
562
+
563
+ if ( 'user_ids' === $r['fields'] ) {
564
+ $sql['fields'] = "DISTINCT o.user_id";
565
+ } else if ( 'email_addresses' === $r['fields'] ) {
566
+ $sql['fields'] = "DISTINCT o.email_address_hash";
567
+ } else {
568
+ $sql['fields'] = 'DISTINCT o.id';
569
+ }
570
+
571
+ // WHERE.
572
+ $sql['where'] = self::get_where_sql(
573
+ array(
574
+ 'id' => $r['id'],
575
+ 'email_address' => $r['email_address'],
576
+ 'user_id' => $r['user_id'],
577
+ 'email_type' => $r['email_type'],
578
+ 'search_terms' => $r['search_terms'],
579
+ )
580
+ );
581
+
582
+ // ORDER BY.
583
+ $sql['orderby'] = self::get_order_by_sql(
584
+ array(
585
+ 'order_by' => $r['order_by'],
586
+ 'sort_order' => $r['sort_order']
587
+ )
588
+ );
589
+
590
+ // LIMIT %d, %d.
591
+ $sql['pagination'] = self::get_paged_sql(
592
+ array(
593
+ 'page' => $r['page'],
594
+ 'per_page' => $r['per_page'],
595
+ )
596
+ );
597
+
598
+ $paged_optouts_sql = "{$sql['select']} {$sql['fields']} {$sql['from']} {$sql['where']} {$sql['orderby']} {$sql['pagination']}";
599
+
600
+ /**
601
+ * Filters the pagination SQL statement.
602
+ *
603
+ * @since 8.0.0
604
+ *
605
+ * @param string $value Concatenated SQL statement.
606
+ * @param array $sql Array of SQL parts before concatenation.
607
+ * @param array $r Array of parsed arguments for the get method.
608
+ */
609
+ $paged_optouts_sql = apply_filters( 'bp_optouts_get_paged_optouts_sql', $paged_optouts_sql, $sql, $r );
610
+
611
+ $cached = bp_core_get_incremented_cache( $paged_optouts_sql, 'bp_optouts' );
612
+ if ( false === $cached ) {
613
+ $paged_optout_ids = $wpdb->get_col( $paged_optouts_sql );
614
+ bp_core_set_incremented_cache( $paged_optouts_sql, 'bp_optouts', $paged_optout_ids );
615
+ } else {
616
+ $paged_optout_ids = $cached;
617
+ }
618
+
619
+ // Special return format cases.
620
+ if ( in_array( $r['fields'], array( 'ids', 'user_ids' ), true ) ) {
621
+ // We only want the field that was found.
622
+ return array_map( 'intval', $paged_optout_ids );
623
+ } else if ( 'email_addresses' === $r['fields'] ) {
624
+ return $paged_optout_ids;
625
+ }
626
+
627
+ $uncached_ids = bp_get_non_cached_ids( $paged_optout_ids, 'bp_optouts' );
628
+ if ( $uncached_ids ) {
629
+ $ids_sql = implode( ',', array_map( 'intval', $uncached_ids ) );
630
+ $data_objects = $wpdb->get_results( "SELECT o.* FROM {$optouts_table_name} o WHERE o.id IN ({$ids_sql})" );
631
+ foreach ( $data_objects as $data_object ) {
632
+ wp_cache_set( $data_object->id, $data_object, 'bp_optouts' );
633
+ }
634
+ }
635
+
636
+ $paged_optouts = array();
637
+ foreach ( $paged_optout_ids as $paged_optout_id ) {
638
+ $paged_optouts[] = new BP_optout( $paged_optout_id );
639
+ }
640
+
641
+ return $paged_optouts;
642
+ }
643
+
644
+ /**
645
+ * Get a count of total optouts matching a set of arguments.
646
+ *
647
+ * @since 8.0.0
648
+ *
649
+ * @see BP_optout::get() for a description of
650
+ * arguments.
651
+ *
652
+ * @param array $args See {@link BP_optout::get()}.
653
+ * @return int Count of located items.
654
+ */
655
+ public static function get_total_count( $args ) {
656
+ global $wpdb;
657
+ $optouts_table_name = BP_Optout::get_table_name();
658
+
659
+ // Parse the arguments.
660
+ $r = bp_parse_args(
661
+ $args,
662
+ array(
663
+ 'id' => false,
664
+ 'email_address' => false,
665
+ 'user_id' => false,
666
+ 'email_type' => false,
667
+ 'search_terms' => '',
668
+ 'order_by' => false,
669
+ 'sort_order' => false,
670
+ 'page' => false,
671
+ 'per_page' => false,
672
+ 'fields' => 'all',
673
+ ),
674
+ 'bp_optout_get_total_count'
675
+ );
676
+
677
+ // Build the query
678
+ $select_sql = "SELECT COUNT(*)";
679
+ $from_sql = "FROM {$optouts_table_name}";
680
+ $where_sql = self::get_where_sql( $r );
681
+ $sql = "{$select_sql} {$from_sql} {$where_sql}";
682
+
683
+ // Return the queried results
684
+ return $wpdb->get_var( $sql );
685
+ }
686
+
687
+ /**
688
+ * Update optouts.
689
+ *
690
+ * @since 8.0.0
691
+ *
692
+ * @see BP_optout::get() for a description of
693
+ * accepted update/where arguments.
694
+ *
695
+ * @param array $update_args Associative array of fields to update,
696
+ * and the values to update them to. Of the format
697
+ * array( 'user_id' => 4, 'email_address' => 'bar@foo.com', ).
698
+ * @param array $where_args Associative array of columns/values, to
699
+ * determine which rows should be updated. Of the format
700
+ * array( 'user_id' => 7, 'email_address' => 'bar@foo.com', ).
701
+ * @return int|bool Number of rows updated on success, false on failure.
702
+ */
703
+ public static function update( $update_args = array(), $where_args = array() ) {
704
+ $update = self::get_query_clauses( $update_args );
705
+ $where = self::get_query_clauses( $where_args );
706
+
707
+ /**
708
+ * Fires before an opt-out is updated.
709
+ *
710
+ * @since 8.0.0
711
+ *
712
+ * @param array $where_args Associative array of columns/values describing
713
+ * opt-outs about to be deleted.
714
+ * @param array $update_args Array of new values.
715
+ */
716
+ do_action( 'bp_optout_before_update', $where_args, $update_args );
717
+
718
+ $retval = self::_update( $update['data'], $where['data'], $update['format'], $where['format'] );
719
+
720
+ // Clear matching items from the cache.
721
+ $cache_args = $where_args;
722
+ $cache_args['fields'] = 'ids';
723
+ $maybe_cached_ids = self::get( $cache_args );
724
+ foreach ( $maybe_cached_ids as $invite_id ) {
725
+ wp_cache_delete( $invite_id, 'bp_optouts' );
726
+ }
727
+
728
+ /**
729
+ * Fires after an opt-out is updated.
730
+ *
731
+ * @since 8.0.0
732
+ *
733
+ * @param array $where_args Associative array of columns/values describing
734
+ * opt-outs about to be deleted.
735
+ * @param array $update_args Array of new values.
736
+ */
737
+ do_action( 'bp_optout_after_update', $where_args, $update_args );
738
+
739
+ return $retval;
740
+ }
741
+
742
+ /**
743
+ * Delete opt-outs.
744
+ *
745
+ * @since 8.0.0
746
+ *
747
+ * @see BP_optout::get() for a description of
748
+ * accepted where arguments.
749
+ *
750
+ * @param array $args Associative array of columns/values, to determine
751
+ * which rows should be deleted. Of the format
752
+ * array( 'user_id' => 7, 'email_address' => 'bar@foo.com', ).
753
+ * @return int|bool Number of rows deleted on success, false on failure.
754
+ */
755
+ public static function delete( $args = array() ) {
756
+ $where = self::get_query_clauses( $args );
757
+
758
+ /**
759
+ * Fires before an opt-out is deleted.
760
+ *
761
+ * @since 8.0.0
762
+ *
763
+ * @param array $args Characteristics of the opt-outs to be deleted.
764
+ */
765
+ do_action( 'bp_optout_before_delete', $args );
766
+
767
+ // Clear matching items from the cache.
768
+ $cache_args = $args;
769
+ $cache_args['fields'] = 'ids';
770
+ $maybe_cached_ids = self::get( $cache_args );
771
+ foreach ( $maybe_cached_ids as $invite_id ) {
772
+ wp_cache_delete( $invite_id, 'bp_optouts' );
773
+ }
774
+
775
+ $retval = self::_delete( $where['data'], $where['format'] );
776
+
777
+ /**
778
+ * Fires after an opt-out is deleted.
779
+ *
780
+ * @since 8.0.0
781
+ *
782
+ * @param array $args Characteristics of the opt-outs just deleted.
783
+ */
784
+ do_action( 'bp_optout_after_delete', $args );
785
+
786
+ return $retval;
787
+ }
788
+
789
+ /** Convenience methods ***********************************************/
790
+
791
+ /**
792
+ * Check whether an invitation exists matching the passed arguments.
793
+ *
794
+ * @since 5.0.0
795
+ *
796
+ * @see BP_Optout::get() for a description of accepted parameters.
797
+ *
798
+ * @return int|bool ID of first found invitation or false if none found.
799
+ */
800
+ public function optout_exists( $args = array() ) {
801
+ $exists = false;
802
+
803
+ $args['fields'] = 'ids';
804
+ $optouts = BP_Optout::get( $args );
805
+ if ( $optouts ) {
806
+ $exists = current( $optouts );
807
+ }
808
+
809
+ return $exists;
810
+ }
811
+
812
+ /**
813
+ * Delete a single opt-out by ID.
814
+ *
815
+ * @since 8.0.0
816
+ *
817
+ * @see BP_optout::delete() for explanation of
818
+ * return value.
819
+ *
820
+ * @param int $id ID of the opt-out item to be deleted.
821
+ * @return bool True on success, false on failure.
822
+ */
823
+ public static function delete_by_id( $id ) {
824
+ return self::delete( array(
825
+ 'id' => $id,
826
+ ) );
827
+ }
828
+ }
bp-core/classes/class-bp-optouts-list-table.php ADDED
@@ -0,0 +1,393 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * BuddyPress Opt-outs List Table class.
4
+ *
5
+ * @package BuddyPress
6
+ * @subpackage CoreAdminClasses
7
+ * @since 8.0.0
8
+ */
9
+
10
+ // Exit if accessed directly.
11
+ defined( 'ABSPATH' ) || exit;
12
+
13
+ /**
14
+ * List table class for nonmember opt-outs admin page.
15
+ *
16
+ * @since 8.0.0
17
+ */
18
+ class BP_Optouts_List_Table extends WP_Users_List_Table {
19
+
20
+ /**
21
+ * Opt-out count.
22
+ *
23
+ * @since 8.0.0
24
+ *
25
+ * @var int
26
+ */
27
+ public $total_items = 0;
28
+
29
+ /**
30
+ * Constructor.
31
+ *
32
+ * @since 8.0.0
33
+ */
34
+ public function __construct() {
35
+ // Define singular and plural labels, as well as whether we support AJAX.
36
+ parent::__construct(
37
+ array(
38
+ 'ajax' => false,
39
+ 'plural' => 'optouts',
40
+ 'singular' => 'optout',
41
+ 'screen' => get_current_screen()->id,
42
+ )
43
+ );
44
+ }
45
+
46
+ /**
47
+ * Set up items for display in the list table.
48
+ *
49
+ * Handles filtering of data, sorting, pagination, and any other data
50
+ * manipulation required prior to rendering.
51
+ *
52
+ * @since 8.0.0
53
+ */
54
+ public function prepare_items() {
55
+ global $usersearch;
56
+
57
+ $search = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
58
+ $per_page = $this->get_items_per_page( str_replace( '-', '_', "{$this->screen->id}_per_page" ) );
59
+ $paged = $this->get_pagenum();
60
+
61
+ $args = array(
62
+ 'search_terms' => $search,
63
+ 'order_by' => 'date_modified',
64
+ 'sort_order' => 'DESC',
65
+ 'page' => $paged,
66
+ 'per_page' => $per_page,
67
+ );
68
+
69
+ if ( isset( $_REQUEST['orderby'] ) ) {
70
+ $args['order_by'] = $_REQUEST['orderby'];
71
+ }
72
+
73
+ if ( isset( $_REQUEST['order'] ) ) {
74
+ $args['sort_order'] = $_REQUEST['order'];
75
+ }
76
+
77
+ $this->items = bp_get_optouts( $args );
78
+ $optouts_class = new BP_Optout();
79
+ $this->total_items = $optouts_class->get_total_count( $args );
80
+
81
+ $this->set_pagination_args(
82
+ array(
83
+ 'total_items' => $this->total_items,
84
+ 'per_page' => $per_page,
85
+ )
86
+ );
87
+ }
88
+
89
+ /**
90
+ * Get the list of views available on this table.
91
+ *
92
+ * @since 8.0.0
93
+ */
94
+ public function views() {
95
+ if ( is_multisite() && bp_core_do_network_admin() ) {
96
+ $tools_parent = 'admin.php';
97
+ } else {
98
+ $tools_parent = 'tools.php';
99
+ }
100
+
101
+ $url_base = add_query_arg(
102
+ array(
103
+ 'page' => 'bp-optouts',
104
+ ),
105
+ bp_get_admin_url( $tools_parent )
106
+ );
107
+ ?>
108
+
109
+ <h2 class="screen-reader-text">
110
+ <?php
111
+ /* translators: accessibility text */
112
+ esc_html_e( 'Filter opt-outs list', 'buddypress' );
113
+ ?>
114
+ </h2>
115
+ <ul class="subsubsub">
116
+ <?php
117
+ /**
118
+ * Fires inside listing of views so plugins can add their own.
119
+ *
120
+ * @since 8.0.0
121
+ *
122
+ * @param string $url_base Current URL base for view.
123
+ * @param array $active_filters Current filters being requested.
124
+ */
125
+ do_action( 'bp_optouts_list_table_get_views', $url_base, $this->active_filters ); ?>
126
+ </ul>
127
+ <?php
128
+ }
129
+
130
+ /**
131
+ * Get rid of the extra nav.
132
+ *
133
+ * WP_Users_List_Table will add an extra nav to change user's role.
134
+ * As we're dealing with opt-outs, we don't need this.
135
+ *
136
+ * @since 8.0.0
137
+ *
138
+ * @param array $which Current table nav item.
139
+ */
140
+ public function extra_tablenav( $which ) {
141
+ return;
142
+ }
143
+
144
+ /**
145
+ * Specific opt-out columns.
146
+ *
147
+ * @since 8.0.0
148
+ *
149
+ * @return array
150
+ */
151
+ public function get_columns() {
152
+ /**
153
+ * Filters the nonmember opt-outs columns.
154
+ *
155
+ * @since 8.0.0
156
+ *
157
+ * @param array $value Array of columns to display.
158
+ */
159
+ return apply_filters(
160
+ 'bp_optouts_list_columns',
161
+ array(
162
+ 'cb' => '<input type="checkbox" />',
163
+ 'email_address' => __( 'Email Address Hash', 'buddypress' ),
164
+ 'username' => __( 'Email Sender', 'buddypress' ),
165
+ 'user_registered' => __( 'Email Sender Registered', 'buddypress' ),
166
+ 'email_type' => __( 'Email Type', 'buddypress' ),
167
+ 'email_type_description' => __( 'Email Description', 'buddypress' ),
168
+ 'optout_date_modified' => __( 'Date Modified', 'buddypress' ),
169
+ )
170
+ );
171
+ }
172
+
173
+ /**
174
+ * Specific bulk actions for opt-outs.
175
+ *
176
+ * @since 8.0.0
177
+ */
178
+ public function get_bulk_actions() {
179
+ if ( current_user_can( 'delete_users' ) ) {
180
+ $actions['delete'] = _x( 'Delete', 'Optout database record action', 'buddypress' );
181
+ }
182
+
183
+ return $actions;
184
+ }
185
+
186
+ /**
187
+ * The text shown when no items are found.
188
+ *
189
+ * Nice job, clean sheet!
190
+ *
191
+ * @since 8.0.0
192
+ */
193
+ public function no_items() {
194
+ esc_html_e( 'No opt-outs found.', 'buddypress' );
195
+ }
196
+
197
+ /**
198
+ * The columns opt-outs can be reordered by.
199
+ *
200
+ * @since 8.0.0
201
+ */
202
+ public function get_sortable_columns() {
203
+ return array(
204
+ 'username' => 'user_id',
205
+ 'email_type' => 'email_type',
206
+ 'optout_date_modified' => 'date_modified',
207
+ );
208
+ }
209
+
210
+ /**
211
+ * Display opt-out rows.
212
+ *
213
+ * @since 8.0.0
214
+ */
215
+ public function display_rows() {
216
+ $style = '';
217
+ foreach ( $this->items as $optout ) {
218
+ $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
219
+ echo "\n\t" . $this->single_row( $optout, $style );
220
+ }
221
+ }
222
+
223
+ /**
224
+ * Display an opt-out row.
225
+ *
226
+ * @since 8.0.0
227
+ *
228
+ * @see WP_List_Table::single_row() for explanation of params.
229
+ *
230
+ * @param BP_Optout $optout BP_Optout object.
231
+ * @param string $style Styles for the row.
232
+ * @param string $role Role to be assigned to user.
233
+ * @param int $numposts Number of posts.
234
+ * @return void
235
+ */
236
+ public function single_row( $optout = null, $style = '', $role = '', $numposts = 0 ) {
237
+ echo '<tr' . $style . ' id="optout-' . intval( $optout->id ) . '">';
238
+ echo $this->single_row_columns( $optout );
239
+ echo '</tr>';
240
+ }
241
+
242
+ /**
243
+ * Markup for the checkbox used to select items for bulk actions.
244
+ *
245
+ * @since 8.0.0
246
+ *
247
+ * @param BP_Optout $optout BP_Optout object.
248
+ */
249
+ public function column_cb( $optout = null ) {
250
+ ?>
251
+ <label class="screen-reader-text" for="optout_<?php echo intval( $optout->id ); ?>">
252
+ <?php
253
+ /* translators: %d: accessibility text. */
254
+ printf( esc_html__( 'Select opt-out request: %d', 'buddypress' ), intval( $optout->id ) );
255
+ ?>
256
+ </label>
257
+ <input type="checkbox" id="optout_<?php echo intval( $optout->id ) ?>" name="optout_ids[]" value="<?php echo esc_attr( $optout->id ) ?>" />
258
+ <?php
259
+ }
260
+
261
+ /**
262
+ * Markup for the checkbox used to select items for bulk actions.
263
+ *
264
+ * @since 8.0.0
265
+ *
266
+ * @param BP_Optout $optout BP_Optout object.
267
+ */
268
+ public function column_email_address( $optout = null ) {
269
+ echo esc_html( $optout->email_address );
270
+
271
+ $actions = array();
272
+
273
+ if ( is_network_admin() ) {
274
+ $form_url = network_admin_url( 'admin.php' );
275
+ } else {
276
+ $form_url = bp_get_admin_url( 'tools.php' );
277
+ }
278
+
279
+ // Delete link.
280
+ $delete_link = add_query_arg(
281
+ array(
282
+ 'page' => 'bp-optouts',
283
+ 'optout_id' => $optout->id,
284
+ 'action' => 'delete',
285
+ ),
286
+ $form_url
287
+ );
288
+ $actions['delete'] = sprintf( '<a href="%1$s" class="delete">%2$s</a>', esc_url( $delete_link ), esc_html__( 'Delete', 'buddypress' ) );
289
+
290
+ /**
291
+ * Filters the row actions for each opt-out in list.
292
+ *
293
+ * @since 8.0.0
294
+ *
295
+ * @param array $actions Array of actions and corresponding links.
296
+ * @param object $optout The BP_Optout.
297
+ */
298
+ $actions = apply_filters( 'bp_optouts_management_row_actions', $actions, $optout );
299
+
300
+ echo $this->row_actions( $actions );
301
+ }
302
+
303
+ /**
304
+ * The inviter/site member who sent the email that prompted the opt-out.
305
+ *
306
+ * @since 8.0.0
307
+ *
308
+ * @param BP_Optout $optout BP_Optout object.
309
+ */
310
+ public function column_username( $optout = null ) {
311
+ $avatar = get_avatar( $optout->user_id, 32 );
312
+ $inviter = get_user_by( 'id', $optout->user_id );
313
+ if ( ! $inviter ) {
314
+ return;
315
+ }
316
+ $user_link = bp_core_get_user_domain( $optout->user_id );
317
+ echo $avatar . sprintf( '<strong><a href="%1$s" class="edit">%2$s</a></strong><br/>', esc_url( $user_link ), esc_html( $inviter->user_login ) );
318
+ }
319
+
320
+ /**
321
+ * Display registration date of user whose communication prompted opt-out.
322
+ *
323
+ * @since 8.0.0
324
+ *
325
+ * @param BP_Optout $optout BP_Optout object.
326
+ */
327
+ public function column_user_registered( $optout = null ) {
328
+ $inviter = get_user_by( 'id', $optout->user_id );
329
+ if ( ! $inviter ) {
330
+ return;
331
+ }
332
+ echo esc_html( mysql2date( 'Y/m/d g:i:s a', $inviter->user_registered ) );
333
+ }
334
+
335
+ /**
336
+ * Display type of email that prompted opt-out.
337
+ *
338
+ * @since 8.0.0
339
+ *
340
+ * @param BP_Optout $optout BP_Optout object.
341
+ */
342
+ public function column_email_type( $optout = null ) {
343
+ echo esc_html( $optout->email_type );
344
+ }
345
+
346
+ /**
347
+ * Display description of bp-email-type that prompted opt-out.
348
+ *
349
+ * @since 8.0.0
350
+ *
351
+ * @param BP_Optout $optout BP_Optout object.
352
+ */
353
+ public function column_email_type_description( $optout = null ) {
354
+ $type_term = get_term_by( 'slug', $optout->email_type, 'bp-email-type' );
355
+ if ( $type_term ) {
356
+ echo esc_html( $type_term->description );
357
+ }
358
+
359
+ }
360
+
361
+ /**
362
+ * Display opt-out date.
363
+ *
364
+ * @since 8.0.0
365
+ *
366
+ * @param BP_Optout $optout BP_Optout object.
367
+ */
368
+ public function column_optout_date_modified( $optout = null ) {
369
+ echo esc_html( mysql2date( 'Y/m/d g:i:s a', $optout->date_modified ) );
370
+ }
371
+
372
+ /**
373
+ * Allow plugins to add custom columns.
374
+ *
375
+ * @since 8.0.0
376
+ *
377
+ * @param BP_Optout $optout BP_Optout object.
378
+ * @param string $column_name The column name.
379
+ * @return string
380
+ */
381
+ function column_default( $optout = null, $column_name = '' ) {
382
+
383
+ /**
384
+ * Filters the single site custom columns for plugins.
385
+ *
386
+ * @since 8.0.0
387
+ *
388
+ * @param string $column_name The column name.
389
+ * @param BP_Optout $optout BP_Optout object.
390
+ */
391
+ return apply_filters( 'bp_optouts_management_custom_column', '', $column_name, $optout );
392
+ }
393
+ }
bp-core/classes/class-bp-rest-components-endpoint.php CHANGED
@@ -428,41 +428,43 @@ class BP_REST_Components_Endpoint extends WP_REST_Controller {
428
  * @return array
429
  */
430
  public function get_item_schema() {
431
- $schema = array(
432
- '$schema' => 'http://json-schema.org/draft-04/schema#',
433
- 'title' => 'bp_components',
434
- 'type' => 'object',
435
- 'properties' => array(
436
- 'name' => array(
437
- 'context' => array( 'view', 'edit' ),
438
- 'description' => __( 'Name of the object.', 'buddypress' ),
439
- 'type' => 'string',
440
- ),
441
- 'status' => array(
442
- 'context' => array( 'view', 'edit' ),
443
- 'description' => __( 'Whether the object is active or inactive.', 'buddypress' ),
444
- 'type' => 'string',
445
- 'enum' => array( 'active', 'inactive' ),
446
- ),
447
- 'title' => array(
448
- 'context' => array( 'view', 'edit' ),
449
- 'description' => __( 'HTML title of the object.', 'buddypress' ),
450
- 'type' => 'string',
451
- ),
452
- 'description' => array(
453
- 'context' => array( 'view', 'edit' ),
454
- 'description' => __( 'HTML description of the object.', 'buddypress' ),
455
- 'type' => 'string',
 
 
456
  ),
457
- ),
458
- );
459
 
460
  /**
461
  * Filters the components schema.
462
  *
463
- * @param string $schema The endpoint schema.
464
  */
465
- return apply_filters( 'bp_rest_components_schema', $this->add_additional_fields_schema( $schema ) );
466
  }
467
 
468
  /**
428
  * @return array
429
  */
430
  public function get_item_schema() {
431
+ if ( is_null( $this->schema ) ) {
432
+ $this->schema = array(
433
+ '$schema' => 'http://json-schema.org/draft-04/schema#',
434
+ 'title' => 'bp_components',
435
+ 'type' => 'object',
436
+ 'properties' => array(
437
+ 'name' => array(
438
+ 'context' => array( 'view', 'edit' ),
439
+ 'description' => __( 'Name of the object.', 'buddypress' ),
440
+ 'type' => 'string',
441
+ ),
442
+ 'status' => array(
443
+ 'context' => array( 'view', 'edit' ),
444
+ 'description' => __( 'Whether the object is active or inactive.', 'buddypress' ),
445
+ 'type' => 'string',
446
+ 'enum' => array( 'active', 'inactive' ),
447
+ ),
448
+ 'title' => array(
449
+ 'context' => array( 'view', 'edit' ),
450
+ 'description' => __( 'HTML title of the object.', 'buddypress' ),
451
+ 'type' => 'string',
452
+ ),
453
+ 'description' => array(
454
+ 'context' => array( 'view', 'edit' ),
455
+ 'description' => __( 'HTML description of the object.', 'buddypress' ),
456
+ 'type' => 'string',
457
+ ),
458
  ),
459
+ );
460
+ }
461
 
462
  /**
463
  * Filters the components schema.
464
  *
465
+ * @param array $schema The endpoint schema.
466
  */
467
+ return apply_filters( 'bp_rest_components_schema', $this->add_additional_fields_schema( $this->schema ) );
468
  }
469
 
470
  /**
bp-core/classes/trait-attachments.php CHANGED
@@ -229,7 +229,7 @@ trait BP_REST_Attachments {
229
 
230
  // Set the arguments for the avatar.
231
  $args = array();
232
- foreach ( [ 'full', 'thumb' ] as $key_type ) {
233
 
234
  // Update path with an url.
235
  $url = str_replace( bp_core_avatar_upload_path(), '', $cropped[ $key_type ] );
229
 
230
  // Set the arguments for the avatar.
231
  $args = array();
232
+ foreach ( array( 'full', 'thumb' ) as $key_type ) {
233
 
234
  // Update path with an url.
235
  $url = str_replace( bp_core_avatar_upload_path(), '', $cropped[ $key_type ] );
bp-core/css/admin-bar-rtl.css CHANGED
@@ -68,3 +68,16 @@
68
  display: block;
69
  }
70
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  display: block;
69
  }
70
  }
71
+
72
+ @media screen and (max-width: 782px) {
73
+
74
+ #wpadminbar li#wp-admin-bar-bp-login,
75
+ #wpadminbar li#wp-admin-bar-bp-register {
76
+ display: block;
77
+ }
78
+
79
+ #wpadminbar li#wp-admin-bar-bp-login a,
80
+ #wpadminbar li#wp-admin-bar-bp-register a {
81
+ padding: 0 8px;
82
+ }
83
+ }
bp-core/css/admin-bar-rtl.min.css CHANGED
@@ -1 +1 @@
1
- #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a img{width:16px;height:16px;display:inline;border:1px solid #999;vertical-align:middle;margin:-2px -5px 0 10px;padding:0;background:#eee;float:none}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{right:0}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{right:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications,#wpadminbar .quicklinks li#wp-admin-bar-my-account a span.count,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a span.count{background:#21759b;color:#fff;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:700;border-radius:10px}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications{background:#ddd;color:#333;margin:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications.alert{background-color:#21759b;color:#fff}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications>a{padding:0 .5em}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}#wpadminbar .wp-admin-bar-arrow-right{display:none}@media screen and (max-width:600px){#wpadminbar .wp-admin-bar-arrow-right{display:block}}
1
+ #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a img{width:16px;height:16px;display:inline;border:1px solid #999;vertical-align:middle;margin:-2px -5px 0 10px;padding:0;background:#eee;float:none}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{right:0}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{right:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications,#wpadminbar .quicklinks li#wp-admin-bar-my-account a span.count,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a span.count{background:#21759b;color:#fff;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:700;border-radius:10px}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications{background:#ddd;color:#333;margin:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications.alert{background-color:#21759b;color:#fff}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications>a{padding:0 .5em}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}#wpadminbar .wp-admin-bar-arrow-right{display:none}@media screen and (max-width:600px){#wpadminbar .wp-admin-bar-arrow-right{display:block}}@media screen and (max-width:782px){#wpadminbar li#wp-admin-bar-bp-login,#wpadminbar li#wp-admin-bar-bp-register{display:block}#wpadminbar li#wp-admin-bar-bp-login a,#wpadminbar li#wp-admin-bar-bp-register a{padding:0 8px}}
bp-core/css/admin-bar.css CHANGED
@@ -68,3 +68,16 @@
68
  display: block;
69
  }
70
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  display: block;
69
  }
70
  }
71
+
72
+ @media screen and (max-width: 782px) {
73
+
74
+ #wpadminbar li#wp-admin-bar-bp-login,
75
+ #wpadminbar li#wp-admin-bar-bp-register {
76
+ display: block;
77
+ }
78
+
79
+ #wpadminbar li#wp-admin-bar-bp-login a,
80
+ #wpadminbar li#wp-admin-bar-bp-register a {
81
+ padding: 0 8px;
82
+ }
83
+ }
bp-core/css/admin-bar.min.css CHANGED
@@ -1 +1 @@
1
- #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a img{width:16px;height:16px;display:inline;border:1px solid #999;vertical-align:middle;margin:-2px 10px 0 -5px;padding:0;background:#eee;float:none}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{left:0}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications,#wpadminbar .quicklinks li#wp-admin-bar-my-account a span.count,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a span.count{background:#21759b;color:#fff;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:700;border-radius:10px}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications{background:#ddd;color:#333;margin:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications.alert{background-color:#21759b;color:#fff}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications>a{padding:0 .5em}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}#wpadminbar .wp-admin-bar-arrow-right{display:none}@media screen and (max-width:600px){#wpadminbar .wp-admin-bar-arrow-right{display:block}}
1
+ #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a img{width:16px;height:16px;display:inline;border:1px solid #999;vertical-align:middle;margin:-2px 10px 0 -5px;padding:0;background:#eee;float:none}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{left:0}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications,#wpadminbar .quicklinks li#wp-admin-bar-my-account a span.count,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a span.count{background:#21759b;color:#fff;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:700;border-radius:10px}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications{background:#ddd;color:#333;margin:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications.alert{background-color:#21759b;color:#fff}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications>a{padding:0 .5em}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}#wpadminbar .wp-admin-bar-arrow-right{display:none}@media screen and (max-width:600px){#wpadminbar .wp-admin-bar-arrow-right{display:block}}@media screen and (max-width:782px){#wpadminbar li#wp-admin-bar-bp-login,#wpadminbar li#wp-admin-bar-bp-register{display:block}#wpadminbar li#wp-admin-bar-bp-login a,#wpadminbar li#wp-admin-bar-bp-register a{padding:0 8px}}
bp-core/css/buddybar-rtl.css DELETED
@@ -1,235 +0,0 @@
1
- body:not(.wp-admin) {
2
- padding-top: 25px !important;
3
- }
4
-
5
- #wp-admin-bar {
6
- position: fixed;
7
- top: 0;
8
- right: 0;
9
- height: 25px;
10
- font-size: 11px;
11
- width: 100%;
12
- z-index: 9999;
13
- }
14
-
15
- #wp-admin-bar .padder {
16
- position: relative;
17
- padding: 0;
18
- width: 100%;
19
- margin: 0 auto;
20
- background: url(../images/60pc_black.png);
21
- height: 25px;
22
- }
23
-
24
- body#bp-default #wp-admin-bar .padder {
25
- max-width: 1250px;
26
- }
27
-
28
- #wp-admin-bar * {
29
- z-index: 999;
30
- }
31
-
32
- #wp-admin-bar div#admin-bar-logo {
33
- position: absolute;
34
- top: 5px;
35
- right: 10px;
36
- }
37
-
38
- #wp-admin-bar a img {
39
- border: none;
40
- }
41
-
42
- #wp-admin-bar li {
43
- list-style: none;
44
- margin: 0;
45
- padding: 0;
46
- line-height: 1;
47
- text-align: right;
48
- }
49
-
50
- #wp-admin-bar li a {
51
- padding: 7px 15px;
52
- color: #eee;
53
- text-decoration: none;
54
- font-size: 11px;
55
- }
56
-
57
- #wp-admin-bar li.alt {
58
- border: none;
59
- }
60
-
61
- #wp-admin-bar li.no-arrow a {
62
- padding-left: 15px;
63
- }
64
-
65
- #wp-admin-bar ul li ul li a span {
66
- display: none;
67
- }
68
-
69
- #wp-admin-bar li:hover,
70
- #wp-admin-bar li.hover {
71
- position: static;
72
- }
73
-
74
- #admin-bar-logo {
75
- float: right;
76
- font-weight: 700;
77
- font-size: 11px;
78
- padding: 5px 8px;
79
- margin: 0;
80
- text-decoration: none;
81
- color: #fff;
82
- }
83
-
84
- body#bp-default #admin-bar-logo {
85
- padding: 2px 8px;
86
- }
87
-
88
- /* all lists */
89
- #wp-admin-bar ul {
90
- margin: 0;
91
- list-style: none;
92
- line-height: 1;
93
- cursor: pointer;
94
- height: auto;
95
- padding: 0;
96
- }
97
-
98
- /* all list items */
99
- #wp-admin-bar ul li {
100
- padding: 0;
101
- float: right;
102
- position: relative;
103
- background: url(../images/admin-menu-arrow.gif) 12% 53% no-repeat;
104
- padding-left: 11px;
105
- }
106
-
107
- #wp-admin-bar ul li.no-arrow {
108
- background: none;
109
- padding-left: 0;
110
- }
111
-
112
- #wp-admin-bar ul li ul li {
113
- background-image: none;
114
- }
115
-
116
- #wp-admin-bar ul li.align-right {
117
- position: absolute;
118
- left: 0;
119
- }
120
-
121
- #wp-admin-bar ul li a {
122
- display: block;
123
- }
124
-
125
- #wp-admin-bar ul.main-nav li:hover,
126
- #wp-admin-bar ul.main-nav li.sfhover,
127
- #wp-admin-bar ul.main-nav li ul li.sfhover {
128
- background-color: #333;
129
- }
130
-
131
- /* second-level lists */
132
- #wp-admin-bar ul li ul {
133
- position: absolute;
134
- width: 185px;
135
- right: -999em;
136
- margin-right: 0;
137
- background: #333;
138
- border: 1px solid #222;
139
- -moz-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
140
- -webkit-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
141
- -moz-border-radius: 3px;
142
- -webkit-border-radius: 3px;
143
- -moz-border-radius-topright: 0;
144
- -webkit-border-top-right-radius: 0;
145
- -moz-border-radius-topleft: 0;
146
- -webkit-border-top-left-radius: 0;
147
- }
148
-
149
- #wp-admin-bar ul li > ul {
150
- border-top: none;
151
- }
152
-
153
- #wp-admin-bar ul li ul a {
154
- color: #eee;
155
- }
156
-
157
- #wp-admin-bar ul li ul li {
158
- float: right;
159
- width: 174px;
160
- margin: 0;
161
- }
162
-
163
- #wp-admin-bar ul li ul li:hover a {
164
- color: #fff;
165
- }
166
-
167
- #wp-admin-bar ul li div.admin-bar-clear {
168
- clear: both;
169
- }
170
-
171
- #wp-admin-bar ul.main-nav li ul li:hover,
172
- #wp-admin-bar ul.main-nav li ul li.sfhover,
173
- #wp-admin-bar ul.main-nav li ul li.sfhover {
174
- background-color: #222;
175
- }
176
-
177
- /* third-and-above-level lists */
178
- #wp-admin-bar ul li ul ul {
179
- margin: -25px 184px 0 0;
180
- -moz-border-radius: 3px;
181
- -webkit-border-radius: 3px;
182
- }
183
-
184
- #wp-admin-bar ul li ul li:hover ul li a {
185
- color: #eee;
186
- }
187
-
188
- #wp-admin-bar ul li ul li ul li:hover a {
189
- color: #fff;
190
- }
191
-
192
- #wp-admin-bar ul li:hover ul,
193
- #wp-admin-bar ul li ul li:hover ul,
194
- #wp-admin-bar ul li.sfhover ul,
195
- #wp-admin-bar ul li ul li.sfhover ul {
196
- right: auto;
197
- }
198
-
199
- #wp-admin-bar ul li.align-right:hover ul {
200
- left: 0;
201
- }
202
-
203
- #wp-admin-bar ul li:hover ul ul,
204
- #wp-admin-bar li.sfhover ul li ul {
205
- right: -999em;
206
- }
207
-
208
- /* Menu item css */
209
- #wp-admin-bar img.avatar {
210
- float: right;
211
- margin-left: 8px;
212
- }
213
-
214
- #wp-admin-bar span.activity {
215
- display: block;
216
- margin-right: 34px;
217
- padding: 0;
218
- }
219
-
220
- #wp-admin-bar ul.author-list li a {
221
- height: 17px;
222
- }
223
-
224
- #wp-admin-bar ul li#bp-adminbar-notifications-menu a span {
225
- padding: 0 6px;
226
- margin-right: 2px;
227
- background: #fff;
228
- color: #000;
229
- border-radius: 3px;
230
- }
231
-
232
- #wp-admin-bar-user-info img.avatar {
233
- height: 64px;
234
- width: 64px;
235
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bp-core/css/buddybar-rtl.min.css DELETED
@@ -1 +0,0 @@
1
- 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{border:none}#wp-admin-bar li{list-style:none;margin:0;padding:0;line-height:1;text-align:right}#wp-admin-bar li a{padding:7px 15px;color:#eee;text-decoration:none;font-size:11px}#wp-admin-bar li.alt{border:none}#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;font-size:11px;padding:5px 8px;margin:0;text-decoration:none;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;float:right;position:relative;background:url(../images/admin-menu-arrow.gif) 12% 53% no-repeat;padding-left:11px}#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:3px;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0;-moz-border-radius-topleft:0;-webkit-border-top-left-radius: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;border-radius:3px}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}
 
bp-core/css/buddybar.css DELETED
@@ -1,235 +0,0 @@
1
- body:not(.wp-admin) {
2
- padding-top: 25px !important;
3
- }
4
-
5
- #wp-admin-bar {
6
- position: fixed;
7
- top: 0;
8
- left: 0;
9
- height: 25px;
10
- font-size: 11px;
11
- width: 100%;
12
- z-index: 9999;
13
- }
14
-
15
- #wp-admin-bar .padder {
16
- position: relative;
17
- padding: 0;
18
- width: 100%;
19
- margin: 0 auto;
20
- background: url(../images/60pc_black.png);
21
- height: 25px;
22
- }
23
-
24
- body#bp-default #wp-admin-bar .padder {
25
- max-width: 1250px;
26
- }
27
-
28
- #wp-admin-bar * {
29
- z-index: 999;
30
- }
31
-
32
- #wp-admin-bar div#admin-bar-logo {
33
- position: absolute;
34
- top: 5px;
35
- left: 10px;
36
- }
37
-
38
- #wp-admin-bar a img {
39
- border: none;
40
- }
41
-
42
- #wp-admin-bar li {
43
- list-style: none;
44
- margin: 0;
45
- padding: 0;
46
- line-height: 1;
47
- text-align: left;
48
- }
49
-
50
- #wp-admin-bar li a {
51
- padding: 7px 15px;
52
- color: #eee;
53
- text-decoration: none;
54
- font-size: 11px;
55
- }
56
-
57
- #wp-admin-bar li.alt {
58
- border: none;
59
- }
60
-
61
- #wp-admin-bar li.no-arrow a {
62
- padding-right: 15px;
63
- }
64
-
65
- #wp-admin-bar ul li ul li a span {
66
- display: none;
67
- }
68
-
69
- #wp-admin-bar li:hover,
70
- #wp-admin-bar li.hover {
71
- position: static;
72
- }
73
-
74
- #admin-bar-logo {
75
- float: left;
76
- font-weight: 700;
77
- font-size: 11px;
78
- padding: 5px 8px;
79
- margin: 0;
80
- text-decoration: none;
81
- color: #fff;
82
- }
83
-
84
- body#bp-default #admin-bar-logo {
85
- padding: 2px 8px;
86
- }
87
-
88
- /* all lists */
89
- #wp-admin-bar ul {
90
- margin: 0;
91
- list-style: none;
92
- line-height: 1;
93
- cursor: pointer;
94
- height: auto;
95
- padding: 0;
96
- }
97
-
98
- /* all list items */
99
- #wp-admin-bar ul li {
100
- padding: 0;
101
- float: left;
102
- position: relative;
103
- background: url(../images/admin-menu-arrow.gif) 88% 53% no-repeat;
104
- padding-right: 11px;
105
- }
106
-
107
- #wp-admin-bar ul li.no-arrow {
108
- background: none;
109
- padding-right: 0;
110
- }
111
-
112
- #wp-admin-bar ul li ul li {
113
- background-image: none;
114
- }
115
-
116
- #wp-admin-bar ul li.align-right {
117
- position: absolute;
118
- right: 0;
119
- }
120
-
121
- #wp-admin-bar ul li a {
122
- display: block;
123
- }
124
-
125
- #wp-admin-bar ul.main-nav li:hover,
126
- #wp-admin-bar ul.main-nav li.sfhover,
127
- #wp-admin-bar ul.main-nav li ul li.sfhover {
128
- background-color: #333;
129
- }
130
-
131
- /* second-level lists */
132
- #wp-admin-bar ul li ul {
133
- position: absolute;
134
- width: 185px;
135
- left: -999em;
136
- margin-left: 0;
137
- background: #333;
138
- border: 1px solid #222;
139
- -moz-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
140
- -webkit-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
141
- -moz-border-radius: 3px;
142
- -webkit-border-radius: 3px;
143
- -moz-border-radius-topleft: 0;
144
- -webkit-border-top-left-radius: 0;
145
- -moz-border-radius-topright: 0;
146
- -webkit-border-top-right-radius: 0;
147
- }
148
-
149
- #wp-admin-bar ul li > ul {
150
- border-top: none;
151
- }
152
-
153
- #wp-admin-bar ul li ul a {
154
- color: #eee;
155
- }
156
-
157
- #wp-admin-bar ul li ul li {
158
- float: left;
159
- width: 174px;
160
- margin: 0;
161
- }
162
-
163
- #wp-admin-bar ul li ul li:hover a {
164
- color: #fff;
165
- }
166
-
167
- #wp-admin-bar ul li div.admin-bar-clear {
168
- clear: both;
169
- }
170
-
171
- #wp-admin-bar ul.main-nav li ul li:hover,
172
- #wp-admin-bar ul.main-nav li ul li.sfhover,
173
- #wp-admin-bar ul.main-nav li ul li.sfhover {
174
- background-color: #222;
175
- }
176
-
177
- /* third-and-above-level lists */
178
- #wp-admin-bar ul li ul ul {
179
- margin: -25px 0 0 184px;
180
- -moz-border-radius: 3px;
181
- -webkit-border-radius: 3px;
182
- }
183
-
184
- #wp-admin-bar ul li ul li:hover ul li a {
185
- color: #eee;
186
- }
187
-
188
- #wp-admin-bar ul li ul li ul li:hover a {
189
- color: #fff;
190
- }
191
-
192
- #wp-admin-bar ul li:hover ul,
193
- #wp-admin-bar ul li ul li:hover ul,
194
- #wp-admin-bar ul li.sfhover ul,
195
- #wp-admin-bar ul li ul li.sfhover ul {
196
- left: auto;
197
- }
198
-
199
- #wp-admin-bar ul li.align-right:hover ul {
200
- right: 0;
201
- }
202
-
203
- #wp-admin-bar ul li:hover ul ul,
204
- #wp-admin-bar li.sfhover ul li ul {
205
- left: -999em;
206
- }
207
-
208
- /* Menu item css */
209
- #wp-admin-bar img.avatar {
210
- float: left;
211
- margin-right: 8px;
212
- }
213
-
214
- #wp-admin-bar span.activity {
215
- display: block;
216
- margin-left: 34px;
217
- padding: 0;
218
- }
219
-
220
- #wp-admin-bar ul.author-list li a {
221
- height: 17px;
222
- }
223
-
224
- #wp-admin-bar ul li#bp-adminbar-notifications-menu a span {
225
- padding: 0 6px;
226
- margin-left: 2px;
227
- background: #fff;
228
- color: #000;
229
- border-radius: 3px;
230
- }
231
-
232
- #wp-admin-bar-user-info img.avatar {
233
- height: 64px;
234
- width: 64px;
235
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bp-core/css/buddybar.min.css DELETED
@@ -1 +0,0 @@
1
- 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{border:none}#wp-admin-bar li{list-style:none;margin:0;padding:0;line-height:1;text-align:left}#wp-admin-bar li a{padding:7px 15px;color:#eee;text-decoration:none;font-size:11px}#wp-admin-bar li.alt{border:none}#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;font-size:11px;padding:5px 8px;margin:0;text-decoration:none;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;float:left;position:relative;background:url(../images/admin-menu-arrow.gif) 88% 53% no-repeat;padding-right:11px}#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:3px;-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;-moz-border-radius-topright:0;-webkit-border-top-right-radius: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;border-radius:3px}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}
 
bp-core/deprecated/2.1.php CHANGED
@@ -39,61 +39,6 @@ function bp_core_register_deprecated_styles() {
39
  * @return false|null Returns false on failure. Otherwise echoes the menu item.
40
  */
41
  function bp_adminbar_blogs_menu() {
42
-
43
- if ( ! is_user_logged_in() || ! bp_is_active( 'blogs' ) ) {
44
- return false;
45
- }
46
-
47
- if ( ! is_multisite() ) {
48
- return false;
49
- }
50
-
51
- $blogs = wp_cache_get( 'bp_blogs_of_user_' . bp_loggedin_user_id() . '_inc_hidden', 'bp' );
52
- if ( empty( $blogs ) ) {
53
- $blogs = bp_blogs_get_blogs_for_user( bp_loggedin_user_id(), true );
54
- wp_cache_set( 'bp_blogs_of_user_' . bp_loggedin_user_id() . '_inc_hidden', $blogs, 'bp' );
55
- }
56
-
57
- $counter = 0;
58
- if ( is_array( $blogs['blogs'] ) && (int) $blogs['count'] ) {
59
-
60
- echo '<li id="bp-adminbar-blogs-menu"><a href="' . trailingslashit( bp_loggedin_user_domain() . bp_get_blogs_slug() ) . '">';
61
-
62
- _e( 'My Sites', 'buddypress' );
63
-
64
- echo '</a>';
65
- echo '<ul>';
66
-
67
- foreach ( (array) $blogs['blogs'] as $blog ) {
68
- $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
69
- $site_url = esc_attr( $blog->siteurl );
70
-
71
- echo '<li' . $alt . '>';
72
- echo '<a href="' . $site_url . '">' . esc_html( $blog->name ) . '</a>';
73
- echo '<ul>';
74
- echo '<li class="alt"><a href="' . $site_url . 'wp-admin/">' . __( 'Dashboard', 'buddypress' ) . '</a></li>';
75
- echo '<li><a href="' . $site_url . 'wp-admin/post-new.php">' . __( 'New Post', 'buddypress' ) . '</a></li>';
76
- echo '<li class="alt"><a href="' . $site_url . 'wp-admin/edit.php">' . __( 'Manage Posts', 'buddypress' ) . '</a></li>';
77
- echo '<li><a href="' . $site_url . 'wp-admin/edit-comments.php">' . __( 'Manage Comments', 'buddypress' ) . '</a></li>';
78
- echo '</ul>';
79
-
80
- do_action( 'bp_adminbar_blog_items', $blog );
81
-
82
- echo '</li>';
83
- $counter++;
84
- }
85
-
86
- $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
87
-
88
- if ( bp_blog_signup_enabled() ) {
89
- echo '<li' . $alt . '>';
90
- echo '<a href="' . trailingslashit( bp_get_blogs_directory_permalink() . 'create' ) . '">' . __( 'Create a Site!', 'buddypress' ) . '</a>';
91
- echo '</li>';
92
- }
93
-
94
- echo '</ul>';
95
- echo '</li>';
96
- }
97
  }
98
 
99
  /**
@@ -104,12 +49,6 @@ function bp_adminbar_blogs_menu() {
104
  * @deprecated 2.1.0
105
  */
106
  function bp_admin_setting_callback_force_buddybar() {
107
- ?>
108
-
109
- <input id="_bp_force_buddybar" name="_bp_force_buddybar" type="checkbox" value="1" <?php checked( ! bp_force_buddybar( true ) ); ?> />
110
- <label for="_bp_force_buddybar"><?php _e( 'Switch to WordPress Toolbar', 'buddypress' ); ?></label>
111
-
112
- <?php
113
  }
114
 
115
 
@@ -135,32 +74,6 @@ function bp_admin_sanitize_callback_force_buddybar( $value = false ) {
135
  * @deprecated 2.1.0
136
  */
137
  function bp_core_admin_bar() {
138
- $bp = buddypress();
139
-
140
- if ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR ) {
141
- return false;
142
- }
143
-
144
- if ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() ) {
145
- return false;
146
- }
147
-
148
- $bp->doing_admin_bar = true;
149
-
150
- echo '<div id="wp-admin-bar"><div class="padder">';
151
-
152
- // **** Do bp-adminbar-logo Actions ********
153
- do_action( 'bp_adminbar_logo' );
154
-
155
- echo '<ul class="main-nav">';
156
-
157
- // **** Do bp-adminbar-menus Actions ********
158
- do_action( 'bp_adminbar_menus' );
159
-
160
- echo '</ul>';
161
- echo "</div></div><!-- #wp-admin-bar -->\n\n";
162
-
163
- $bp->doing_admin_bar = false;
164
  }
165
 
166
  /**
@@ -169,7 +82,6 @@ function bp_core_admin_bar() {
169
  * @deprecated 2.1.0
170
  */
171
  function bp_adminbar_logo() {
172
- echo '<a href="' . bp_get_root_domain() . '" id="admin-bar-logo">' . get_blog_option( bp_get_root_blog_id(), 'blogname' ) . '</a>';
173
  }
174
 
175
  /**
@@ -182,17 +94,6 @@ function bp_adminbar_logo() {
182
  * @return false|null Returns false if the current user is logged in.
183
  */
184
  function bp_adminbar_login_menu() {
185
-
186
- if ( is_user_logged_in() ) {
187
- return false;
188
- }
189
-
190
- echo '<li class="bp-login no-arrow"><a href="' . wp_login_url() . '">' . __( 'Log In', 'buddypress' ) . '</a></li>';
191
-
192
- // Show "Sign Up" link if user registrations are allowed.
193
- if ( bp_get_signup_allowed() ) {
194
- echo '<li class="bp-signup no-arrow"><a href="' . bp_get_signup_page() . '">' . __( 'Sign Up', 'buddypress' ) . '</a></li>';
195
- }
196
  }
197
 
198
  /**
@@ -203,79 +104,9 @@ function bp_adminbar_login_menu() {
203
  * @return false|null Returns false on failure.
204
  */
205
  function bp_adminbar_account_menu() {
206
- $bp = buddypress();
207
-
208
- if ( empty( $bp->bp_nav ) || ! is_user_logged_in() ) {
209
- return false;
210
- }
211
-
212
- echo '<li id="bp-adminbar-account-menu"><a href="' . bp_loggedin_user_domain() . '">';
213
- echo __( 'My Account', 'buddypress' ) . '</a>';
214
- echo '<ul>';
215
-
216
- // Loop through each navigation item.
217
- $counter = 0;
218
- foreach( (array) $bp->bp_nav as $nav_item ) {
219
- $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
220
-
221
- if ( -1 == $nav_item['position'] ) {
222
- continue;
223
- }
224
-
225
- echo '<li' . $alt . '>';
226
- echo '<a id="bp-admin-' . $nav_item['css_id'] . '" href="' . $nav_item['link'] . '">' . $nav_item['name'] . '</a>';
227
-
228
- if ( isset( $bp->bp_options_nav[$nav_item['slug']] ) && is_array( $bp->bp_options_nav[$nav_item['slug']] ) ) {
229
- echo '<ul>';
230
- $sub_counter = 0;
231
-
232
- foreach( (array) $bp->bp_options_nav[$nav_item['slug']] as $subnav_item ) {
233
- $link = $subnav_item['link'];
234
- $name = $subnav_item['name'];
235
-
236
- if ( bp_displayed_user_domain() ) {
237
- $link = str_replace( bp_displayed_user_domain(), bp_loggedin_user_domain(), $subnav_item['link'] );
238
- }
239
-
240
- if ( isset( $bp->displayed_user->userdata->user_login ) ) {
241
- $name = str_replace( $bp->displayed_user->userdata->user_login, $bp->loggedin_user->userdata->user_login, $subnav_item['name'] );
242
- }
243
-
244
- $alt = ( 0 == $sub_counter % 2 ) ? ' class="alt"' : '';
245
- echo '<li' . $alt . '><a id="bp-admin-' . $subnav_item['css_id'] . '" href="' . $link . '">' . $name . '</a></li>';
246
- $sub_counter++;
247
- }
248
- echo '</ul>';
249
- }
250
-
251
- echo '</li>';
252
-
253
- $counter++;
254
- }
255
-
256
- $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
257
-
258
- echo '<li' . $alt . '><a id="bp-admin-logout" class="logout" href="' . wp_logout_url( home_url() ) . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>';
259
- echo '</ul>';
260
- echo '</li>';
261
  }
262
 
263
  function bp_adminbar_thisblog_menu() {
264
- if ( current_user_can( 'edit_posts' ) ) {
265
- echo '<li id="bp-adminbar-thisblog-menu"><a href="' . admin_url() . '">';
266
- _e( 'Dashboard', 'buddypress' );
267
- echo '</a>';
268
- echo '<ul>';
269
-
270
- echo '<li class="alt"><a href="' . admin_url() . 'post-new.php">' . __( 'New Post', 'buddypress' ) . '</a></li>';
271
- echo '<li><a href="' . admin_url() . 'edit.php">' . __( 'Manage Posts', 'buddypress' ) . '</a></li>';
272
- echo '<li class="alt"><a href="' . admin_url() . 'edit-comments.php">' . __( 'Manage Comments', 'buddypress' ) . '</a></li>';
273
-
274
- do_action( 'bp_adminbar_thisblog_items' );
275
-
276
- echo '</ul>';
277
- echo '</li>';
278
- }
279
  }
280
 
281
  /**
@@ -286,31 +117,6 @@ function bp_adminbar_thisblog_menu() {
286
  * @deprecated 2.1.0
287
  */
288
  function bp_adminbar_random_menu() {
289
- ?>
290
-
291
- <li class="align-right" id="bp-adminbar-visitrandom-menu">
292
- <a href="#"><?php _e( 'Visit', 'buddypress' ) ?></a>
293
- <ul class="random-list">
294
- <li><a href="<?php bp_members_directory_permalink(); ?>?random-member" rel="nofollow"><?php _e( 'Random Member', 'buddypress' ) ?></a></li>
295
-
296
- <?php if ( bp_is_active( 'groups' ) ) : ?>
297
-
298
- <li class="alt"><a href="<?php bp_groups_directory_permalink(); ?>?random-group" rel="nofollow"><?php _e( 'Random Group', 'buddypress' ) ?></a></li>
299
-
300
- <?php endif; ?>
301
-
302
- <?php if ( is_multisite() && bp_is_active( 'blogs' ) ) : ?>
303
-
304
- <li><a href="<?php bp_blogs_directory_permalink(); ?>?random-blog" rel="nofollow"><?php _e( 'Random Site', 'buddypress' ) ?></a></li>
305
-
306
- <?php endif; ?>
307
-
308
- <?php do_action( 'bp_adminbar_random_menu' ) ?>
309
-
310
- </ul>
311
- </li>
312
-
313
- <?php
314
  }
315
 
316
  /**
@@ -319,27 +125,7 @@ function bp_adminbar_random_menu() {
319
  * @deprecated 2.1.0
320
  */
321
  function bp_core_load_buddybar_css() {
322
-
323
- if ( bp_use_wp_admin_bar() || ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() ) || ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR ) ) {
324
- return;
325
- }
326
-
327
- $min = bp_core_get_minified_asset_suffix();
328
-
329
- if ( file_exists( get_stylesheet_directory() . '/_inc/css/adminbar.css' ) ) { // Backwards compatibility.
330
- $stylesheet = get_stylesheet_directory_uri() . '/_inc/css/adminbar.css';
331
- } else {
332
- $stylesheet = buddypress()->plugin_url . "bp-core/css/buddybar{$min}.css";
333
- }
334
-
335
- wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_buddybar_rtl_css', $stylesheet ), array(), bp_get_version() );
336
-
337
- wp_style_add_data( 'bp-admin-bar', 'rtl', 'replace' );
338
- if ( $min ) {
339
- wp_style_add_data( 'bp-admin-bar', 'suffix', $min );
340
- }
341
  }
342
- add_action( 'bp_init', 'bp_core_load_buddybar_css' );
343
 
344
  /**
345
  * Add menu items to the BuddyBar.
@@ -349,55 +135,7 @@ add_action( 'bp_init', 'bp_core_load_buddybar_css' );
349
  * @deprecated 2.1.0
350
  */
351
  function bp_groups_adminbar_admin_menu() {
352
- $bp = buddypress();
353
-
354
- if ( empty( $bp->groups->current_group ) ) {
355
- return false;
356
- }
357
-
358
- // Only group admins and site admins can see this menu.
359
- if ( !current_user_can( 'edit_users' ) && !bp_current_user_can( 'bp_moderate' ) && !bp_is_item_admin() ) {
360
- return false;
361
- } ?>
362
-
363
- <li id="bp-adminbar-adminoptions-menu">
364
- <a href="<?php bp_groups_action_link( 'admin' ); ?>"><?php _e( 'Admin Options', 'buddypress' ); ?></a>
365
-
366
- <ul>
367
- <li><a href="<?php bp_groups_action_link( 'admin/edit-details' ); ?>"><?php _e( 'Edit Details', 'buddypress' ); ?></a></li>
368
-
369
- <li><a href="<?php bp_groups_action_link( 'admin/group-settings' ); ?>"><?php _e( 'Group Settings', 'buddypress' ); ?></a></li>
370
-
371
- <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) && $bp->avatar->show_avatars ) : ?>
372
-
373
- <li><a href="<?php bp_groups_action_link( 'admin/group-avatar' ); ?>"><?php _e( 'Group Profile Photo', 'buddypress' ); ?></a></li>
374
-
375
- <?php endif; ?>
376
-
377
- <?php if ( bp_is_active( 'friends' ) ) : ?>
378
-
379
- <li><a href="<?php bp_groups_action_link( 'send-invites' ); ?>"><?php _e( 'Manage Invitations', 'buddypress' ); ?></a></li>
380
-
381
- <?php endif; ?>
382
-
383
- <li><a href="<?php bp_groups_action_link( 'admin/manage-members' ); ?>"><?php _e( 'Manage Members', 'buddypress' ); ?></a></li>
384
-
385
- <?php if ( $bp->groups->current_group->status == 'private' ) : ?>
386
-
387
- <li><a href="<?php bp_groups_action_link( 'admin/membership-requests' ); ?>"><?php _e( 'Membership Requests', 'buddypress' ); ?></a></li>
388
-
389
- <?php endif; ?>
390
-
391
- <li><a class="confirm" href="<?php echo wp_nonce_url( bp_get_group_permalink( $bp->groups->current_group ) . 'admin/delete-group/', 'groups_delete_group' ); ?>&amp;delete-group-button=1&amp;delete-group-understand=1"><?php _e( "Delete Group", 'buddypress' ) ?></a></li>
392
-
393
- <?php do_action( 'bp_groups_adminbar_admin_menu' ) ?>
394
-
395
- </ul>
396
- </li>
397
-
398
- <?php
399
  }
400
- add_action( 'bp_adminbar_menus', 'bp_groups_adminbar_admin_menu', 20 );
401
 
402
  /**
403
  * Add the Notifications menu to the BuddyBar.
@@ -405,15 +143,7 @@ add_action( 'bp_adminbar_menus', 'bp_groups_adminbar_admin_menu', 20 );
405
  * @deprecated 2.1.0
406
  */
407
  function bp_adminbar_notifications_menu() {
408
-
409
- // Bail if notifications is not active.
410
- if ( ! bp_is_active( 'notifications' ) ) {
411
- return false;
412
- }
413
-
414
- bp_notifications_buddybar_menu();
415
  }
416
- add_action( 'bp_adminbar_menus', 'bp_adminbar_notifications_menu', 8 );
417
 
418
  /**
419
  * Add the Blog Authors menu to the BuddyBar (visible when not logged in).
@@ -421,56 +151,7 @@ add_action( 'bp_adminbar_menus', 'bp_adminbar_notifications_menu', 8 );
421
  * @deprecated 2.1.0
422
  */
423
  function bp_adminbar_authors_menu() {
424
- global $wpdb;
425
-
426
- // Only for multisite.
427
- if ( ! is_multisite() ) {
428
- return false;
429
- }
430
-
431
- // Hide on root blog.
432
- if ( bp_is_root_blog( $wpdb->blogid ) || ! bp_is_active( 'blogs' ) ) {
433
- return false;
434
- }
435
-
436
- $blog_prefix = $wpdb->get_blog_prefix( $wpdb->blogid );
437
- $authors = $wpdb->get_results( "SELECT user_id, user_login, user_nicename, display_name, user_email, meta_value as caps FROM $wpdb->users u, $wpdb->usermeta um WHERE u.ID = um.user_id AND meta_key = '{$blog_prefix}capabilities' ORDER BY um.user_id" );
438
-
439
- if ( !empty( $authors ) ) {
440
- // This is a blog, render a menu with links to all authors.
441
- echo '<li id="bp-adminbar-authors-menu"><a href="/">';
442
- _e('Blog Authors', 'buddypress');
443
- echo '</a>';
444
-
445
- echo '<ul class="author-list">';
446
- foreach( (array) $authors as $author ) {
447
- $caps = maybe_unserialize( $author->caps );
448
- if ( isset( $caps['subscriber'] ) || isset( $caps['contributor'] ) ) {
449
- continue;
450
- }
451
-
452
- echo '<li>';
453
- echo '<a href="' . bp_core_get_user_domain( $author->user_id, $author->user_nicename, $author->user_login ) . '">';
454
- echo bp_core_fetch_avatar( array(
455
- 'item_id' => $author->user_id,
456
- 'email' => $author->user_email,
457
- 'width' => 15,
458
- 'height' => 15,
459
- 'alt' => sprintf(
460
- /* translators: %s: member name */
461
- __( 'Profile picture of %s', 'buddypress' ),
462
- $author->display_name
463
- ),
464
- ) );
465
- echo ' ' . $author->display_name . '</a>';
466
- echo '<div class="admin-bar-clear"></div>';
467
- echo '</li>';
468
- }
469
- echo '</ul>';
470
- echo '</li>';
471
- }
472
  }
473
- add_action( 'bp_adminbar_menus', 'bp_adminbar_authors_menu', 12 );
474
 
475
  /**
476
  * Add a member admin menu to the BuddyBar.
@@ -481,63 +162,7 @@ add_action( 'bp_adminbar_menus', 'bp_adminbar_authors_menu', 12 );
481
  * @deprecated 2.1.0
482
  */
483
  function bp_members_adminbar_admin_menu() {
484
-
485
- // Only show if viewing a user.
486
- if ( ! bp_displayed_user_id() ) {
487
- return false;
488
- }
489
-
490
- // Don't show this menu to non site admins or if you're viewing your own profile.
491
- if ( !current_user_can( 'edit_users' ) || bp_is_my_profile() ) {
492
- return false;
493
- } ?>
494
-
495
- <li id="bp-adminbar-adminoptions-menu">
496
-
497
- <a href=""><?php _e( 'Admin Options', 'buddypress' ) ?></a>
498
-
499
- <ul>
500
- <?php if ( bp_is_active( 'xprofile' ) ) : ?>
501
-
502
- <li>
503
- <a href="<?php bp_members_component_link( 'profile', 'edit' ); ?>">
504
- <?php
505
- /* translators: %s: member name */
506
- printf( __( "Edit %s's Profile", 'buddypress' ), esc_attr( bp_get_displayed_user_fullname() ) );
507
- ?>
508
- </a>
509
- </li>
510
-
511
- <?php endif ?>
512
-
513
- <li>
514
- <a href="<?php bp_members_component_link( 'profile', 'change-avatar' ); ?>">
515
- <?php
516
- /* translators: %s: member name */
517
- printf( _x( "Edit %s's Profile Photo", 'deprecated string', 'buddypress' ), esc_attr( bp_get_displayed_user_fullname() ) );
518
- ?>
519
- </a>
520
- </li>
521
-
522
- <li><a href="<?php bp_members_component_link( 'settings', 'capabilities' ); ?>"><?php _e( 'User Capabilities', 'buddypress' ); ?></a></li>
523
-
524
- <li>
525
- <a href="<?php bp_members_component_link( 'settings', 'delete-account' ); ?>">
526
- <?php
527
- /* translators: %s: member name */
528
- printf( _x( "Delete %s's Account", 'deprecated string', 'buddypress' ), esc_attr( bp_get_displayed_user_fullname() ) );
529
- ?>
530
- </a>
531
- </li>
532
-
533
- <?php do_action( 'bp_members_adminbar_admin_menu' ) ?>
534
-
535
- </ul>
536
- </li>
537
-
538
- <?php
539
  }
540
- add_action( 'bp_adminbar_menus', 'bp_members_adminbar_admin_menu', 20 );
541
 
542
  /**
543
  * Create the Notifications menu for the BuddyBar.
@@ -546,45 +171,7 @@ add_action( 'bp_adminbar_menus', 'bp_members_adminbar_admin_menu', 20 );
546
  * @deprecated 2.1.0
547
  */
548
  function bp_notifications_buddybar_menu() {
549
-
550
- if ( ! is_user_logged_in() ) {
551
- return false;
552
- }
553
-
554
- echo '<li id="bp-adminbar-notifications-menu"><a href="' . esc_url( bp_loggedin_user_domain() ) . '">';
555
- _e( 'Notifications', 'buddypress' );
556
-
557
- $notification_count = bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );
558
- $notifications = bp_notifications_get_notifications_for_user( bp_loggedin_user_id() );
559
-
560
- if ( ! empty( $notification_count ) ) : ?>
561
- <span><?php echo bp_core_number_format( $notification_count ); ?></span>
562
- <?php
563
- endif;
564
-
565
- echo '</a>';
566
- echo '<ul>';
567
-
568
- if ( ! empty( $notifications ) ) {
569
- $counter = 0;
570
- for ( $i = 0, $count = count( $notifications ); $i < $count; ++$i ) {
571
- $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; ?>
572
-
573
- <li<?php echo $alt ?>><?php echo $notifications[$i] ?></li>
574
-
575
- <?php $counter++;
576
- }
577
- } else { ?>
578
-
579
- <li><a href="<?php echo esc_url( bp_loggedin_user_domain() ); ?>"><?php _e( 'No new notifications.', 'buddypress' ); ?></a></li>
580
-
581
- <?php
582
- }
583
-
584
- echo '</ul>';
585
- echo '</li>';
586
  }
587
- add_action( 'bp_adminbar_menus', 'bp_adminbar_notifications_menu', 8 );
588
 
589
  /**
590
  * Output the base URL for subdomain installations of WordPress Multisite.
39
  * @return false|null Returns false on failure. Otherwise echoes the menu item.
40
  */
41
  function bp_adminbar_blogs_menu() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  }
43
 
44
  /**
49
  * @deprecated 2.1.0
50
  */
51
  function bp_admin_setting_callback_force_buddybar() {
 
 
 
 
 
 
52
  }
53
 
54
 
74
  * @deprecated 2.1.0
75
  */
76
  function bp_core_admin_bar() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  }
78
 
79
  /**
82
  * @deprecated 2.1.0
83
  */
84
  function bp_adminbar_logo() {
 
85
  }
86
 
87
  /**
94
  * @return false|null Returns false if the current user is logged in.
95
  */
96
  function bp_adminbar_login_menu() {
 
 
 
 
 
 
 
 
 
 
 
97
  }
98
 
99
  /**
104
  * @return false|null Returns false on failure.
105
  */
106
  function bp_adminbar_account_menu() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  }
108
 
109
  function bp_adminbar_thisblog_menu() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  }
111
 
112
  /**
117
  * @deprecated 2.1.0
118
  */
119
  function bp_adminbar_random_menu() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  }
121
 
122
  /**
125
  * @deprecated 2.1.0
126
  */
127
  function bp_core_load_buddybar_css() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  }
 
129
 
130
  /**
131
  * Add menu items to the BuddyBar.
135
  * @deprecated 2.1.0
136
  */
137
  function bp_groups_adminbar_admin_menu() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  }
 
139
 
140
  /**
141
  * Add the Notifications menu to the BuddyBar.
143
  * @deprecated 2.1.0
144
  */
145
  function bp_adminbar_notifications_menu() {
 
 
 
 
 
 
 
146
  }
 
147
 
148
  /**
149
  * Add the Blog Authors menu to the BuddyBar (visible when not logged in).
151
  * @deprecated 2.1.0
152
  */
153
  function bp_adminbar_authors_menu() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  }
 
155
 
156
  /**
157
  * Add a member admin menu to the BuddyBar.
162
  * @deprecated 2.1.0
163
  */
164
  function bp_members_adminbar_admin_menu() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  }
 
166
 
167
  /**
168
  * Create the Notifications menu for the BuddyBar.
171
  * @deprecated 2.1.0
172
  */
173
  function bp_notifications_buddybar_menu() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
  }
 
175
 
176
  /**
177
  * Output the base URL for subdomain installations of WordPress Multisite.
bp-core/deprecated/8.0.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Deprecated functions.
5
+ *
6
+ * @deprecated 8.0.0
7
+ */
8
+
9
+ // Exit if accessed directly.
10
+ defined( 'ABSPATH' ) || exit;
11
+
12
+ /**
13
+ * Format 'new_avatar' activity actions.
14
+ *
15
+ * @since 2.0.0
16
+ * @deprecated 8.0.0
17
+ *
18
+ * @param string $action Static activity action.
19
+ * @param object $activity Activity object.
20
+ * @return string
21
+ */
22
+ function bp_xprofile_format_activity_action_new_avatar( $action, $activity ) {
23
+ _deprecated_function( __FUNCTION__, '8.0.0', 'bp_members_format_activity_action_new_avatar()' );
24
+ return bp_members_format_activity_action_new_avatar( $action, $activity );
25
+ }
26
+
27
+ /**
28
+ * Adds an activity stream item when a user has uploaded a new avatar.
29
+ *
30
+ * @since 1.0.0
31
+ * @since 2.3.4 Add new parameter to get the user id the avatar was set for.
32
+ * @deprecated 8.0.0
33
+ *
34
+ * @param int $user_id The user id the avatar was set for.
35
+ * @return bool
36
+ */
37
+ function bp_xprofile_new_avatar_activity( $user_id = 0 ) {
38
+ _deprecated_function( __FUNCTION__, '8.0.0', 'bp_members_new_avatar_activity()' );
39
+ return bp_members_new_avatar_activity( $user_id );
40
+ }
41
+
42
+ /**
43
+ * Should the old BuddyBar be forced in place of the WP admin bar?
44
+ *
45
+ * We deprecated the BuddyBar in v2.1.0, but have completely removed it in
46
+ * v8.0.
47
+ *
48
+ * @since 1.6.0
49
+ * @deprecated 8.0.0
50
+ *
51
+ * @return bool
52
+ */
53
+ function bp_force_buddybar() {
54
+ _deprecated_function( __FUNCTION__, '8.0' );
55
+
56
+ return false;
57
+ }
bp-core/images/bp-members-invitations-invite-screen.png ADDED
Binary file
bp-core/images/bp-members-invitations-manage-admin-screen.png ADDED
Binary file
bp-core/images/bp-new-blocks.png DELETED
Binary file
bp-core/images/bp-nouveau-2021.png DELETED
Binary file
bp-core/images/bp-types-illustration.png DELETED
Binary file
bp-core/images/bp-xprofile-admin-signup-fields.png ADDED
Binary file
bp-core/images/bp-xprofile-checkbox-acceptance-field-type.png ADDED
Binary file
bp-core/images/bp-xprofile-wp-field-type.png ADDED
Binary file
bp-core/js/avatar.js CHANGED
@@ -1,8 +1,8 @@
1
- /* global bp, BP_Uploader, _, Backbone */
2
 
3
  window.bp = window.bp || {};
4
 
5
- ( function( exports, $ ) {
6
 
7
  // Bail if not set.
8
  if ( typeof BP_Uploader === 'undefined' ) {
@@ -679,4 +679,4 @@ window.bp = window.bp || {};
679
 
680
  bp.Avatar.start();
681
 
682
- })( bp, jQuery );
1
+ /* global BP_Uploader, _, Backbone */
2
 
3
  window.bp = window.bp || {};
4
 
5
+ ( function( bp, $ ) {
6
 
7
  // Bail if not set.
8
  if ( typeof BP_Uploader === 'undefined' ) {
679
 
680
  bp.Avatar.start();
681
 
682
+ })( window.bp, jQuery );
bp-core/js/avatar.min.js CHANGED
@@ -1 +1 @@
1
- window.bp=window.bp||{},function(e,t){"undefined"!=typeof BP_Uploader&&(bp.Models=bp.Models||{},bp.Collections=bp.Collections||{},bp.Views=bp.Views||{},bp.Avatar={start:function(){var e=this;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),t("body.wp-admin").on("tb_unload","#TB_window",function(){e.resetViews()}),t("body.wp-admin").on("click",".bp-members-avatar-user-edit",function(){e.resetViews()})},removeLegacyUI:function(){t("#avatar-upload-form").length?(t("#avatar-upload").remove(),t("#avatar-upload-form p").remove()):t("#group-settings-form").length?(t("#group-settings-form p").each(function(e){0!==e&&t(this).remove()}),t("#delete-group-avatar-button").length&&t("#delete-group-avatar-button").remove()):t("#group-create-body").length?(t(".main-column p #file").remove(),t(".main-column p #upload").remove()):t("#bp_members_user_admin_avatar a.bp-members-avatar-user-admin").length&&t("#bp_members_user_admin_avatar a.bp-members-avatar-user-admin").remove()},setView:function(e){switch(_.isUndefined(this.views.models)||_.each(this.views.models,function(e){e.get("view").remove()},this),this.views.reset(),_.isUndefined(this.avatars)||this.avatars.reset(),_.isEmpty(this.jcropapi)||(this.jcropapi.destroy(),this.jcropapi={}),e){case"upload":this.uploaderView();break;case"delete":this.deleteView()}},resetViews:function(){this.nav.trigger("bp-avatar-view:changed","upload"),_.each(this.navItems.models,function(e){"upload"===e.id?e.set({active:1}):e.set({active:0})})},setupNav:function(){var e,t,a=this;this.navItems=new Backbone.Collection,_.each(BP_Uploader.settings.nav,function(i,s){_.isObject(i)&&(t=0,0===s&&(e=i.id,t=1),a.navItems.add({id:i.id,name:i.caption,href:"#",active:t,hide:_.isUndefined(i.hide)?0:i.hide}))}),this.nav=new bp.Views.Nav({collection:this.navItems}),this.nav.inject(".bp-avatar-nav"),this.setView(e),this.nav.on("bp-avatar-view:changed",_.bind(this.setView,this))},uploaderView:function(){bp.Uploader.filesQueue.on("add",this.uploadProgress,this);var e=new bp.Views.Uploader;this.views.add({id:"upload",view:e}),e.inject(".bp-avatar")},uploadProgress:function(){var e=new bp.Views.uploaderStatus({collection:bp.Uploader.filesQueue});_.isUndefined(this.views.get("status"))?this.views.add({id:"status",view:e}):this.views.set({id:"status",view:e}),e.inject(".bp-avatar-status")},cropView:function(){var e;if(!_.isEmpty(this.avatars.models)){_.isUndefined(this.views.get("status"))||((e=this.views.get("status")).get("view").remove(),this.views.remove({id:"status",view:e}));var t=new bp.Views.Avatars({collection:this.avatars});this.views.add({id:"crop",view:t}),t.inject(".bp-avatar")}},setAvatar:function(e){var a,i=this;_.isUndefined(this.views.get("crop"))||(_.isEmpty(this.jcropapi)||(this.jcropapi.destroy(),this.jcropapi={}),(a=this.views.get("crop")).get("view").remove(),this.views.remove({id:"crop",view:a})),bp.ajax.post("bp_avatar_set",{json:!0,original_file:e.get("url"),crop_w:e.get("w"),crop_h:e.get("h"),crop_x:e.get("x"),crop_y:e.get("y"),item_id:e.get("item_id"),object:e.get("object"),type:_.isUndefined(e.get("type"))?"crop":e.get("type"),nonce:e.get("nonces").set}).done(function(a){var s=new bp.Views.AvatarStatus({value:BP_Uploader.strings.feedback_messages[a.feedback_code],type:"success"});i.views.add({id:"status",view:s}),s.inject(".bp-avatar-status"),t("."+e.get("object")+"-"+a.item_id+"-avatar").each(function(){t(this).prop("src",a.avatar)}),bp.Avatar.navItems.get("delete").set({hide:0}),i.Attachment.set(_.extend(_.pick(e.attributes,["object","item_id"]),{url:a.avatar,action:"uploaded"}))}).fail(function(e){var t=BP_Uploader.strings.default_error;_.isUndefined(e)||(t=BP_Uploader.strings.feedback_messages[e.feedback_code]);var a=new bp.Views.AvatarStatus({value:t,type:"error"});i.views.add({id:"status",view:a}),a.inject(".bp-avatar-status")})},deleteView:function(){var e=new Backbone.Model(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,"object","item_id","nonces")),t=new bp.Views.DeleteAvatar({model:e});this.views.add({id:"delete",view:t}),t.inject(".bp-avatar")},deleteAvatar:function(e){var a,i=this;_.isUndefined(this.views.get("delete"))||((a=this.views.get("delete")).get("view").remove(),this.views.remove({id:"delete",view:a})),bp.ajax.post("bp_avatar_delete",{json:!0,item_id:e.get("item_id"),object:e.get("object"),nonce:e.get("nonces").remove}).done(function(a){var s=new bp.Views.AvatarStatus({value:BP_Uploader.strings.feedback_messages[a.feedback_code],type:"success"});i.views.add({id:"status",view:s}),s.inject(".bp-avatar-status"),t("."+e.get("object")+"-"+a.item_id+"-avatar").each(function(){t(this).prop("src",a.avatar)}),bp.Avatar.navItems.get("delete").set({active:0,hide:1}),i.Attachment.set(_.extend(_.pick(e.attributes,["object","item_id"]),{url:a.avatar,action:"deleted"}))}).fail(function(e){var t=BP_Uploader.strings.default_error;_.isUndefined(e)||(t=BP_Uploader.strings.feedback_messages[e.feedback_code]);var a=new bp.Views.AvatarStatus({value:t,type:"error"});i.views.add({id:"status",view:a}),a.inject(".bp-avatar-status")})},removeWarning:function(){_.isNull(this.warning)||this.warning.remove()},displayWarning:function(e){this.removeWarning(),this.warning=new bp.Views.uploaderWarning({value:e}),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(){1!==_.findWhere(this.collection.models,{id:"delete"}).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(e){1!==e.get("hide")&&this.views.add(new bp.Views.NavItem({model:e}))},showHideNavItem:function(e){var t=null;_.each(this.views._views[""],function(a){1===a.model.get("hide")&&a.remove(),e.get("id")===a.model.get("id")&&(t=!0)}),_.isBoolean(t)||this.addNavItem(e)},toggleView:function(e){e.preventDefault(),bp.Avatar.removeWarning();var a=t(e.target).data("nav");_.each(this.collection.models,function(e){e.id===a?(e.set({active:1}),this.trigger("bp-avatar-view:changed",e.id)):e.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(e){1===e.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(e){var t={full_h:150,full_w:150};_.isUndefined(BP_Uploader.settings.crop.full_h)||_.isUndefined(BP_Uploader.settings.crop.full_w)||(t.full_h=BP_Uploader.settings.crop.full_h,t.full_w=BP_Uploader.settings.crop.full_w),e.set(_.extend(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,"object","item_id","nonces"),t)),this.views.add(new bp.Views.Avatar({model:e}))}}),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 e,a,i,s,n,o,r=this,d=this.$el.find("#avatar-to-crop img"),l=this.$el.width(),p={};_.isUndefined(this.options.full_h)||_.isUndefined(this.options.full_w)||(this.options.aspectRatio=this.options.full_w/this.options.full_h),p.w=this.model.get("width"),p.h=this.model.get("height"),this.options.full_w+p.w+20<l&&(t("#avatar-to-crop").addClass("adjust"),this.$el.find(".avatar-crop-management").addClass("adjust")),p.h<=p.w?(e=Math.round(p.h/4),a=(n=o=Math.round(p.h/2))+e,s=o+(i=(p.w-o)/2)):(i=Math.round(p.w/4),n=o=Math.round(p.w/2),s=o+i,a=n+(e=(p.h-n)/2)),d.Jcrop({onChange:_.bind(r.showPreview,r),onSelect:_.bind(r.showPreview,r),aspectRatio:r.options.aspectRatio,setSelect:[i,e,s,a]},function(){bp.Avatar.jcropapi=this})},cropAvatar:function(e){e.preventDefault(),bp.Avatar.setAvatar(this.model)},showPreview:function(e){if(e.w&&e.h&&parseInt(e.w,10)>0){var a=this.options.full_w,i=this.options.full_h,s=a/e.w,n=i/e.h;this.model.set({x:e.x,y:e.y,w:e.w,h:e.h}),t("#avatar-crop-preview").css({maxWidth:"none",width:Math.round(s*this.model.get("width"))+"px",height:Math.round(n*this.model.get("height"))+"px",marginLeft:"-"+Math.round(s*this.model.get("x"))+"px",marginTop:"-"+Math.round(n*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(e){e.preventDefault(),bp.Avatar.deleteAvatar(this.model)}}),bp.Avatar.start())}(bp,jQuery);
1
+ window.bp=window.bp||{},function(v,c){"undefined"!=typeof BP_Uploader&&(v.Models=v.Models||{},v.Collections=v.Collections||{},v.Views=v.Views||{},v.Avatar={start:function(){var e=this;this.removeLegacyUI(),this.views=new Backbone.Collection,this.jcropapi={},this.warning=null,this.setupNav(),this.avatars=v.Uploader.filesUploaded,this.Attachment=new Backbone.Model,v.Uploader.filesQueue.on("reset",this.cropView,this),c("body.wp-admin").on("tb_unload","#TB_window",function(){e.resetViews()}),c("body.wp-admin").on("click",".bp-members-avatar-user-edit",function(){e.resetViews()})},removeLegacyUI:function(){c("#avatar-upload-form").length?(c("#avatar-upload").remove(),c("#avatar-upload-form p").remove()):c("#group-settings-form").length?(c("#group-settings-form p").each(function(e){0!==e&&c(this).remove()}),c("#delete-group-avatar-button").length&&c("#delete-group-avatar-button").remove()):c("#group-create-body").length?(c(".main-column p #file").remove(),c(".main-column p #upload").remove()):c("#bp_members_user_admin_avatar a.bp-members-avatar-user-admin").length&&c("#bp_members_user_admin_avatar a.bp-members-avatar-user-admin").remove()},setView:function(e){switch(_.isUndefined(this.views.models)||_.each(this.views.models,function(e){e.get("view").remove()},this),this.views.reset(),_.isUndefined(this.avatars)||this.avatars.reset(),_.isEmpty(this.jcropapi)||(this.jcropapi.destroy(),this.jcropapi={}),e){case"upload":this.uploaderView();break;case"delete":this.deleteView()}},resetViews:function(){this.nav.trigger("bp-avatar-view:changed","upload"),_.each(this.navItems.models,function(e){"upload"===e.id?e.set({active:1}):e.set({active:0})})},setupNav:function(){var a,i,s=this;this.navItems=new Backbone.Collection,_.each(BP_Uploader.settings.nav,function(e,t){_.isObject(e)&&((i=0)===t&&(a=e.id,i=1),s.navItems.add({id:e.id,name:e.caption,href:"#",active:i,hide:_.isUndefined(e.hide)?0:e.hide}))}),this.nav=new v.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(){v.Uploader.filesQueue.on("add",this.uploadProgress,this);var e=new v.Views.Uploader;this.views.add({id:"upload",view:e}),e.inject(".bp-avatar")},uploadProgress:function(){var e=new v.Views.uploaderStatus({collection:v.Uploader.filesQueue});_.isUndefined(this.views.get("status"))?this.views.add({id:"status",view:e}):this.views.set({id:"status",view:e}),e.inject(".bp-avatar-status")},cropView:function(){var e;_.isEmpty(this.avatars.models)||(_.isUndefined(this.views.get("status"))||((e=this.views.get("status")).get("view").remove(),this.views.remove({id:"status",view:e})),e=new v.Views.Avatars({collection:this.avatars}),this.views.add({id:"crop",view:e}),e.inject(".bp-avatar"))},setAvatar:function(a){var e,i=this;_.isUndefined(this.views.get("crop"))||(_.isEmpty(this.jcropapi)||(this.jcropapi.destroy(),this.jcropapi={}),(e=this.views.get("crop")).get("view").remove(),this.views.remove({id:"crop",view:e})),v.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(e){var t=new v.Views.AvatarStatus({value:BP_Uploader.strings.feedback_messages[e.feedback_code],type:"success"});i.views.add({id:"status",view:t}),t.inject(".bp-avatar-status"),c("."+a.get("object")+"-"+e.item_id+"-avatar").each(function(){c(this).prop("src",e.avatar)}),v.Avatar.navItems.get("delete").set({hide:0}),i.Attachment.set(_.extend(_.pick(a.attributes,["object","item_id"]),{url:e.avatar,action:"uploaded"}))}).fail(function(e){var t=BP_Uploader.strings.default_error;_.isUndefined(e)||(t=BP_Uploader.strings.feedback_messages[e.feedback_code]);t=new v.Views.AvatarStatus({value:t,type:"error"});i.views.add({id:"status",view:t}),t.inject(".bp-avatar-status")})},deleteView:function(){var e=new Backbone.Model(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,"object","item_id","nonces")),e=new v.Views.DeleteAvatar({model:e});this.views.add({id:"delete",view:e}),e.inject(".bp-avatar")},deleteAvatar:function(a){var e,i=this;_.isUndefined(this.views.get("delete"))||((e=this.views.get("delete")).get("view").remove(),this.views.remove({id:"delete",view:e})),v.ajax.post("bp_avatar_delete",{json:!0,item_id:a.get("item_id"),object:a.get("object"),nonce:a.get("nonces").remove}).done(function(e){var t=new v.Views.AvatarStatus({value:BP_Uploader.strings.feedback_messages[e.feedback_code],type:"success"});i.views.add({id:"status",view:t}),t.inject(".bp-avatar-status"),c("."+a.get("object")+"-"+e.item_id+"-avatar").each(function(){c(this).prop("src",e.avatar)}),v.Avatar.navItems.get("delete").set({active:0,hide:1}),i.Attachment.set(_.extend(_.pick(a.attributes,["object","item_id"]),{url:e.avatar,action:"deleted"}))}).fail(function(e){var t=BP_Uploader.strings.default_error;_.isUndefined(e)||(t=BP_Uploader.strings.feedback_messages[e.feedback_code]);t=new v.Views.AvatarStatus({value:t,type:"error"});i.views.add({id:"status",view:t}),t.inject(".bp-avatar-status")})},removeWarning:function(){_.isNull(this.warning)||this.warning.remove()},displayWarning:function(e){this.removeWarning(),this.warning=new v.Views.uploaderWarning({value:e}),this.warning.inject(".bp-avatar-status")}},v.Views.Nav=v.View.extend({tagName:"ul",className:"avatar-nav-items",events:{"click .bp-avatar-nav-item":"toggleView"},initialize:function(){1!==_.findWhere(this.collection.models,{id:"delete"}).get("hide")&&v.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(e){1!==e.get("hide")&&this.views.add(new v.Views.NavItem({model:e}))},showHideNavItem:function(t){var a=null;_.each(this.views._views[""],function(e){1===e.model.get("hide")&&e.remove(),t.get("id")===e.model.get("id")&&(a=!0)}),_.isBoolean(a)||this.addNavItem(t)},toggleView:function(e){e.preventDefault(),v.Avatar.removeWarning();var t=c(e.target).data("nav");_.each(this.collection.models,function(e){e.id===t?(e.set({active:1}),this.trigger("bp-avatar-view:changed",e.id)):e.set({active:0})},this)}}),v.Views.NavItem=v.View.extend({tagName:"li",className:"avatar-nav-item",template:v.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(e){1===e.get("active")?this.$el.addClass("current"):this.$el.removeClass("current")}}),v.Views.Avatars=v.View.extend({className:"items",initialize:function(){_.each(this.collection.models,this.addItemView,this)},addItemView:function(e){var t={full_h:150,full_w:150};_.isUndefined(BP_Uploader.settings.crop.full_h)||_.isUndefined(BP_Uploader.settings.crop.full_w)||(t.full_h=BP_Uploader.settings.crop.full_h,t.full_w=BP_Uploader.settings.crop.full_w),e.set(_.extend(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,"object","item_id","nonces"),t)),this.views.add(new v.Views.Avatar({model:e}))}}),v.Views.Avatar=v.View.extend({className:"item",template:v.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")&&v.Avatar.displayWarning(this.model.get("feedback")),this.on("ready",this.initCropper)},initCropper:function(){var e,t,a,i,s,n,o=this,r=this.$el.find("#avatar-to-crop img"),d=this.$el.width(),l={};_.isUndefined(this.options.full_h)||_.isUndefined(this.options.full_w)||(this.options.aspectRatio=this.options.full_w/this.options.full_h),l.w=this.model.get("width"),l.h=this.model.get("height"),this.options.full_w+l.w+20<d&&(c("#avatar-to-crop").addClass("adjust"),this.$el.find(".avatar-crop-management").addClass("adjust")),l.h<=l.w?(e=Math.round(l.h/4),t=(s=n=Math.round(l.h/2))+e,i=n+(a=(l.w-n)/2)):(a=Math.round(l.w/4),s=n=Math.round(l.w/2),i=n+a,t=s+(e=(l.h-s)/2)),r.Jcrop({onChange:_.bind(o.showPreview,o),onSelect:_.bind(o.showPreview,o),aspectRatio:o.options.aspectRatio,setSelect:[a,e,i,t]},function(){v.Avatar.jcropapi=this})},cropAvatar:function(e){e.preventDefault(),v.Avatar.setAvatar(this.model)},showPreview:function(e){var t,a;e.w&&e.h&&0<parseInt(e.w,10)&&(t=this.options.full_w,a=this.options.full_h,t=t/e.w,a=a/e.h,this.model.set({x:e.x,y:e.y,w:e.w,h:e.h}),c("#avatar-crop-preview").css({maxWidth:"none",width:Math.round(t*this.model.get("width"))+"px",height:Math.round(a*this.model.get("height"))+"px",marginLeft:"-"+Math.round(t*this.model.get("x"))+"px",marginTop:"-"+Math.round(a*this.model.get("y"))+"px"}))}}),v.Views.AvatarStatus=v.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}}),v.Views.DeleteAvatar=v.View.extend({tagName:"div",id:"bp-delete-avatar-container",template:v.template("bp-avatar-delete"),events:{"click #bp-delete-avatar":"deleteAvatar"},deleteAvatar:function(e){e.preventDefault(),v.Avatar.deleteAvatar(this.model)}}),v.Avatar.start())}(window.bp,jQuery);
bp-core/js/block-components.js CHANGED
@@ -15,7 +15,7 @@ function t(o,e){return module.exports=t=Object.setPrototypeOf||function(t,o){ret
15
  },{}],"RISo":[function(require,module,exports) {
16
  var e=require("./setPrototypeOf");function r(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),t&&e(r,t)}module.exports=r;
17
  },{"./setPrototypeOf":"zqo5"}],"W80x":[function(require,module,exports) {
18
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("@babel/runtime/helpers/classCallCheck")),t=o(require("@babel/runtime/helpers/createClass")),r=o(require("@babel/runtime/helpers/assertThisInitialized")),a=o(require("@babel/runtime/helpers/possibleConstructorReturn")),s=o(require("@babel/runtime/helpers/getPrototypeOf")),n=o(require("@babel/runtime/helpers/inherits"));function o(e){return e&&e.__esModule?e:{default:e}}function u(e){var t=l();return function(){var r,n=(0,s.default)(e);if(t){var o=(0,s.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}var i=wp,c=i.apiFetch,m=i.components.Popover,p=i.element,h=p.Component,f=p.Fragment,d=p.createElement,b=i.i18n.__,v=i.url.addQueryArgs,_=function(a){(0,n.default)(o,a);var s=u(o);function o(){var t;return(0,e.default)(this,o),(t=s.apply(this,arguments)).state={search:"",items:[],error:""},t.searchItemName=t.searchItemName.bind((0,r.default)(t)),t.selectItemName=t.selectItemName.bind((0,r.default)(t)),t}return(0,t.default)(o,[{key:"searchItemName",value:function(e){var t=this,r=this.state.search,a=this.props,s=a.component,n=a.objectQueryArgs;this.setState({search:e}),e.length<r.length&&this.setState({items:[]});var o="/buddypress/v1/"+s,u={};e&&(u.search=encodeURIComponent(e)),n&&(u=Object.assign(u,n)),c({path:v(o,u)}).then(function(e){t.setState({items:e})},function(e){t.setState({error:e.message})})}},{key:"selectItemName",value:function(e,t){var r=this.props.onSelectItem;return e.preventDefault(),this.setState({search:"",items:[],error:""}),r({itemID:t})}},{key:"render",value:function(){var e,t=this,r=this.state,a=r.search,s=r.items,n=this.props,o=n.ariaLabel,u=n.placeholder,l=n.useAvatar,i=n.slugValue;return o||(o=b("Item's name","buddypress")),u||(u=b("Enter Item's name here…","buddypress")),s.length&&(e=s.map(function(e){return d("button",{type:"button",key:"editor-autocompleters__item-item-"+e.id,role:"option","aria-selected":"true",className:"components-button components-autocomplete__result editor-autocompleters__user",onClick:function(r){return t.selectItemName(r,e.id)}},l&&d("img",{key:"avatar",className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls.thumb}),d("span",{key:"name",className:"editor-autocompleters__user-name"},e.name),i&&null!==i(e)&&d("span",{key:"slug",className:"editor-autocompleters__user-slug"},i(e)))})),d(f,null,d("input",{type:"text",value:a,className:"components-placeholder__input","aria-label":o,placeholder:u,onChange:function(e){return t.searchItemName(e.target.value)}}),0!==s.length&&d(m,{className:"components-autocomplete__popover",focusOnMount:!1,position:"bottom left"},d("div",{className:"components-autocomplete__results"},e)))}}]),o}(h),y=_;exports.default=y;
19
  },{"@babel/runtime/helpers/classCallCheck":"IC7x","@babel/runtime/helpers/createClass":"WiqS","@babel/runtime/helpers/assertThisInitialized":"NS7G","@babel/runtime/helpers/possibleConstructorReturn":"oXYo","@babel/runtime/helpers/getPrototypeOf":"goD2","@babel/runtime/helpers/inherits":"RISo"}],"iA92":[function(require,module,exports) {
20
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./autocompleter"));function t(e){return e&&e.__esModule?e:{default:e}}var r={AutoCompleter:e.default};exports.default=r;
21
  },{"./autocompleter":"W80x"}],"Ee8M":[function(require,module,exports) {
15
  },{}],"RISo":[function(require,module,exports) {
16
  var e=require("./setPrototypeOf");function r(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),t&&e(r,t)}module.exports=r;
17
  },{"./setPrototypeOf":"zqo5"}],"W80x":[function(require,module,exports) {
18
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("@babel/runtime/helpers/classCallCheck")),t=o(require("@babel/runtime/helpers/createClass")),r=o(require("@babel/runtime/helpers/assertThisInitialized")),a=o(require("@babel/runtime/helpers/possibleConstructorReturn")),s=o(require("@babel/runtime/helpers/getPrototypeOf")),n=o(require("@babel/runtime/helpers/inherits"));function o(e){return e&&e.__esModule?e:{default:e}}function u(e){var t=l();return function(){var r,n=(0,s.default)(e);if(t){var o=(0,s.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var c=wp,i=c.apiFetch,m=c.components.Popover,p=c.element,h=p.Component,f=p.Fragment,d=p.createElement,b=c.i18n.__,v=c.url.addQueryArgs,_=function(a){(0,n.default)(o,a);var s=u(o);function o(){var t;return(0,e.default)(this,o),(t=s.apply(this,arguments)).state={search:"",items:[],error:""},t.searchItemName=t.searchItemName.bind((0,r.default)(t)),t.selectItemName=t.selectItemName.bind((0,r.default)(t)),t}return(0,t.default)(o,[{key:"searchItemName",value:function(e){var t=this,r=this.state.search,a=this.props,s=a.component,n=a.objectQueryArgs;this.setState({search:e}),e.length<r.length&&this.setState({items:[]});var o="/buddypress/v1/"+s,u={};e&&(u.search=encodeURIComponent(e)),n&&(u=Object.assign(u,n)),i({path:v(o,u)}).then(function(e){t.setState({items:e})},function(e){t.setState({error:e.message})})}},{key:"selectItemName",value:function(e,t){var r=this.props.onSelectItem;return e.preventDefault(),this.setState({search:"",items:[],error:""}),r({itemID:t})}},{key:"render",value:function(){var e,t=this,r=this.state,a=r.search,s=r.items,n=this.props,o=n.ariaLabel,u=n.placeholder,l=n.useAvatar,c=n.slugValue;return o||(o=b("Item's name","buddypress")),u||(u=b("Enter Item's name here…","buddypress")),s.length&&(e=s.map(function(e){return d("button",{type:"button",key:"editor-autocompleters__item-item-"+e.id,role:"option","aria-selected":"true",className:"components-button components-autocomplete__result editor-autocompleters__user",onClick:function(r){return t.selectItemName(r,e.id)}},l&&d("img",{key:"avatar",className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls.thumb}),d("span",{key:"name",className:"editor-autocompleters__user-name"},e.name),c&&null!==c(e)&&d("span",{key:"slug",className:"editor-autocompleters__user-slug"},c(e)))})),d(f,null,d("input",{type:"text",value:a,className:"components-placeholder__input","aria-label":o,placeholder:u,onChange:function(e){return t.searchItemName(e.target.value)}}),0!==s.length&&d(m,{className:"components-autocomplete__popover",focusOnMount:!1,position:"bottom left"},d("div",{className:"components-autocomplete__results"},e)))}}]),o}(h),y=_;exports.default=y;
19
  },{"@babel/runtime/helpers/classCallCheck":"IC7x","@babel/runtime/helpers/createClass":"WiqS","@babel/runtime/helpers/assertThisInitialized":"NS7G","@babel/runtime/helpers/possibleConstructorReturn":"oXYo","@babel/runtime/helpers/getPrototypeOf":"goD2","@babel/runtime/helpers/inherits":"RISo"}],"iA92":[function(require,module,exports) {
20
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./autocompleter"));function t(e){return e&&e.__esModule?e:{default:e}}var r={AutoCompleter:e.default};exports.default=r;
21
  },{"./autocompleter":"W80x"}],"Ee8M":[function(require,module,exports) {
bp-core/js/block-components.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../node_modules/@babel/runtime/helpers/classCallCheck.js","../../../../../node_modules/@babel/runtime/helpers/createClass.js","../../../../../node_modules/@babel/runtime/helpers/assertThisInitialized.js","../../../../../node_modules/@babel/runtime/helpers/typeof.js","../../../../../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../../../../../node_modules/@babel/runtime/helpers/getPrototypeOf.js","../../../../../node_modules/@babel/runtime/helpers/setPrototypeOf.js","../../../../../node_modules/@babel/runtime/helpers/inherits.js","components/autocompleter.js","components/index.js","block-components.js"],"names":["AutoCompleter","wp","apiFetch","Popover","components","element","Component","Fragment","createElement","__","i18n","addQueryArgs","url","arguments","state","search","items","error","searchItemName","bind","selectItemName","value","props","component","objectQueryArgs","setState","length","path","queryArgs","encodeURIComponent","Object","assign","then","message","event","itemID","onSelectItem","preventDefault","itemsList","ariaLabel","placeholder","useAvatar","slugValue","map","item","id","avatar_urls","thumb","name","target"],"mappings":";AAAA,SAAA,EAAA,EAAA,GACA,KAAA,aAAA,GACA,MAAA,IAAA,UAAA,qCAIA,OAAA,QAAA;;ACNA,SAAA,EAAA,EAAA,GACA,IAAA,IAAA,EAAA,EAAA,EAAA,EAAA,OAAA,IAAA,CACA,IAAA,EAAA,EAAA,GACA,EAAA,WAAA,EAAA,aAAA,EACA,EAAA,cAAA,EACA,UAAA,IAAA,EAAA,UAAA,GACA,OAAA,eAAA,EAAA,EAAA,IAAA,IAIA,SAAA,EAAA,EAAA,EAAA,GAGA,OAFA,GAAA,EAAA,EAAA,UAAA,GACA,GAAA,EAAA,EAAA,GACA,EAGA,OAAA,QAAA;;AChBA,SAAA,EAAA,GACA,QAAA,IAAA,EACA,MAAA,IAAA,eAAA,6DAGA,OAAA,EAGA,OAAA,QAAA;;ACRA,SAAA,EAAA,GAaA,MAVA,mBAAA,QAAA,iBAAA,OAAA,SACA,OAAA,QAAA,EAAA,SAAA,GACA,cAAA,GAGA,OAAA,QAAA,EAAA,SAAA,GACA,OAAA,GAAA,mBAAA,QAAA,EAAA,cAAA,QAAA,IAAA,OAAA,UAAA,gBAAA,GAIA,EAAA,GAGA,OAAA,QAAA;;AChBA,IAAA,EAAA,QAAA,qBAEA,EAAA,QAAA,2BAEA,SAAA,EAAA,EAAA,GACA,OAAA,GAAA,WAAA,EAAA,IAAA,mBAAA,EAIA,EAAA,GAHA,EAMA,OAAA,QAAA;;ACZA,SAAA,EAAA,GAIA,OAHA,OAAA,QAAA,EAAA,OAAA,eAAA,OAAA,eAAA,SAAA,GACA,OAAA,EAAA,WAAA,OAAA,eAAA,IAEA,EAAA,GAGA,OAAA,QAAA;;ACPA,SAAA,EAAA,EAAA,GAMA,OALA,OAAA,QAAA,EAAA,OAAA,gBAAA,SAAA,EAAA,GAEA,OADA,EAAA,UAAA,EACA,GAGA,EAAA,EAAA,GAGA,OAAA,QAAA;;ACTA,IAAA,EAAA,QAAA,oBAEA,SAAA,EAAA,EAAA,GACA,GAAA,mBAAA,GAAA,OAAA,EACA,MAAA,IAAA,UAAA,sDAGA,EAAA,UAAA,OAAA,OAAA,GAAA,EAAA,UAAA,CACA,YAAA,CACA,MAAA,EACA,UAAA,EACA,cAAA,KAGA,GAAA,EAAA,EAAA,GAGA,OAAA,QAAA;;ACyHeA,aAAAA,OAAAA,eAAAA,QAAAA,aAAAA,CAAAA,OAAAA,IAAAA,QAAAA,aAAAA,EAAAA,IAAAA,EAAAA,EAAAA,QAAAA,0CAAAA,EAAAA,EAAAA,QAAAA,uCAAAA,EAAAA,EAAAA,QAAAA,iDAAAA,EAAAA,EAAAA,QAAAA,qDAAAA,EAAAA,EAAAA,QAAAA,0CAAAA,EAAAA,EAAAA,QAAAA,oCAAAA,SAAAA,EAAAA,GAAAA,OAAAA,GAAAA,EAAAA,WAAAA,EAAAA,CAAAA,QAAAA,GAAAA,SAAAA,EAAAA,GAAAA,IAAAA,EAAAA,IAAAA,OAAAA,WAAAA,IAAAA,EAAAA,GAAAA,EAAAA,EAAAA,SAAAA,GAAAA,GAAAA,EAAAA,CAAAA,IAAAA,GAAAA,EAAAA,EAAAA,SAAAA,MAAAA,YAAAA,EAAAA,QAAAA,UAAAA,EAAAA,UAAAA,QAAAA,EAAAA,EAAAA,MAAAA,KAAAA,WAAAA,OAAAA,EAAAA,EAAAA,SAAAA,KAAAA,IAAAA,SAAAA,IAAAA,GAAAA,oBAAAA,UAAAA,QAAAA,UAAAA,OAAAA,EAAAA,GAAAA,QAAAA,UAAAA,KAAAA,OAAAA,EAAAA,GAAAA,mBAAAA,MAAAA,OAAAA,EAAAA,IAAAA,OAAAA,KAAAA,UAAAA,SAAAA,KAAAA,QAAAA,UAAAA,KAAAA,GAAAA,gBAAAA,EAAAA,MAAAA,GAAAA,OAAAA,GAvHXC,IAAAA,EAAAA,GAfHC,EAAAA,EAAAA,SAECC,EADDC,EAAAA,WACCD,QAEDE,EAAAA,EAAAA,QACCC,EAAAA,EAAAA,UACAC,EAAAA,EAAAA,SACAC,EAAAA,EAAAA,cAGAC,EADDC,EAAAA,KACCD,GAGAE,EADDC,EAAAA,IACCD,aAIIX,EAAAA,SAAAA,IAqHSA,EAAAA,EAAAA,SAAAA,EAAAA,GAAAA,IAAAA,EAAAA,EAAAA,GApHA,SAAA,IAAA,IAAA,EAAA,OAAA,EAAA,EAAA,SAAA,KAAA,IACHa,EAAAA,EAAAA,MAAAA,KAAAA,YAELC,MAAQ,CACZC,OAAQ,GACRC,MAAO,GACPC,MAAO,IAGHC,EAAAA,eAAiB,EAAKA,eAAeC,MAA1C,EAAA,EAAA,SAAA,IACKC,EAAAA,eAAiB,EAAKA,eAAeD,MAA1C,EAAA,EAAA,SAAA,IAVa,EAoHAnB,OAAAA,EAAAA,EAAAA,SAAAA,EAAAA,CAAAA,CAAAA,IAAAA,iBAvGEqB,MAAAA,SAAAA,GAAQ,IAAA,EAAA,KACfN,EAAW,KAAKD,MAAhBC,OAC+B,EAAA,KAAKO,MAApCC,EAAAA,EAAAA,UAAWC,EAAAA,EAAAA,gBACdC,KAAAA,SAAU,CAAEV,OAAQM,IAEpBA,EAAMK,OAASX,EAAOW,QACrBD,KAAAA,SAAU,CAAET,MAAO,KAGrBW,IAAAA,EAAM,kBAAoBJ,EAC1BK,EAAY,GAEXP,IACJO,EAAUb,OAASc,mBAAoBR,IAGnCG,IACJI,EAAYE,OAAOC,OAAQH,EAAWJ,IAGvCtB,EAAU,CAAEyB,KAAOhB,EAAcgB,EAAMC,KAAgBI,KAAM,SAAAhB,GAC5D,EAAKS,SAAU,CAAET,MAAOA,KACtB,SAAAC,GACF,EAAKQ,SAAU,CAAER,MAAOA,EAAMgB,cAgFlBjC,CAAAA,IAAAA,iBA5EEkC,MAAAA,SAAAA,EAAOC,GACdC,IAAAA,EAAiB,KAAKd,MAAtBc,aASDA,OARPF,EAAMG,iBAEDZ,KAAAA,SAAU,CACdV,OAAQ,GACRC,MAAO,GACPC,MAAO,KAGDmB,EAAc,CAAED,OAAQA,MAkElBnC,CAAAA,IAAAA,SA/DL,MAAA,WAAA,IAGJsC,EAHI,EAAA,KACkB,EAAA,KAAKxB,MAAvBC,EAAAA,EAAAA,OAAQC,EAAAA,EAAAA,MACuC,EAAA,KAAKM,MAAtDiB,EAAAA,EAAAA,UAAWC,EAAAA,EAAAA,YAAaC,EAAAA,EAAAA,UAAWC,EAAAA,EAAAA,UAoCxC,OAjCMH,IACNA,EAAY9B,EAAI,cAAgB,eAG1B+B,IACNA,EAAc/B,EAAI,0BAA4B,eAG1CO,EAAMU,SACVY,EAAYtB,EAAM2B,IAAK,SAAEC,GAEvB,OAAA,EAAA,SAAA,CACC,KAAK,SAAS,IAAM,oCAAsCA,EAAKC,GAC/D,KAAK,SACS,gBAAA,OACd,UAAU,gFACV,QAAU,SAAEX,GAAW,OAAA,EAAKd,eAAgBc,EAAOU,EAAKC,MAEtDJ,GACD,EAAA,MAAA,CAAK,IAAI,SAAS,UAAU,qCAAqC,IAAI,GAAG,IAAMG,EAAKE,YAAYC,QAGhG,EAAA,OAAA,CAAM,IAAI,OAAO,UAAU,oCAAqCH,EAAKI,MAEnEN,GAAa,OAASA,EAAWE,IAClC,EAAA,OAAA,CAAM,IAAI,OAAO,UAAU,oCAAqCF,EAAWE,QAQ/E,EAAC,EACA,KAAA,EAAA,QAAA,CACC,KAAK,OACL,MAAQ7B,EACR,UAAU,gCACGwB,aAAAA,EACb,YAAcC,EACd,SAAW,SAAEN,GAAW,OAAA,EAAKhB,eAAgBgB,EAAMe,OAAO5B,UAEzD,IAAML,EAAMU,QACb,EAAC,EAAD,CACC,UAAU,mCACV,cAAe,EACf,SAAS,eAET,EAAA,MAAA,CAAK,UAAU,oCACZY,SASMtC,EArHTA,CAAsBM,GAqHbN,EAAAA,EAAAA,QAAAA,QAAAA;;ACvIA,aAAA,OAAA,eAAA,QAAA,aAAA,CAAA,OAAA,IAAA,QAAA,aAAA,EAFf,IAAA,EAAA,EAAA,QAAA,oBAEe,SAAA,EAAA,GAAA,OAAA,GAAA,EAAA,WAAA,EAAA,CAAA,QAAA,GAAA,IAAA,EAAA,CACdA,cAAAA,EAAAA,SADc,QAAA,QAAA;;ACHf,aAAA,OAAA,eAAA,QAAA,aAAA,CAAA,OAAA,IAAA,OAAA,eAAA,QAAA,kBAAA,CAAA,YAAA,EAAA,IAAA,WAAA,OAAA,EAAA,WAAA,IAAA,EAAA,EAAA,QAAA,iBAAA,SAAA,EAAA,GAAA,OAAA,GAAA,EAAA,WAAA,EAAA,CAAA,QAAA","file":"block-components.js","sourceRoot":"../../../src/js/bp-core/js/block-components","sourcesContent":["function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","var _typeof = require(\"../helpers/typeof\");\n\nvar assertThisInitialized = require(\"./assertThisInitialized\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;","/**\n * WordPress dependencies.\n */\nconst {\n\tapiFetch,\n\tcomponents: {\n\t\tPopover,\n\t},\n\telement: {\n\t\tComponent,\n\t\tFragment,\n\t\tcreateElement,\n\t},\n\ti18n: {\n\t\t__,\n\t},\n\turl: {\n\t\taddQueryArgs,\n\t},\n} = wp;\n\nclass AutoCompleter extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\tsearch: '',\n\t\t\titems: [],\n\t\t\terror: '',\n\t\t};\n\n\t\tthis.searchItemName = this.searchItemName.bind( this );\n\t\tthis.selectItemName = this.selectItemName.bind( this );\n\t}\n\n\tsearchItemName( value ) {\n\t\tconst { search } = this.state;\n\t\tconst { component, objectQueryArgs } = this.props;\n\t\tthis.setState( { search: value } );\n\n\t\tif ( value.length < search.length ) {\n\t\t\tthis.setState( { items: [] } );\n\t\t}\n\n\t\tlet path= '/buddypress/v1/' + component;\n\t\tlet queryArgs = {};\n\n\t\tif ( value ) {\n\t\t\tqueryArgs.search = encodeURIComponent( value );\n\t\t}\n\n\t\tif ( objectQueryArgs ) {\n\t\t\tqueryArgs = Object.assign( queryArgs, objectQueryArgs );\n\t\t}\n\n\t\tapiFetch( { path: addQueryArgs( path, queryArgs ) } ).then( items => {\n\t\t\tthis.setState( { items: items } );\n\t\t}, error => {\n\t\t\tthis.setState( { error: error.message } );\n\t\t} );\n\t}\n\n\tselectItemName( event, itemID ) {\n\t\tconst { onSelectItem } = this.props;\n\t\tevent.preventDefault();\n\n\t\tthis.setState( {\n\t\t\tsearch: '',\n\t\t\titems: [],\n\t\t\terror: '',\n\t\t} );\n\n\t\treturn onSelectItem( { itemID: itemID } );\n\t}\n\n\trender() {\n\t\tconst { search, items } = this.state;\n\t\tlet { ariaLabel, placeholder, useAvatar, slugValue } = this.props;\n\t\tlet itemsList;\n\n\t\tif ( ! ariaLabel ) {\n\t\t\tariaLabel = __( 'Item\\'s name', 'buddypress' );\n\t\t}\n\n\t\tif ( ! placeholder ) {\n\t\t\tplaceholder = __( 'Enter Item\\'s name here…', 'buddypress' );\n\t\t}\n\n\t\tif ( items.length ) {\n\t\t\titemsList = items.map( ( item ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\" key={ 'editor-autocompleters__item-item-' + item.id }\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\taria-selected=\"true\"\n\t\t\t\t\t\tclassName=\"components-button components-autocomplete__result editor-autocompleters__user\"\n\t\t\t\t\t\tonClick={ ( event ) => this.selectItemName( event, item.id ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ useAvatar && (\n\t\t\t\t\t\t\t<img key=\"avatar\" className=\"editor-autocompleters__user-avatar\" alt=\"\" src={ item.avatar_urls.thumb } />\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t<span key=\"name\" className=\"editor-autocompleters__user-name\">{ item.name }</span>\n\n\t\t\t\t\t\t{ slugValue && null !== slugValue( item ) && (\n\t\t\t\t\t\t\t<span key=\"slug\" className=\"editor-autocompleters__user-slug\">{ slugValue( item ) }</span>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</button>\n\t\t\t\t);\n\t\t\t} );\n\t\t}\n\n\t\treturn (\n\t\t\t<Fragment>\n\t\t\t\t<input\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\tvalue={ search }\n\t\t\t\t\tclassName=\"components-placeholder__input\"\n\t\t\t\t\taria-label={ ariaLabel }\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\tonChange={ ( event ) => this.searchItemName( event.target.value ) }\n\t\t\t\t/>\n\t\t\t\t{ 0 !== items.length &&\n\t\t\t\t\t<Popover\n\t\t\t\t\t\tclassName=\"components-autocomplete__popover\"\n\t\t\t\t\t\tfocusOnMount={ false }\n\t\t\t\t\t\tposition=\"bottom left\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<div className=\"components-autocomplete__results\">\n\t\t\t\t\t\t\t{ itemsList }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Popover>\n\t\t\t\t}\n\t\t\t</Fragment>\n\t\t);\n\t}\n}\n\nexport default AutoCompleter;\n","// Components\nimport AutoCompleter from './autocompleter'\n\nexport default {\n\tAutoCompleter\n};\n","export { default as blockComponents } from './components';\n"]}
1
+ {"version":3,"sources":["../../../../../node_modules/@babel/runtime/helpers/classCallCheck.js","../../../../../node_modules/@babel/runtime/helpers/createClass.js","../../../../../node_modules/@babel/runtime/helpers/assertThisInitialized.js","../../../../../node_modules/@babel/runtime/helpers/typeof.js","../../../../../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../../../../../node_modules/@babel/runtime/helpers/getPrototypeOf.js","../../../../../node_modules/@babel/runtime/helpers/setPrototypeOf.js","../../../../../node_modules/@babel/runtime/helpers/inherits.js","components/autocompleter.js","components/index.js","block-components.js"],"names":["AutoCompleter","wp","apiFetch","Popover","components","element","Component","Fragment","createElement","__","i18n","addQueryArgs","url","arguments","state","search","items","error","searchItemName","bind","selectItemName","value","props","component","objectQueryArgs","setState","length","path","queryArgs","encodeURIComponent","Object","assign","then","message","event","itemID","onSelectItem","preventDefault","itemsList","ariaLabel","placeholder","useAvatar","slugValue","map","item","id","avatar_urls","thumb","name","target"],"mappings":";AAAA,SAAA,EAAA,EAAA,GACA,KAAA,aAAA,GACA,MAAA,IAAA,UAAA,qCAIA,OAAA,QAAA;;ACNA,SAAA,EAAA,EAAA,GACA,IAAA,IAAA,EAAA,EAAA,EAAA,EAAA,OAAA,IAAA,CACA,IAAA,EAAA,EAAA,GACA,EAAA,WAAA,EAAA,aAAA,EACA,EAAA,cAAA,EACA,UAAA,IAAA,EAAA,UAAA,GACA,OAAA,eAAA,EAAA,EAAA,IAAA,IAIA,SAAA,EAAA,EAAA,EAAA,GAGA,OAFA,GAAA,EAAA,EAAA,UAAA,GACA,GAAA,EAAA,EAAA,GACA,EAGA,OAAA,QAAA;;AChBA,SAAA,EAAA,GACA,QAAA,IAAA,EACA,MAAA,IAAA,eAAA,6DAGA,OAAA,EAGA,OAAA,QAAA;;ACRA,SAAA,EAAA,GAaA,MAVA,mBAAA,QAAA,iBAAA,OAAA,SACA,OAAA,QAAA,EAAA,SAAA,GACA,cAAA,GAGA,OAAA,QAAA,EAAA,SAAA,GACA,OAAA,GAAA,mBAAA,QAAA,EAAA,cAAA,QAAA,IAAA,OAAA,UAAA,gBAAA,GAIA,EAAA,GAGA,OAAA,QAAA;;AChBA,IAAA,EAAA,QAAA,qBAEA,EAAA,QAAA,2BAEA,SAAA,EAAA,EAAA,GACA,OAAA,GAAA,WAAA,EAAA,IAAA,mBAAA,EAIA,EAAA,GAHA,EAMA,OAAA,QAAA;;ACZA,SAAA,EAAA,GAIA,OAHA,OAAA,QAAA,EAAA,OAAA,eAAA,OAAA,eAAA,SAAA,GACA,OAAA,EAAA,WAAA,OAAA,eAAA,IAEA,EAAA,GAGA,OAAA,QAAA;;ACPA,SAAA,EAAA,EAAA,GAMA,OALA,OAAA,QAAA,EAAA,OAAA,gBAAA,SAAA,EAAA,GAEA,OADA,EAAA,UAAA,EACA,GAGA,EAAA,EAAA,GAGA,OAAA,QAAA;;ACTA,IAAA,EAAA,QAAA,oBAEA,SAAA,EAAA,EAAA,GACA,GAAA,mBAAA,GAAA,OAAA,EACA,MAAA,IAAA,UAAA,sDAGA,EAAA,UAAA,OAAA,OAAA,GAAA,EAAA,UAAA,CACA,YAAA,CACA,MAAA,EACA,UAAA,EACA,cAAA,KAGA,GAAA,EAAA,EAAA,GAGA,OAAA,QAAA;;ACyHeA,aAAAA,OAAAA,eAAAA,QAAAA,aAAAA,CAAAA,OAAAA,IAAAA,QAAAA,aAAAA,EAAAA,IAAAA,EAAAA,EAAAA,QAAAA,0CAAAA,EAAAA,EAAAA,QAAAA,uCAAAA,EAAAA,EAAAA,QAAAA,iDAAAA,EAAAA,EAAAA,QAAAA,qDAAAA,EAAAA,EAAAA,QAAAA,0CAAAA,EAAAA,EAAAA,QAAAA,oCAAAA,SAAAA,EAAAA,GAAAA,OAAAA,GAAAA,EAAAA,WAAAA,EAAAA,CAAAA,QAAAA,GAAAA,SAAAA,EAAAA,GAAAA,IAAAA,EAAAA,IAAAA,OAAAA,WAAAA,IAAAA,EAAAA,GAAAA,EAAAA,EAAAA,SAAAA,GAAAA,GAAAA,EAAAA,CAAAA,IAAAA,GAAAA,EAAAA,EAAAA,SAAAA,MAAAA,YAAAA,EAAAA,QAAAA,UAAAA,EAAAA,UAAAA,QAAAA,EAAAA,EAAAA,MAAAA,KAAAA,WAAAA,OAAAA,EAAAA,EAAAA,SAAAA,KAAAA,IAAAA,SAAAA,IAAAA,GAAAA,oBAAAA,UAAAA,QAAAA,UAAAA,OAAAA,EAAAA,GAAAA,QAAAA,UAAAA,KAAAA,OAAAA,EAAAA,GAAAA,mBAAAA,MAAAA,OAAAA,EAAAA,IAAAA,OAAAA,QAAAA,UAAAA,QAAAA,KAAAA,QAAAA,UAAAA,QAAAA,GAAAA,gBAAAA,EAAAA,MAAAA,GAAAA,OAAAA,GAvHXC,IAAAA,EAAAA,GAfHC,EAAAA,EAAAA,SAECC,EADDC,EAAAA,WACCD,QAEDE,EAAAA,EAAAA,QACCC,EAAAA,EAAAA,UACAC,EAAAA,EAAAA,SACAC,EAAAA,EAAAA,cAGAC,EADDC,EAAAA,KACCD,GAGAE,EADDC,EAAAA,IACCD,aAIIX,EAAAA,SAAAA,IAqHSA,EAAAA,EAAAA,SAAAA,EAAAA,GAAAA,IAAAA,EAAAA,EAAAA,GApHA,SAAA,IAAA,IAAA,EAAA,OAAA,EAAA,EAAA,SAAA,KAAA,IACHa,EAAAA,EAAAA,MAAAA,KAAAA,YAELC,MAAQ,CACZC,OAAQ,GACRC,MAAO,GACPC,MAAO,IAGHC,EAAAA,eAAiB,EAAKA,eAAeC,MAA1C,EAAA,EAAA,SAAA,IACKC,EAAAA,eAAiB,EAAKA,eAAeD,MAA1C,EAAA,EAAA,SAAA,IAVa,EAoHAnB,OAAAA,EAAAA,EAAAA,SAAAA,EAAAA,CAAAA,CAAAA,IAAAA,iBAvGEqB,MAAAA,SAAAA,GAAQ,IAAA,EAAA,KACfN,EAAW,KAAKD,MAAhBC,OAC+B,EAAA,KAAKO,MAApCC,EAAAA,EAAAA,UAAWC,EAAAA,EAAAA,gBACdC,KAAAA,SAAU,CAAEV,OAAQM,IAEpBA,EAAMK,OAASX,EAAOW,QACrBD,KAAAA,SAAU,CAAET,MAAO,KAGrBW,IAAAA,EAAM,kBAAoBJ,EAC1BK,EAAY,GAEXP,IACJO,EAAUb,OAASc,mBAAoBR,IAGnCG,IACJI,EAAYE,OAAOC,OAAQH,EAAWJ,IAGvCtB,EAAU,CAAEyB,KAAOhB,EAAcgB,EAAMC,KAAgBI,KAAM,SAAAhB,GAC5D,EAAKS,SAAU,CAAET,MAAOA,KACtB,SAAAC,GACF,EAAKQ,SAAU,CAAER,MAAOA,EAAMgB,cAgFlBjC,CAAAA,IAAAA,iBA5EEkC,MAAAA,SAAAA,EAAOC,GACdC,IAAAA,EAAiB,KAAKd,MAAtBc,aASDA,OARPF,EAAMG,iBAEDZ,KAAAA,SAAU,CACdV,OAAQ,GACRC,MAAO,GACPC,MAAO,KAGDmB,EAAc,CAAED,OAAQA,MAkElBnC,CAAAA,IAAAA,SA/DL,MAAA,WAAA,IAGJsC,EAHI,EAAA,KACkB,EAAA,KAAKxB,MAAvBC,EAAAA,EAAAA,OAAQC,EAAAA,EAAAA,MACuC,EAAA,KAAKM,MAAtDiB,EAAAA,EAAAA,UAAWC,EAAAA,EAAAA,YAAaC,EAAAA,EAAAA,UAAWC,EAAAA,EAAAA,UAoCxC,OAjCMH,IACNA,EAAY9B,EAAI,cAAgB,eAG1B+B,IACNA,EAAc/B,EAAI,0BAA4B,eAG1CO,EAAMU,SACVY,EAAYtB,EAAM2B,IAAK,SAAEC,GAEvB,OAAA,EAAA,SAAA,CACC,KAAK,SAAS,IAAM,oCAAsCA,EAAKC,GAC/D,KAAK,SACS,gBAAA,OACd,UAAU,gFACV,QAAU,SAAEX,GAAW,OAAA,EAAKd,eAAgBc,EAAOU,EAAKC,MAEtDJ,GACD,EAAA,MAAA,CAAK,IAAI,SAAS,UAAU,qCAAqC,IAAI,GAAG,IAAMG,EAAKE,YAAYC,QAGhG,EAAA,OAAA,CAAM,IAAI,OAAO,UAAU,oCAAqCH,EAAKI,MAEnEN,GAAa,OAASA,EAAWE,IAClC,EAAA,OAAA,CAAM,IAAI,OAAO,UAAU,oCAAqCF,EAAWE,QAQ/E,EAAC,EACA,KAAA,EAAA,QAAA,CACC,KAAK,OACL,MAAQ7B,EACR,UAAU,gCACGwB,aAAAA,EACb,YAAcC,EACd,SAAW,SAAEN,GAAW,OAAA,EAAKhB,eAAgBgB,EAAMe,OAAO5B,UAEzD,IAAML,EAAMU,QACb,EAAC,EAAD,CACC,UAAU,mCACV,cAAe,EACf,SAAS,eAET,EAAA,MAAA,CAAK,UAAU,oCACZY,SASMtC,EArHTA,CAAsBM,GAqHbN,EAAAA,EAAAA,QAAAA,QAAAA;;ACvIA,aAAA,OAAA,eAAA,QAAA,aAAA,CAAA,OAAA,IAAA,QAAA,aAAA,EAFf,IAAA,EAAA,EAAA,QAAA,oBAEe,SAAA,EAAA,GAAA,OAAA,GAAA,EAAA,WAAA,EAAA,CAAA,QAAA,GAAA,IAAA,EAAA,CACdA,cAAAA,EAAAA,SADc,QAAA,QAAA;;ACHf,aAAA,OAAA,eAAA,QAAA,aAAA,CAAA,OAAA,IAAA,OAAA,eAAA,QAAA,kBAAA,CAAA,YAAA,EAAA,IAAA,WAAA,OAAA,EAAA,WAAA,IAAA,EAAA,EAAA,QAAA,iBAAA,SAAA,EAAA,GAAA,OAAA,GAAA,EAAA,WAAA,EAAA,CAAA,QAAA","file":"block-components.js","sourceRoot":"../../../src/js/bp-core/js/block-components","sourcesContent":["function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","var _typeof = require(\"../helpers/typeof\");\n\nvar assertThisInitialized = require(\"./assertThisInitialized\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;","/**\n * WordPress dependencies.\n */\nconst {\n\tapiFetch,\n\tcomponents: {\n\t\tPopover,\n\t},\n\telement: {\n\t\tComponent,\n\t\tFragment,\n\t\tcreateElement,\n\t},\n\ti18n: {\n\t\t__,\n\t},\n\turl: {\n\t\taddQueryArgs,\n\t},\n} = wp;\n\nclass AutoCompleter extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\tsearch: '',\n\t\t\titems: [],\n\t\t\terror: '',\n\t\t};\n\n\t\tthis.searchItemName = this.searchItemName.bind( this );\n\t\tthis.selectItemName = this.selectItemName.bind( this );\n\t}\n\n\tsearchItemName( value ) {\n\t\tconst { search } = this.state;\n\t\tconst { component, objectQueryArgs } = this.props;\n\t\tthis.setState( { search: value } );\n\n\t\tif ( value.length < search.length ) {\n\t\t\tthis.setState( { items: [] } );\n\t\t}\n\n\t\tlet path= '/buddypress/v1/' + component;\n\t\tlet queryArgs = {};\n\n\t\tif ( value ) {\n\t\t\tqueryArgs.search = encodeURIComponent( value );\n\t\t}\n\n\t\tif ( objectQueryArgs ) {\n\t\t\tqueryArgs = Object.assign( queryArgs, objectQueryArgs );\n\t\t}\n\n\t\tapiFetch( { path: addQueryArgs( path, queryArgs ) } ).then( items => {\n\t\t\tthis.setState( { items: items } );\n\t\t}, error => {\n\t\t\tthis.setState( { error: error.message } );\n\t\t} );\n\t}\n\n\tselectItemName( event, itemID ) {\n\t\tconst { onSelectItem } = this.props;\n\t\tevent.preventDefault();\n\n\t\tthis.setState( {\n\t\t\tsearch: '',\n\t\t\titems: [],\n\t\t\terror: '',\n\t\t} );\n\n\t\treturn onSelectItem( { itemID: itemID } );\n\t}\n\n\trender() {\n\t\tconst { search, items } = this.state;\n\t\tlet { ariaLabel, placeholder, useAvatar, slugValue } = this.props;\n\t\tlet itemsList;\n\n\t\tif ( ! ariaLabel ) {\n\t\t\tariaLabel = __( 'Item\\'s name', 'buddypress' );\n\t\t}\n\n\t\tif ( ! placeholder ) {\n\t\t\tplaceholder = __( 'Enter Item\\'s name here…', 'buddypress' );\n\t\t}\n\n\t\tif ( items.length ) {\n\t\t\titemsList = items.map( ( item ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\" key={ 'editor-autocompleters__item-item-' + item.id }\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\taria-selected=\"true\"\n\t\t\t\t\t\tclassName=\"components-button components-autocomplete__result editor-autocompleters__user\"\n\t\t\t\t\t\tonClick={ ( event ) => this.selectItemName( event, item.id ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ useAvatar && (\n\t\t\t\t\t\t\t<img key=\"avatar\" className=\"editor-autocompleters__user-avatar\" alt=\"\" src={ item.avatar_urls.thumb } />\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t<span key=\"name\" className=\"editor-autocompleters__user-name\">{ item.name }</span>\n\n\t\t\t\t\t\t{ slugValue && null !== slugValue( item ) && (\n\t\t\t\t\t\t\t<span key=\"slug\" className=\"editor-autocompleters__user-slug\">{ slugValue( item ) }</span>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</button>\n\t\t\t\t);\n\t\t\t} );\n\t\t}\n\n\t\treturn (\n\t\t\t<Fragment>\n\t\t\t\t<input\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\tvalue={ search }\n\t\t\t\t\tclassName=\"components-placeholder__input\"\n\t\t\t\t\taria-label={ ariaLabel }\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\tonChange={ ( event ) => this.searchItemName( event.target.value ) }\n\t\t\t\t/>\n\t\t\t\t{ 0 !== items.length &&\n\t\t\t\t\t<Popover\n\t\t\t\t\t\tclassName=\"components-autocomplete__popover\"\n\t\t\t\t\t\tfocusOnMount={ false }\n\t\t\t\t\t\tposition=\"bottom left\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<div className=\"components-autocomplete__results\">\n\t\t\t\t\t\t\t{ itemsList }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Popover>\n\t\t\t\t}\n\t\t\t</Fragment>\n\t\t);\n\t}\n}\n\nexport default AutoCompleter;\n","// Components\nimport AutoCompleter from './autocompleter'\n\nexport default {\n\tAutoCompleter\n};\n","export { default as blockComponents } from './components';\n"]}
bp-core/js/bp-api-request.min.js CHANGED
@@ -1 +1 @@
1
- window.bp=window.bp||{},function(e,n,t){"undefined"!=typeof bpApiSettings&&(n.isRestEnabled=!0,n.apiRequest=function(n){var p;if(n.dataType||(n.dataType="json"),e.apiRequest)p=e.apiRequest(n);else{var i=bpApiSettings.root;n.path&&(i+=n.path.replace(/^\//,"")),n.url||(n.url=i),-1!==n.url.indexOf(i)&&(n.beforeSend=function(e){e.setRequestHeader("X-WP-Nonce",bpApiSettings.nonce)}),p=t.ajax(n)}return p.then(null,function(e){var n={code:"unexpected_error",message:bpApiSettings.unexpectedError,data:{status:404}};return e&&e.responseJSON&&(n=e.responseJSON),n})})}(window.wp||{},window.bp,jQuery);
1
+ window.bp=window.bp||{},function(t,e,p){"undefined"!=typeof bpApiSettings&&(e.isRestEnabled=!0,e.apiRequest=function(e){var n;return e.dataType||(e.dataType="json"),(t.apiRequest?t.apiRequest(e):(n=bpApiSettings.root,e.path&&(n+=e.path.replace(/^\//,"")),e.url||(e.url=n),-1!==e.url.indexOf(n)&&(e.beforeSend=function(e){e.setRequestHeader("X-WP-Nonce",bpApiSettings.nonce)}),p.ajax(e))).then(null,function(e){var n={code:"unexpected_error",message:bpApiSettings.unexpectedError,data:{status:404}};return n=e&&e.responseJSON?e.responseJSON:n})})}(window.wp||{},window.bp,jQuery);
bp-core/js/bp-plupload.js CHANGED
@@ -1,9 +1,9 @@
1
- /* global bp, plupload, BP_Uploader, _, JSON, Backbone */
2
 
3
  window.wp = window.wp || {};
4
  window.bp = window.bp || {};
5
 
6
- ( function( exports, $ ) {
7
 
8
  // Bail if not set.
9
  if ( typeof BP_Uploader === 'undefined' ) {
@@ -85,14 +85,17 @@ window.bp = window.bp || {};
85
 
86
  if ( uploader.features.dragdrop && ! self.params.browser.mobile ) {
87
  container.addClass( 'drag-drop' );
88
- drop_element.bind( 'dragover.wp-uploader', function() {
 
89
  container.addClass( 'drag-over' );
90
- } ).bind( 'dragleave.wp-uploader, drop.wp-uploader', function() {
 
 
91
  container.removeClass( 'drag-over' );
92
  } );
93
  } else {
94
  container.removeClass( 'drag-drop' );
95
- drop_element.unbind( '.wp-uploader' );
96
  }
97
 
98
  } );
@@ -416,4 +419,4 @@ window.bp = window.bp || {};
416
  template: bp.template( 'progress-window' )
417
  } );
418
 
419
- })( bp, jQuery );
1
+ /* global plupload, BP_Uploader, _, JSON, Backbone */
2
 
3
  window.wp = window.wp || {};
4
  window.bp = window.bp || {};
5
 
6
+ ( function( bp, $ ) {
7
 
8
  // Bail if not set.
9
  if ( typeof BP_Uploader === 'undefined' ) {
85
 
86
  if ( uploader.features.dragdrop && ! self.params.browser.mobile ) {
87
  container.addClass( 'drag-drop' );
88
+
89
+ drop_element.on( 'dragover.wp-uploader', function() {
90
  container.addClass( 'drag-over' );
91
+ } );
92
+
93
+ drop_element.on( 'dragleave.wp-uploader, drop.wp-uploader', function() {
94
  container.removeClass( 'drag-over' );
95
  } );
96
  } else {
97
  container.removeClass( 'drag-drop' );
98
+ drop_element.off( '.wp-uploader' );
99
  }
100
 
101
  } );
419
  template: bp.template( 'progress-window' )
420
  } );
421
 
422
+ })( window.bp, jQuery );
bp-core/js/bp-plupload.min.js CHANGED
@@ -1 +1 @@
1
- window.wp=window.wp||{},window.bp=window.bp||{},function(e,i){"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 e=this,t=-1!==navigator.userAgent.indexOf("Trident/")||-1!==navigator.userAgent.indexOf("MSIE ");this.params=BP_Uploader.settings,this.strings=BP_Uploader.strings,this.supports={upload:this.params.browser.supported},this.supported=this.supports.upload,this.supported?(t||"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(t){var s=i("#"+e.params.defaults.container),a=i("#"+e.params.defaults.drop_element);"html4"===t.runtime&&(t.settings.multipart_params.html4=!0),"bp_avatar_upload"===t.settings.multipart_params.action&&(t.settings.multipart_params.bp_params.ui_available_width=s.width()),t.features.dragdrop&&!e.params.browser.mobile?(s.addClass("drag-drop"),a.bind("dragover.wp-uploader",function(){s.addClass("drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){s.removeClass("drag-over")})):(s.removeClass("drag-drop"),a.unbind(".wp-uploader"))}),this.uploader.bind("postinit",function(e){e.refresh()}),this.uploader.init(),this.feedback=function(e,i,t){!_.isNull(t)&&t.item&&t.item.clear(),bp.Uploader.filesError.unshift({message:e,data:i,file:t})},this.uploader.bind("FilesAdded",function(t,s){var a=parseInt(t.settings.max_file_size,10),r=this;if(!t.settings.multi_selection&&s.length>1){for(var n in s)t.removeFile(s[n]);i(e).trigger("bp-uploader-warning",e.strings.unique_file_warning)}else _.each(s,function(e){var i;plupload.FAILED!==e.status&&(a>104857600&&e.size>104857600&&"html5"!==t.runtime?r.uploadSizeError(t,e,!0):(i=_.extend({id:e.id,file:e,uploading:!0,date:new Date,filename:e.name},_.pick(e,"loaded","size","percent")),e.item=new bp.Models.File(i),bp.Uploader.filesQueue.add(e.item)))}),t.refresh(),t.start()}),this.uploader.bind("UploadProgress",function(e,i){i.item.set(_.pick(i,"loaded","percent"))}),this.uploader.bind("FileUploaded",function(i,t,s){var a=e.strings.default_error;try{s=JSON.parse(s.response)}catch(i){return e.feedback(a,i,t)}return!_.isObject(s)||_.isUndefined(s.success)?e.feedback(a,null,t):s.success?(_.each(["file","loaded","size","percent"],function(e){t.item.unset(e)}),t.item.set(_.extend(s.data,{uploading:!1})),void bp.Uploader.filesUploaded.add(t.item)):(s.data&&s.data.message&&(a=s.data.message),e.feedback(a,s.data,t))}),this.uploader.bind("BeforeUpload",function(t,s){i(e).trigger("bp-uploader-new-upload",t,s)}),this.uploader.bind("UploadComplete",function(t,s){i(e).trigger("bp-uploader-upload-complete",t,s),bp.Uploader.filesQueue.reset()}),this.uploader.bind("Error",function(t,s){var a,r=e.strings.default_error,n={FAILED:e.strings.upload_failed,FILE_EXTENSION_ERROR:e.strings.invalid_filetype,IMAGE_FORMAT_ERROR:e.strings.not_an_image,IMAGE_MEMORY_ERROR:e.strings.image_memory_exceeded,IMAGE_DIMENSIONS_ERROR:e.strings.image_dimensions_exceeded,GENERIC_ERROR:e.strings.upload_failed,IO_ERROR:e.strings.io_error,HTTP_ERROR:e.strings.http_error,SECURITY_ERROR:e.strings.security_error,FILE_SIZE_ERROR:e.strings.file_exceeds_size_limit.replace("%s",i("<span />").text(s.file.name).html())};for(a in n)if(s.code===plupload[a]){r=n[a];break}i(e).trigger("bp-uploader-warning",r),t.refresh()})):BP_Uploader=void 0},bp.Models.File=Backbone.Model.extend({file:{}}),i.extend(bp.Uploader,{filesQueue:new Backbone.Collection,filesUploaded:new Backbone.Collection,filesError:new Backbone.Collection}),bp.View=bp.Backbone.View.extend({inject:function(e){this.render(),i(e).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,i(this.uploader).on("bp-uploader-warning",_.bind(this.setWarning,this)),i(this.uploader).on("bp-uploader-new-upload",_.bind(this.resetWarning,this))},setWarning:function(e,i){if(!_.isUndefined(i)){var t=new bp.Views.uploaderWarning({value:i}).render();this.warnings.push(t),this.$el.after(t.el)}},resetWarning:function(){0!==this.warnings.length&&(_.each(this.warnings,function(e){e.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(e){this.views.add(new bp.Views.uploaderProgress({model:e}))},progress:function(e){_.isUndefined(e.get("percent"))||i("#"+e.get("id")+" .bp-progress .bp-bar").css("width",e.get("percent")+"%")},feedback:function(e){_.isUndefined(e.get("message"))||_.isUndefined(e.get("file"))||i("#"+e.get("file").id).html(e.get("message")).addClass("error")}}),bp.Views.uploaderProgress=bp.View.extend({className:"bp-uploader-progress",template:bp.template("progress-window")}))}(bp,jQuery);
1
+ window.wp=window.wp||{},window.bp=window.bp||{},function(d,o){"undefined"!=typeof BP_Uploader&&(_.extend(d,_.pick(wp,"Backbone","ajax","template")),d.Models=d.Models||{},d.Collections=d.Collections||{},d.Views=d.Views||{},d.Uploader={},d.Uploader.uploader=function(){var n=this,e=-1!==navigator.userAgent.indexOf("Trident/")||-1!==navigator.userAgent.indexOf("MSIE ");this.params=BP_Uploader.settings,this.strings=BP_Uploader.strings,this.supports={upload:this.params.browser.supported},this.supported=this.supports.upload,this.supported?(e||"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(e){var i=o("#"+n.params.defaults.container),t=o("#"+n.params.defaults.drop_element);"html4"===e.runtime&&(e.settings.multipart_params.html4=!0),"bp_avatar_upload"===e.settings.multipart_params.action&&(e.settings.multipart_params.bp_params.ui_available_width=i.width()),e.features.dragdrop&&!n.params.browser.mobile?(i.addClass("drag-drop"),t.on("dragover.wp-uploader",function(){i.addClass("drag-over")}),t.on("dragleave.wp-uploader, drop.wp-uploader",function(){i.removeClass("drag-over")})):(i.removeClass("drag-drop"),t.off(".wp-uploader"))}),this.uploader.bind("postinit",function(e){e.refresh()}),this.uploader.init(),this.feedback=function(e,i,t){!_.isNull(t)&&t.item&&t.item.clear(),d.Uploader.filesError.unshift({message:e,data:i,file:t})},this.uploader.bind("FilesAdded",function(t,e){var s=104857600,a=parseInt(t.settings.max_file_size,10),r=this;if(!t.settings.multi_selection&&1<e.length){for(var i in e)t.removeFile(e[i]);o(n).trigger("bp-uploader-warning",n.strings.unique_file_warning)}else _.each(e,function(e){var i;plupload.FAILED!==e.status&&(s<a&&e.size>s&&"html5"!==t.runtime?r.uploadSizeError(t,e,!0):(i=_.extend({id:e.id,file:e,uploading:!0,date:new Date,filename:e.name},_.pick(e,"loaded","size","percent")),e.item=new d.Models.File(i),d.Uploader.filesQueue.add(e.item)))}),t.refresh(),t.start()}),this.uploader.bind("UploadProgress",function(e,i){i.item.set(_.pick(i,"loaded","percent"))}),this.uploader.bind("FileUploaded",function(e,i,t){var s=n.strings.default_error;try{t=JSON.parse(t.response)}catch(e){return n.feedback(s,e,i)}return!_.isObject(t)||_.isUndefined(t.success)?n.feedback(s,null,i):t.success?(_.each(["file","loaded","size","percent"],function(e){i.item.unset(e)}),i.item.set(_.extend(t.data,{uploading:!1})),void d.Uploader.filesUploaded.add(i.item)):(t.data&&t.data.message&&(s=t.data.message),n.feedback(s,t.data,i))}),this.uploader.bind("BeforeUpload",function(e,i){o(n).trigger("bp-uploader-new-upload",e,i)}),this.uploader.bind("UploadComplete",function(e,i){o(n).trigger("bp-uploader-upload-complete",e,i),d.Uploader.filesQueue.reset()}),this.uploader.bind("Error",function(e,i){var t,s=n.strings.default_error,a={FAILED:n.strings.upload_failed,FILE_EXTENSION_ERROR:n.strings.invalid_filetype,IMAGE_FORMAT_ERROR:n.strings.not_an_image,IMAGE_MEMORY_ERROR:n.strings.image_memory_exceeded,IMAGE_DIMENSIONS_ERROR:n.strings.image_dimensions_exceeded,GENERIC_ERROR:n.strings.upload_failed,IO_ERROR:n.strings.io_error,HTTP_ERROR:n.strings.http_error,SECURITY_ERROR:n.strings.security_error,FILE_SIZE_ERROR:n.strings.file_exceeds_size_limit.replace("%s",o("<span />").text(i.file.name).html())};for(t in a)if(i.code===plupload[t]){s=a[t];break}o(n).trigger("bp-uploader-warning",s),e.refresh()})):BP_Uploader=void 0},d.Models.File=Backbone.Model.extend({file:{}}),o.extend(d.Uploader,{filesQueue:new Backbone.Collection,filesUploaded:new Backbone.Collection,filesError:new Backbone.Collection}),d.View=d.Backbone.View.extend({inject:function(e){this.render(),o(e).html(this.el),this.views.ready()},prepare:function(){return!_.isUndefined(this.model)&&_.isFunction(this.model.toJSON)?this.model.toJSON():{}}}),d.Views.Uploader=d.View.extend({className:"bp-uploader-window",template:d.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 d.Uploader.uploader,o(this.uploader).on("bp-uploader-warning",_.bind(this.setWarning,this)),o(this.uploader).on("bp-uploader-new-upload",_.bind(this.resetWarning,this))},setWarning:function(e,i){_.isUndefined(i)||(i=new d.Views.uploaderWarning({value:i}).render(),this.warnings.push(i),this.$el.after(i.el))},resetWarning:function(){0!==this.warnings.length&&(_.each(this.warnings,function(e){e.remove()}),this.warnings=[])}}),d.Views.uploaderWarning=d.View.extend({tagName:"p",className:"warning",initialize:function(){this.value=this.options.value},render:function(){return this.$el.html(this.value),this}}),d.Views.uploaderStatus=d.View.extend({className:"files",initialize:function(){_.each(this.collection.models,this.addFile,this),this.collection.on("change:percent",this.progress,this),d.Uploader.filesError.on("add",this.feedback,this)},addFile:function(e){this.views.add(new d.Views.uploaderProgress({model:e}))},progress:function(e){_.isUndefined(e.get("percent"))||o("#"+e.get("id")+" .bp-progress .bp-bar").css("width",e.get("percent")+"%")},feedback:function(e){_.isUndefined(e.get("message"))||_.isUndefined(e.get("file"))||o("#"+e.get("file").id).html(e.get("message")).addClass("error")}}),d.Views.uploaderProgress=d.View.extend({className:"bp-uploader-progress",template:d.template("progress-window")}))}(window.bp,jQuery);
bp-core/js/confirm.js CHANGED
@@ -1,7 +1,7 @@
1
  /* jshint devel: true */
2
  /* global BP_Confirm */
3
 
4
- jQuery( document ).ready( function() {
5
  jQuery( '#buddypress' ).on( 'click', 'a.confirm', function() {
6
  if ( confirm( BP_Confirm.are_you_sure ) ) {
7
  return true;
1
  /* jshint devel: true */
2
  /* global BP_Confirm */
3
 
4
+ jQuery( function() {
5
  jQuery( '#buddypress' ).on( 'click', 'a.confirm', function() {
6
  if ( confirm( BP_Confirm.are_you_sure ) ) {
7
  return true;
bp-core/js/confirm.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(){jQuery("#buddypress").on("click","a.confirm",function(){return!!confirm(BP_Confirm.are_you_sure)})});
1
+ jQuery(function(){jQuery("#buddypress").on("click","a.confirm",function(){return!!confirm(BP_Confirm.are_you_sure)})});
bp-core/js/cover-image.js CHANGED
@@ -1,8 +1,8 @@
1
- /* global bp, BP_Uploader, _, Backbone */
2
 
3
  window.bp = window.bp || {};
4
 
5
- ( function( exports, $ ) {
6
 
7
  // Bail if not set.
8
  if ( typeof BP_Uploader === 'undefined' ) {
@@ -274,4 +274,4 @@ window.bp = window.bp || {};
274
 
275
  bp.CoverImage.start();
276
 
277
- })( bp, jQuery );
1
+ /* global BP_Uploader, _, Backbone */
2
 
3
  window.bp = window.bp || {};
4
 
5
+ ( function( bp, $ ) {
6
 
7
  // Bail if not set.
8
  if ( typeof BP_Uploader === 'undefined' ) {
274
 
275
  bp.CoverImage.start();
276
 
277
+ })( window.bp, jQuery );
bp-core/js/cover-image.min.js CHANGED
@@ -1 +1 @@
1
- window.bp=window.bp||{},function(e,i){"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 e=new bp.Views.Uploader;this.views.add({id:"upload",view:e}),e.inject(".bp-cover-image")},uploadProgress:function(){var e=new bp.Views.coverImageUploadProgress({collection:bp.Uploader.filesQueue});_.isUndefined(this.views.get("status"))?this.views.add({id:"status",view:e}):this.views.set({id:"status",view:e}),e.inject(".bp-cover-image-status")},deleteView:function(){var e=new Backbone.Model(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,["object","item_id","nonces"]));if(_.isUndefined(this.views.get("delete"))){var i=new bp.Views.DeleteCoverImage({model:e});this.views.add({id:"delete",view:i}),i.inject(".bp-cover-image-manage")}},deleteCoverImage:function(e){var t,a=this;_.isUndefined(this.views.get("delete"))||((t=this.views.get("delete")).get("view").remove(),this.views.remove({id:"delete",view:t})),bp.ajax.post("bp_cover_image_delete",{json:!0,item_id:e.get("item_id"),object:e.get("object"),nonce:e.get("nonces").remove}).done(function(t){var s=new bp.Views.CoverImageStatus({value:BP_Uploader.strings.feedback_messages[t.feedback_code],type:"success"});a.views.add({id:"status",view:s}),s.inject(".bp-cover-image-status"),""===t.reset_url?i("#header-cover-image").css({"background-image":"none"}):i("#header-cover-image").css({"background-image":"url( "+t.reset_url+" )"}),BP_Uploader.settings.defaults.multipart_params.bp_params.has_cover_image=!1,a.Attachment.set(_.extend(_.pick(e.attributes,["object","item_id"]),{url:t.reset_url,action:"deleted"}))}).fail(function(e){var i=BP_Uploader.strings.default_error;_.isUndefined(e)||(i=BP_Uploader.strings.feedback_messages[e.feedback_code]);var t=new bp.Views.CoverImageStatus({value:i,type:"error"});a.views.add({id:"status",view:t}),t.inject(".bp-cover-image-status"),bp.CoverImage.deleteView()})},removeWarning:function(){_.isNull(this.warning)||this.warning.remove()},displayWarning:function(e){this.removeWarning(),this.warning=new bp.Views.uploaderWarning({value:e}),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(e){var t,a;_.isUndefined(e.get("url"))||(0===e.get("feedback_code")?(t=BP_Uploader.strings.cover_image_warnings.dimensions,a="warning"):(t=BP_Uploader.strings.feedback_messages[e.get("feedback_code")],a="success"),this.views.set(".bp-uploader-progress",new bp.Views.CoverImageStatus({value:t,type:a})),i("#header-cover-image").css({"background-image":"url( "+e.get("url")+" )"}),bp.CoverImage.deleteView(),bp.CoverImage.Attachment.set(_.extend(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,["object","item_id"]),{url:e.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(e){e.preventDefault(),bp.CoverImage.deleteCoverImage(this.model)}}),bp.CoverImage.start())}(bp,jQuery);
1
+ window.bp=window.bp||{},function(a,n){"undefined"!=typeof BP_Uploader&&(a.Models=a.Models||{},a.Collections=a.Collections||{},a.Views=a.Views||{},a.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(){a.Uploader.filesQueue.on("add",this.uploadProgress,this);var e=new a.Views.Uploader;this.views.add({id:"upload",view:e}),e.inject(".bp-cover-image")},uploadProgress:function(){var e=new a.Views.coverImageUploadProgress({collection:a.Uploader.filesQueue});_.isUndefined(this.views.get("status"))?this.views.add({id:"status",view:e}):this.views.set({id:"status",view:e}),e.inject(".bp-cover-image-status")},deleteView:function(){var e=new Backbone.Model(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,["object","item_id","nonces"]));_.isUndefined(this.views.get("delete"))&&(e=new a.Views.DeleteCoverImage({model:e}),this.views.add({id:"delete",view:e}),e.inject(".bp-cover-image-manage"))},deleteCoverImage:function(t){var e,s=this;_.isUndefined(this.views.get("delete"))||((e=this.views.get("delete")).get("view").remove(),this.views.remove({id:"delete",view:e})),a.ajax.post("bp_cover_image_delete",{json:!0,item_id:t.get("item_id"),object:t.get("object"),nonce:t.get("nonces").remove}).done(function(e){var i=new a.Views.CoverImageStatus({value:BP_Uploader.strings.feedback_messages[e.feedback_code],type:"success"});s.views.add({id:"status",view:i}),i.inject(".bp-cover-image-status"),""===e.reset_url?n("#header-cover-image").css({"background-image":"none"}):n("#header-cover-image").css({"background-image":"url( "+e.reset_url+" )"}),BP_Uploader.settings.defaults.multipart_params.bp_params.has_cover_image=!1,s.Attachment.set(_.extend(_.pick(t.attributes,["object","item_id"]),{url:e.reset_url,action:"deleted"}))}).fail(function(e){var i=BP_Uploader.strings.default_error;_.isUndefined(e)||(i=BP_Uploader.strings.feedback_messages[e.feedback_code]);i=new a.Views.CoverImageStatus({value:i,type:"error"});s.views.add({id:"status",view:i}),i.inject(".bp-cover-image-status"),a.CoverImage.deleteView()})},removeWarning:function(){_.isNull(this.warning)||this.warning.remove()},displayWarning:function(e){this.removeWarning(),this.warning=new a.Views.uploaderWarning({value:e}),this.warning.inject(".bp-cover-image-status")}},a.Views.coverImageUploadProgress=a.Views.uploaderStatus.extend({className:"files",initialize:function(){a.Views.uploaderStatus.prototype.initialize.apply(this,arguments),this.collection.on("change:url",this.uploadResult,this)},uploadResult:function(e){var i,t;_.isUndefined(e.get("url"))||(t=0===e.get("feedback_code")?(i=BP_Uploader.strings.cover_image_warnings.dimensions,"warning"):(i=BP_Uploader.strings.feedback_messages[e.get("feedback_code")],"success"),this.views.set(".bp-uploader-progress",new a.Views.CoverImageStatus({value:i,type:t})),n("#header-cover-image").css({"background-image":"url( "+e.get("url")+" )"}),a.CoverImage.deleteView(),a.CoverImage.Attachment.set(_.extend(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,["object","item_id"]),{url:e.get("url"),action:"uploaded"})))}}),a.Views.CoverImageStatus=a.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}}),a.Views.DeleteCoverImage=a.View.extend({tagName:"div",id:"bp-delete-cover-image-container",template:a.template("bp-cover-image-delete"),events:{"click #bp-delete-cover-image":"deleteCoverImage"},deleteCoverImage:function(e){e.preventDefault(),a.CoverImage.deleteCoverImage(this.model)}}),a.CoverImage.start())}(window.bp,jQuery);
bp-core/js/jquery-query.min.js CHANGED
@@ -1 +1 @@
1
- function bp_get_querystring(n){var t=location.search.split(n+"=")[1];return t?decodeURIComponent(t.split("&")[0]):null}
1
+ function bp_get_querystring(n){n=location.search.split(n+"=")[1];return n?decodeURIComponent(n.split("&")[0]):null}
bp-core/js/vendor/jquery-cookie.js CHANGED
@@ -52,14 +52,14 @@
52
 
53
  function read(s, converter) {
54
  var value = config.raw ? s : parseCookieValue(s);
55
- return $.isFunction(converter) ? converter(value) : value;
56
  }
57
 
58
  var config = $.cookie = function(key, value, options) {
59
 
60
  // Write.
61
 
62
- if (value !== undefined && !$.isFunction(value)) {
63
  options = $.extend({}, config.defaults, options);
64
 
65
  if (typeof options.expires === 'number') {
@@ -117,4 +117,4 @@
117
  return !$.cookie(key);
118
  };
119
 
120
- }));
52
 
53
  function read(s, converter) {
54
  var value = config.raw ? s : parseCookieValue(s);
55
+ return typeof converter === 'function' ? converter(value) : value;
56
  }
57
 
58
  var config = $.cookie = function(key, value, options) {
59
 
60
  // Write.
61
 
62
+ if (value !== undefined && typeof value !== 'function' ) {
63
  options = $.extend({}, config.defaults, options);
64
 
65
  if (typeof options.expires === 'number') {
117
  return !$.cookie(key);
118
  };
119
 
120
+ }));
bp-core/js/vendor/jquery-cookie.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){function n(e){return u.raw?e:encodeURIComponent(e)}function o(e){return u.raw?e:decodeURIComponent(e)}function i(e){return n(u.json?JSON.stringify(e):String(e))}function r(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(c," ")),u.json?JSON.parse(e):e}catch(e){}}function t(n,o){var i=u.raw?n:r(n);return e.isFunction(o)?o(i):i}var c=/\+/g,u=e.cookie=function(r,c,f){if(void 0!==c&&!e.isFunction(c)){if("number"==typeof(f=e.extend({},u.defaults,f)).expires){var a=f.expires,d=f.expires=new Date;d.setTime(+d+864e5*a)}return document.cookie=[n(r),"=",i(c),f.expires?"; expires="+f.expires.toUTCString():"",f.path?"; path="+f.path:"",f.domain?"; domain="+f.domain:"",f.secure?"; secure":""].join("")}for(var p=r?void 0:{},s=document.cookie?document.cookie.split("; "):[],m=0,x=s.length;m<x;m++){var v=s[m].split("="),k=o(v.shift()),l=v.join("=");if(r&&r===k){p=t(l,c);break}r||void 0===(l=t(l))||(p[k]=l)}return p};u.defaults={},e.removeCookie=function(n,o){return void 0!==e.cookie(n)&&(e.cookie(n,"",e.extend({},o,{expires:-1})),!e.cookie(n))}});
1
+ !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)}(function(d){var n=/\+/g;function s(e){return x.raw?e:encodeURIComponent(e)}function m(e,o){e=x.raw?e:function(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(n," ")),x.json?JSON.parse(e):e}catch(e){}}(e);return"function"==typeof o?o(e):e}var x=d.cookie=function(e,o,n){var i,t;if(void 0!==o&&"function"!=typeof o)return"number"==typeof(n=d.extend({},x.defaults,n)).expires&&(t=n.expires,(i=n.expires=new Date).setTime(+i+864e5*t)),document.cookie=[s(e),"=",(t=o,s(x.json?JSON.stringify(t):String(t))),n.expires?"; expires="+n.expires.toUTCString():"",n.path?"; path="+n.path:"",n.domain?"; domain="+n.domain:"",n.secure?"; secure":""].join("");for(var r=e?void 0:{},c=document.cookie?document.cookie.split("; "):[],u=0,f=c.length;u<f;u++){var p=c[u].split("="),a=(a=p.shift(),x.raw?a:decodeURIComponent(a)),p=p.join("=");if(e&&e===a){r=m(p,o);break}e||void 0===(p=m(p))||(r[a]=p)}return r};x.defaults={},d.removeCookie=function(e,o){return void 0!==d.cookie(e)&&(d.cookie(e,"",d.extend({},o,{expires:-1})),!d.cookie(e))}});
bp-core/js/vendor/jquery-scroll-to.js CHANGED
@@ -2,62 +2,48 @@
2
  /* jshint -W065 */
3
 
4
  /*!
5
- * jQuery.ScrollTo
6
- * Copyright (c) 2007-2014 Ariel Flesler - aflesler<a>gmail<d>com | http://flesler.blogspot.com
7
  * Licensed under MIT
8
- * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
9
- * @projectDescription Easy element scrolling using jQuery.
10
  * @author Ariel Flesler
11
- * @version 1.4.12
12
  */
13
-
14
- (function(factory) {
15
- // AMD.
16
  if (typeof define === 'function' && define.amd) {
 
17
  define(['jquery'], factory);
18
- // CommonJS.
19
- } else if (typeof exports === 'object') {
20
- factory(require('jquery'));
21
- // Browser globals.
22
  } else {
 
23
  factory(jQuery);
24
  }
25
- }(function($) {
 
26
 
27
  var $scrollTo = $.scrollTo = function(target, duration, settings) {
28
  return $(window).scrollTo(target, duration, settings);
29
  };
30
 
31
  $scrollTo.defaults = {
32
- axis: 'xy',
33
- duration: parseFloat($.fn.jquery) >= 1.3 ? 0 : 1,
34
- limit: true
35
- };
36
-
37
- // Returns the element that needs to be animated to scroll the window.
38
- // Kept for backwards compatibility (specially for localScroll & serialScroll).
39
- $scrollTo.window = function() {
40
- return $(window)._scrollable();
41
  };
42
 
43
- // Hack, hack, hack :)
44
- // Returns the real elements to scroll (supports window/iframes, documents and regular nodes).
45
- $.fn._scrollable = function() {
46
- return this.map(function() {
47
- var elem = this,
48
- isWin = !elem.nodeName || $.inArray(elem.nodeName.toLowerCase(), ['iframe', '#document', 'html', 'body']) !== -1;
49
-
50
- if (!isWin) {
51
- return elem;
52
- }
53
-
54
- var doc = (elem.contentWindow || elem).document || elem.ownerDocument || elem;
55
 
56
- return /webkit/i.test(navigator.userAgent) || doc.compatMode === 'BackCompat' ?
57
- doc.body :
58
- doc.documentElement;
59
- });
60
- };
61
 
62
  $.fn.scrollTo = function(target, duration, settings) {
63
  if (typeof duration === 'object') {
@@ -65,41 +51,37 @@
65
  duration = 0;
66
  }
67
  if (typeof settings === 'function') {
68
- settings = {onAfter: settings};
69
  }
70
-
71
  if (target === 'max') {
72
  target = 9e9;
73
  }
74
 
75
  settings = $.extend({}, $scrollTo.defaults, settings);
76
- // Speed is still recognized for backwards compatibility.
77
  duration = duration || settings.duration;
78
- // Make sure the settings are given right.
79
- settings.queue = settings.queue && settings.axis.length > 1;
80
-
81
- // Let's keep the overall duration.
82
- if (settings.queue) {
83
  duration /= 2;
84
  }
85
-
86
  settings.offset = both(settings.offset);
87
  settings.over = both(settings.over);
88
 
89
- return this._scrollable().each(function() {
 
 
90
 
91
- // Null target yields nothing, just like jQuery does.
92
- if (target === null) {
93
- return;
94
- }
95
-
96
- var elem = this,
97
- $elem = $(elem),
98
- targ = target, toff, attr = {},
99
- win = $elem.is('html,body');
100
 
101
  switch (typeof targ) {
102
- // A number will pass the regex.
103
  case 'number':
104
  case 'string':
105
  if (/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)) {
@@ -107,102 +89,130 @@
107
  // We are done
108
  break;
109
  }
110
- // Relative/Absolute selector, no break!
111
- targ = win ? $(targ) : $(targ, this);
112
- if (!targ.length) {
113
- return;
114
- }
115
  /* falls through */
116
  case 'object':
117
- // DOMElement / jQuery.
 
118
  if (targ.is || targ.style) {
119
- // Get the real position of the target.
120
  toff = (targ = $(targ)).offset();
121
  }
122
  }
123
 
124
- var offset = $.isFunction(settings.offset) && settings.offset(elem, targ) || settings.offset;
125
 
126
  $.each(settings.axis.split(''), function(i, axis) {
127
- var Pos = axis === 'x' ? 'Left' : 'Top',
128
- pos = Pos.toLowerCase(),
129
- key = 'scroll' + Pos,
130
- old = elem[key],
131
- max = $scrollTo.max(elem, axis);
132
 
133
- if (toff) { // jQuery / DOMElement.
134
- attr[key] = toff[pos] + (win ? 0 : old - $elem.offset()[pos]);
135
 
136
- // If it's a dom element, reduce the margin.
137
  if (settings.margin) {
138
- attr[key] -= parseInt(targ.css('margin' + Pos)) || 0;
139
- attr[key] -= parseInt(targ.css('border' + Pos + 'Width')) || 0;
140
  }
141
 
142
  attr[key] += offset[pos] || 0;
143
 
144
- // Scroll to a fraction of its width/height.
145
  if (settings.over[pos]) {
146
- attr[key] += targ[axis === 'x' ? 'width' : 'height']() * settings.over[pos];
 
147
  }
148
  } else {
149
  var val = targ[pos];
150
- // Handle percentage values.
151
  attr[key] = val.slice && val.slice(-1) === '%' ?
152
- parseFloat(val) / 100 * max
153
- : val;
154
  }
155
 
156
- // Number or 'number'.
157
  if (settings.limit && /^\d+$/.test(attr[key])) {
158
  // Check the limits
159
  attr[key] = attr[key] <= 0 ? 0 : Math.min(attr[key], max);
160
  }
161
 
162
- // Queueing axes.
163
- if (!i && settings.queue) {
164
- // Don't waste time animating, if there's no need.
165
- if (old !== attr[key]) {
166
- // Intermediate animation.
 
 
167
  animate(settings.onAfterFirst);
 
 
168
  }
169
- // Don't animate this axis again in the next iteration.
170
- delete attr[key];
171
  }
172
  });
173
 
174
  animate(settings.onAfter);
175
 
176
  function animate(callback) {
177
- $elem.animate(attr, duration, settings.easing, callback && function() {
178
- callback.call(this, targ, settings);
 
 
 
 
 
 
179
  });
 
180
  }
181
-
182
- }).end();
183
  };
184
 
185
  // Max scrolling position, works on quirks mode
186
  // It only fails (not too badly) on IE, quirks mode.
187
  $scrollTo.max = function(elem, axis) {
188
  var Dim = axis === 'x' ? 'Width' : 'Height',
189
- scroll = 'scroll' + Dim;
190
 
191
- if (!$(elem).is('html,body')) {
192
  return elem[scroll] - $(elem)[Dim.toLowerCase()]();
193
- }
194
 
195
  var size = 'client' + Dim,
196
- html = elem.ownerDocument.documentElement,
197
- body = elem.ownerDocument.body;
 
198
 
199
  return Math.max(html[scroll], body[scroll]) - Math.min(html[size], body[size]);
200
  };
201
 
202
  function both(val) {
203
- return $.isFunction(val) || typeof val === 'object' ? val : {top: val, left: val};
204
  }
205
 
206
- // AMD requirement.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  return $scrollTo;
208
- }));
2
  /* jshint -W065 */
3
 
4
  /*!
5
+ * jQuery.scrollTo
6
+ * Copyright (c) 2007 Ariel Flesler - afleslergmailcom | https://github.com/flesler
7
  * Licensed under MIT
8
+ * https://github.com/flesler/jquery.scrollTo
9
+ * @projectDescription Lightweight, cross-browser and highly customizable animated scrolling with jQuery
10
  * @author Ariel Flesler
11
+ * @version 2.1.3
12
  */
13
+ ;(function(factory) {
14
+ 'use strict';
 
15
  if (typeof define === 'function' && define.amd) {
16
+ // AMD
17
  define(['jquery'], factory);
18
+ } else if (typeof module !== 'undefined' && module.exports) {
19
+ // CommonJS
20
+ module.exports = factory(require('jquery'));
 
21
  } else {
22
+ // Global
23
  factory(jQuery);
24
  }
25
+ })(function($) {
26
+ 'use strict';
27
 
28
  var $scrollTo = $.scrollTo = function(target, duration, settings) {
29
  return $(window).scrollTo(target, duration, settings);
30
  };
31
 
32
  $scrollTo.defaults = {
33
+ axis:'xy',
34
+ duration: 0,
35
+ limit:true
 
 
 
 
 
 
36
  };
37
 
38
+ function isWin(elem) {
39
+ return !elem.nodeName ||
40
+ $.inArray(elem.nodeName.toLowerCase(), ['iframe','#document','html','body']) !== -1;
41
+ }
 
 
 
 
 
 
 
 
42
 
43
+ function isFunction(obj) {
44
+ // Brought from jQuery since it's deprecated
45
+ return typeof obj === 'function'
46
+ }
 
47
 
48
  $.fn.scrollTo = function(target, duration, settings) {
49
  if (typeof duration === 'object') {
51
  duration = 0;
52
  }
53
  if (typeof settings === 'function') {
54
+ settings = { onAfter:settings };
55
  }
 
56
  if (target === 'max') {
57
  target = 9e9;
58
  }
59
 
60
  settings = $.extend({}, $scrollTo.defaults, settings);
61
+ // Speed is still recognized for backwards compatibility
62
  duration = duration || settings.duration;
63
+ // Make sure the settings are given right
64
+ var queue = settings.queue && settings.axis.length > 1;
65
+ if (queue) {
66
+ // Let's keep the overall duration
 
67
  duration /= 2;
68
  }
 
69
  settings.offset = both(settings.offset);
70
  settings.over = both(settings.over);
71
 
72
+ return this.each(function() {
73
+ // Null target yields nothing, just like jQuery does
74
+ if (target === null) return;
75
 
76
+ var win = isWin(this),
77
+ elem = win ? this.contentWindow || window : this,
78
+ $elem = $(elem),
79
+ targ = target,
80
+ attr = {},
81
+ toff;
 
 
 
82
 
83
  switch (typeof targ) {
84
+ // A number will pass the regex
85
  case 'number':
86
  case 'string':
87
  if (/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)) {
89
  // We are done
90
  break;
91
  }
92
+ // Relative/Absolute selector
93
+ targ = win ? $(targ) : $(targ, elem);
 
 
 
94
  /* falls through */
95
  case 'object':
96
+ if (targ.length === 0) return;
97
+ // DOMElement / jQuery
98
  if (targ.is || targ.style) {
99
+ // Get the real position of the target
100
  toff = (targ = $(targ)).offset();
101
  }
102
  }
103
 
104
+ var offset = isFunction(settings.offset) && settings.offset(elem, targ) || settings.offset;
105
 
106
  $.each(settings.axis.split(''), function(i, axis) {
107
+ var Pos = axis === 'x' ? 'Left' : 'Top',
108
+ pos = Pos.toLowerCase(),
109
+ key = 'scroll' + Pos,
110
+ prev = $elem[key](),
111
+ max = $scrollTo.max(elem, axis);
112
 
113
+ if (toff) {// jQuery / DOMElement
114
+ attr[key] = toff[pos] + (win ? 0 : prev - $elem.offset()[pos]);
115
 
116
+ // If it's a dom element, reduce the margin
117
  if (settings.margin) {
118
+ attr[key] -= parseInt(targ.css('margin'+Pos), 10) || 0;
119
+ attr[key] -= parseInt(targ.css('border'+Pos+'Width'), 10) || 0;
120
  }
121
 
122
  attr[key] += offset[pos] || 0;
123
 
 
124
  if (settings.over[pos]) {
125
+ // Scroll to a fraction of its width/height
126
+ attr[key] += targ[axis === 'x'?'width':'height']() * settings.over[pos];
127
  }
128
  } else {
129
  var val = targ[pos];
130
+ // Handle percentage values
131
  attr[key] = val.slice && val.slice(-1) === '%' ?
132
+ parseFloat(val) / 100 * max
133
+ : val;
134
  }
135
 
136
+ // Number or 'number'
137
  if (settings.limit && /^\d+$/.test(attr[key])) {
138
  // Check the limits
139
  attr[key] = attr[key] <= 0 ? 0 : Math.min(attr[key], max);
140
  }
141
 
142
+ // Don't waste time animating, if there's no need.
143
+ if (!i && settings.axis.length > 1) {
144
+ if (prev === attr[key]) {
145
+ // No animation needed
146
+ attr = {};
147
+ } else if (queue) {
148
+ // Intermediate animation
149
  animate(settings.onAfterFirst);
150
+ // Don't animate this axis again in the next iteration.
151
+ attr = {};
152
  }
 
 
153
  }
154
  });
155
 
156
  animate(settings.onAfter);
157
 
158
  function animate(callback) {
159
+ var opts = $.extend({}, settings, {
160
+ // The queue setting conflicts with animate()
161
+ // Force it to always be true
162
+ queue: true,
163
+ duration: duration,
164
+ complete: callback && function() {
165
+ callback.call(elem, targ, settings);
166
+ }
167
  });
168
+ $elem.animate(attr, opts);
169
  }
170
+ });
 
171
  };
172
 
173
  // Max scrolling position, works on quirks mode
174
  // It only fails (not too badly) on IE, quirks mode.
175
  $scrollTo.max = function(elem, axis) {
176
  var Dim = axis === 'x' ? 'Width' : 'Height',
177
+ scroll = 'scroll'+Dim;
178
 
179
+ if (!isWin(elem))
180
  return elem[scroll] - $(elem)[Dim.toLowerCase()]();
 
181
 
182
  var size = 'client' + Dim,
183
+ doc = elem.ownerDocument || elem.document,
184
+ html = doc.documentElement,
185
+ body = doc.body;
186
 
187
  return Math.max(html[scroll], body[scroll]) - Math.min(html[size], body[size]);
188
  };
189
 
190
  function both(val) {
191
+ return isFunction(val) || $.isPlainObject(val) ? val : { top:val, left:val };
192
  }
193
 
194
+ // Add special hooks so that window scroll properties can be animated
195
+ $.Tween.propHooks.scrollLeft =
196
+ $.Tween.propHooks.scrollTop = {
197
+ get: function(t) {
198
+ return $(t.elem)[t.prop]();
199
+ },
200
+ set: function(t) {
201
+ var curr = this.get(t);
202
+ // If interrupt is true and user scrolled, stop animating
203
+ if (t.options.interrupt && t._last && t._last !== curr) {
204
+ return $(t.elem).stop();
205
+ }
206
+ var next = Math.round(t.now);
207
+ // Don't waste CPU
208
+ // Browsers don't render floating point scroll
209
+ if (curr !== next) {
210
+ $(t.elem)[t.prop](next);
211
+ t._last = this.get(t);
212
+ }
213
+ }
214
+ };
215
+
216
+ // AMD requirement
217
  return $scrollTo;
218
+ });
bp-core/js/vendor/jquery-scroll-to.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){function t(t){return e.isFunction(t)||"object"==typeof t?t:{top:t,left:t}}var n=e.scrollTo=function(t,n,o){return e(window).scrollTo(t,n,o)};return n.defaults={axis:"xy",duration:parseFloat(e.fn.jquery)>=1.3?0:1,limit:!0},n.window=function(){return e(window)._scrollable()},e.fn._scrollable=function(){return this.map(function(){var t=this;if(!(!t.nodeName||-1!==e.inArray(t.nodeName.toLowerCase(),["iframe","#document","html","body"])))return t;var n=(t.contentWindow||t).document||t.ownerDocument||t;return/webkit/i.test(navigator.userAgent)||"BackCompat"===n.compatMode?n.body:n.documentElement})},e.fn.scrollTo=function(o,r,i){return"object"==typeof r&&(i=r,r=0),"function"==typeof i&&(i={onAfter:i}),"max"===o&&(o=9e9),i=e.extend({},n.defaults,i),r=r||i.duration,i.queue=i.queue&&i.axis.length>1,i.queue&&(r/=2),i.offset=t(i.offset),i.over=t(i.over),this._scrollable().each(function(){function s(e){u.animate(l,r,i.easing,e&&function(){e.call(this,c,i)})}if(null!==o){var a,f=this,u=e(f),c=o,l={},d=u.is("html,body");switch(typeof c){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(c)){c=t(c);break}if(!(c=d?e(c):e(c,this)).length)return;case"object":(c.is||c.style)&&(a=(c=e(c)).offset())}var m=e.isFunction(i.offset)&&i.offset(f,c)||i.offset;e.each(i.axis.split(""),function(e,t){var o="x"===t?"Left":"Top",r=o.toLowerCase(),h="scroll"+o,p=f[h],y=n.max(f,t);if(a)l[h]=a[r]+(d?0:p-u.offset()[r]),i.margin&&(l[h]-=parseInt(c.css("margin"+o))||0,l[h]-=parseInt(c.css("border"+o+"Width"))||0),l[h]+=m[r]||0,i.over[r]&&(l[h]+=c["x"===t?"width":"height"]()*i.over[r]);else{var b=c[r];l[h]=b.slice&&"%"===b.slice(-1)?parseFloat(b)/100*y:b}i.limit&&/^\d+$/.test(l[h])&&(l[h]=l[h]<=0?0:Math.min(l[h],y)),!e&&i.queue&&(p!==l[h]&&s(i.onAfterFirst),delete l[h])}),s(i.onAfter)}}).end()},n.max=function(t,n){var o="x"===n?"Width":"Height",r="scroll"+o;if(!e(t).is("html,body"))return t[r]-e(t)[o.toLowerCase()]();var i="client"+o,s=t.ownerDocument.documentElement,a=t.ownerDocument.body;return Math.max(s[r],a[r])-Math.min(s[i],a[i])},n});
1
+ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(r){"use strict";var w=r.scrollTo=function(e,t,o){return r(window).scrollTo(e,t,o)};function i(e){return!e.nodeName||-1!==r.inArray(e.nodeName.toLowerCase(),["iframe","#document","html","body"])}function t(e){return"function"==typeof e}function n(e){return t(e)||r.isPlainObject(e)?e:{top:e,left:e}}return w.defaults={axis:"xy",duration:0,limit:!0},r.fn.scrollTo=function(e,o,h){"object"==typeof o&&(h=o,o=0),"max"===e&&(e=9e9),h=r.extend({},w.defaults,h="function"==typeof h?{onAfter:h}:h),o=o||h.duration;var x=h.queue&&1<h.axis.length;return x&&(o/=2),h.offset=n(h.offset),h.over=n(h.over),this.each(function(){if(null!==e){var f,u=i(this),a=u?this.contentWindow||window:this,c=r(a),l=e,d={};switch(typeof l){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(l)){l=n(l);break}l=u?r(l):r(l,a);case"object":if(0===l.length)return;(l.is||l.style)&&(f=(l=r(l)).offset())}var m=t(h.offset)&&h.offset(a,l)||h.offset;r.each(h.axis.split(""),function(e,t){var o="x"===t?"Left":"Top",n=o.toLowerCase(),r="scroll"+o,i=c[r](),s=w.max(a,t);f?(d[r]=f[n]+(u?0:i-c.offset()[n]),h.margin&&(d[r]-=parseInt(l.css("margin"+o),10)||0,d[r]-=parseInt(l.css("border"+o+"Width"),10)||0),d[r]+=m[n]||0,h.over[n]&&(d[r]+=l["x"===t?"width":"height"]()*h.over[n])):(n=l[n],d[r]=n.slice&&"%"===n.slice(-1)?parseFloat(n)/100*s:n),h.limit&&/^\d+$/.test(d[r])&&(d[r]=d[r]<=0?0:Math.min(d[r],s)),!e&&1<h.axis.length&&(i===d[r]?d={}:x&&(p(h.onAfterFirst),d={}))}),p(h.onAfter)}function p(e){var t=r.extend({},h,{queue:!0,duration:o,complete:e&&function(){e.call(a,l,h)}});c.animate(d,t)}})},w.max=function(e,t){var o="x"===t?"Width":"Height",n="scroll"+o;if(!i(e))return e[n]-r(e)[o.toLowerCase()]();t="client"+o,o=e.ownerDocument||e.document,e=o.documentElement,o=o.body;return Math.max(e[n],o[n])-Math.min(e[t],o[t])},r.Tween.propHooks.scrollLeft=r.Tween.propHooks.scrollTop={get:function(e){return r(e.elem)[e.prop]()},set:function(e){var t=this.get(e);if(e.options.interrupt&&e._last&&e._last!==t)return r(e.elem).stop();var o=Math.round(e.now);t!==o&&(r(e.elem)[e.prop](o),e._last=this.get(e))}},w});
bp-core/js/vendor/jquery.atwho.js CHANGED
@@ -461,7 +461,7 @@ Controller = (function() {
461
 
462
  Controller.arrayToDefaultHash = function(data) {
463
  var i, item, len, results;
464
- if (!$.isArray(data)) {
465
  return data;
466
  }
467
  results = [];
@@ -628,9 +628,9 @@ TextareaController = (function(superClass) {
628
  iframe: this.app.iframe
629
  });
630
  if (!$inputor.is(':focus')) {
631
- $inputor.focus();
632
  }
633
- return $inputor.change();
634
  };
635
 
636
  return TextareaController;
@@ -976,7 +976,7 @@ View = (function() {
976
  };
977
 
978
  View.prototype.visible = function() {
979
- return $.expr.filters.visible(this.$el[0]);
980
  };
981
 
982
  View.prototype.highlighted = function() {
@@ -1092,7 +1092,7 @@ View = (function() {
1092
 
1093
  View.prototype.render = function(list) {
1094
  var $li, $ul, i, item, len, li, tpl;
1095
- if (!($.isArray(list) && list.length > 0)) {
1096
  this.hide();
1097
  return;
1098
  }
461
 
462
  Controller.arrayToDefaultHash = function(data) {
463
  var i, item, len, results;
464
+ if (!Array.isArray(data)) {
465
  return data;
466
  }
467
  results = [];
628
  iframe: this.app.iframe
629
  });
630
  if (!$inputor.is(':focus')) {
631
+ $inputor.trigger( 'focus' );
632
  }
633
+ return $inputor.trigger( 'change' );
634
  };
635
 
636
  return TextareaController;
976
  };
977
 
978
  View.prototype.visible = function() {
979
+ return $.expr.pseudos.visible(this.$el[0]);
980
  };
981
 
982
  View.prototype.highlighted = function() {
1092
 
1093
  View.prototype.render = function(list) {
1094
  var $li, $ul, i, item, len, li, tpl;
1095
+ if (!(Array.isArray(list) && list.length > 0)) {
1096
  this.hide();
1097
  return;
1098
  }
bp-core/js/vendor/jquery.atwho.min.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"function"==typeof define&&define.amd?define(["jquery"],function(t){return e(t)}):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(0,function(t){var e,i;i={ESC:27,TAB:9,ENTER:13,CTRL:17,A:65,P:80,N:78,LEFT:37,UP:38,RIGHT:39,DOWN:40,BACKSPACE:8,SPACE:32},e={beforeSave:function(t){return r.arrayToDefaultHash(t)},matcher:function(t,e,i,n){var r,o,s,a,l;return t=t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),i&&(t="(?:^|\\s)"+t),r=decodeURI("%C3%80"),o=decodeURI("%C3%BF"),l=n?" ":"",a=new RegExp(t+"([A-Za-z"+r+"-"+o+"0-9_"+l+"'.+-]*)$|"+t+"([^\\x00-\\xff]*)$","gi"),(s=a.exec(e))?s[2]||s[1]:null},filter:function(t,e,i){var n,r,o,s;for(n=[],r=0,s=e.length;r<s;r++)o=e[r],~new String(o[i]).toLowerCase().indexOf(t.toLowerCase())&&n.push(o);return n},remoteFilter:null,sorter:function(t,e,i){var n,r,o,s;if(!t)return e;for(n=[],r=0,s=e.length;r<s;r++)(o=e[r]).atwho_order=new String(o[i]).toLowerCase().indexOf(t.toLowerCase()),o.atwho_order>-1&&n.push(o);return n.sort(function(t,e){return t.atwho_order-e.atwho_order})},tplEval:function(t,e){var i;i=t;try{return"string"!=typeof t&&(i=t(e)),i.replace(/\$\{([^\}]*)\}/g,function(t,i,n){return e[i]})}catch(t){return t,""}},highlighter:function(t,e){var i;return e?(i=new RegExp(">\\s*([^<]*?)("+e.replace("+","\\+")+")([^<]*)\\s*<","ig"),t.replace(i,function(t,e,i,n){return"> "+e+"<strong>"+i+"</strong>"+n+" <"})):t},beforeInsert:function(t,e,i){return t},beforeReposition:function(t){return t},afterMatchFailed:function(t,e){}};var n;n=function(){function e(e){this.currentFlag=null,this.controllers={},this.aliasMaps={},this.$inputor=t(e),this.setupRootElement(),this.listen()}return e.prototype.createContainer=function(e){var i;return null!=(i=this.$el)&&i.remove(),t(e.body).append(this.$el=t("<div class='atwho-container'></div>"))},e.prototype.setupRootElement=function(e,i){var n;if(null==i&&(i=!1),e)this.window=e.contentWindow,this.document=e.contentDocument||this.window.document,this.iframe=e;else{this.document=this.$inputor[0].ownerDocument,this.window=this.document.defaultView||this.document.parentWindow;try{this.iframe=this.window.frameElement}catch(e){if(n=e,this.iframe=null,t.fn.atwho.debug)throw new Error("iframe auto-discovery is failed.\nPlease use `setIframe` to set the target iframe manually.\n"+n)}}return this.createContainer((this.iframeAsRoot=i)?this.document:document)},e.prototype.controller=function(t){var e,i,n,r;if(this.aliasMaps[t])i=this.controllers[this.aliasMaps[t]];else{r=this.controllers;for(n in r)if(e=r[n],n===t){i=e;break}}return i||this.controllers[this.currentFlag]},e.prototype.setContextFor=function(t){return this.currentFlag=t,this},e.prototype.reg=function(t,e){var i,n;return n=(i=this.controllers)[t]||(i[t]=this.$inputor.is("[contentEditable]")?new h(this,t):new s(this,t)),e.alias&&(this.aliasMaps[e.alias]=t),n.init(e),this},e.prototype.listen=function(){return this.$inputor.on("compositionstart",function(t){return function(e){var i;return null!=(i=t.controller())&&i.view.hide(),t.isComposing=!0,null}}(this)).on("compositionend",function(t){return function(e){return t.isComposing=!1,setTimeout(function(e){return t.dispatch(e)}),null}}(this)).on("keyup.atwhoInner",function(t){return function(e){return t.onKeyup(e)}}(this)).on("keydown.atwhoInner",function(t){return function(e){return t.onKeydown(e)}}(this)).on("blur.atwhoInner",function(t){return function(e){var i;if(i=t.controller())return i.expectedQueryCBId=null,i.view.hide(e,i.getOpt("displayTimeout"))}}(this)).on("click.atwhoInner",function(t){return function(e){return t.dispatch(e)}}(this)).on("scroll.atwhoInner",function(t){return function(){var e;return e=t.$inputor.scrollTop(),function(i){var n,r;return n=i.target.scrollTop,e!==n&&null!=(r=t.controller())&&r.view.hide(i),e=n,!0}}}(this)())},e.prototype.shutdown=function(){var t,e;e=this.controllers;for(t in e)e[t].destroy(),delete this.controllers[t];return this.$inputor.off(".atwhoInner"),this.$el.remove()},e.prototype.dispatch=function(t){var e,i,n,r;n=this.controllers,r=[];for(e in n)i=n[e],r.push(i.lookUp(t));return r},e.prototype.onKeyup=function(e){var n;switch(e.keyCode){case i.ESC:e.preventDefault(),null!=(n=this.controller())&&n.view.hide();break;case i.DOWN:case i.UP:case i.CTRL:case i.ENTER:t.noop();break;case i.P:case i.N:e.ctrlKey||this.dispatch(e);break;default:this.dispatch(e)}},e.prototype.onKeydown=function(e){var n,r;if((r=null!=(n=this.controller())?n.view:void 0)&&r.visible())switch(e.keyCode){case i.ESC:e.preventDefault(),r.hide(e);break;case i.UP:e.preventDefault(),r.prev();break;case i.DOWN:e.preventDefault(),r.next();break;case i.P:if(!e.ctrlKey)return;e.preventDefault(),r.prev();break;case i.N:if(!e.ctrlKey)return;e.preventDefault(),r.next();break;case i.TAB:case i.ENTER:case i.SPACE:if(!r.visible())return;if(!this.controller().getOpt("spaceSelectsMatch")&&e.keyCode===i.SPACE)return;if(!this.controller().getOpt("tabSelectsMatch")&&e.keyCode===i.TAB)return;r.highlighted()?(e.preventDefault(),r.choose(e)):r.hide(e);break;default:t.noop()}},e}();var r,o=[].slice;r=function(){function i(e,i){this.app=e,this.at=i,this.$inputor=this.app.$inputor,this.id=this.$inputor[0].id||this.uid(),this.expectedQueryCBId=null,this.setting=null,this.query=null,this.pos=0,this.range=null,0===(this.$el=t("#atwho-ground-"+this.id,this.app.$el)).length&&this.app.$el.append(this.$el=t("<div id='atwho-ground-"+this.id+"'></div>")),this.model=new u(this),this.view=new c(this)}return i.prototype.uid=function(){return(Math.random().toString(16)+"000000000").substr(2,8)+(new Date).getTime()},i.prototype.init=function(e){return this.setting=t.extend({},this.setting||t.fn.atwho.default,e),this.view.init(),this.model.reload(this.setting.data)},i.prototype.destroy=function(){return this.trigger("beforeDestroy"),this.model.destroy(),this.view.destroy(),this.$el.remove()},i.prototype.callDefault=function(){var i,n,r;r=arguments[0],i=2<=arguments.length?o.call(arguments,1):[];try{return e[r].apply(this,i)}catch(e){return n=e,t.error(n+" Or maybe At.js doesn't have function "+r)}},i.prototype.trigger=function(t,e){var i,n;return null==e&&(e=[]),e.push(this),i=this.getOpt("alias"),n=i?t+"-"+i+".atwho":t+".atwho",this.$inputor.trigger(n,e)},i.prototype.callbacks=function(t){return this.getOpt("callbacks")[t]||e[t]},i.prototype.getOpt=function(t,e){try{return this.setting[t]}catch(t){return t,null}},i.prototype.insertContentFor=function(e){var i,n;return n=this.getOpt("insertTpl"),i=t.extend({},e.data("item-data"),{"atwho-at":this.at}),this.callbacks("tplEval").call(this,n,i,"onInsert")},i.prototype.renderView=function(t){var e;return e=this.getOpt("searchKey"),t=this.callbacks("sorter").call(this,this.query.text,t.slice(0,1001),e),this.view.render(t.slice(0,this.getOpt("limit")))},i.arrayToDefaultHash=function(e){var i,n,r,o;if(!t.isArray(e))return e;for(o=[],i=0,r=e.length;i<r;i++)n=e[i],t.isPlainObject(n)?o.push(n):o.push({name:n});return o},i.prototype.lookUp=function(t){var e,i;if((!t||"click"!==t.type||this.getOpt("lookUpOnClick"))&&(!this.getOpt("suspendOnComposing")||!this.app.isComposing))return(e=this.catchQuery(t))?(this.app.setContextFor(this.at),(i=this.getOpt("delay"))?this._delayLookUp(e,i):this._lookUp(e),e):(this.expectedQueryCBId=null,e)},i.prototype._delayLookUp=function(t,e){var i,n;return i=Date.now?Date.now():(new Date).getTime(),this.previousCallTime||(this.previousCallTime=i),0<(n=e-(i-this.previousCallTime))&&n<e?(this.previousCallTime=i,this._stopDelayedCall(),this.delayedCallTimeout=setTimeout(function(e){return function(){return e.previousCallTime=0,e.delayedCallTimeout=null,e._lookUp(t)}}(this),e)):(this._stopDelayedCall(),this.previousCallTime!==i&&(this.previousCallTime=0),this._lookUp(t))},i.prototype._stopDelayedCall=function(){if(this.delayedCallTimeout)return clearTimeout(this.delayedCallTimeout),this.delayedCallTimeout=null},i.prototype._generateQueryCBId=function(){return{}},i.prototype._lookUp=function(e){var i;return i=function(t,e){if(t===this.expectedQueryCBId)return e&&e.length>0?this.renderView(this.constructor.arrayToDefaultHash(e)):this.view.hide()},this.expectedQueryCBId=this._generateQueryCBId(),this.model.query(e.text,t.proxy(i,this,this.expectedQueryCBId))},i}();var s,a=function(t,e){function i(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},l={}.hasOwnProperty;s=function(e){function i(){return i.__super__.constructor.apply(this,arguments)}return a(i,r),i.prototype.catchQuery=function(){var t,e,i,n,r,o,s;if(e=this.$inputor.val(),t=this.$inputor.caret("pos",{iframe:this.app.iframe}),s=e.slice(0,t),r=this.callbacks("matcher").call(this,this.at,s,this.getOpt("startWithSpace"),this.getOpt("acceptSpaceBar")),!((n="string"==typeof r)&&r.length<this.getOpt("minLen",0)))return n&&r.length<=this.getOpt("maxLen",20)?(i=(o=t-r.length)+r.length,this.pos=o,r={text:r,headPos:o,endPos:i},this.trigger("matched",[this.at,r.text])):(r=null,this.view.hide()),this.query=r},i.prototype.rect=function(){var e,i,n;if(e=this.$inputor.caret("offset",this.pos-1,{iframe:this.app.iframe}))return this.app.iframe&&!this.app.iframeAsRoot&&(i=t(this.app.iframe).offset(),e.left+=i.left,e.top+=i.top),n=this.app.document.selection?0:2,{left:e.left,top:e.top,bottom:e.top+e.height+n}},i.prototype.insert=function(t,e){var i,n,r,o,s;return i=this.$inputor,n=i.val(),r=n.slice(0,Math.max(this.query.headPos-this.at.length,0)),o=""===(o=this.getOpt("suffix"))?o:o||" ",t+=o,s=""+r+t+n.slice(this.query.endPos||0),i.val(s),i.caret("pos",r.length+t.length,{iframe:this.app.iframe}),i.is(":focus")||i.focus(),i.change()},i}();var h,a=function(t,e){function i(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},l={}.hasOwnProperty;h=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return a(n,r),n.prototype._getRange=function(){var t;if((t=this.app.window.getSelection()).rangeCount>0)return t.getRangeAt(0)},n.prototype._setRange=function(e,i,n){if(null==n&&(n=this._getRange()),n&&i)return i=t(i)[0],"after"===e?(n.setEndAfter(i),n.setStartAfter(i)):(n.setEndBefore(i),n.setStartBefore(i)),n.collapse(!1),this._clearRange(n)},n.prototype._clearRange=function(t){var e;if(null==t&&(t=this._getRange()),e=this.app.window.getSelection(),null==this.ctrl_a_pressed)return e.removeAllRanges(),e.addRange(t)},n.prototype._movingEvent=function(t){var e;return"click"===t.type||(e=t.which)===i.RIGHT||e===i.LEFT||e===i.UP||e===i.DOWN},n.prototype._unwrap=function(e){var i;return e=t(e).unwrap().get(0),(i=e.nextSibling)&&i.nodeValue&&(e.nodeValue+=i.nodeValue,t(i).remove()),e},n.prototype.catchQuery=function(e){var n,r,o,s,a,l,h,u,c,p,f,d;if((d=this._getRange())&&d.collapsed){if(e.which===i.ENTER)return(r=t(d.startContainer).closest(".atwho-query")).contents().unwrap(),r.is(":empty")&&r.remove(),(r=t(".atwho-query",this.app.document)).text(r.text()).contents().last().unwrap(),void this._clearRange();if(/firefox/i.test(navigator.userAgent)){if(t(d.startContainer).is(this.$inputor))return void this._clearRange();e.which===i.BACKSPACE&&d.startContainer.nodeType===document.ELEMENT_NODE&&(c=d.startOffset-1)>=0?((o=d.cloneRange()).setStart(d.startContainer,c),t(o.cloneContents()).contents().last().is(".atwho-inserted")&&(a=t(d.startContainer).contents().get(c),this._setRange("after",t(a).contents().last()))):e.which===i.LEFT&&d.startContainer.nodeType===document.TEXT_NODE&&(n=t(d.startContainer.previousSibling)).is(".atwho-inserted")&&0===d.startOffset&&this._setRange("after",n.contents().last())}if(t(d.startContainer).closest(".atwho-inserted").addClass("atwho-query").siblings().removeClass("atwho-query"),(r=t(".atwho-query",this.app.document)).length>0&&r.is(":empty")&&0===r.text().length&&r.remove(),this._movingEvent(e)||r.removeClass("atwho-inserted"),r.length>0)switch(e.which){case i.LEFT:return this._setRange("before",r.get(0),d),void r.removeClass("atwho-query");case i.RIGHT:return this._setRange("after",r.get(0).nextSibling,d),void r.removeClass("atwho-query")}if(r.length>0&&(f=r.attr("data-atwho-at-query"))&&(r.empty().html(f).attr("data-atwho-at-query",null),this._setRange("after",r.get(0),d)),(o=d.cloneRange()).setStart(d.startContainer,0),u=this.callbacks("matcher").call(this,this.at,o.toString(),this.getOpt("startWithSpace"),this.getOpt("acceptSpaceBar")),l="string"==typeof u,0===r.length&&l&&(s=d.startOffset-this.at.length-u.length)>=0&&(d.setStart(d.startContainer,s),r=t("<span/>",this.app.document).attr(this.getOpt("editableAtwhoQueryAttrs")).addClass("atwho-query"),d.surroundContents(r.get(0)),(h=r.contents().last().get(0))&&(/firefox/i.test(navigator.userAgent)?(d.setStart(h,h.length),d.setEnd(h,h.length),this._clearRange(d)):this._setRange("after",h,d))),!(l&&u.length<this.getOpt("minLen",0)))return l&&u.length<=this.getOpt("maxLen",20)?(p={text:u,el:r},this.trigger("matched",[this.at,p.text]),this.query=p):(this.view.hide(),this.query={el:r},r.text().indexOf(this.at)>=0&&(this._movingEvent(e)&&r.hasClass("atwho-inserted")?r.removeClass("atwho-query"):!1!==this.callbacks("afterMatchFailed").call(this,this.at,r)&&this._setRange("after",this._unwrap(r.text(r.text()).contents().first()))),null)}},n.prototype.rect=function(){var e,i;if((i=this.query.el.offset())&&this.query.el[0].getClientRects().length)return this.app.iframe&&!this.app.iframeAsRoot&&(e=t(this.app.iframe).offset(),i.left+=e.left-this.$inputor.scrollLeft(),i.top+=e.top-this.$inputor.scrollTop()),i.bottom=i.top+this.query.el.height(),i},n.prototype.insert=function(t,e){var i,n,r,o,s;return this.$inputor.is(":focus")||this.$inputor.focus(),(n=this.getOpt("functionOverrides")).insert?n.insert.call(this,t,e):(o=""===(o=this.getOpt("suffix"))?o:o||" ",i=e.data("item-data"),this.query.el.removeClass("atwho-query").addClass("atwho-inserted").html(t).attr("data-atwho-at-query",""+i["atwho-at"]+this.query.text).attr("contenteditable","false"),(r=this._getRange())&&(this.query.el.length&&r.setEndAfter(this.query.el[0]),r.collapse(!1),r.insertNode(s=this.app.document.createTextNode(""+o)),this._setRange("after",s,r)),this.$inputor.is(":focus")||this.$inputor.focus(),this.$inputor.change())},n}();var u;u=function(){function e(t){this.context=t,this.at=this.context.at,this.storage=this.context.$inputor}return e.prototype.destroy=function(){return this.storage.data(this.at,null)},e.prototype.saved=function(){return this.fetch()>0},e.prototype.query=function(t,e){var i,n,r;return n=this.fetch(),r=this.context.getOpt("searchKey"),n=this.context.callbacks("filter").call(this.context,t,n,r)||[],i=this.context.callbacks("remoteFilter"),n.length>0||!i&&0===n.length?e(n):i.call(this.context,t,e)},e.prototype.fetch=function(){return this.storage.data(this.at)||[]},e.prototype.save=function(t){return this.storage.data(this.at,this.context.callbacks("beforeSave").call(this.context,t||[]))},e.prototype.load=function(t){if(!this.saved()&&t)return this._load(t)},e.prototype.reload=function(t){return this._load(t)},e.prototype._load=function(e){return"string"==typeof e?t.ajax(e,{dataType:"json"}).done(function(t){return function(e){return t.save(e)}}(this)):this.save(e)},e}();var c;c=function(){function e(e){this.context=e,this.$el=t("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>"),this.$elUl=this.$el.children(),this.timeoutID=null,this.context.$el.append(this.$el),this.bindEvent()}return e.prototype.init=function(){var t,e;return e=this.context.getOpt("alias")||this.context.at.charCodeAt(0),(t=this.context.getOpt("headerTpl"))&&1===this.$el.children().length&&this.$el.prepend(t),this.$el.attr({id:"at-view-"+e})},e.prototype.destroy=function(){return this.$el.remove()},e.prototype.bindEvent=function(){var e,i,n;return e=this.$el.find("ul"),i=0,n=0,e.on("mousemove.atwho-view","li",function(r){var o;if((i!==r.clientX||n!==r.clientY)&&(i=r.clientX,n=r.clientY,!(o=t(r.currentTarget)).hasClass("cur")))return e.find(".cur").removeClass("cur"),o.addClass("cur")}).on("click.atwho-view","li",function(i){return function(n){return e.find(".cur").removeClass("cur"),t(n.currentTarget).addClass("cur"),i.choose(n),n.preventDefault()}}(this))},e.prototype.visible=function(){return t.expr.filters.visible(this.$el[0])},e.prototype.highlighted=function(){return this.$el.find(".cur").length>0},e.prototype.choose=function(t){var e,i;if((e=this.$el.find(".cur")).length&&(i=this.context.insertContentFor(e),this.context._stopDelayedCall(),this.context.insert(this.context.callbacks("beforeInsert").call(this.context,i,e,t),e),this.context.trigger("inserted",[e,t]),this.hide(t)),this.context.getOpt("hideWithoutSuffix"))return this.stopShowing=!0},e.prototype.reposition=function(e){var i,n,r,o;return i=this.context.app.iframeAsRoot?this.context.app.window:window,e.bottom+this.$el.height()-t(i).scrollTop()>t(i).height()&&(e.bottom=e.top-this.$el.height()),e.left>(r=t(i).width()-this.$el.width()-5)&&(e.left=r),n={left:e.left,top:e.bottom},null!=(o=this.context.callbacks("beforeReposition"))&&o.call(this.context,n),this.$el.offset(n),this.context.trigger("reposition",[n])},e.prototype.next=function(){var t,e,i,n;return t=this.$el.find(".cur").removeClass("cur"),(e=t.next()).length||(e=this.$el.find("li:first")),e.addClass("cur"),i=e[0],n=i.offsetTop+i.offsetHeight+(i.nextSibling?i.nextSibling.offsetHeight:0),this.scrollTop(Math.max(0,n-this.$el.height()))},e.prototype.prev=function(){var t,e,i,n;return t=this.$el.find(".cur").removeClass("cur"),(i=t.prev()).length||(i=this.$el.find("li:last")),i.addClass("cur"),n=i[0],e=n.offsetTop+n.offsetHeight+(n.nextSibling?n.nextSibling.offsetHeight:0),this.scrollTop(Math.max(0,e-this.$el.height()))},e.prototype.scrollTop=function(t){var e;return(e=this.context.getOpt("scrollDuration"))?this.$elUl.animate({scrollTop:t},e):this.$elUl.scrollTop(t)},e.prototype.show=function(){var t;{if(!this.stopShowing)return this.visible()||(this.$el.show(),this.$el.scrollTop(0),this.context.trigger("shown")),(t=this.context.rect())?this.reposition(t):void 0;this.stopShowing=!1}},e.prototype.hide=function(t,e){var i;if(this.visible())return isNaN(e)?(this.$el.hide(),this.context.trigger("hidden",[t])):(i=function(t){return function(){return t.hide()}}(this),clearTimeout(this.timeoutID),this.timeoutID=setTimeout(i,e))},e.prototype.render=function(e){var i,n,r,o,s,a,l;{if(t.isArray(e)&&e.length>0){for(this.$el.find("ul").empty(),n=this.$el.find("ul"),l=this.context.getOpt("displayTpl"),r=0,s=e.length;r<s;r++)o=e[r],o=t.extend({},o,{"atwho-at":this.context.at}),a=this.context.callbacks("tplEval").call(this.context,l,o,"onDisplay"),(i=t(this.context.callbacks("highlighter").call(this.context,a,this.context.query.text))).data("item-data",o),n.append(i);return this.show(),this.context.getOpt("highlightFirst")?n.find("li:first").addClass("cur"):void 0}this.hide()}},e}();var p;p={load:function(t,e){var i;if(i=this.controller(t))return i.model.load(e)},isSelecting:function(){var t;return!!(null!=(t=this.controller())?t.view.visible():void 0)},hide:function(){var t;return null!=(t=this.controller())?t.view.hide():void 0},reposition:function(){var t;if(t=this.controller())return t.view.reposition(t.rect())},setIframe:function(t,e){return this.setupRootElement(t,e),null},run:function(){return this.dispatch()},destroy:function(){return this.shutdown(),this.$inputor.data("atwho",null)}},t.fn.atwho=function(e){var i,r;return i=arguments,r=null,this.filter('textarea, input, [contenteditable=""], [contenteditable=true]').each(function(){var o,s;return(s=(o=t(this)).data("atwho"))||o.data("atwho",s=new n(this)),"object"!=typeof e&&e?p[e]&&s?r=p[e].apply(s,Array.prototype.slice.call(i,1)):t.error("Method "+e+" does not exist on jQuery.atwho"):s.reg(e.at,e)}),null!=r?r:this},t.fn.atwho.default={at:void 0,alias:void 0,data:null,displayTpl:"<li>${name}</li>",insertTpl:"${atwho-at}${name}",headerTpl:null,callbacks:e,functionOverrides:{},searchKey:"name",suffix:void 0,hideWithoutSuffix:!1,startWithSpace:!0,acceptSpaceBar:!1,highlightFirst:!0,limit:5,maxLen:20,minLen:0,displayTimeout:300,delay:null,spaceSelectsMatch:!1,tabSelectsMatch:!0,editableAtwhoQueryAttrs:{},scrollDuration:150,suspendOnComposing:!0,lookUpOnClick:!0},t.fn.atwho.debug=!1});
1
+ !function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t(require("jquery")):t(jQuery)}(function(l){var i,h;function t(t){this.currentFlag=null,this.controllers={},this.aliasMaps={},this.$inputor=l(t),this.setupRootElement(),this.listen()}h={ESC:27,TAB:9,ENTER:13,CTRL:17,A:65,P:80,N:78,LEFT:37,UP:38,RIGHT:39,DOWN:40,BACKSPACE:8,SPACE:32},i={beforeSave:function(t){return n.arrayToDefaultHash(t)},matcher:function(t,e,i,r){var n;return t=t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),i&&(t="(?:^|\\s)"+t),n=decodeURI("%C3%80"),i=decodeURI("%C3%BF"),(e=new RegExp(t+"([A-Za-z"+n+"-"+i+"0-9_"+(r?" ":"")+"'.+-]*)$|"+t+"([^\\x00-\\xff]*)$","gi").exec(e))?e[2]||e[1]:null},filter:function(t,e,i){for(var r,n=[],o=0,s=e.length;o<s;o++)r=e[o],~new String(r[i]).toLowerCase().indexOf(t.toLowerCase())&&n.push(r);return n},remoteFilter:null,sorter:function(t,e,i){var r,n,o,s;if(!t)return e;for(r=[],n=0,s=e.length;n<s;n++)(o=e[n]).atwho_order=new String(o[i]).toLowerCase().indexOf(t.toLowerCase()),-1<o.atwho_order&&r.push(o);return r.sort(function(t,e){return t.atwho_order-e.atwho_order})},tplEval:function(t,r){var e=t;try{return(e="string"!=typeof t?t(r):e).replace(/\$\{([^\}]*)\}/g,function(t,e,i){return r[e]})}catch(t){return""}},highlighter:function(t,e){return e?(e=new RegExp(">\\s*([^<]*?)("+e.replace("+","\\+")+")([^<]*)\\s*<","ig"),t.replace(e,function(t,e,i,r){return"> "+e+"<strong>"+i+"</strong>"+r+" <"})):t},beforeInsert:function(t,e,i){return t},beforeReposition:function(t){return t},afterMatchFailed:function(t,e){}},t.prototype.createContainer=function(t){var e;return null!=(e=this.$el)&&e.remove(),l(t.body).append(this.$el=l("<div class='atwho-container'></div>"))},t.prototype.setupRootElement=function(e,t){if(null==t&&(t=!1),e)this.window=e.contentWindow,this.document=e.contentDocument||this.window.document,this.iframe=e;else{this.document=this.$inputor[0].ownerDocument,this.window=this.document.defaultView||this.document.parentWindow;try{this.iframe=this.window.frameElement}catch(t){if(e=t,this.iframe=null,l.fn.atwho.debug)throw new Error("iframe auto-discovery is failed.\nPlease use `setIframe` to set the target iframe manually.\n"+e)}}return this.createContainer((this.iframeAsRoot=t)?this.document:document)},t.prototype.controller=function(t){var e,i,r,n;if(this.aliasMaps[t])i=this.controllers[this.aliasMaps[t]];else for(r in n=this.controllers)if(e=n[r],r===t){i=e;break}return i||this.controllers[this.currentFlag]},t.prototype.setContextFor=function(t){return this.currentFlag=t,this},t.prototype.reg=function(t,e){var i=(i=this.controllers)[t]||(i[t]=new(this.$inputor.is("[contentEditable]")?c:g)(this,t));return e.alias&&(this.aliasMaps[e.alias]=t),i.init(e),this},t.prototype.listen=function(){return this.$inputor.on("compositionstart",(a=this,function(t){var e;return null!=(e=a.controller())&&e.view.hide(),a.isComposing=!0,null})).on("compositionend",(s=this,function(t){return s.isComposing=!1,setTimeout(function(t){return s.dispatch(t)}),null})).on("keyup.atwhoInner",(o=this,function(t){return o.onKeyup(t)})).on("keydown.atwhoInner",(r=this,function(t){return r.onKeydown(t)})).on("blur.atwhoInner",(i=this,function(t){var e;if(e=i.controller())return e.expectedQueryCBId=null,e.view.hide(t,e.getOpt("displayTimeout"))})).on("click.atwhoInner",(e=this,function(t){return e.dispatch(t)})).on("scroll.atwhoInner",(n=this,function(){var r=n.$inputor.scrollTop();return function(t){var e,i=t.target.scrollTop;return r!==i&&null!=(e=n.controller())&&e.view.hide(t),r=i,!0}}()));var n,e,i,r,o,s,a},t.prototype.shutdown=function(){var t,e=this.controllers;for(t in e)e[t].destroy(),delete this.controllers[t];return this.$inputor.off(".atwhoInner"),this.$el.remove()},t.prototype.dispatch=function(t){var e,i,r=this.controllers,n=[];for(e in r)i=r[e],n.push(i.lookUp(t));return n},t.prototype.onKeyup=function(t){var e;switch(t.keyCode){case h.ESC:t.preventDefault(),null!=(e=this.controller())&&e.view.hide();break;case h.DOWN:case h.UP:case h.CTRL:case h.ENTER:l.noop();break;case h.P:case h.N:t.ctrlKey||this.dispatch(t);break;default:this.dispatch(t)}},t.prototype.onKeydown=function(t){var e,i=null!=(e=this.controller())?e.view:void 0;if(i&&i.visible())switch(t.keyCode){case h.ESC:t.preventDefault(),i.hide(t);break;case h.UP:t.preventDefault(),i.prev();break;case h.DOWN:t.preventDefault(),i.next();break;case h.P:if(!t.ctrlKey)return;t.preventDefault(),i.prev();break;case h.N:if(!t.ctrlKey)return;t.preventDefault(),i.next();break;case h.TAB:case h.ENTER:case h.SPACE:if(!i.visible())return;if(!this.controller().getOpt("spaceSelectsMatch")&&t.keyCode===h.SPACE)return;if(!this.controller().getOpt("tabSelectsMatch")&&t.keyCode===h.TAB)return;i.highlighted()?(t.preventDefault(),i.choose(t)):i.hide(t);break;default:l.noop()}};var o=t,r=[].slice;function e(t,e){this.app=t,this.at=e,this.$inputor=this.app.$inputor,this.id=this.$inputor[0].id||this.uid(),this.expectedQueryCBId=null,this.setting=null,this.query=null,this.pos=0,this.range=null,0===(this.$el=l("#atwho-ground-"+this.id,this.app.$el)).length&&this.app.$el.append(this.$el=l("<div id='atwho-ground-"+this.id+"'></div>")),this.model=new p(this),this.view=new f(this)}e.prototype.uid=function(){return(Math.random().toString(16)+"000000000").substr(2,8)+(new Date).getTime()},e.prototype.init=function(t){return this.setting=l.extend({},this.setting||l.fn.atwho.default,t),this.view.init(),this.model.reload(this.setting.data)},e.prototype.destroy=function(){return this.trigger("beforeDestroy"),this.model.destroy(),this.view.destroy(),this.$el.remove()},e.prototype.callDefault=function(){var e=arguments[0],t=2<=arguments.length?r.call(arguments,1):[];try{return i[e].apply(this,t)}catch(t){return l.error(t+" Or maybe At.js doesn't have function "+e)}},e.prototype.trigger=function(t,e){var i;return(e=null==e?[]:e).push(this),i=this.getOpt("alias"),this.$inputor.trigger(i?t+"-"+i+".atwho":t+".atwho",e)},e.prototype.callbacks=function(t){return this.getOpt("callbacks")[t]||i[t]},e.prototype.getOpt=function(t,e){try{return this.setting[t]}catch(t){return null}},e.prototype.insertContentFor=function(t){var e=this.getOpt("insertTpl"),t=l.extend({},t.data("item-data"),{"atwho-at":this.at});return this.callbacks("tplEval").call(this,e,t,"onInsert")},e.prototype.renderView=function(t){var e=this.getOpt("searchKey");return t=this.callbacks("sorter").call(this,this.query.text,t.slice(0,1001),e),this.view.render(t.slice(0,this.getOpt("limit")))},e.arrayToDefaultHash=function(t){var e,i,r,n;if(!Array.isArray(t))return t;for(n=[],e=0,r=t.length;e<r;e++)i=t[e],l.isPlainObject(i)?n.push(i):n.push({name:i});return n},e.prototype.lookUp=function(t){var e;if((!t||"click"!==t.type||this.getOpt("lookUpOnClick"))&&(!this.getOpt("suspendOnComposing")||!this.app.isComposing))return(e=this.catchQuery(t))?(this.app.setContextFor(this.at),(t=this.getOpt("delay"))?this._delayLookUp(e,t):this._lookUp(e)):this.expectedQueryCBId=null,e},e.prototype._delayLookUp=function(t,e){var i,r,n=Date.now?Date.now():(new Date).getTime();return this.previousCallTime||(this.previousCallTime=n),0<(i=e-(n-this.previousCallTime))&&i<e?(this.previousCallTime=n,this._stopDelayedCall(),this.delayedCallTimeout=setTimeout((r=this,function(){return r.previousCallTime=0,r.delayedCallTimeout=null,r._lookUp(t)}),e)):(this._stopDelayedCall(),this.previousCallTime!==n&&(this.previousCallTime=0),this._lookUp(t))},e.prototype._stopDelayedCall=function(){if(this.delayedCallTimeout)return clearTimeout(this.delayedCallTimeout),this.delayedCallTimeout=null},e.prototype._generateQueryCBId=function(){return{}},e.prototype._lookUp=function(t){var e=function(t,e){if(t===this.expectedQueryCBId)return e&&0<e.length?this.renderView(this.constructor.arrayToDefaultHash(e)):this.view.hide()};return this.expectedQueryCBId=this._generateQueryCBId(),this.model.query(t.text,l.proxy(e,this,this.expectedQueryCBId))};var n,s=function(t,e){for(var i in e)a.call(e,i)&&(t[i]=e[i]);function r(){this.constructor=t}return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},a={}.hasOwnProperty;function u(){return u.__super__.constructor.apply(this,arguments)}s(u,n=e),u.prototype.catchQuery=function(){var t=this.$inputor.val(),e=this.$inputor.caret("pos",{iframe:this.app.iframe}),i=t.slice(0,e),t=this.callbacks("matcher").call(this,this.at,i,this.getOpt("startWithSpace"),this.getOpt("acceptSpaceBar")),i="string"==typeof t;if(!(i&&t.length<this.getOpt("minLen",0)))return i&&t.length<=this.getOpt("maxLen",20)?(e=(i=e-t.length)+t.length,this.pos=i,this.trigger("matched",[this.at,(t={text:t,headPos:i,endPos:e}).text])):(t=null,this.view.hide()),this.query=t},u.prototype.rect=function(){var t,e;if(t=this.$inputor.caret("offset",this.pos-1,{iframe:this.app.iframe}))return this.app.iframe&&!this.app.iframeAsRoot&&(e=l(this.app.iframe).offset(),t.left+=e.left,t.top+=e.top),e=this.app.document.selection?0:2,{left:t.left,top:t.top,bottom:t.top+t.height+e}},u.prototype.insert=function(t,e){var i=this.$inputor,r=i.val(),n=r.slice(0,Math.max(this.query.headPos-this.at.length,0)),o=""===(o=this.getOpt("suffix"))?o:o||" ",r=""+n+(t+=o)+r.slice(this.query.endPos||0);return i.val(r),i.caret("pos",n.length+t.length,{iframe:this.app.iframe}),i.is(":focus")||i.trigger("focus"),i.trigger("change")};var c,p,f,d,g=u,s=function(t,e){for(var i in e)a.call(e,i)&&(t[i]=e[i]);function r(){this.constructor=t}return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},a={}.hasOwnProperty;function y(){return y.__super__.constructor.apply(this,arguments)}function v(t){this.context=t,this.at=this.context.at,this.storage=this.context.$inputor}function w(t){this.context=t,this.$el=l("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>"),this.$elUl=this.$el.children(),this.timeoutID=null,this.context.$el.append(this.$el),this.bindEvent()}s(y,n),y.prototype._getRange=function(){var t=this.app.window.getSelection();if(0<t.rangeCount)return t.getRangeAt(0)},y.prototype._setRange=function(t,e,i){if((i=null==i?this._getRange():i)&&e)return e=l(e)[0],"after"===t?(i.setEndAfter(e),i.setStartAfter(e)):(i.setEndBefore(e),i.setStartBefore(e)),i.collapse(!1),this._clearRange(i)},y.prototype._clearRange=function(t){var e;if(null==t&&(t=this._getRange()),e=this.app.window.getSelection(),null==this.ctrl_a_pressed)return e.removeAllRanges(),e.addRange(t)},y.prototype._movingEvent=function(t){var e;return"click"===t.type||(e=t.which)===h.RIGHT||e===h.LEFT||e===h.UP||e===h.DOWN},y.prototype._unwrap=function(t){var e;return(e=(t=l(t).unwrap().get(0)).nextSibling)&&e.nodeValue&&(t.nodeValue+=e.nodeValue,l(e).remove()),t},y.prototype.catchQuery=function(t){var e,i,r,n,o,s,a;if((a=this._getRange())&&a.collapsed){if(t.which===h.ENTER)return(i=l(a.startContainer).closest(".atwho-query")).contents().unwrap(),i.is(":empty")&&i.remove(),(i=l(".atwho-query",this.app.document)).text(i.text()).contents().last().unwrap(),void this._clearRange();if(/firefox/i.test(navigator.userAgent)){if(l(a.startContainer).is(this.$inputor))return void this._clearRange();t.which===h.BACKSPACE&&a.startContainer.nodeType===document.ELEMENT_NODE&&0<=(o=a.startOffset-1)?((r=a.cloneRange()).setStart(a.startContainer,o),l(r.cloneContents()).contents().last().is(".atwho-inserted")&&(o=l(a.startContainer).contents().get(o),this._setRange("after",l(o).contents().last()))):t.which===h.LEFT&&a.startContainer.nodeType===document.TEXT_NODE&&(e=l(a.startContainer.previousSibling)).is(".atwho-inserted")&&0===a.startOffset&&this._setRange("after",e.contents().last())}if(l(a.startContainer).closest(".atwho-inserted").addClass("atwho-query").siblings().removeClass("atwho-query"),0<(i=l(".atwho-query",this.app.document)).length&&i.is(":empty")&&0===i.text().length&&i.remove(),this._movingEvent(t)||i.removeClass("atwho-inserted"),0<i.length)switch(t.which){case h.LEFT:return this._setRange("before",i.get(0),a),void i.removeClass("atwho-query");case h.RIGHT:return this._setRange("after",i.get(0).nextSibling,a),void i.removeClass("atwho-query")}return 0<i.length&&(s=i.attr("data-atwho-at-query"))&&(i.empty().html(s).attr("data-atwho-at-query",null),this._setRange("after",i.get(0),a)),(r=a.cloneRange()).setStart(a.startContainer,0),r="string"==typeof(s=this.callbacks("matcher").call(this,this.at,r.toString(),this.getOpt("startWithSpace"),this.getOpt("acceptSpaceBar"))),0===i.length&&r&&0<=(n=a.startOffset-this.at.length-s.length)&&(a.setStart(a.startContainer,n),i=l("<span/>",this.app.document).attr(this.getOpt("editableAtwhoQueryAttrs")).addClass("atwho-query"),a.surroundContents(i.get(0)),(n=i.contents().last().get(0))&&(/firefox/i.test(navigator.userAgent)?(a.setStart(n,n.length),a.setEnd(n,n.length),this._clearRange(a)):this._setRange("after",n,a))),r&&s.length<this.getOpt("minLen",0)?void 0:r&&s.length<=this.getOpt("maxLen",20)?(this.trigger("matched",[this.at,(s={text:s,el:i}).text]),this.query=s):(this.view.hide(),this.query={el:i},0<=i.text().indexOf(this.at)&&(this._movingEvent(t)&&i.hasClass("atwho-inserted")?i.removeClass("atwho-query"):!1!==this.callbacks("afterMatchFailed").call(this,this.at,i)&&this._setRange("after",this._unwrap(i.text(i.text()).contents().first()))),null)}},y.prototype.rect=function(){var t,e=this.query.el.offset();if(e&&this.query.el[0].getClientRects().length)return this.app.iframe&&!this.app.iframeAsRoot&&(t=l(this.app.iframe).offset(),e.left+=t.left-this.$inputor.scrollLeft(),e.top+=t.top-this.$inputor.scrollTop()),e.bottom=e.top+this.query.el.height(),e},y.prototype.insert=function(t,e){var i;return this.$inputor.is(":focus")||this.$inputor.focus(),(i=this.getOpt("functionOverrides")).insert?i.insert.call(this,t,e):(i=""===(i=this.getOpt("suffix"))?i:i||" ",e=e.data("item-data"),this.query.el.removeClass("atwho-query").addClass("atwho-inserted").html(t).attr("data-atwho-at-query",""+e["atwho-at"]+this.query.text).attr("contenteditable","false"),(e=this._getRange())&&(this.query.el.length&&e.setEndAfter(this.query.el[0]),e.collapse(!1),e.insertNode(i=this.app.document.createTextNode(""+i)),this._setRange("after",i,e)),this.$inputor.is(":focus")||this.$inputor.focus(),this.$inputor.change())},c=y,v.prototype.destroy=function(){return this.storage.data(this.at,null)},v.prototype.saved=function(){return 0<this.fetch()},v.prototype.query=function(t,e){var i=this.fetch(),r=this.context.getOpt("searchKey");return i=this.context.callbacks("filter").call(this.context,t,i,r)||[],r=this.context.callbacks("remoteFilter"),0<i.length||!r&&0===i.length?e(i):r.call(this.context,t,e)},v.prototype.fetch=function(){return this.storage.data(this.at)||[]},v.prototype.save=function(t){return this.storage.data(this.at,this.context.callbacks("beforeSave").call(this.context,t||[]))},v.prototype.load=function(t){if(!this.saved()&&t)return this._load(t)},v.prototype.reload=function(t){return this._load(t)},v.prototype._load=function(t){return"string"==typeof t?l.ajax(t,{dataType:"json"}).done((e=this,function(t){return e.save(t)})):this.save(t);var e},p=v,w.prototype.init=function(){var t=this.context.getOpt("alias")||this.context.at.charCodeAt(0),e=this.context.getOpt("headerTpl");return e&&1===this.$el.children().length&&this.$el.prepend(e),this.$el.attr({id:"at-view-"+t})},w.prototype.destroy=function(){return this.$el.remove()},w.prototype.bindEvent=function(){var e,i=this.$el.find("ul"),r=0,n=0;return i.on("mousemove.atwho-view","li",function(t){var e;if((r!==t.clientX||n!==t.clientY)&&(r=t.clientX,n=t.clientY,!(e=l(t.currentTarget)).hasClass("cur")))return i.find(".cur").removeClass("cur"),e.addClass("cur")}).on("click.atwho-view","li",(e=this,function(t){return i.find(".cur").removeClass("cur"),l(t.currentTarget).addClass("cur"),e.choose(t),t.preventDefault()}))},w.prototype.visible=function(){return l.expr.pseudos.visible(this.$el[0])},w.prototype.highlighted=function(){return 0<this.$el.find(".cur").length},w.prototype.choose=function(t){var e,i;if((e=this.$el.find(".cur")).length&&(i=this.context.insertContentFor(e),this.context._stopDelayedCall(),this.context.insert(this.context.callbacks("beforeInsert").call(this.context,i,e,t),e),this.context.trigger("inserted",[e,t]),this.hide(t)),this.context.getOpt("hideWithoutSuffix"))return this.stopShowing=!0},w.prototype.reposition=function(t){var e=this.context.app.iframeAsRoot?this.context.app.window:window;return t.bottom+this.$el.height()-l(e).scrollTop()>l(e).height()&&(t.bottom=t.top-this.$el.height()),t.left>(e=l(e).width()-this.$el.width()-5)&&(t.left=e),e={left:t.left,top:t.bottom},null!=(t=this.context.callbacks("beforeReposition"))&&t.call(this.context,e),this.$el.offset(e),this.context.trigger("reposition",[e])},w.prototype.next=function(){var t=this.$el.find(".cur").removeClass("cur").next();return(t=!t.length?this.$el.find("li:first"):t).addClass("cur"),t=(t=t[0]).offsetTop+t.offsetHeight+(t.nextSibling?t.nextSibling.offsetHeight:0),this.scrollTop(Math.max(0,t-this.$el.height()))},w.prototype.prev=function(){var t=this.$el.find(".cur").removeClass("cur").prev();return(t=!t.length?this.$el.find("li:last"):t).addClass("cur"),t=(t=t[0]).offsetTop+t.offsetHeight+(t.nextSibling?t.nextSibling.offsetHeight:0),this.scrollTop(Math.max(0,t-this.$el.height()))},w.prototype.scrollTop=function(t){var e=this.context.getOpt("scrollDuration");return e?this.$elUl.animate({scrollTop:t},e):this.$elUl.scrollTop(t)},w.prototype.show=function(){var t;if(!this.stopShowing)return this.visible()||(this.$el.show(),this.$el.scrollTop(0),this.context.trigger("shown")),(t=this.context.rect())?this.reposition(t):void 0;this.stopShowing=!1},w.prototype.hide=function(t,e){var i;if(this.visible())return isNaN(e)?(this.$el.hide(),this.context.trigger("hidden",[t])):(i=this,t=function(){return i.hide()},clearTimeout(this.timeoutID),this.timeoutID=setTimeout(t,e))},w.prototype.render=function(t){var e,i,r,n,o,s;if(Array.isArray(t)&&0<t.length){for(this.$el.find("ul").empty(),e=this.$el.find("ul"),s=this.context.getOpt("displayTpl"),i=0,n=t.length;i<n;i++)r=t[i],r=l.extend({},r,{"atwho-at":this.context.at}),o=this.context.callbacks("tplEval").call(this.context,s,r,"onDisplay"),(o=l(this.context.callbacks("highlighter").call(this.context,o,this.context.query.text))).data("item-data",r),e.append(o);return this.show(),this.context.getOpt("highlightFirst")?e.find("li:first").addClass("cur"):void 0}this.hide()},f=w,d={load:function(t,e){if(t=this.controller(t))return t.model.load(e)},isSelecting:function(){var t;return!(null==(t=this.controller())||!t.view.visible())},hide:function(){var t;return null!=(t=this.controller())?t.view.hide():void 0},reposition:function(){var t;if(t=this.controller())return t.view.reposition(t.rect())},setIframe:function(t,e){return this.setupRootElement(t,e),null},run:function(){return this.dispatch()},destroy:function(){return this.shutdown(),this.$inputor.data("atwho",null)}},l.fn.atwho=function(i){var r=arguments,n=null;return this.filter('textarea, input, [contenteditable=""], [contenteditable=true]').each(function(){var t,e;return(e=(t=l(this)).data("atwho"))||t.data("atwho",e=new o(this)),"object"!=typeof i&&i?d[i]&&e?n=d[i].apply(e,Array.prototype.slice.call(r,1)):l.error("Method "+i+" does not exist on jQuery.atwho"):e.reg(i.at,i)}),null!=n?n:this},l.fn.atwho.default={at:void 0,alias:void 0,data:null,displayTpl:"<li>${name}</li>",insertTpl:"${atwho-at}${name}",headerTpl:null,callbacks:i,functionOverrides:{},searchKey:"name",suffix:void 0,hideWithoutSuffix:!1,startWithSpace:!0,acceptSpaceBar:!1,highlightFirst:!0,limit:5,maxLen:20,minLen:0,displayTimeout:300,delay:null,spaceSelectsMatch:!1,tabSelectsMatch:!0,editableAtwhoQueryAttrs:{},scrollDuration:150,suspendOnComposing:!0,lookUpOnClick:!0},l.fn.atwho.debug=!1});
bp-core/js/vendor/jquery.caret.min.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"function"==typeof define&&define.amd?define(["jquery"],function(o){return t.returnExportsGlobal=e(o)}):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(this,function(t){"use strict";var e,o,n,r,i,s,a,l,p;e=function(){function e(t){this.$inputor=t,this.domInputor=this.$inputor[0]}return e.prototype.setPos=function(t){var e,o,n,r;return(r=l.getSelection())&&(n=0,o=!1,(e=function(t,i){var a,l,p,c,f,u;for(u=[],p=0,c=(f=i.childNodes).length;p<c&&(a=f[p],!o);p++)if(3===a.nodeType){if(n+a.length>=t){o=!0,(l=s.createRange()).setStart(a,t-n),r.removeAllRanges(),r.addRange(l);break}u.push(n+=a.length)}else u.push(e(t,a));return u})(t,this.domInputor)),this.domInputor},e.prototype.getIEPosition=function(){return this.getPosition()},e.prototype.getPosition=function(){var t,e;return e=this.getOffset(),t=this.$inputor.offset(),e.left-=t.left,e.top-=t.top,e},e.prototype.getOldIEPos=function(){var t,e;return e=s.selection.createRange(),(t=s.body.createTextRange()).moveToElementText(this.domInputor),t.setEndPoint("EndToEnd",e),t.text.length},e.prototype.getPos=function(){var t,e,o;return(o=this.range())?((t=o.cloneRange()).selectNodeContents(this.domInputor),t.setEnd(o.endContainer,o.endOffset),e=t.toString().length,t.detach(),e):s.selection?this.getOldIEPos():void 0},e.prototype.getOldIEOffset=function(){var t,e;return(t=s.selection.createRange().duplicate()).moveStart("character",-1),e=t.getBoundingClientRect(),{height:e.bottom-e.top,left:e.left,top:e.top}},e.prototype.getOffset=function(e){var o,n,r,i,a;return l.getSelection&&(r=this.range())?(r.endOffset-1>0&&r.endContainer!==this.domInputor&&((o=r.cloneRange()).setStart(r.endContainer,r.endOffset-1),o.setEnd(r.endContainer,r.endOffset),n={height:(i=o.getBoundingClientRect()).height,left:i.left+i.width,top:i.top},o.detach()),n&&0!==(null!=n?n.height:void 0)||(o=r.cloneRange(),a=t(s.createTextNode("|")),o.insertNode(a[0]),o.selectNode(a[0]),n={height:(i=o.getBoundingClientRect()).height,left:i.left,top:i.top},a.remove(),o.detach())):s.selection&&(n=this.getOldIEOffset()),n&&(n.top+=t(l).scrollTop(),n.left+=t(l).scrollLeft()),n},e.prototype.range=function(){var t;if(l.getSelection)return(t=l.getSelection()).rangeCount>0?t.getRangeAt(0):null},e}(),o=function(){function e(t){this.$inputor=t,this.domInputor=this.$inputor[0]}return e.prototype.getIEPos=function(){var t,e,o,n,r,i;return e=this.domInputor,r=s.selection.createRange(),n=0,r&&r.parentElement()===e&&(o=e.value.replace(/\r\n/g,"\n").length,(i=e.createTextRange()).moveToBookmark(r.getBookmark()),(t=e.createTextRange()).collapse(!1),n=i.compareEndPoints("StartToEnd",t)>-1?o:-i.moveStart("character",-o)),n},e.prototype.getPos=function(){return s.selection?this.getIEPos():this.domInputor.selectionStart},e.prototype.setPos=function(t){var e,o;return e=this.domInputor,s.selection?((o=e.createTextRange()).move("character",t),o.select()):e.setSelectionRange&&e.setSelectionRange(t,t),e},e.prototype.getIEOffset=function(t){var e,o,n,r;return o=this.domInputor.createTextRange(),t||(t=this.getPos()),o.move("character",t),n=o.boundingLeft,r=o.boundingTop,e=o.boundingHeight,{left:n,top:r,height:e}},e.prototype.getOffset=function(e){var o,n,r;return o=this.$inputor,s.selection?(n=this.getIEOffset(e),n.top+=t(l).scrollTop()+o.scrollTop(),n.left+=t(l).scrollLeft()+o.scrollLeft(),n):(n=o.offset(),r=this.getPosition(e),n={left:n.left+r.left-o.scrollLeft(),top:n.top+r.top-o.scrollTop(),height:r.height})},e.prototype.getPosition=function(t){var e,o,r,i,s,a;return e=this.$inputor,r=function(t){return t=t.replace(/<|>|`|"|&/g,"?").replace(/\r\n|\r|\n/g,"<br/>"),/firefox/i.test(navigator.userAgent)&&(t=t.replace(/\s/g,"&nbsp;")),t},void 0===t&&(t=this.getPos()),a=e.val().slice(0,t),o=e.val().slice(t),i="<span style='position: relative; display: inline;'>"+r(a)+"</span>",i+="<span id='caret' style='position: relative; display: inline;'>|</span>",i+="<span style='position: relative; display: inline;'>"+r(o)+"</span>",s=new n(e),s.create(i).rect()},e.prototype.getIEPosition=function(t){var e,o,n,r,i;return n=this.getIEOffset(t),o=this.$inputor.offset(),r=n.left-o.left,i=n.top-o.top,e=n.height,{left:r,top:i,height:e}},e}(),n=function(){function e(t){this.$inputor=t}return e.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"],e.prototype.mirrorCss=function(){var e,o=this;return e={position:"absolute",left:-9999,top:0,zIndex:-2e4},"TEXTAREA"===this.$inputor.prop("tagName")&&this.css_attr.push("width"),t.each(this.css_attr,function(t,n){return e[n]=o.$inputor.css(n)}),e},e.prototype.create=function(e){return this.$mirror=t("<div></div>"),this.$mirror.css(this.mirrorCss()),this.$mirror.html(e),this.$inputor.after(this.$mirror),this},e.prototype.rect=function(){var t,e,o;return t=this.$mirror.find("#caret"),e=t.position(),o={left:e.left,top:e.top,height:t.height()},this.$mirror.remove(),o},e}(),r={contentEditable:function(t){return!(!t[0].contentEditable||"true"!==t[0].contentEditable)}},i={pos:function(t){return t||0===t?this.setPos(t):this.getPos()},position:function(t){return s.selection?this.getIEPosition(t):this.getPosition(t)},offset:function(t){return this.getOffset(t)}},s=null,l=null,a=null,p=function(t){var e;return(e=null!=t?t.iframe:void 0)?(a=e,l=e.contentWindow,s=e.contentDocument||l.document):(a=void 0,l=window,s=document)},t.fn.caret=function(n,s,a){var l;return i[n]?(t.isPlainObject(s)?(p(s),s=void 0):p(a),l=r.contentEditable(this)?new e(this):new o(this),i[n].apply(l,[s])):t.error("Method "+n+" does not exist on jQuery.caret")},t.fn.caret.EditableCaret=e,t.fn.caret.InputCaret=o,t.fn.caret.Utils=r,t.fn.caret.apis=i});
1
+ !function(e,o){"function"==typeof define&&define.amd?define(["jquery"],function(t){return e.returnExportsGlobal=o(t)}):"object"==typeof exports?module.exports=o(require("jquery")):o(jQuery)}(this,function(i){"use strict";var n,r,s,a,p,u,h,l;function t(t){this.$inputor=t,this.domInputor=this.$inputor[0]}function e(t){this.$inputor=t,this.domInputor=this.$inputor[0]}function o(t){this.$inputor=t}t.prototype.setPos=function(t){var p,l,c,f;return(f=h.getSelection())&&(c=0,l=!1,(p=function(t,e){for(var o,n,r=e.childNodes,i=[],s=0,a=r.length;s<a&&(o=r[s],!l);s++)if(3===o.nodeType){if(c+o.length>=t){l=!0,(n=u.createRange()).setStart(o,t-c),f.removeAllRanges(),f.addRange(n);break}i.push(c+=o.length)}else i.push(p(t,o));return i})(t,this.domInputor)),this.domInputor},t.prototype.getIEPosition=function(){return this.getPosition()},t.prototype.getPosition=function(){var t=this.getOffset(),e=this.$inputor.offset();return t.left-=e.left,t.top-=e.top,t},t.prototype.getOldIEPos=function(){var t=u.selection.createRange(),e=u.body.createTextRange();return e.moveToElementText(this.domInputor),e.setEndPoint("EndToEnd",t),e.text.length},t.prototype.getPos=function(){var t,e;return(e=this.range())?((t=e.cloneRange()).selectNodeContents(this.domInputor),t.setEnd(e.endContainer,e.endOffset),e=t.toString().length,t.detach(),e):u.selection?this.getOldIEPos():void 0},t.prototype.getOldIEOffset=function(){var t=u.selection.createRange().duplicate();return t.moveStart("character",-1),{height:(t=t.getBoundingClientRect()).bottom-t.top,left:t.left,top:t.top}},t.prototype.getOffset=function(t){var e,o,n,r;return h.getSelection&&(r=this.range())?(0<r.endOffset-1&&r.endContainer!==this.domInputor&&((e=r.cloneRange()).setStart(r.endContainer,r.endOffset-1),e.setEnd(r.endContainer,r.endOffset),o={height:(n=e.getBoundingClientRect()).height,left:n.left+n.width,top:n.top},e.detach()),o&&0!==(null!=o?o.height:void 0)||(e=r.cloneRange(),r=i(u.createTextNode("|")),e.insertNode(r[0]),e.selectNode(r[0]),o={height:(n=e.getBoundingClientRect()).height,left:n.left,top:n.top},r.remove(),e.detach())):u.selection&&(o=this.getOldIEOffset()),o&&(o.top+=i(h).scrollTop(),o.left+=i(h).scrollLeft()),o},t.prototype.range=function(){var t;if(h.getSelection)return 0<(t=h.getSelection()).rangeCount?t.getRangeAt(0):null},n=t,e.prototype.getIEPos=function(){var t,e,o=this.domInputor,n=u.selection.createRange(),r=0;return n&&n.parentElement()===o&&(t=o.value.replace(/\r\n/g,"\n").length,(e=o.createTextRange()).moveToBookmark(n.getBookmark()),(o=o.createTextRange()).collapse(!1),r=-1<e.compareEndPoints("StartToEnd",o)?t:-e.moveStart("character",-t)),r},e.prototype.getPos=function(){return u.selection?this.getIEPos():this.domInputor.selectionStart},e.prototype.setPos=function(t){var e,o=this.domInputor;return u.selection?((e=o.createTextRange()).move("character",t),e.select()):o.setSelectionRange&&o.setSelectionRange(t,t),o},e.prototype.getIEOffset=function(t){var e=this.domInputor.createTextRange();return t=t||this.getPos(),e.move("character",t),{left:e.boundingLeft,top:e.boundingTop,height:e.boundingHeight}},e.prototype.getOffset=function(t){var e,o=this.$inputor;return u.selection?((e=this.getIEOffset(t)).top+=i(h).scrollTop()+o.scrollTop(),e.left+=i(h).scrollLeft()+o.scrollLeft(),e):(e=o.offset(),t=this.getPosition(t),{left:e.left+t.left-o.scrollLeft(),top:e.top+t.top-o.scrollTop(),height:t.height})},e.prototype.getPosition=function(t){var e,o=this.$inputor,n=function(t){return t=t.replace(/<|>|`|"|&/g,"?").replace(/\r\n|\r|\n/g,"<br/>"),t=/firefox/i.test(navigator.userAgent)?t.replace(/\s/g,"&nbsp;"):t};return void 0===t&&(t=this.getPos()),e=o.val().slice(0,t),t=o.val().slice(t),e="<span style='position: relative; display: inline;'>"+n(e)+"</span>",e+="<span id='caret' style='position: relative; display: inline;'>|</span>",e+="<span style='position: relative; display: inline;'>"+n(t)+"</span>",new s(o).create(e).rect()},e.prototype.getIEPosition=function(t){var e=this.getIEOffset(t),t=this.$inputor.offset();return{left:e.left-t.left,top:e.top-t.top,height:e.height}},r=e,o.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"],o.prototype.mirrorCss=function(){var o=this,n={position:"absolute",left:-9999,top:0,zIndex:-2e4};return"TEXTAREA"===this.$inputor.prop("tagName")&&this.css_attr.push("width"),i.each(this.css_attr,function(t,e){return n[e]=o.$inputor.css(e)}),n},o.prototype.create=function(t){return this.$mirror=i("<div></div>"),this.$mirror.css(this.mirrorCss()),this.$mirror.html(t),this.$inputor.after(this.$mirror),this},o.prototype.rect=function(){var t=this.$mirror.find("#caret"),e=t.position(),t={left:e.left,top:e.top,height:t.height()};return this.$mirror.remove(),t},s=o,a={contentEditable:function(t){return!(!t[0].contentEditable||"true"!==t[0].contentEditable)}},p={pos:function(t){return t||0===t?this.setPos(t):this.getPos()},position:function(t){return u.selection?this.getIEPosition(t):this.getPosition(t)},offset:function(t){return this.getOffset(t)}},h=u=null,l=function(t){return u=(t=null!=t?t.iframe:void 0)?(h=t.contentWindow,t.contentDocument||h.document):(h=window,document)},i.fn.caret=function(t,e,o){return p[t]?(i.isPlainObject(e)?(l(e),e=void 0):l(o),o=new(a.contentEditable(this)?n:r)(this),p[t].apply(o,[e])):i.error("Method "+t+" does not exist on jQuery.caret")},i.fn.caret.EditableCaret=n,i.fn.caret.InputCaret=r,i.fn.caret.Utils=a,i.fn.caret.apis=p});
bp-core/js/vendor/livestamp.min.js CHANGED
@@ -1 +1 @@
1
- !function(t,a){var e=1e3,i=!1,n=t([]),o=function(e,i){var o=e.data("livestampdata");if("number"==typeof i&&(i*=1e3),e.removeAttr("data-livestamp").removeData("livestamp"),i=a(i),a.isMoment(i)&&!isNaN(+i)){var r=t.extend({},{original:e.contents()},o);r.moment=a(i),e.data("livestampdata",r).empty(),n.push(e[0])}},r=function(){i||(m.update(),setTimeout(r,e))},m={update:function(){t("[data-livestamp]").each(function(){var a=t(this);o(a,a.data("livestamp"))});var e=[];n.each(function(){var i=t(this),n=i.data("livestampdata");if(void 0===n)e.push(this);else if(a.isMoment(n.moment)){var o=i.html(),r=n.moment.fromNow();if(o!=r){var m=t.Event("change.livestamp");i.trigger(m,[o,r]),m.isDefaultPrevented()||i.html(r)}}}),n=n.not(e)},pause:function(){i=!0},resume:function(){i=!1,r()},interval:function(t){if(void 0===t)return e;e=t}},s={add:function(e,i){return"number"==typeof i&&(i*=1e3),i=a(i),a.isMoment(i)&&!isNaN(+i)&&(e.each(function(){o(t(this),i)}),m.update()),e},destroy:function(a){return n=n.not(a),a.each(function(){var e=t(this),i=e.data("livestampdata");if(void 0===i)return a;e.html(i.original?i.original:"").removeData("livestampdata")}),a},isLivestamp:function(t){return void 0!==t.data("livestampdata")}};t.livestamp=m,t(function(){m.resume()}),t.fn.livestamp=function(t,a){return s[t]||(a=t,t="add"),s[t](this,a)}}(jQuery,moment);
1
+ !function(o,m){function e(t,a){var e=t.data("livestampdata");"number"==typeof a&&(a*=1e3),t.removeAttr("data-livestamp").removeData("livestamp"),a=m(a),m.isMoment(a)&&!isNaN(+a)&&((e=o.extend({},{original:t.contents()},e)).moment=m(a),t.data("livestampdata",e).empty(),n.push(t[0]))}var a=1e3,t=!1,n=o([]),i=function(){t||(r.update(),setTimeout(i,a))},r={update:function(){o("[data-livestamp]").each(function(){var t=o(this);e(t,t.data("livestamp"))});var i=[];n.each(function(){var t,a,e=o(this),n=e.data("livestampdata");void 0===n?i.push(this):!m.isMoment(n.moment)||(t=e.html())!=(a=n.moment.fromNow())&&(n=o.Event("change.livestamp"),e.trigger(n,[t,a]),n.isDefaultPrevented()||e.html(a))}),n=n.not(i)},pause:function(){t=!0},resume:function(){t=!1,i()},interval:function(t){if(void 0===t)return a;a=t}},s={add:function(t,a){return"number"==typeof a&&(a*=1e3),a=m(a),m.isMoment(a)&&!isNaN(+a)&&(t.each(function(){e(o(this),a)}),r.update()),t},destroy:function(e){return n=n.not(e),e.each(function(){var t=o(this),a=t.data("livestampdata");if(void 0===a)return e;t.html(a.original||"").removeData("livestampdata")}),e},isLivestamp:function(t){return void 0!==t.data("livestampdata")}};o.livestamp=r,o(function(){r.resume()}),o.fn.livestamp=function(t,a){return s[t]||(a=t,t="add"),s[t](this,a)}}(jQuery,moment);
bp-core/js/vendor/moment-js/locale/af.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";return e.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(e){return/^nm$/i.test(e)},meridiem:function(e,n,a){return e<12?a?"vm":"VM":a?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})});
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";return e.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(e){return/^nm$/i.test(e)},meridiem:function(e,n,a){return e<12?a?"vm":"VM":a?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||20<=e?"ste":"de")},week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/ar-ly.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,d){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?d(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],d):d(e.moment)}(this,function(e){"use strict";var d={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},t=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},n={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},r=function(e){return function(d,r,i,m){var o=t(d),a=n[e][t(d)];return 2===o&&(a=a[r?0:1]),a.replace(/%d/i,d)}},i=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];return e.defineLocale("ar-ly",{months:i,monthsShort:i,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,d,t){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:r("s"),m:r("m"),mm:r("m"),h:r("h"),hh:r("h"),d:r("d"),dd:r("d"),M:r("M"),MM:r("M"),y:r("y"),yy:r("y")},preparse:function(e){return e.replace(/\u200f/g,"").replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return d[e]}).replace(/,/g,"،")},week:{dow:6,doy:12}})});
1
+ !function(e,d){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?d(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],d):d(e.moment)}(this,function(e){"use strict";function o(e){return 0===e?0:1===e?1:2===e?2:3<=e%100&&e%100<=10?3:11<=e%100?4:5}function d(m){return function(e,d,t,n){var r=o(e),i=a[m][o(e)];return(i=2===r?i[d?0:1]:i).replace(/%d/i,e)}}var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},a={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},n=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];return e.defineLocale("ar-ly",{months:n,monthsShort:n,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,d,t){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:d("s"),m:d("m"),mm:d("m"),h:d("h"),hh:d("h"),d:d("d"),dd:d("d"),M:d("M"),MM:d("M"),y:d("y"),yy:d("y")},preparse:function(e){return e.replace(/\u200f/g,"").replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},week:{dow:6,doy:12}})});
bp-core/js/vendor/moment-js/locale/ar.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,d){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?d(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],d):d(e.moment)}(this,function(e){"use strict";var d={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},t={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},r={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},i=function(e){return function(d,t,i,o){var a=n(d),m=r[e][n(d)];return 2===a&&(m=m[t?0:1]),m.replace(/%d/i,d)}},o=["كانون الثاني يناير","شباط فبراير","آذار مارس","نيسان أبريل","أيار مايو","حزيران يونيو","تموز يوليو","آب أغسطس","أيلول سبتمبر","تشرين الأول أكتوبر","تشرين الثاني نوفمبر","كانون الأول ديسمبر"];return e.defineLocale("ar",{months:o,monthsShort:o,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,d,t){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:i("s"),m:i("m"),mm:i("m"),h:i("h"),hh:i("h"),d:i("d"),dd:i("d"),M:i("M"),MM:i("M"),y:i("y"),yy:i("y")},preparse:function(e){return e.replace(/\u200f/g,"").replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(e){return t[e]}).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return d[e]}).replace(/,/g,"،")},week:{dow:6,doy:12}})});
1
+ !function(e,d){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?d(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],d):d(e.moment)}(this,function(e){"use strict";function a(e){return 0===e?0:1===e?1:2===e?2:3<=e%100&&e%100<=10?3:11<=e%100?4:5}function d(o){return function(e,d,t,n){var r=a(e),i=m[o][a(e)];return(i=2===r?i[d?0:1]:i).replace(/%d/i,e)}}var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},m={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},r=["كانون الثاني يناير","شباط فبراير","آذار مارس","نيسان أبريل","أيار مايو","حزيران يونيو","تموز يوليو","آب أغسطس","أيلول سبتمبر","تشرين الأول أكتوبر","تشرين الثاني نوفمبر","كانون الأول ديسمبر"];return e.defineLocale("ar",{months:r,monthsShort:r,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,d,t){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:d("s"),m:d("m"),mm:d("m"),h:d("h"),hh:d("h"),d:d("d"),dd:d("d"),M:d("M"),MM:d("M"),y:d("y"),yy:d("y")},preparse:function(e){return e.replace(/\u200f/g,"").replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(e){return n[e]}).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},week:{dow:6,doy:12}})});
bp-core/js/vendor/moment-js/locale/az.min.js CHANGED
@@ -1 +1 @@
1
- !function(n,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(n.moment)}(this,function(n){"use strict";var a={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};return n.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"birneçə saniyyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(n){return/^(gündüz|axşam)$/.test(n)},meridiem:function(n,a,e){return n<4?"gecə":n<12?"səhər":n<17?"gündüz":"axşam"},ordinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(n){if(0===n)return n+"-ıncı";var e=n%10,i=n%100-e,t=n>=100?100:null;return n+(a[e]||a[i]||a[t])},week:{dow:1,doy:7}})});
1
+ !function(n,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(n.moment)}(this,function(n){"use strict";var e={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};return n.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"birneçə saniyyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(n){return/^(gündüz|axşam)$/.test(n)},meridiem:function(n,a,e){return n<4?"gecə":n<12?"səhər":n<17?"gündüz":"axşam"},ordinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(n){if(0===n)return n+"-ıncı";var a=n%10;return n+(e[a]||e[n%100-a]||e[100<=n?100:null])},week:{dow:1,doy:7}})});
bp-core/js/vendor/moment-js/locale/be.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";function _(e,_){var t=e.split("_");return _%10==1&&_%100!=11?t[0]:_%10>=2&&_%10<=4&&(_%100<10||_%100>=20)?t[1]:t[2]}function t(e,t,n){var s={mm:t?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:t?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"};return"m"===n?t?"хвіліна":"хвіліну":"h"===n?t?"гадзіна":"гадзіну":e+" "+_(s[n],+e)}return e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:t,mm:t,h:t,hh:t,d:"дзень",dd:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,_,t){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},ordinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,_){switch(_){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})});
1
+ !function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";function _(e,_,t){return"m"===t?_?"хвіліна":"хвіліну":"h"===t?_?"гадзіна":"гадзіну":e+" "+(e=+e,t=(t={mm:_?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:_?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"}[t]).split("_"),e%10==1&&e%100!=11?t[0]:2<=e%10&&e%10<=4&&(e%100<10||20<=e%100)?t[1]:t[2])}return e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:_,mm:_,h:_,hh:_,d:"дзень",dd:_,M:"месяц",MM:_,y:"год",yy:_},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,_,t){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},ordinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,_){switch(_){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})});
bp-core/js/vendor/moment-js/locale/bg.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";return e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var _=e%10,d=e%100;return 0===e?e+"-ев":0===d?e+"-ен":d>10&&d<20?e+"-ти":1===_?e+"-ви":2===_?e+"-ри":7===_||8===_?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})});
1
+ !function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";return e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var _=e%10,d=e%100;return 0===e?e+"-ев":0==d?e+"-ен":10<d&&d<20?e+"-ти":1==_?e+"-ви":2==_?e+"-ри":7==_||8==_?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})});
bp-core/js/vendor/moment-js/locale/bn.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},_={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};return e.defineLocale("bn",{months:"জানুয়ারী_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব_মার্চ_এপ্র_মে_জুন_জুল_আগ_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,function(e){return _[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t&&e>=4||"দুপুর"===t&&e<5||"বিকাল"===t?e+12:e},meridiem:function(e,t,_){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},_={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};return e.defineLocale("bn",{months:"জানুয়ারী_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব_মার্চ_এপ্র_মে_জুন_জুল_আগ_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,function(e){return _[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t&&4<=e||"দুপুর"===t&&e<5||"বিকাল"===t?e+12:e},meridiem:function(e,t,_){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}})});
bp-core/js/vendor/moment-js/locale/bo.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},_={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};return e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,function(e){return _[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return 12===e&&(e=0),"མཚན་མོ"===t&&e>=4||"ཉིན་གུང"===t&&e<5||"དགོང་དག"===t?e+12:e},meridiem:function(e,t,_){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},_={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};return e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,function(e){return _[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return 12===e&&(e=0),"མཚན་མོ"===t&&4<=e||"ཉིན་གུང"===t&&e<5||"དགོང་དག"===t?e+12:e},meridiem:function(e,t,_){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})});
bp-core/js/vendor/moment-js/locale/br.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";function n(e,n,r){return e+" "+t({mm:"munutenn",MM:"miz",dd:"devezh"}[r],e)}function r(e){return e>9?r(e%10):e}function t(e,n){return 2===n?a(e):e}function a(e){var n={m:"v",b:"v",d:"z"};return void 0===n[e.charAt(0)]?e:n[e.charAt(0)]+e.substring(1)}return e.defineLocale("br",{months:"Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h[e]mm A",LTS:"h[e]mm:ss A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY h[e]mm A",LLLL:"dddd, D [a viz] MMMM YYYY h[e]mm A"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc'hoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec'h da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s 'zo",s:"un nebeud segondennoù",m:"ur vunutenn",mm:n,h:"un eur",hh:"%d eur",d:"un devezh",dd:n,M:"ur miz",MM:n,y:"ur bloaz",yy:function(e){switch(r(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},ordinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){return e+(1===e?"añ":"vet")},week:{dow:1,doy:4}})});
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";function n(e,n,r){return e+" "+(r={mm:"munutenn",MM:"miz",dd:"devezh"}[r],2!==e?r:function(e){var n={m:"v",b:"v",d:"z"};return void 0!==n[e.charAt(0)]?n[e.charAt(0)]+e.substring(1):e}(r))}return e.defineLocale("br",{months:"Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h[e]mm A",LTS:"h[e]mm:ss A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY h[e]mm A",LLLL:"dddd, D [a viz] MMMM YYYY h[e]mm A"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc'hoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec'h da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s 'zo",s:"un nebeud segondennoù",m:"ur vunutenn",mm:n,h:"un eur",hh:"%d eur",d:"un devezh",dd:n,M:"ur miz",MM:n,y:"ur bloaz",yy:function(e){switch(function e(n){if(9<n)return e(n%10);return n}(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},ordinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){return e+(1===e?"añ":"vet")},week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/bs.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";function a(e,a,t){var s=e+" ";switch(t){case"m":return a?"jedna minuta":"jedne minute";case"mm":return s+=1===e?"minuta":2===e||3===e||4===e?"minute":"minuta";case"h":return a?"jedan sat":"jednog sata";case"hh":return s+=1===e?"sat":2===e||3===e||4===e?"sata":"sati";case"dd":return s+=1===e?"dan":"dana";case"MM":return s+=1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci";case"yy":return s+=1===e?"godina":2===e||3===e||4===e?"godine":"godina"}}return e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:a,mm:a,h:a,hh:a,d:"dan",dd:a,M:"mjesec",MM:a,y:"godinu",yy:a},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})});
1
+ !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";function a(e,a,t){var s=e+" ";switch(t){case"m":return a?"jedna minuta":"jedne minute";case"mm":return s+=1!==e&&(2===e||3===e||4===e)?"minute":"minuta";case"h":return a?"jedan sat":"jednog sata";case"hh":return s+=1===e?"sat":2===e||3===e||4===e?"sata":"sati";case"dd":return s+=1===e?"dan":"dana";case"MM":return s+=1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci";case"yy":return s+=1!==e&&(2===e||3===e||4===e)?"godine":"godina"}}return e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:a,mm:a,h:a,hh:a,d:"dan",dd:a,M:"mjesec",MM:a,y:"godinu",yy:a},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})});
bp-core/js/vendor/moment-js/locale/ca.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,s){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?s(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],s):s(e.moment)}(this,function(e){"use strict";return e.defineLocale("ca",{months:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),monthsShort:"gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,s){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==s&&"W"!==s||(n="a"),e+n},week:{dow:1,doy:4}})});
1
+ !function(e,s){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?s(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],s):s(e.moment)}(this,function(e){"use strict";return e.defineLocale("ca",{months:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),monthsShort:"gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,s){return e+("w"!==s&&"W"!==s?1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è":"a")},week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/cs.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";function n(e){return e>1&&e<5&&1!=~~(e/10)}function t(e,t,r,s){var u=e+" ";switch(r){case"s":return t||s?"pár sekund":"pár sekundami";case"m":return t?"minuta":s?"minutu":"minutou";case"mm":return t||s?u+(n(e)?"minuty":"minut"):u+"minutami";case"h":return t?"hodina":s?"hodinu":"hodinou";case"hh":return t||s?u+(n(e)?"hodiny":"hodin"):u+"hodinami";case"d":return t||s?"den":"dnem";case"dd":return t||s?u+(n(e)?"dny":"dní"):u+"dny";case"M":return t||s?"měsíc":"měsícem";case"MM":return t||s?u+(n(e)?"měsíce":"měsíců"):u+"měsíci";case"y":return t||s?"rok":"rokem";case"yy":return t||s?u+(n(e)?"roky":"let"):u+"lety"}}var r="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),s="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_");return e.defineLocale("cs",{months:r,monthsShort:s,monthsParse:function(e,n){var t,r=[];for(t=0;t<12;t++)r[t]=new RegExp("^"+e[t]+"$|^"+n[t]+"$","i");return r}(r,s),shortMonthsParse:function(e){var n,t=[];for(n=0;n<12;n++)t[n]=new RegExp("^"+e[n]+"$","i");return t}(s),longMonthsParse:function(e){var n,t=[];for(n=0;n<12;n++)t[n]=new RegExp("^"+e[n]+"$","i");return t}(r),weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";var n="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),t="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_");function u(e){return 1<e&&e<5&&1!=~~(e/10)}function r(e,n,t,r){var s=e+" ";switch(t){case"s":return n||r?"pár sekund":"pár sekundami";case"m":return n?"minuta":r?"minutu":"minutou";case"mm":return n||r?s+(u(e)?"minuty":"minut"):s+"minutami";case"h":return n?"hodina":r?"hodinu":"hodinou";case"hh":return n||r?s+(u(e)?"hodiny":"hodin"):s+"hodinami";case"d":return n||r?"den":"dnem";case"dd":return n||r?s+(u(e)?"dny":"dní"):s+"dny";case"M":return n||r?"měsíc":"měsícem";case"MM":return n||r?s+(u(e)?"měsíce":"měsíců"):s+"měsíci";case"y":return n||r?"rok":"rokem";case"yy":return n||r?s+(u(e)?"roky":"let"):s+"lety"}}return e.defineLocale("cs",{months:n,monthsShort:t,monthsParse:function(e,n){for(var t=[],r=0;r<12;r++)t[r]=new RegExp("^"+e[r]+"$|^"+n[r]+"$","i");return t}(n,t),shortMonthsParse:function(e){for(var n=[],t=0;t<12;t++)n[t]=new RegExp("^"+e[t]+"$","i");return n}(t),longMonthsParse:function(e){for(var n=[],t=0;t<12;t++)n[t]=new RegExp("^"+e[t]+"$","i");return n}(n),weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/cy.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,d){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?d(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],d):d(e.moment)}(this,function(e){"use strict";return e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},ordinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var d=e,a="",n=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"];return d>20?a=40===d||50===d||60===d||80===d||100===d?"fed":"ain":d>0&&(a=n[d]),e+a},week:{dow:1,doy:4}})});
1
+ !function(e,d){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?d(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],d):d(e.moment)}(this,function(e){"use strict";return e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},ordinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var d="";return 20<e?d=40===e||50===e||60===e||80===e||100===e?"fed":"ain":0<e&&(d=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"][e]),e+d},week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/de-at.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";function n(e,n,t,a){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return n?r[t][0]:r[t][1]}return e.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:n,mm:"%d Minuten",h:n,hh:"%d Stunden",d:n,dd:n,M:n,MM:n,y:n,yy:n},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";function n(e,n,t,a){e={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return n?e[t][0]:e[t][1]}return e.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:n,mm:"%d Minuten",h:n,hh:"%d Stunden",d:n,dd:n,M:n,MM:n,y:n,yy:n},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/de.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";function n(e,n,t,a){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return n?r[t][0]:r[t][1]}return e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:n,mm:"%d Minuten",h:n,hh:"%d Stunden",d:n,dd:n,M:n,MM:n,y:n,yy:n},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";function n(e,n,t,a){e={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return n?e[t][0]:e[t][1]}return e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:n,mm:"%d Minuten",h:n,hh:"%d Stunden",d:n,dd:n,M:n,MM:n,y:n,yy:n},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/el.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";function t(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}return e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,t){return/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,t,n){return e>11?n?"μμ":"ΜΜ":n?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(e,n){var _=this._calendarEl[e],i=n&&n.hours();return t(_)&&(_=_.apply(n)),_.replace("{}",i%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},ordinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";return e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,t){return(/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl:this._monthsNominativeEl)[e.month()]},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,t,n){return 11<e?n?"μμ":"ΜΜ":n?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){return 6!==this.day()?"[την προηγούμενη] dddd [{}] LT":"[το προηγούμενο] dddd [{}] LT"},sameElse:"L"},calendar:function(e,t){var n=this._calendarEl[e],_=t&&t.hours();return(n=(e=n)instanceof Function||"[object Function]"===Object.prototype.toString.call(e)?n.apply(t):n).replace("{}",_%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},ordinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/en-au.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1===a?"st":2===a?"nd":3===a?"rd":"th")},week:{dow:1,doy:4}})});
1
+ !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1==a?"st":2==a?"nd":3==a?"rd":"th")},week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/en-ca.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1===a?"st":2===a?"nd":3===a?"rd":"th")}})});
1
+ !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1==a?"st":2==a?"nd":3==a?"rd":"th")}})});
bp-core/js/vendor/moment-js/locale/en-gb.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1===a?"st":2===a?"nd":3===a?"rd":"th")},week:{dow:1,doy:4}})});
1
+ !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1==a?"st":2==a?"nd":3==a?"rd":"th")},week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/en-ie.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1===a?"st":2===a?"nd":3===a?"rd":"th")},week:{dow:1,doy:4}})});
1
+ !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1==a?"st":2==a?"nd":3==a?"rd":"th")},week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/en-nz.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1===a?"st":2===a?"nd":3===a?"rd":"th")},week:{dow:1,doy:4}})});
1
+ !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1==a?"st":2==a?"nd":3==a?"rd":"th")},week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/eo.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,o){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?o(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],o):o(e.moment)}(this,function(e){"use strict";return e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdays:"Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato".split("_"),weekdaysShort:"Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Ĵa_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D[-an de] MMMM, YYYY",LLL:"D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd, [la] D[-an de] MMMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,o,a){return e>11?a?"p.t.m.":"P.T.M.":a?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd [je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasinta] dddd [je] LT",sameElse:"L"},relativeTime:{future:"je %s",past:"antaŭ %s",s:"sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"},ordinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})});
1
+ !function(e,o){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?o(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],o):o(e.moment)}(this,function(e){"use strict";return e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdays:"Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato".split("_"),weekdaysShort:"Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Ĵa_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D[-an de] MMMM, YYYY",LLL:"D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd, [la] D[-an de] MMMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,o,a){return 11<e?a?"p.t.m.":"P.T.M.":a?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd [je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasinta] dddd [je] LT",sameElse:"L"},relativeTime:{future:"je %s",past:"antaŭ %s",s:"sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"},ordinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})});
bp-core/js/vendor/moment-js/locale/es-do.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";var n="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),o="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_");return e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,s){return/-MMM-/.test(s)?o[e.month()]:n[e.month()]},monthsParseExact:!0,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})});
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";var o="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),s="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_");return e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,n){return(/-MMM-/.test(n)?s:o)[e.month()]},monthsParseExact:!0,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/es.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";var n="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),o="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_");return e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,s){return/-MMM-/.test(s)?o[e.month()]:n[e.month()]},monthsParseExact:!0,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})});
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";var s="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),o="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_");return e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,n){return(/-MMM-/.test(n)?o:s)[e.month()]},monthsParseExact:!0,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/et.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";function a(e,a,t,n){var s={s:["mõne sekundi","mõni sekund","paar sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return a?s[t][2]?s[t][2]:s[t][1]:n?s[t][0]:s[t][1]}return e.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:a,m:a,mm:a,h:a,hh:a,d:a,dd:"%d päeva",M:a,MM:a,y:a,yy:a},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
1
+ !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";function a(e,a,t,n){e={s:["mõne sekundi","mõni sekund","paar sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return a?e[t][2]||e[t][1]:n?e[t][0]:e[t][1]}return e.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:a,m:a,mm:a,h:a,hh:a,d:a,dd:"%d päeva",M:a,MM:a,y:a,yy:a},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/fi.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,u){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?u(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],u):u(e.moment)}(this,function(e){"use strict";function u(e,u,t,a){var i="";switch(t){case"s":return a?"muutaman sekunnin":"muutama sekunti";case"m":return a?"minuutin":"minuutti";case"mm":i=a?"minuutin":"minuuttia";break;case"h":return a?"tunnin":"tunti";case"hh":i=a?"tunnin":"tuntia";break;case"d":return a?"päivän":"päivä";case"dd":i=a?"päivän":"päivää";break;case"M":return a?"kuukauden":"kuukausi";case"MM":i=a?"kuukauden":"kuukautta";break;case"y":return a?"vuoden":"vuosi";case"yy":i=a?"vuoden":"vuotta"}return i=n(e,a)+" "+i}function n(e,u){return e<10?u?a[e]:t[e]:e}var t="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),a=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",t[7],t[8],t[9]];return e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:u,m:u,mm:u,h:u,hh:u,d:u,dd:u,M:u,MM:u,y:u,yy:u},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
1
+ !function(e,u){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?u(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],u):u(e.moment)}(this,function(e){"use strict";var i="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),s=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",i[7],i[8],i[9]];function u(e,u,n,t){var a="";switch(n){case"s":return t?"muutaman sekunnin":"muutama sekunti";case"m":return t?"minuutin":"minuutti";case"mm":a=t?"minuutin":"minuuttia";break;case"h":return t?"tunnin":"tunti";case"hh":a=t?"tunnin":"tuntia";break;case"d":return t?"päivän":"päivä";case"dd":a=t?"päivän":"päivää";break;case"M":return t?"kuukauden":"kuukausi";case"MM":a=t?"kuukauden":"kuukautta";break;case"y":return t?"vuoden":"vuosi";case"yy":a=t?"vuoden":"vuotta"}return n=t,a=((e=e)<10?(n?s:i)[e]:e)+" "+a}return e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:u,m:u,mm:u,h:u,hh:u,d:u,dd:u,M:u,MM:u,y:u,yy:u},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/fy.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";var n="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),t="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");return e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,o){return/-MMM-/.test(o)?t[e.month()]:n[e.month()]},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})});
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),o="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");return e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,n){return(/-MMM-/.test(n)?o:t)[e.month()]},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||20<=e?"ste":"de")},week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/gd.min.js CHANGED
@@ -1 +1 @@
1
- !function(a,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(a.moment)}(this,function(a){"use strict";var n=["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],i=["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],e=["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],d=["Did","Dil","Dim","Dic","Dia","Dih","Dis"],t=["Dò","Lu","Mà","Ci","Ar","Ha","Sa"];return a.defineLocale("gd",{months:n,monthsShort:i,monthsParseExact:!0,weekdays:e,weekdaysShort:d,weekdaysMin:t,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},ordinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(a){return a+(1===a?"d":a%10==2?"na":"mh")},week:{dow:1,doy:4}})});
1
+ !function(a,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(a.moment)}(this,function(a){"use strict";return a.defineLocale("gd",{months:["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],monthsShort:["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],monthsParseExact:!0,weekdays:["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],weekdaysShort:["Did","Dil","Dim","Dic","Dia","Dih","Dis"],weekdaysMin:["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},ordinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(a){return a+(1===a?"d":a%10==2?"na":"mh")},week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/hi.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},_={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};return e.defineLocale("hi",{months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return _[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,t){return 12===e&&(e=0),"रात"===t?e<4?e:e+12:"सुबह"===t?e:"दोपहर"===t?e>=10?e:e+12:"शाम"===t?e+12:void 0},meridiem:function(e,t,_){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},_={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};return e.defineLocale("hi",{months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return _[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,t){return 12===e&&(e=0),"रात"===t?e<4?e:e+12:"सुबह"===t?e:"दोपहर"===t?10<=e?e:e+12:"शाम"===t?e+12:void 0},meridiem:function(e,t,_){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}})});
bp-core/js/vendor/moment-js/locale/hr.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";function a(e,a,s){var t=e+" ";switch(s){case"m":return a?"jedna minuta":"jedne minute";case"mm":return t+=1===e?"minuta":2===e||3===e||4===e?"minute":"minuta";case"h":return a?"jedan sat":"jednog sata";case"hh":return t+=1===e?"sat":2===e||3===e||4===e?"sata":"sati";case"dd":return t+=1===e?"dan":"dana";case"MM":return t+=1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci";case"yy":return t+=1===e?"godina":2===e||3===e||4===e?"godine":"godina"}}return e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:a,mm:a,h:a,hh:a,d:"dan",dd:a,M:"mjesec",MM:a,y:"godinu",yy:a},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})});
1
+ !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";function a(e,a,s){var t=e+" ";switch(s){case"m":return a?"jedna minuta":"jedne minute";case"mm":return t+=1!==e&&(2===e||3===e||4===e)?"minute":"minuta";case"h":return a?"jedan sat":"jednog sata";case"hh":return t+=1===e?"sat":2===e||3===e||4===e?"sata":"sati";case"dd":return t+=1===e?"dan":"dana";case"MM":return t+=1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci";case"yy":return t+=1!==e&&(2===e||3===e||4===e)?"godine":"godina"}}return e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:a,mm:a,h:a,hh:a,d:"dan",dd:a,M:"mjesec",MM:a,y:"godinu",yy:a},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})});
bp-core/js/vendor/moment-js/locale/hu.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,r){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?r(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],r):r(e.moment)}(this,function(e){"use strict";function r(e,r,n,t){var a=e;switch(n){case"s":return t||r?"néhány másodperc":"néhány másodperce";case"m":return"egy"+(t||r?" perc":" perce");case"mm":return a+(t||r?" perc":" perce");case"h":return"egy"+(t||r?" óra":" órája");case"hh":return a+(t||r?" óra":" órája");case"d":return"egy"+(t||r?" nap":" napja");case"dd":return a+(t||r?" nap":" napja");case"M":return"egy"+(t||r?" hónap":" hónapja");case"MM":return a+(t||r?" hónap":" hónapja");case"y":return"egy"+(t||r?" év":" éve");case"yy":return a+(t||r?" év":" éve")}return""}function n(e){return(e?"":"[múlt] ")+"["+t[this.day()]+"] LT[-kor]"}var t="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");return e.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,r,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return n.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return n.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})});
1
+ !function(e,r){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?r(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],r):r(e.moment)}(this,function(e){"use strict";var r="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function n(e,r,n,t){var a=e;switch(n){case"s":return t||r?"néhány másodperc":"néhány másodperce";case"m":return"egy"+(t||r?" perc":" perce");case"mm":return a+(t||r?" perc":" perce");case"h":return"egy"+(t||r?" óra":" órája");case"hh":return a+(t||r?" óra":" órája");case"d":return"egy"+(t||r?" nap":" napja");case"dd":return a+(t||r?" nap":" napja");case"M":return"egy"+(t||r?" hónap":" hónapja");case"MM":return a+(t||r?" hónap":" hónapja");case"y":return"egy"+(t||r?" év":" éve");case"yy":return a+(t||r?" év":" éve")}return""}function t(e){return(e?"":"[múlt] ")+"["+r[this.day()]+"] LT[-kor]"}return e.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,r,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return t.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return t.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})});
bp-core/js/vendor/moment-js/locale/id.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,a){return 12===e&&(e=0),"pagi"===a?e:"siang"===a?e>=11?e:e+12:"sore"===a||"malam"===a?e+12:void 0},meridiem:function(e,a,i){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})});
1
+ !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,a){return 12===e&&(e=0),"pagi"===a?e:"siang"===a?11<=e?e:e+12:"sore"===a||"malam"===a?e+12:void 0},meridiem:function(e,a,i){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})});
bp-core/js/vendor/moment-js/locale/is.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,r){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?r(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],r):r(e.moment)}(this,function(e){"use strict";function r(e){return e%100==11||e%10!=1}function u(e,u,n,a){var t=e+" ";switch(n){case"s":return u||a?"nokkrar sekúndur":"nokkrum sekúndum";case"m":return u?"mínúta":"mínútu";case"mm":return r(e)?t+(u||a?"mínútur":"mínútum"):u?t+"mínúta":t+"mínútu";case"hh":return r(e)?t+(u||a?"klukkustundir":"klukkustundum"):t+"klukkustund";case"d":return u?"dagur":a?"dag":"degi";case"dd":return r(e)?u?t+"dagar":t+(a?"daga":"dögum"):u?t+"dagur":t+(a?"dag":"degi");case"M":return u?"mánuður":a?"mánuð":"mánuði";case"MM":return r(e)?u?t+"mánuðir":t+(a?"mánuði":"mánuðum"):u?t+"mánuður":t+(a?"mánuð":"mánuði");case"y":return u||a?"ár":"ári";case"yy":return r(e)?t+(u||a?"ár":"árum"):t+(u||a?"ár":"ári")}}return e.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:u,m:u,mm:u,h:"klukkustund",hh:u,d:u,dd:u,M:u,MM:u,y:u,yy:u},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
1
+ !function(e,r){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?r(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],r):r(e.moment)}(this,function(e){"use strict";function t(e){return e%100==11||e%10!=1}function r(e,r,u,n){var a=e+" ";switch(u){case"s":return r||n?"nokkrar sekúndur":"nokkrum sekúndum";case"m":return r?"mínúta":"mínútu";case"mm":return t(e)?a+(r||n?"mínútur":"mínútum"):r?a+"mínúta":a+"mínútu";case"hh":return t(e)?a+(r||n?"klukkustundir":"klukkustundum"):a+"klukkustund";case"d":return r?"dagur":n?"dag":"degi";case"dd":return t(e)?r?a+"dagar":a+(n?"daga":"dögum"):r?a+"dagur":a+(n?"dag":"degi");case"M":return r?"mánuður":n?"mánuð":"mánuði";case"MM":return t(e)?r?a+"mánuðir":a+(n?"mánuði":"mánuðum"):r?a+"mánuður":a+(n?"mánuð":"mánuði");case"y":return r||n?"ár":"ári";case"yy":return t(e)?a+(r||n?"ár":"árum"):a+(r||n?"ár":"ári")}}return e.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:r,m:r,mm:r,h:"klukkustund",hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/it.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";return e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),weekdaysMin:"Do_Lu_Ma_Me_Gi_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})});
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";return e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),weekdaysMin:"Do_Lu_Ma_Me_Gi_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){return 0!==this.day()?"[lo scorso] dddd [alle] LT":"[la scorsa] dddd [alle] LT"},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/jv.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";return e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,n){return 12===e&&(e=0),"enjing"===n?e:"siyang"===n?e>=11?e:e+12:"sonten"===n||"ndalu"===n?e+12:void 0},meridiem:function(e,n,t){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})});
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";return e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,n){return 12===e&&(e=0),"enjing"===n?e:"siyang"===n?11<=e?e:e+12:"sonten"===n||"ndalu"===n?e+12:void 0},meridiem:function(e,n,t){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})});
bp-core/js/vendor/moment-js/locale/kk.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";var _={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};return e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},ordinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){var d=e%10,t=e>=100?100:null;return e+(_[e]||_[d]||_[t])},week:{dow:1,doy:7}})});
1
+ !function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";var _={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};return e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},ordinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){return e+(_[e]||_[e%10]||_[100<=e?100:null])},week:{dow:1,doy:7}})});
bp-core/js/vendor/moment-js/locale/ky.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";var _={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};return e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кече саат] LT",lastWeek:"[Өткен аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},ordinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){var d=e%10,t=e>=100?100:null;return e+(_[e]||_[d]||_[t])},week:{dow:1,doy:7}})});
1
+ !function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";var _={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};return e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кече саат] LT",lastWeek:"[Өткен аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},ordinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){return e+(_[e]||_[e%10]||_[100<=e?100:null])},week:{dow:1,doy:7}})});
bp-core/js/vendor/moment-js/locale/lb.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";function n(e,n,t,r){var u={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return n?u[t][0]:u[t][1]}function t(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var n=e%10,r=e/10;return t(0===n?r:n)}if(e<1e4){for(;e>=10;)e/=10;return t(e)}return e/=1e3,t(e)}return e.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(e){return t(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e},past:function(e){return t(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e},s:"e puer Sekonnen",m:n,mm:"%d Minutten",h:n,hh:"%d Stonnen",d:n,dd:"%d Deeg",M:n,MM:"%d Méint",y:n,yy:"%d Joer"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";function n(e,n,t,r){var u={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return n?u[t][0]:u[t][1]}function t(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var n=e%10;return 0==n?t(e/10):t(n)}if(e<1e4){for(;10<=e;)e/=10;return t(e)}return t(e/=1e3)}return e.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(e){return t(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e},past:function(e){return t(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e},s:"e puer Sekonnen",m:n,mm:"%d Minutten",h:n,hh:"%d Stonnen",d:n,dd:"%d Deeg",M:n,MM:"%d Méint",y:n,yy:"%d Joer"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/lt.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,i){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?i(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],i):i(e.moment)}(this,function(e){"use strict";function i(e,i,n,s){return i?a(n)[0]:s?a(n)[1]:a(n)[2]}function n(e){return e%10==0||e>10&&e<20}function a(e){return d[e].split("_")}function s(e,s,d,t){var _=e+" ";return 1===e?_+i(e,s,d[0],t):s?_+(n(e)?a(d)[1]:a(d)[0]):t?_+a(d)[1]:_+(n(e)?a(d)[1]:a(d)[2])}var d={m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};return e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?|MMMM?(\[[^\[\]]*\]|\s+)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:function(e,i,n,a){return i?"kelios sekundės":a?"kelių sekundžių":"kelias sekundes"},m:i,mm:s,h:i,hh:s,d:i,dd:s,M:i,MM:s,y:i,yy:s},ordinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})});
1
+ !function(e,i){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?i(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],i):i(e.moment)}(this,function(e){"use strict";var i={m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function d(e,i,n,a){return i?_(n)[0]:a?_(n)[1]:_(n)[2]}function t(e){return e%10==0||10<e&&e<20}function _(e){return i[e].split("_")}function n(e,i,n,a){var s=e+" ";return 1===e?s+d(0,i,n[0],a):i?s+(t(e)?_(n)[1]:_(n)[0]):a?s+_(n)[1]:s+(t(e)?_(n)[1]:_(n)[2])}return e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?|MMMM?(\[[^\[\]]*\]|\s+)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:function(e,i,n,a){return i?"kelios sekundės":a?"kelių sekundžių":"kelias sekundes"},m:d,mm:n,h:d,hh:n,d:d,dd:n,M:d,MM:n,y:d,yy:n},ordinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/lv.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";function n(e,n,s){return s?n%10==1&&n%100!=11?e[2]:e[3]:n%10==1&&n%100!=11?e[0]:e[1]}function s(e,s,t){return e+" "+n(i[t],e,s)}function t(e,s,t){return n(i[t],e,s)}var i={m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};return e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:function(e,n){return n?"dažas sekundes":"dažām sekundēm"},m:t,mm:s,h:t,hh:s,d:t,dd:s,M:t,MM:s,y:t,yy:s},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";var t={m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function i(e,n,s){return s?n%10==1&&n%100!=11?e[2]:e[3]:n%10==1&&n%100!=11?e[0]:e[1]}function n(e,n,s){return e+" "+i(t[s],e,n)}function s(e,n,s){return i(t[s],e,n)}return e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:function(e,n){return n?"dažas sekundes":"dažām sekundēm"},m:s,mm:n,h:s,hh:n,d:s,dd:n,M:s,MM:n,y:s,yy:n},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/me.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";var a={words:{m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,a){return 1===e?a[0]:e>=2&&e<=4?a[1]:a[2]},translate:function(e,t,n){var r=a.words[n];return 1===n.length?t?r[0]:r[1]:e+" "+a.correctGrammaticalCase(e,r)}};return e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",m:a.translate,mm:a.translate,h:a.translate,hh:a.translate,d:"dan",dd:a.translate,M:"mjesec",MM:a.translate,y:"godinu",yy:a.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})});
1
+ !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";var r={words:{m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,a){return 1===e?a[0]:2<=e&&e<=4?a[1]:a[2]},translate:function(e,a,t){var n=r.words[t];return 1===t.length?a?n[0]:n[1]:e+" "+r.correctGrammaticalCase(e,n)}};return e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",m:r.translate,mm:r.translate,h:r.translate,hh:r.translate,d:"dan",dd:r.translate,M:"mjesec",MM:r.translate,y:"godinu",yy:r.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})});
bp-core/js/vendor/moment-js/locale/mk.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";return e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var _=e%10,d=e%100;return 0===e?e+"-ев":0===d?e+"-ен":d>10&&d<20?e+"-ти":1===_?e+"-ви":2===_?e+"-ри":7===_||8===_?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})});
1
+ !function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";return e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var _=e%10,d=e%100;return 0===e?e+"-ев":0==d?e+"-ен":10<d&&d<20?e+"-ти":1==_?e+"-ви":2==_?e+"-ри":7==_||8==_?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})});
bp-core/js/vendor/moment-js/locale/ml.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";return e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,_){return 12===e&&(e=0),"രാത്രി"===_&&e>=4||"ഉച്ച കഴിഞ്ഞ്"===_||"വൈകുന്നേരം"===_?e+12:e},meridiem:function(e,_,t){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}})});
1
+ !function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";return e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,_){return 12===e&&(e=0),"രാത്രി"===_&&4<=e||"ഉച്ച കഴിഞ്ഞ്"===_||"വൈകുന്നേരം"===_?e+12:e},meridiem:function(e,_,t){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}})});
bp-core/js/vendor/moment-js/locale/mr.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";function a(e,a,r,s){var t="";if(a)switch(r){case"s":t="काही सेकंद";break;case"m":t="एक मिनिट";break;case"mm":t="%d मिनिटे";break;case"h":t="एक तास";break;case"hh":t="%d तास";break;case"d":t="एक दिवस";break;case"dd":t="%d दिवस";break;case"M":t="एक महिना";break;case"MM":t="%d महिने";break;case"y":t="एक वर्ष";break;case"yy":t="%d वर्षे"}else switch(r){case"s":t="काही सेकंदां";break;case"m":t="एका मिनिटा";break;case"mm":t="%d मिनिटां";break;case"h":t="एका तासा";break;case"hh":t="%d तासां";break;case"d":t="एका दिवसा";break;case"dd":t="%d दिवसां";break;case"M":t="एका महिन्या";break;case"MM":t="%d महिन्यां";break;case"y":t="एका वर्षा";break;case"yy":t="%d वर्षां"}return t.replace(/%d/i,e)}var r={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},s={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};return e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return s[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return r[e]})},meridiemParse:/रात्री|सकाळी|दुपारी|सायंकाळी/,meridiemHour:function(e,a){return 12===e&&(e=0),"रात्री"===a?e<4?e:e+12:"सकाळी"===a?e:"दुपारी"===a?e>=10?e:e+12:"सायंकाळी"===a?e+12:void 0},meridiem:function(e,a,r){return e<4?"रात्री":e<10?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})});
1
+ !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";var a={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},r={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};function s(e,a,r,s){var t="";if(a)switch(r){case"s":t="काही सेकंद";break;case"m":t="एक मिनिट";break;case"mm":t="%d मिनिटे";break;case"h":t="एक तास";break;case"hh":t="%d तास";break;case"d":t="एक दिवस";break;case"dd":t="%d दिवस";break;case"M":t="एक महिना";break;case"MM":t="%d महिने";break;case"y":t="एक वर्ष";break;case"yy":t="%d वर्षे"}else switch(r){case"s":t="काही सेकंदां";break;case"m":t="एका मिनिटा";break;case"mm":t="%d मिनिटां";break;case"h":t="एका तासा";break;case"hh":t="%d तासां";break;case"d":t="एका दिवसा";break;case"dd":t="%d दिवसां";break;case"M":t="एका महिन्या";break;case"MM":t="%d महिन्यां";break;case"y":t="एका वर्षा";break;case"yy":t="%d वर्षां"}return t.replace(/%d/i,e)}return e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return r[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return a[e]})},meridiemParse:/रात्री|सकाळी|दुपारी|सायंकाळी/,meridiemHour:function(e,a){return 12===e&&(e=0),"रात्री"===a?e<4?e:e+12:"सकाळी"===a?e:"दुपारी"===a?10<=e?e:e+12:"सायंकाळी"===a?e+12:void 0},meridiem:function(e,a,r){return e<4?"रात्री":e<10?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})});
bp-core/js/vendor/moment-js/locale/ms-my.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,a){return 12===e&&(e=0),"pagi"===a?e:"tengahari"===a?e>=11?e:e+12:"petang"===a||"malam"===a?e+12:void 0},meridiem:function(e,a,i){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})});
1
+ !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,a){return 12===e&&(e=0),"pagi"===a?e:"tengahari"===a?11<=e?e:e+12:"petang"===a||"malam"===a?e+12:void 0},meridiem:function(e,a,i){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})});
bp-core/js/vendor/moment-js/locale/ms.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,a){return 12===e&&(e=0),"pagi"===a?e:"tengahari"===a?e>=11?e:e+12:"petang"===a||"malam"===a?e+12:void 0},meridiem:function(e,a,i){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})});
1
+ !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,a){return 12===e&&(e=0),"pagi"===a?e:"tengahari"===a?11<=e?e:e+12:"petang"===a||"malam"===a?e+12:void 0},meridiem:function(e,a,i){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})});
bp-core/js/vendor/moment-js/locale/ne.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};return e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return 12===e&&(e=0),"राति"===t?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?e>=10?e:e+12:"साँझ"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};return e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return 12===e&&(e=0),"राति"===t?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?10<=e?e:e+12:"साँझ"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})});
bp-core/js/vendor/moment-js/locale/nl.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";var a="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),t=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|april|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;return e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,t){return/-MMM-/.test(t)?n[e.month()]:a[e.month()]},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:t,longMonthsParse:t,shortMonthsParse:t,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"Zo_Ma_Di_Wo_Do_Vr_Za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})});
1
+ !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";var n="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),t="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),a=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|april|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;return e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,a){return(/-MMM-/.test(a)?t:n)[e.month()]},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:a,longMonthsParse:a,shortMonthsParse:a,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"Zo_Ma_Di_Wo_Do_Vr_Za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||20<=e?"ste":"de")},week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/pa-in.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},_={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};return e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,function(e){return _[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ਰਾਤ"===t?e<4?e:e+12:"ਸਵੇਰ"===t?e:"ਦੁਪਹਿਰ"===t?e>=10?e:e+12:"ਸ਼ਾਮ"===t?e+12:void 0},meridiem:function(e,t,_){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},_={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};return e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,function(e){return _[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ਰਾਤ"===t?e<4?e:e+12:"ਸਵੇਰ"===t?e:"ਦੁਪਹਿਰ"===t?10<=e?e:e+12:"ਸ਼ਾਮ"===t?e+12:void 0},meridiem:function(e,t,_){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})});
bp-core/js/vendor/moment-js/locale/pl.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";function t(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function i(e,i,n){var a=e+" ";switch(n){case"m":return i?"minuta":"minutę";case"mm":return a+(t(e)?"minuty":"minut");case"h":return i?"godzina":"godzinę";case"hh":return a+(t(e)?"godziny":"godzin");case"MM":return a+(t(e)?"miesiące":"miesięcy");case"yy":return a+(t(e)?"lata":"lat")}}var n="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),a="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_");return e.defineLocale("pl",{months:function(e,t){return""===t?"("+a[e.month()]+"|"+n[e.month()]+")":/D MMMM/.test(t)?a[e.month()]:n[e.month()]},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:i,mm:i,h:i,hh:i,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:i,y:"rok",yy:i},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var i="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_");function a(e){return e%10<5&&1<e%10&&~~(e/10)%10!=1}function t(e,t,i){var n=e+" ";switch(i){case"m":return t?"minuta":"minutę";case"mm":return n+(a(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return n+(a(e)?"godziny":"godzin");case"MM":return n+(a(e)?"miesiące":"miesięcy");case"yy":return n+(a(e)?"lata":"lat")}}return e.defineLocale("pl",{months:function(e,t){return""===t?"("+n[e.month()]+"|"+i[e.month()]+")":(/D MMMM/.test(t)?n:i)[e.month()]},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:t,mm:t,h:t,hh:t,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:t,y:"rok",yy:t},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/ro.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,i){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?i(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],i):i(e.moment)}(this,function(e){"use strict";function i(e,i,t){var n={mm:"minute",hh:"ore",dd:"zile",MM:"luni",yy:"ani"},a=" ";return(e%100>=20||e>=100&&e%100==0)&&(a=" de "),e+a+n[t]}return e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",m:"un minut",mm:i,h:"o oră",hh:i,d:"o zi",dd:i,M:"o lună",MM:i,y:"un an",yy:i},week:{dow:1,doy:7}})});
1
+ !function(e,i){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?i(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],i):i(e.moment)}(this,function(e){"use strict";function i(e,i,t){return e+(20<=e%100||100<=e&&e%100==0?" de ":" ")+{mm:"minute",hh:"ore",dd:"zile",MM:"luni",yy:"ani"}[t]}return e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",m:"un minut",mm:i,h:"o oră",hh:i,d:"o zi",dd:i,M:"o lună",MM:i,y:"un an",yy:i},week:{dow:1,doy:7}})});
bp-core/js/vendor/moment-js/locale/ru.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";function t(e,t){var _=e.split("_");return t%10==1&&t%100!=11?_[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?_[1]:_[2]}function _(e,_,d){var s={mm:_?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"};return"m"===d?_?"минута":"минуту":e+" "+t(s[d],+e)}var d=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];return e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:d,longMonthsParse:d,shortMonthsParse:d,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В следующее] dddd [в] LT";case 1:case 2:case 4:return"[В следующий] dddd [в] LT";case 3:case 5:case 6:return"[В следующую] dddd [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:_,mm:_,h:"час",hh:_,d:"день",dd:_,M:"месяц",MM:_,y:"год",yy:_},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,_){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},ordinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:7}})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";function t(e,t,_){return"m"===_?t?"минута":"минуту":e+" "+(e=+e,_=(_={mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[_]).split("_"),e%10==1&&e%100!=11?_[0]:2<=e%10&&e%10<=4&&(e%100<10||20<=e%100)?_[1]:_[2])}var _=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];return e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:_,longMonthsParse:_,shortMonthsParse:_,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В следующее] dddd [в] LT";case 1:case 2:case 4:return"[В следующий] dddd [в] LT";case 3:case 5:case 6:return"[В следующую] dddd [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:t,mm:t,h:"час",hh:t,d:"день",dd:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,_){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},ordinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:7}})});
bp-core/js/vendor/moment-js/locale/si.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";return e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},ordinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,_,t){return e>11?t?"ප.ව.":"පස් වරු":t?"පෙ.ව.":"පෙර වරු"}})});
1
+ !function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";return e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},ordinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,_,t){return 11<e?t?"ප.ව.":"පස් වරු":t?"පෙ.ව.":"පෙර වරු"}})});
bp-core/js/vendor/moment-js/locale/sk.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";function t(e){return e>1&&e<5}function n(e,n,r,o){var s=e+" ";switch(r){case"s":return n||o?"pár sekúnd":"pár sekundami";case"m":return n?"minúta":o?"minútu":"minútou";case"mm":return n||o?s+(t(e)?"minúty":"minút"):s+"minútami";case"h":return n?"hodina":o?"hodinu":"hodinou";case"hh":return n||o?s+(t(e)?"hodiny":"hodín"):s+"hodinami";case"d":return n||o?"deň":"dňom";case"dd":return n||o?s+(t(e)?"dni":"dní"):s+"dňami";case"M":return n||o?"mesiac":"mesiacom";case"MM":return n||o?s+(t(e)?"mesiace":"mesiacov"):s+"mesiacmi";case"y":return n||o?"rok":"rokom";case"yy":return n||o?s+(t(e)?"roky":"rokov"):s+"rokmi"}}var r="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),o="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");return e.defineLocale("sk",{months:r,monthsShort:o,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),n="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");function s(e){return 1<e&&e<5}function r(e,t,n,r){var o=e+" ";switch(n){case"s":return t||r?"pár sekúnd":"pár sekundami";case"m":return t?"minúta":r?"minútu":"minútou";case"mm":return t||r?o+(s(e)?"minúty":"minút"):o+"minútami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":return t||r?o+(s(e)?"hodiny":"hodín"):o+"hodinami";case"d":return t||r?"deň":"dňom";case"dd":return t||r?o+(s(e)?"dni":"dní"):o+"dňami";case"M":return t||r?"mesiac":"mesiacom";case"MM":return t||r?o+(s(e)?"mesiace":"mesiacov"):o+"mesiacmi";case"y":return t||r?"rok":"rokom";case"yy":return t||r?o+(s(e)?"roky":"rokov"):o+"rokmi"}}return e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/sr-cyrl.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={words:{m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,a,r){var s=t.words[r];return 1===r.length?a?s[0]:s[1]:e+" "+t.correctGrammaticalCase(e,s)}};return e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"дан",dd:t.translate,M:"месец",MM:t.translate,y:"годину",yy:t.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var s={words:{m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:2<=e&&e<=4?t[1]:t[2]},translate:function(e,t,a){var r=s.words[a];return 1===a.length?t?r[0]:r[1]:e+" "+s.correctGrammaticalCase(e,r)}};return e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",m:s.translate,mm:s.translate,h:s.translate,hh:s.translate,d:"дан",dd:s.translate,M:"месец",MM:s.translate,y:"годину",yy:s.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})});
bp-core/js/vendor/moment-js/locale/sr.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";var a={words:{m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,a){return 1===e?a[0]:e>=2&&e<=4?a[1]:a[2]},translate:function(e,t,n){var r=a.words[n];return 1===n.length?t?r[0]:r[1]:e+" "+a.correctGrammaticalCase(e,r)}};return e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",m:a.translate,mm:a.translate,h:a.translate,hh:a.translate,d:"dan",dd:a.translate,M:"mesec",MM:a.translate,y:"godinu",yy:a.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})});
1
+ !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";var r={words:{m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,a){return 1===e?a[0]:2<=e&&e<=4?a[1]:a[2]},translate:function(e,a,t){var n=r.words[t];return 1===t.length?a?n[0]:n[1]:e+" "+r.correctGrammaticalCase(e,n)}};return e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",m:r.translate,mm:r.translate,h:r.translate,hh:r.translate,d:"dan",dd:r.translate,M:"mesec",MM:r.translate,y:"godinu",yy:r.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})});
bp-core/js/vendor/moment-js/locale/ss.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";return e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,n,a){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,n){return 12===e&&(e=0),"ekuseni"===n?e:"emini"===n?e>=11?e:e+12:"entsambama"===n||"ebusuku"===n?0===e?0:e+12:void 0},ordinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})});
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";return e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,n,a){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,n){return 12===e&&(e=0),"ekuseni"===n?e:"emini"===n?11<=e?e:e+12:"entsambama"===n||"ebusuku"===n?0===e?0:e+12:void 0},ordinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/sv.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,d){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?d(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],d):d(e.moment)}(this,function(e){"use strict";return e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}(e|a)/,ordinal:function(e){var d=e%10;return e+(1==~~(e%100/10)?"e":1===d?"a":2===d?"a":"e")},week:{dow:1,doy:4}})});
1
+ !function(e,d){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?d(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],d):d(e.moment)}(this,function(e){"use strict";return e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}(e|a)/,ordinal:function(e){var d=e%10;return e+(1!=~~(e%100/10)&&(1==d||2==d)?"a":"e")},week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/ta.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};return e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},ordinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,t,n){return e<2?" யாமம்":e<6?" வைகறை":e<10?" காலை":e<14?" நண்பகல்":e<18?" எற்பாடு":e<22?" மாலை":" யாமம்"},meridiemHour:function(e,t){return 12===e&&(e=0),"யாமம்"===t?e<2?e:e+12:"வைகறை"===t||"காலை"===t?e:"நண்பகல்"===t&&e>=10?e:e+12},week:{dow:0,doy:6}})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};return e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},ordinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,t,n){return e<2?" யாமம்":e<6?" வைகறை":e<10?" காலை":e<14?" நண்பகல்":e<18?" எற்பாடு":e<22?" மாலை":" யாமம்"},meridiemHour:function(e,t){return 12===e&&(e=0),"யாமம்"===t?e<2?e:e+12:"வைகறை"===t||"காலை"===t||"நண்பகல்"===t&&10<=e?e:e+12},week:{dow:0,doy:6}})});
bp-core/js/vendor/moment-js/locale/te.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";return e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జూలై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జూలై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},ordinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,_){return 12===e&&(e=0),"రాత్రి"===_?e<4?e:e+12:"ఉదయం"===_?e:"మధ్యాహ్నం"===_?e>=10?e:e+12:"సాయంత్రం"===_?e+12:void 0},meridiem:function(e,_,d){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})});
1
+ !function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";return e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జూలై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జూలై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},ordinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,_){return 12===e&&(e=0),"రాత్రి"===_?e<4?e:e+12:"ఉదయం"===_?e:"మధ్యాహ్నం"===_?10<=e?e:e+12:"సాయంత్రం"===_?e+12:void 0},meridiem:function(e,_,d){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})});
bp-core/js/vendor/moment-js/locale/tlh.min.js CHANGED
@@ -1 +1 @@
1
- !function(a,e){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?e(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],e):e(a.moment)}(this,function(a){"use strict";function e(a,e,r,t){var n=j(a);switch(r){case"mm":return n+" tup";case"hh":return n+" rep";case"dd":return n+" jaj";case"MM":return n+" jar";case"yy":return n+" DIS"}}function j(a){var e=Math.floor(a%1e3/100),j=Math.floor(a%100/10),t=a%10,n="";return e>0&&(n+=r[e]+"vatlh"),j>0&&(n+=(""!==n?" ":"")+r[j]+"maH"),t>0&&(n+=(""!==n?" ":"")+r[t]),""===n?"pagh":n}var r="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");return a.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(a){var e=a;return e=-1!==a.indexOf("jaj")?e.slice(0,-3)+"leS":-1!==a.indexOf("jar")?e.slice(0,-3)+"waQ":-1!==a.indexOf("DIS")?e.slice(0,-3)+"nem":e+" pIq"},past:function(a){var e=a;return e=-1!==a.indexOf("jaj")?e.slice(0,-3)+"Hu’":-1!==a.indexOf("jar")?e.slice(0,-3)+"wen":-1!==a.indexOf("DIS")?e.slice(0,-3)+"ben":e+" ret"},s:"puS lup",m:"wa’ tup",mm:e,h:"wa’ rep",hh:e,d:"wa’ jaj",dd:e,M:"wa’ jar",MM:e,y:"wa’ DIS",yy:e},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
1
+ !function(a,e){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?e(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],e):e(a.moment)}(this,function(a){"use strict";var n="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function e(a,e,j,r){var t=function(a){var e=Math.floor(a%1e3/100),j=Math.floor(a%100/10),r=a%10,a="";0<e&&(a+=n[e]+"vatlh");0<j&&(a+=(""!==a?" ":"")+n[j]+"maH");0<r&&(a+=(""!==a?" ":"")+n[r]);return""===a?"pagh":a}(a);switch(j){case"mm":return t+" tup";case"hh":return t+" rep";case"dd":return t+" jaj";case"MM":return t+" jar";case"yy":return t+" DIS"}}return a.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(a){var e=a;return e=-1!==a.indexOf("jaj")?e.slice(0,-3)+"leS":-1!==a.indexOf("jar")?e.slice(0,-3)+"waQ":-1!==a.indexOf("DIS")?e.slice(0,-3)+"nem":e+" pIq"},past:function(a){var e=a;return e=-1!==a.indexOf("jaj")?e.slice(0,-3)+"Hu’":-1!==a.indexOf("jar")?e.slice(0,-3)+"wen":-1!==a.indexOf("DIS")?e.slice(0,-3)+"ben":e+" ret"},s:"puS lup",m:"wa’ tup",mm:e,h:"wa’ rep",hh:e,d:"wa’ jaj",dd:e,M:"wa’ jar",MM:e,y:"wa’ DIS",yy:e},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/tr.min.js CHANGED
@@ -1 +1 @@
1
- !function(a,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(a.moment)}(this,function(a){"use strict";var n={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};return a.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinalParse:/\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,ordinal:function(a){if(0===a)return a+"'ıncı";var e=a%10,i=a%100-e,t=a>=100?100:null;return a+(n[e]||n[i]||n[t])},week:{dow:1,doy:7}})});
1
+ !function(a,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(a.moment)}(this,function(a){"use strict";var e={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};return a.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinalParse:/\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,ordinal:function(a){if(0===a)return a+"'ıncı";var n=a%10;return a+(e[n]||e[a%100-n]||e[100<=a?100:null])},week:{dow:1,doy:7}})});
bp-core/js/vendor/moment-js/locale/tzl.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";function a(e,a,i,s){var n={s:["viensas secunds","'iensas secunds"],m:["'n míut","'iens míut"],mm:[e+" míuts",e+" míuts"],h:["'n þora","'iensa þora"],hh:[e+" þoras",e+" þoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return s?n[i][0]:a?n[i][0]:n[i][1]}return e.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,a,i){return e>11?i?"d'o":"D'O":i?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
1
+ !function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";function a(e,a,i,s){e={s:["viensas secunds","'iensas secunds"],m:["'n míut","'iens míut"],mm:[e+" míuts",e+" míuts"],h:["'n þora","'iensa þora"],hh:[e+" þoras",e+" þoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return s||a?e[i][0]:e[i][1]}return e.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,a,i){return 11<e?i?"d'o":"D'O":i?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/uk.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";function _(e,_){var t=e.split("_");return _%10==1&&_%100!=11?t[0]:_%10>=2&&_%10<=4&&(_%100<10||_%100>=20)?t[1]:t[2]}function t(e,t,n){var s={mm:t?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:t?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"};return"m"===n?t?"хвилина":"хвилину":"h"===n?t?"година":"годину":e+" "+_(s[n],+e)}function n(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}return e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:function(e,_){return{nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")}[/(\[[ВвУу]\]) ?dddd/.test(_)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(_)?"genitive":"nominative"][e.day()]},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:n("[Сьогодні "),nextDay:n("[Завтра "),lastDay:n("[Вчора "),nextWeek:n("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return n("[Минулої] dddd [").call(this);case 1:case 2:case 4:return n("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:t,mm:t,h:"годину",hh:t,d:"день",dd:t,M:"місяць",MM:t,y:"рік",yy:t},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,_,t){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},ordinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,_){switch(_){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})});
1
+ !function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";function _(e,_,t){return"m"===t?_?"хвилина":"хвилину":"h"===t?_?"година":"годину":e+" "+(e=+e,t=(t={mm:_?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:_?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[t]).split("_"),e%10==1&&e%100!=11?t[0]:2<=e%10&&e%10<=4&&(e%100<10||20<=e%100)?t[1]:t[2])}function t(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}return e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:function(e,_){return{nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")}[/(\[[ВвУу]\]) ?dddd/.test(_)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(_)?"genitive":"nominative"][e.day()]},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:t("[Сьогодні "),nextDay:t("[Завтра "),lastDay:t("[Вчора "),nextWeek:t("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return t("[Минулої] dddd [").call(this);case 1:case 2:case 4:return t("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:_,mm:_,h:"годину",hh:_,d:"день",dd:_,M:"місяць",MM:_,y:"рік",yy:_},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,_,t){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},ordinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,_){switch(_){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})});
bp-core/js/vendor/moment-js/locale/x-pseudo.min.js CHANGED
@@ -1 +1 @@
1
- !function(t,d){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?d(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],d):d(t.moment)}(this,function(t){"use strict";return t.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var d=t%10;return t+(1==~~(t%100/10)?"th":1===d?"st":2===d?"nd":3===d?"rd":"th")},week:{dow:1,doy:4}})});
1
+ !function(t,d){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?d(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],d):d(t.moment)}(this,function(t){"use strict";return t.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var d=t%10;return t+(1==~~(t%100/10)?"th":1==d?"st":2==d?"nd":3==d?"rd":"th")},week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/zh-cn.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";return e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah点mm分",LTS:"Ah点m分s秒",L:"YYYY-MM-DD",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah点mm分",LLLL:"YYYY年MMMD日ddddAh点mm分",l:"YYYY-MM-DD",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah点mm分",llll:"YYYY年MMMD日ddddAh点mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var i=100*e+t;return i<600?"凌晨":i<900?"早上":i<1130?"上午":i<1230?"中午":i<1800?"下午":"晚上"},calendar:{sameDay:function(){return 0===this.minutes()?"[今天]Ah[点整]":"[今天]LT"},nextDay:function(){return 0===this.minutes()?"[明天]Ah[点整]":"[明天]LT"},lastDay:function(){return 0===this.minutes()?"[昨天]Ah[点整]":"[昨天]LT"},nextWeek:function(){var t,n;return t=e().startOf("week"),n=this.diff(t,"days")>=7?"[下]":"[本]",0===this.minutes()?n+"dddAh点整":n+"dddAh点mm"},lastWeek:function(){var t,n;return t=e().startOf("week"),n=this.unix()<t.unix()?"[上]":"[本]",0===this.minutes()?n+"dddAh点整":n+"dddAh点mm"},sameElse:"LL"},ordinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(t){"use strict";return t.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah点mm分",LTS:"Ah点m分s秒",L:"YYYY-MM-DD",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah点mm分",LLLL:"YYYY年MMMD日ddddAh点mm分",l:"YYYY-MM-DD",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah点mm分",llll:"YYYY年MMMD日ddddAh点mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t||"下午"!==t&&"晚上"!==t&&11<=e?e:e+12},meridiem:function(e,t,n){t=100*e+t;return t<600?"凌晨":t<900?"早上":t<1130?"上午":t<1230?"中午":t<1800?"下午":"晚上"},calendar:{sameDay:function(){return 0===this.minutes()?"[今天]Ah[点整]":"[今天]LT"},nextDay:function(){return 0===this.minutes()?"[明天]Ah[点整]":"[明天]LT"},lastDay:function(){return 0===this.minutes()?"[昨天]Ah[点整]":"[昨天]LT"},nextWeek:function(){var e=t().startOf("week"),e=7<=this.diff(e,"days")?"[下]":"[本]";return 0===this.minutes()?e+"dddAh点整":e+"dddAh点mm"},lastWeek:function(){var e=t().startOf("week"),e=this.unix()<e.unix()?"[上]":"[本]";return 0===this.minutes()?e+"dddAh点整":e+"dddAh点mm"},sameElse:"LL"},ordinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})});
bp-core/js/vendor/moment-js/locale/zh-hk.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";return e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah點mm分",LTS:"Ah點m分s秒",L:"YYYY年MMMD日",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah點mm分",LLLL:"YYYY年MMMD日ddddAh點mm分",l:"YYYY年MMMD日",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah點mm分",llll:"YYYY年MMMD日ddddAh點mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,d){var _=100*e+t;return _<600?"凌晨":_<900?"早上":_<1130?"上午":_<1230?"中午":_<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},ordinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";return e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah點mm分",LTS:"Ah點m分s秒",L:"YYYY年MMMD日",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah點mm分",LLLL:"YYYY年MMMD日ddddAh點mm分",l:"YYYY年MMMD日",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah點mm分",llll:"YYYY年MMMD日ddddAh點mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?11<=e?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,d){t=100*e+t;return t<600?"凌晨":t<900?"早上":t<1130?"上午":t<1230?"中午":t<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},ordinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})});
bp-core/js/vendor/moment-js/locale/zh-tw.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";return e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah點mm分",LTS:"Ah點m分s秒",L:"YYYY年MMMD日",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah點mm分",LLLL:"YYYY年MMMD日ddddAh點mm分",l:"YYYY年MMMD日",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah點mm分",llll:"YYYY年MMMD日ddddAh點mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,d){var _=100*e+t;return _<600?"凌晨":_<900?"早上":_<1130?"上午":_<1230?"中午":_<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},ordinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";return e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah點mm分",LTS:"Ah點m分s秒",L:"YYYY年MMMD日",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah點mm分",LLLL:"YYYY年MMMD日ddddAh點mm分",l:"YYYY年MMMD日",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah點mm分",llll:"YYYY年MMMD日ddddAh點mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?11<=e?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,d){t=100*e+t;return t<600?"凌晨":t<900?"早上":t<1130?"上午":t<1230?"中午":t<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},ordinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})});
bp-core/js/vendor/moment-js/moment.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";function e(){return _t.apply(null,arguments)}function t(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function n(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e){var t;for(t in e)return!1;return!0}function i(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function r(e,t){var n,s=[];for(n=0;n<e.length;++n)s.push(t(e[n],n));return s}function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function o(e,t){for(var n in t)a(t,n)&&(e[n]=t[n]);return a(t,"toString")&&(e.toString=t.toString),a(t,"valueOf")&&(e.valueOf=t.valueOf),e}function u(e,t,n,s){return Ue(e,t,n,s,!0).utc()}function d(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null}}function l(e){return null==e._pf&&(e._pf=d()),e._pf}function h(e){if(null==e._isValid){var t=l(e),n=yt.call(t.parsedDateParts,function(e){return null!=e}),s=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return s;e._isValid=s}return e._isValid}function c(e){var t=u(NaN);return null!=e?o(l(t),e):l(t).userInvalidated=!0,t}function f(e){return void 0===e}function m(e,t){var n,s,i;if(f(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),f(t._i)||(e._i=t._i),f(t._f)||(e._f=t._f),f(t._l)||(e._l=t._l),f(t._strict)||(e._strict=t._strict),f(t._tzm)||(e._tzm=t._tzm),f(t._isUTC)||(e._isUTC=t._isUTC),f(t._offset)||(e._offset=t._offset),f(t._pf)||(e._pf=l(t)),f(t._locale)||(e._locale=t._locale),gt.length>0)for(n in gt)f(i=t[s=gt[n]])||(e[s]=i);return e}function _(t){m(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),!1===pt&&(pt=!0,e.updateOffset(this),pt=!1)}function y(e){return e instanceof _||null!=e&&null!=e._isAMomentObject}function g(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function p(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=g(t)),n}function w(e,t,n){var s,i=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),a=0;for(s=0;s<i;s++)(n&&e[s]!==t[s]||!n&&p(e[s])!==p(t[s]))&&a++;return a+r}function v(t){!1===e.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function S(t,n){var s=!0;return o(function(){if(null!=e.deprecationHandler&&e.deprecationHandler(null,t),s){for(var i,r=[],a=0;a<arguments.length;a++){if(i="","object"==typeof arguments[a]){i+="\n["+a+"] ";for(var o in arguments[0])i+=o+": "+arguments[0][o]+", ";i=i.slice(0,-2)}else i=arguments[a];r.push(i)}v(t+"\nArguments: "+Array.prototype.slice.call(r).join("")+"\n"+(new Error).stack),s=!1}return n.apply(this,arguments)},n)}function M(t,n){null!=e.deprecationHandler&&e.deprecationHandler(t,n),wt[t]||(v(n),wt[t]=!0)}function k(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function D(e,t){var s,i=o({},e);for(s in t)a(t,s)&&(n(e[s])&&n(t[s])?(i[s]={},o(i[s],e[s]),o(i[s],t[s])):null!=t[s]?i[s]=t[s]:delete i[s]);for(s in e)a(e,s)&&!a(t,s)&&n(e[s])&&(i[s]=o({},i[s]));return i}function Y(e){null!=e&&this.set(e)}function x(e,t){var n=e.toLowerCase();xt[n]=xt[n+"s"]=xt[t]=e}function O(e){return"string"==typeof e?xt[e]||xt[e.toLowerCase()]:void 0}function b(e){var t,n,s={};for(n in e)a(e,n)&&(t=O(n))&&(s[t]=e[n]);return s}function T(e,t){Ot[e]=t}function P(e){var t=[];for(var n in e)t.push({unit:n,priority:Ot[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}function W(t,n){return function(s){return null!=s?(U(this,t,s),e.updateOffset(this,n),this):R(this,t)}}function R(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function U(e,t,n){e.isValid()&&e._d["set"+(e._isUTC?"UTC":"")+t](n)}function C(e,t,n){var s=""+Math.abs(e),i=t-s.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}function F(e,t,n,s){var i=s;"string"==typeof s&&(i=function(){return this[s]()}),e&&(Wt[e]=i),t&&(Wt[t[0]]=function(){return C(i.apply(this,arguments),t[1],t[2])}),n&&(Wt[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function H(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function L(e){var t,n,s=e.match(bt);for(t=0,n=s.length;t<n;t++)Wt[s[t]]?s[t]=Wt[s[t]]:s[t]=H(s[t]);return function(t){var i,r="";for(i=0;i<n;i++)r+=s[i]instanceof Function?s[i].call(t,e):s[i];return r}}function G(e,t){return e.isValid()?(t=V(t,e.localeData()),Pt[t]=Pt[t]||L(t),Pt[t](e)):e.localeData().invalidDate()}function V(e,t){var n=5;for(Tt.lastIndex=0;n>=0&&Tt.test(e);)e=e.replace(Tt,function(e){return t.longDateFormat(e)||e}),Tt.lastIndex=0,n-=1;return e}function j(e,t,n){Bt[e]=k(t)?t:function(e,s){return e&&n?n:t}}function A(e,t){return a(Bt,e)?Bt[e](t._strict,t._locale):new RegExp(E(e))}function E(e){return I(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i}))}function I(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function N(e,t){var n,s=t;for("string"==typeof e&&(e=[e]),"number"==typeof t&&(s=function(e,n){n[t]=p(e)}),n=0;n<e.length;n++)Jt[e[n]]=s}function z(e,t){N(e,function(e,n,s,i){s._w=s._w||{},t(e,s._w,s,i)})}function Z(e,t,n){null!=t&&a(Jt,e)&&Jt[e](t,n._a,n,e)}function q(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}function $(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=u([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=St.call(this._shortMonthsParse,a))?i:null:-1!==(i=St.call(this._longMonthsParse,a))?i:null:"MMM"===t?-1!==(i=St.call(this._shortMonthsParse,a))?i:-1!==(i=St.call(this._longMonthsParse,a))?i:null:-1!==(i=St.call(this._longMonthsParse,a))?i:-1!==(i=St.call(this._shortMonthsParse,a))?i:null}function B(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=p(t);else if("number"!=typeof(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),q(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function J(t){return null!=t?(B(this,t),e.updateOffset(this,!0),this):R(this,"Month")}function Q(){function e(e,t){return t.length-e.length}var t,n,s=[],i=[],r=[];for(t=0;t<12;t++)n=u([2e3,t]),s.push(this.monthsShort(n,"")),i.push(this.months(n,"")),r.push(this.months(n,"")),r.push(this.monthsShort(n,""));for(s.sort(e),i.sort(e),r.sort(e),t=0;t<12;t++)s[t]=I(s[t]),i[t]=I(i[t]);for(t=0;t<24;t++)r[t]=I(r[t]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function X(e){return K(e)?366:365}function K(e){return e%4==0&&e%100!=0||e%400==0}function ee(e,t,n,s,i,r,a){var o=new Date(e,t,n,s,i,r,a);return e<100&&e>=0&&isFinite(o.getFullYear())&&o.setFullYear(e),o}function te(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function ne(e,t,n){var s=7+t-n;return-((7+te(e,0,s).getUTCDay()-t)%7)+s-1}function se(e,t,n,s,i){var r,a,o=1+7*(t-1)+(7+n-s)%7+ne(e,s,i);return o<=0?a=X(r=e-1)+o:o>X(e)?(r=e+1,a=o-X(e)):(r=e,a=o),{year:r,dayOfYear:a}}function ie(e,t,n){var s,i,r=ne(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+re(i=e.year()-1,t,n):a>re(e.year(),t,n)?(s=a-re(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function re(e,t,n){var s=ne(e,t,n),i=ne(e+1,t,n);return(X(e)-s+i)/7}function ae(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function oe(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function ue(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=u([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=St.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=St.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=St.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=St.call(this._weekdaysParse,a))?i:-1!==(i=St.call(this._shortWeekdaysParse,a))?i:-1!==(i=St.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=St.call(this._shortWeekdaysParse,a))?i:-1!==(i=St.call(this._weekdaysParse,a))?i:-1!==(i=St.call(this._minWeekdaysParse,a))?i:null:-1!==(i=St.call(this._minWeekdaysParse,a))?i:-1!==(i=St.call(this._weekdaysParse,a))?i:-1!==(i=St.call(this._shortWeekdaysParse,a))?i:null}function de(){function e(e,t){return t.length-e.length}var t,n,s,i,r,a=[],o=[],d=[],l=[];for(t=0;t<7;t++)n=u([2e3,1]).day(t),s=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),r=this.weekdays(n,""),a.push(s),o.push(i),d.push(r),l.push(s),l.push(i),l.push(r);for(a.sort(e),o.sort(e),d.sort(e),l.sort(e),t=0;t<7;t++)o[t]=I(o[t]),d[t]=I(d[t]),l[t]=I(l[t]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function le(){return this.hours()%12||12}function he(e,t){F(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function ce(e,t){return t._meridiemParse}function fe(e){return e?e.toLowerCase().replace("_","-"):e}function me(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=fe(e[r]).split("-")).length,n=(n=fe(e[r+1]))?n.split("-"):null;t>0;){if(s=_e(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&w(i,n,!0)>=t-1)break;t--}r++}return null}function _e(e){var t=null;if(!Dn[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=vn._abbr,require("./locale/"+e),ye(t)}catch(e){}return Dn[e]}function ye(e,t){var n;return e&&(n=f(t)?pe(e):ge(e,t))&&(vn=n),vn._abbr}function ge(e,t){if(null!==t){var n=kn;return t.abbr=e,null!=Dn[e]?(M("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=Dn[e]._config):null!=t.parentLocale&&(null!=Dn[t.parentLocale]?n=Dn[t.parentLocale]._config:M("parentLocaleUndefined","specified parentLocale is not defined yet. See http://momentjs.com/guides/#/warnings/parent-locale/")),Dn[e]=new Y(D(n,t)),ye(e),Dn[e]}return delete Dn[e],null}function pe(e){var n;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return vn;if(!t(e)){if(n=_e(e))return n;e=[e]}return me(e)}function we(e){var t,n=e._a;return n&&-2===l(e).overflow&&(t=n[Xt]<0||n[Xt]>11?Xt:n[Kt]<1||n[Kt]>q(n[Qt],n[Xt])?Kt:n[en]<0||n[en]>24||24===n[en]&&(0!==n[tn]||0!==n[nn]||0!==n[sn])?en:n[tn]<0||n[tn]>59?tn:n[nn]<0||n[nn]>59?nn:n[sn]<0||n[sn]>999?sn:-1,l(e)._overflowDayOfYear&&(t<Qt||t>Kt)&&(t=Kt),l(e)._overflowWeeks&&-1===t&&(t=rn),l(e)._overflowWeekday&&-1===t&&(t=an),l(e).overflow=t),e}function ve(e){var t,n,s,i,r,a,o=e._i,u=Yn.exec(o)||xn.exec(o);if(u){for(l(e).iso=!0,t=0,n=bn.length;t<n;t++)if(bn[t][1].exec(u[1])){i=bn[t][0],s=!1!==bn[t][2];break}if(null==i)return void(e._isValid=!1);if(u[3]){for(t=0,n=Tn.length;t<n;t++)if(Tn[t][1].exec(u[3])){r=(u[2]||" ")+Tn[t][0];break}if(null==r)return void(e._isValid=!1)}if(!s&&null!=r)return void(e._isValid=!1);if(u[4]){if(!On.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),xe(e)}else e._isValid=!1}function Se(t){var n=Pn.exec(t._i);null===n?(ve(t),!1===t._isValid&&(delete t._isValid,e.createFromInputFallback(t))):t._d=new Date(+n[1])}function Me(e,t,n){return null!=e?e:null!=t?t:n}function ke(t){var n=new Date(e.now());return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function De(e){var t,n,s,i,r=[];if(!e._d){for(s=ke(e),e._w&&null==e._a[Kt]&&null==e._a[Xt]&&Ye(e),e._dayOfYear&&(i=Me(e._a[Qt],s[Qt]),e._dayOfYear>X(i)&&(l(e)._overflowDayOfYear=!0),n=te(i,0,e._dayOfYear),e._a[Xt]=n.getUTCMonth(),e._a[Kt]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=r[t]=s[t];for(;t<7;t++)e._a[t]=r[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[en]&&0===e._a[tn]&&0===e._a[nn]&&0===e._a[sn]&&(e._nextDay=!0,e._a[en]=0),e._d=(e._useUTC?te:ee).apply(null,r),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[en]=24)}}function Ye(e){var t,n,s,i,r,a,o,u;null!=(t=e._w).GG||null!=t.W||null!=t.E?(r=1,a=4,n=Me(t.GG,e._a[Qt],ie(Ce(),1,4).year),s=Me(t.W,1),((i=Me(t.E,1))<1||i>7)&&(u=!0)):(r=e._locale._week.dow,a=e._locale._week.doy,n=Me(t.gg,e._a[Qt],ie(Ce(),r,a).year),s=Me(t.w,1),null!=t.d?((i=t.d)<0||i>6)&&(u=!0):null!=t.e?(i=t.e+r,(t.e<0||t.e>6)&&(u=!0)):i=r),s<1||s>re(n,r,a)?l(e)._overflowWeeks=!0:null!=u?l(e)._overflowWeekday=!0:(o=se(n,s,i,r,a),e._a[Qt]=o.year,e._dayOfYear=o.dayOfYear)}function xe(t){if(t._f!==e.ISO_8601){t._a=[],l(t).empty=!0;var n,s,i,r,a,o=""+t._i,u=o.length,d=0;for(i=V(t._f,t._locale).match(bt)||[],n=0;n<i.length;n++)r=i[n],(s=(o.match(A(r,t))||[])[0])&&((a=o.substr(0,o.indexOf(s))).length>0&&l(t).unusedInput.push(a),o=o.slice(o.indexOf(s)+s.length),d+=s.length),Wt[r]?(s?l(t).empty=!1:l(t).unusedTokens.push(r),Z(r,s,t)):t._strict&&!s&&l(t).unusedTokens.push(r);l(t).charsLeftOver=u-d,o.length>0&&l(t).unusedInput.push(o),t._a[en]<=12&&!0===l(t).bigHour&&t._a[en]>0&&(l(t).bigHour=void 0),l(t).parsedDateParts=t._a.slice(0),l(t).meridiem=t._meridiem,t._a[en]=Oe(t._locale,t._a[en],t._meridiem),De(t),we(t)}else ve(t)}function Oe(e,t,n){var s;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((s=e.isPM(n))&&t<12&&(t+=12),s||12!==t||(t=0),t):t}function be(e){var t,n,s,i,r;if(0===e._f.length)return l(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;i<e._f.length;i++)r=0,t=m({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],xe(t),h(t)&&(r+=l(t).charsLeftOver,r+=10*l(t).unusedTokens.length,l(t).score=r,(null==s||r<s)&&(s=r,n=t));o(e,n||t)}function Te(e){if(!e._d){var t=b(e._i);e._a=r([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),De(e)}}function Pe(e){var t=new _(we(We(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function We(e){var n=e._i,s=e._f;return e._locale=e._locale||pe(e._l),null===n||void 0===s&&""===n?c({nullInput:!0}):("string"==typeof n&&(e._i=n=e._locale.preparse(n)),y(n)?new _(we(n)):(t(s)?be(e):i(n)?e._d=n:s?xe(e):Re(e),h(e)||(e._d=null),e))}function Re(n){var s=n._i;void 0===s?n._d=new Date(e.now()):i(s)?n._d=new Date(s.valueOf()):"string"==typeof s?Se(n):t(s)?(n._a=r(s.slice(0),function(e){return parseInt(e,10)}),De(n)):"object"==typeof s?Te(n):"number"==typeof s?n._d=new Date(s):e.createFromInputFallback(n)}function Ue(e,i,r,a,o){var u={};return"boolean"==typeof r&&(a=r,r=void 0),(n(e)&&s(e)||t(e)&&0===e.length)&&(e=void 0),u._isAMomentObject=!0,u._useUTC=u._isUTC=o,u._l=r,u._i=e,u._f=i,u._strict=a,Pe(u)}function Ce(e,t,n,s){return Ue(e,t,n,s,!1)}function Fe(e,n){var s,i;if(1===n.length&&t(n[0])&&(n=n[0]),!n.length)return Ce();for(s=n[0],i=1;i<n.length;++i)n[i].isValid()&&!n[i][e](s)||(s=n[i]);return s}function He(e){var t=b(e),n=t.year||0,s=t.quarter||0,i=t.month||0,r=t.week||0,a=t.day||0,o=t.hour||0,u=t.minute||0,d=t.second||0,l=t.millisecond||0;this._milliseconds=+l+1e3*d+6e4*u+1e3*o*60*60,this._days=+a+7*r,this._months=+i+3*s+12*n,this._data={},this._locale=pe(),this._bubble()}function Le(e){return e instanceof He}function Ge(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ve(e,t){F(e,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+C(~~(e/60),2)+t+C(~~e%60,2)})}function je(e,t){var n=(t||"").match(e)||[],s=((n[n.length-1]||[])+"").match(Un)||["-",0,0],i=60*s[1]+p(s[2]);return"+"===s[0]?i:-i}function Ae(t,n){var s,r;return n._isUTC?(s=n.clone(),r=(y(t)||i(t)?t.valueOf():Ce(t).valueOf())-s.valueOf(),s._d.setTime(s._d.valueOf()+r),e.updateOffset(s,!1),s):Ce(t).local()}function Ee(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Ie(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Ne(e,t){var n,s,i,r=e,o=null;return Le(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(r={},t?r[t]=e:r.milliseconds=e):(o=Cn.exec(e))?(n="-"===o[1]?-1:1,r={y:0,d:p(o[Kt])*n,h:p(o[en])*n,m:p(o[tn])*n,s:p(o[nn])*n,ms:p(Ge(1e3*o[sn]))*n}):(o=Fn.exec(e))?(n="-"===o[1]?-1:1,r={y:ze(o[2],n),M:ze(o[3],n),w:ze(o[4],n),d:ze(o[5],n),h:ze(o[6],n),m:ze(o[7],n),s:ze(o[8],n)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(i=qe(Ce(r.from),Ce(r.to)),(r={}).ms=i.milliseconds,r.M=i.months),s=new He(r),Le(e)&&a(e,"_locale")&&(s._locale=e._locale),s}function ze(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Ze(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function qe(e,t){var n;return e.isValid()&&t.isValid()?(t=Ae(t,e),e.isBefore(t)?n=Ze(e,t):((n=Ze(t,e)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function $e(e,t){return function(n,s){var i,r;return null===s||isNaN(+s)||(M(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=n,n=s,s=r),n="string"==typeof n?+n:n,i=Ne(n,s),Be(this,i,e),this}}function Be(t,n,s,i){var r=n._milliseconds,a=Ge(n._days),o=Ge(n._months);t.isValid()&&(i=null==i||i,r&&t._d.setTime(t._d.valueOf()+r*s),a&&U(t,"Date",R(t,"Date")+a*s),o&&B(t,R(t,"Month")+o*s),i&&e.updateOffset(t,a||o))}function Je(e,t){var n,s=12*(t.year()-e.year())+(t.month()-e.month()),i=e.clone().add(s,"months");return n=t-i<0?(t-i)/(i-e.clone().add(s-1,"months")):(t-i)/(e.clone().add(s+1,"months")-i),-(s+n)||0}function Qe(e){var t;return void 0===e?this._locale._abbr:(null!=(t=pe(e))&&(this._locale=t),this)}function Xe(){return this._locale}function Ke(e,t){F(0,[e,e.length],0,t)}function et(e,t,n,s,i){var r;return null==e?ie(this,s,i).year:(r=re(e,s,i),t>r&&(t=r),tt.call(this,e,t,n,s,i))}function tt(e,t,n,s,i){var r=se(e,t,n,s,i),a=te(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function nt(e){return e}function st(e,t,n,s){var i=pe(),r=u().set(s,t);return i[n](r,e)}function it(e,t,n){if("number"==typeof e&&(t=e,e=void 0),e=e||"",null!=t)return st(e,t,n,"month");var s,i=[];for(s=0;s<12;s++)i[s]=st(e,s,n,"month");return i}function rt(e,t,n,s){"boolean"==typeof e?("number"==typeof t&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,"number"==typeof t&&(n=t,t=void 0),t=t||"");var i=pe(),r=e?i._week.dow:0;if(null!=n)return st(t,(n+r)%7,s,"day");var a,o=[];for(a=0;a<7;a++)o[a]=st(t,(a+r)%7,s,"day");return o}function at(e,t,n,s){var i=Ne(t,n);return e._milliseconds+=s*i._milliseconds,e._days+=s*i._days,e._months+=s*i._months,e._bubble()}function ot(e){return e<0?Math.floor(e):Math.ceil(e)}function ut(e){return 4800*e/146097}function dt(e){return 146097*e/4800}function lt(e){return function(){return this.as(e)}}function ht(e){return function(){return this._data[e]}}function ct(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}function ft(e,t,n){var s=Ne(e).abs(),i=ds(s.as("s")),r=ds(s.as("m")),a=ds(s.as("h")),o=ds(s.as("d")),u=ds(s.as("M")),d=ds(s.as("y")),l=i<ls.s&&["s",i]||r<=1&&["m"]||r<ls.m&&["mm",r]||a<=1&&["h"]||a<ls.h&&["hh",a]||o<=1&&["d"]||o<ls.d&&["dd",o]||u<=1&&["M"]||u<ls.M&&["MM",u]||d<=1&&["y"]||["yy",d];return l[2]=t,l[3]=+e>0,l[4]=n,ct.apply(null,l)}function mt(){var e,t,n,s=hs(this._milliseconds)/1e3,i=hs(this._days),r=hs(this._months);t=g((e=g(s/60))/60),s%=60,e%=60;var a=n=g(r/12),o=r%=12,u=i,d=t,l=e,h=s,c=this.asSeconds();return c?(c<0?"-":"")+"P"+(a?a+"Y":"")+(o?o+"M":"")+(u?u+"D":"")+(d||l||h?"T":"")+(d?d+"H":"")+(l?l+"M":"")+(h?h+"S":""):"P0D"}var _t,yt;yt=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1};var gt=e.momentProperties=[],pt=!1,wt={};e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;var vt;vt=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)a(e,t)&&n.push(t);return n};var St,Mt={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},kt={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Dt=/\d{1,2}/,Yt={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},xt={},Ot={},bt=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Tt=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Pt={},Wt={},Rt=/\d/,Ut=/\d\d/,Ct=/\d{3}/,Ft=/\d{4}/,Ht=/[+-]?\d{6}/,Lt=/\d\d?/,Gt=/\d\d\d\d?/,Vt=/\d\d\d\d\d\d?/,jt=/\d{1,3}/,At=/\d{1,4}/,Et=/[+-]?\d{1,6}/,It=/\d+/,Nt=/[+-]?\d+/,zt=/Z|[+-]\d\d:?\d\d/gi,Zt=/Z|[+-]\d\d(?::?\d\d)?/gi,qt=/[+-]?\d+(\.\d{1,3})?/,$t=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Bt={},Jt={},Qt=0,Xt=1,Kt=2,en=3,tn=4,nn=5,sn=6,rn=7,an=8;St=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},F("M",["MM",2],"Mo",function(){return this.month()+1}),F("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),F("MMMM",0,0,function(e){return this.localeData().months(this,e)}),x("month","M"),T("month",8),j("M",Lt),j("MM",Lt,Ut),j("MMM",function(e,t){return t.monthsShortRegex(e)}),j("MMMM",function(e,t){return t.monthsRegex(e)}),N(["M","MM"],function(e,t){t[Xt]=p(e)-1}),N(["MMM","MMMM"],function(e,t,n,s){var i=n._locale.monthsParse(e,s,n._strict);null!=i?t[Xt]=i:l(n).invalidMonth=e});var on=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,un="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),dn="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),ln=$t,hn=$t;F("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),F(0,["YY",2],0,function(){return this.year()%100}),F(0,["YYYY",4],0,"year"),F(0,["YYYYY",5],0,"year"),F(0,["YYYYYY",6,!0],0,"year"),x("year","y"),T("year",1),j("Y",Nt),j("YY",Lt,Ut),j("YYYY",At,Ft),j("YYYYY",Et,Ht),j("YYYYYY",Et,Ht),N(["YYYYY","YYYYYY"],Qt),N("YYYY",function(t,n){n[Qt]=2===t.length?e.parseTwoDigitYear(t):p(t)}),N("YY",function(t,n){n[Qt]=e.parseTwoDigitYear(t)}),N("Y",function(e,t){t[Qt]=parseInt(e,10)}),e.parseTwoDigitYear=function(e){return p(e)+(p(e)>68?1900:2e3)};var cn=W("FullYear",!0);F("w",["ww",2],"wo","week"),F("W",["WW",2],"Wo","isoWeek"),x("week","w"),x("isoWeek","W"),T("week",5),T("isoWeek",5),j("w",Lt),j("ww",Lt,Ut),j("W",Lt),j("WW",Lt,Ut),z(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=p(e)});var fn={dow:0,doy:6};F("d",0,"do","day"),F("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),F("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),F("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),F("e",0,0,"weekday"),F("E",0,0,"isoWeekday"),x("day","d"),x("weekday","e"),x("isoWeekday","E"),T("day",11),T("weekday",11),T("isoWeekday",11),j("d",Lt),j("e",Lt),j("E",Lt),j("dd",function(e,t){return t.weekdaysMinRegex(e)}),j("ddd",function(e,t){return t.weekdaysShortRegex(e)}),j("dddd",function(e,t){return t.weekdaysRegex(e)}),z(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:l(n).invalidWeekday=e}),z(["d","e","E"],function(e,t,n,s){t[s]=p(e)});var mn="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),_n="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),yn="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),gn=$t,pn=$t,wn=$t;F("H",["HH",2],0,"hour"),F("h",["hh",2],0,le),F("k",["kk",2],0,function(){return this.hours()||24}),F("hmm",0,0,function(){return""+le.apply(this)+C(this.minutes(),2)}),F("hmmss",0,0,function(){return""+le.apply(this)+C(this.minutes(),2)+C(this.seconds(),2)}),F("Hmm",0,0,function(){return""+this.hours()+C(this.minutes(),2)}),F("Hmmss",0,0,function(){return""+this.hours()+C(this.minutes(),2)+C(this.seconds(),2)}),he("a",!0),he("A",!1),x("hour","h"),T("hour",13),j("a",ce),j("A",ce),j("H",Lt),j("h",Lt),j("HH",Lt,Ut),j("hh",Lt,Ut),j("hmm",Gt),j("hmmss",Vt),j("Hmm",Gt),j("Hmmss",Vt),N(["H","HH"],en),N(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),N(["h","hh"],function(e,t,n){t[en]=p(e),l(n).bigHour=!0}),N("hmm",function(e,t,n){var s=e.length-2;t[en]=p(e.substr(0,s)),t[tn]=p(e.substr(s)),l(n).bigHour=!0}),N("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[en]=p(e.substr(0,s)),t[tn]=p(e.substr(s,2)),t[nn]=p(e.substr(i)),l(n).bigHour=!0}),N("Hmm",function(e,t,n){var s=e.length-2;t[en]=p(e.substr(0,s)),t[tn]=p(e.substr(s))}),N("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[en]=p(e.substr(0,s)),t[tn]=p(e.substr(s,2)),t[nn]=p(e.substr(i))});var vn,Sn=/[ap]\.?m?\.?/i,Mn=W("Hours",!0),kn={calendar:Mt,longDateFormat:kt,invalidDate:"Invalid date",ordinal:"%d",ordinalParse:Dt,relativeTime:Yt,months:un,monthsShort:dn,week:fn,weekdays:mn,weekdaysMin:yn,weekdaysShort:_n,meridiemParse:Sn},Dn={},Yn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,xn=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,On=/Z|[+-]\d\d(?::?\d\d)?/,bn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Tn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Pn=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=S("value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),e.ISO_8601=function(){};var Wn=S("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ce.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:c()}),Rn=S("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ce.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:c()});Ve("Z",":"),Ve("ZZ",""),j("Z",Zt),j("ZZ",Zt),N(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=je(Zt,e)});var Un=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var Cn=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Fn=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;Ne.fn=He.prototype;var Hn=$e(1,"add"),Ln=$e(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Gn=S("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});F(0,["gg",2],0,function(){return this.weekYear()%100}),F(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ke("gggg","weekYear"),Ke("ggggg","weekYear"),Ke("GGGG","isoWeekYear"),Ke("GGGGG","isoWeekYear"),x("weekYear","gg"),x("isoWeekYear","GG"),T("weekYear",1),T("isoWeekYear",1),j("G",Nt),j("g",Nt),j("GG",Lt,Ut),j("gg",Lt,Ut),j("GGGG",At,Ft),j("gggg",At,Ft),j("GGGGG",Et,Ht),j("ggggg",Et,Ht),z(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=p(e)}),z(["gg","GG"],function(t,n,s,i){n[i]=e.parseTwoDigitYear(t)}),F("Q",0,"Qo","quarter"),x("quarter","Q"),T("quarter",7),j("Q",Rt),N("Q",function(e,t){t[Xt]=3*(p(e)-1)}),F("D",["DD",2],"Do","date"),x("date","D"),T("date",9),j("D",Lt),j("DD",Lt,Ut),j("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),N(["D","DD"],Kt),N("Do",function(e,t){t[Kt]=p(e.match(Lt)[0],10)});var Vn=W("Date",!0);F("DDD",["DDDD",3],"DDDo","dayOfYear"),x("dayOfYear","DDD"),T("dayOfYear",4),j("DDD",jt),j("DDDD",Ct),N(["DDD","DDDD"],function(e,t,n){n._dayOfYear=p(e)}),F("m",["mm",2],0,"minute"),x("minute","m"),T("minute",14),j("m",Lt),j("mm",Lt,Ut),N(["m","mm"],tn);var jn=W("Minutes",!1);F("s",["ss",2],0,"second"),x("second","s"),T("second",15),j("s",Lt),j("ss",Lt,Ut),N(["s","ss"],nn);var An=W("Seconds",!1);F("S",0,0,function(){return~~(this.millisecond()/100)}),F(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),F(0,["SSS",3],0,"millisecond"),F(0,["SSSS",4],0,function(){return 10*this.millisecond()}),F(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),F(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),F(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),F(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),F(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),x("millisecond","ms"),T("millisecond",16),j("S",jt,Rt),j("SS",jt,Ut),j("SSS",jt,Ct);var En;for(En="SSSS";En.length<=9;En+="S")j(En,It);for(En="S";En.length<=9;En+="S")N(En,function(e,t){t[sn]=p(1e3*("0."+e))});var In=W("Milliseconds",!1);F("z",0,0,"zoneAbbr"),F("zz",0,0,"zoneName");var Nn=_.prototype;Nn.add=Hn,Nn.calendar=function(t,n){var s=t||Ce(),i=Ae(s,this).startOf("day"),r=e.calendarFormat(this,i)||"sameElse",a=n&&(k(n[r])?n[r].call(this,s):n[r]);return this.format(a||this.localeData().calendar(r,this,Ce(s)))},Nn.clone=function(){return new _(this)},Nn.diff=function(e,t,n){var s,i,r,a;return this.isValid()&&(s=Ae(e,this)).isValid()?(i=6e4*(s.utcOffset()-this.utcOffset()),"year"===(t=O(t))||"month"===t||"quarter"===t?(a=Je(this,s),"quarter"===t?a/=3:"year"===t&&(a/=12)):(r=this-s,a="second"===t?r/1e3:"minute"===t?r/6e4:"hour"===t?r/36e5:"day"===t?(r-i)/864e5:"week"===t?(r-i)/6048e5:r),n?a:g(a)):NaN},Nn.endOf=function(e){return void 0===(e=O(e))||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))},Nn.format=function(t){t||(t=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var n=G(this,t);return this.localeData().postformat(n)},Nn.from=function(e,t){return this.isValid()&&(y(e)&&e.isValid()||Ce(e).isValid())?Ne({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Nn.fromNow=function(e){return this.from(Ce(),e)},Nn.to=function(e,t){return this.isValid()&&(y(e)&&e.isValid()||Ce(e).isValid())?Ne({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Nn.toNow=function(e){return this.to(Ce(),e)},Nn.get=function(e){return e=O(e),k(this[e])?this[e]():this},Nn.invalidAt=function(){return l(this).overflow},Nn.isAfter=function(e,t){var n=y(e)?e:Ce(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=O(f(t)?"millisecond":t))?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},Nn.isBefore=function(e,t){var n=y(e)?e:Ce(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=O(f(t)?"millisecond":t))?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},Nn.isBetween=function(e,t,n,s){return("("===(s=s||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===s[1]?this.isBefore(t,n):!this.isAfter(t,n))},Nn.isSame=function(e,t){var n,s=y(e)?e:Ce(e);return!(!this.isValid()||!s.isValid())&&("millisecond"===(t=O(t||"millisecond"))?this.valueOf()===s.valueOf():(n=s.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},Nn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},Nn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},Nn.isValid=function(){return h(this)},Nn.lang=Gn,Nn.locale=Qe,Nn.localeData=Xe,Nn.max=Rn,Nn.min=Wn,Nn.parsingFlags=function(){return o({},l(this))},Nn.set=function(e,t){if("object"==typeof e)for(var n=P(e=b(e)),s=0;s<n.length;s++)this[n[s].unit](e[n[s].unit]);else if(e=O(e),k(this[e]))return this[e](t);return this},Nn.startOf=function(e){switch(e=O(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this},Nn.subtract=Ln,Nn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},Nn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},Nn.toDate=function(){return new Date(this.valueOf())},Nn.toISOString=function(){var e=this.clone().utc();return 0<e.year()&&e.year()<=9999?k(Date.prototype.toISOString)?this.toDate().toISOString():G(e,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):G(e,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},Nn.toJSON=function(){return this.isValid()?this.toISOString():null},Nn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Nn.unix=function(){return Math.floor(this.valueOf()/1e3)},Nn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},Nn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Nn.year=cn,Nn.isLeapYear=function(){return K(this.year())},Nn.weekYear=function(e){return et.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},Nn.isoWeekYear=function(e){return et.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},Nn.quarter=Nn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},Nn.month=J,Nn.daysInMonth=function(){return q(this.year(),this.month())},Nn.week=Nn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},Nn.isoWeek=Nn.isoWeeks=function(e){var t=ie(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},Nn.weeksInYear=function(){var e=this.localeData()._week;return re(this.year(),e.dow,e.doy)},Nn.isoWeeksInYear=function(){return re(this.year(),1,4)},Nn.date=Vn,Nn.day=Nn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=ae(e,this.localeData()),this.add(e-t,"d")):t},Nn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},Nn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=oe(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},Nn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},Nn.hour=Nn.hours=Mn,Nn.minute=Nn.minutes=jn,Nn.second=Nn.seconds=An,Nn.millisecond=Nn.milliseconds=In,Nn.utcOffset=function(t,n){var s,i=this._offset||0;return this.isValid()?null!=t?("string"==typeof t?t=je(Zt,t):Math.abs(t)<16&&(t*=60),!this._isUTC&&n&&(s=Ee(this)),this._offset=t,this._isUTC=!0,null!=s&&this.add(s,"m"),i!==t&&(!n||this._changeInProgress?Be(this,Ne(t-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?i:Ee(this):null!=t?this:NaN},Nn.utc=function(e){return this.utcOffset(0,e)},Nn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Ee(this),"m")),this},Nn.parseZone=function(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&(0===je(zt,this._i)?this.utcOffset(0,!0):this.utcOffset(je(zt,this._i))),this},Nn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Ce(e).utcOffset():0,(this.utcOffset()-e)%60==0)},Nn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Nn.isLocal=function(){return!!this.isValid()&&!this._isUTC},Nn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},Nn.isUtc=Ie,Nn.isUTC=Ie,Nn.zoneAbbr=function(){return this._isUTC?"UTC":""},Nn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Nn.dates=S("dates accessor is deprecated. Use date instead.",Vn),Nn.months=S("months accessor is deprecated. Use month instead",J),Nn.years=S("years accessor is deprecated. Use year instead",cn),Nn.zone=S("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),Nn.isDSTShifted=S("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!f(this._isDSTShifted))return this._isDSTShifted;var e={};if(m(e,this),(e=We(e))._a){var t=e._isUTC?u(e._a):Ce(e._a);this._isDSTShifted=this.isValid()&&w(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted});var zn=Nn,Zn=Y.prototype;Zn.calendar=function(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return k(s)?s.call(t,n):s},Zn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])},Zn.invalidDate=function(){return this._invalidDate},Zn.ordinal=function(e){return this._ordinal.replace("%d",e)},Zn.preparse=nt,Zn.postformat=nt,Zn.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return k(i)?i(e,t,n,s):i.replace(/%d/i,e)},Zn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return k(n)?n(t):n.replace(/%s/i,t)},Zn.set=function(e){var t,n;for(n in e)k(t=e[n])?this[n]=t:this["_"+n]=t;this._config=e,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)},Zn.months=function(e,n){return e?t(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||on).test(n)?"format":"standalone"][e.month()]:this._months},Zn.monthsShort=function(e,n){return e?t(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[on.test(n)?"format":"standalone"][e.month()]:this._monthsShort},Zn.monthsParse=function(e,t,n){var s,i,r;if(this._monthsParseExact)return $.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=u([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},Zn.monthsRegex=function(e){return this._monthsParseExact?(a(this,"_monthsRegex")||Q.call(this),e?this._monthsStrictRegex:this._monthsRegex):(a(this,"_monthsRegex")||(this._monthsRegex=hn),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},Zn.monthsShortRegex=function(e){return this._monthsParseExact?(a(this,"_monthsRegex")||Q.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(a(this,"_monthsShortRegex")||(this._monthsShortRegex=ln),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},Zn.week=function(e){return ie(e,this._week.dow,this._week.doy).week},Zn.firstDayOfYear=function(){return this._week.doy},Zn.firstDayOfWeek=function(){return this._week.dow},Zn.weekdays=function(e,n){return e?t(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(n)?"format":"standalone"][e.day()]:this._weekdays},Zn.weekdaysMin=function(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin},Zn.weekdaysShort=function(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort},Zn.weekdaysParse=function(e,t,n){var s,i,r;if(this._weekdaysParseExact)return ue.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=u([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".",".?")+"$","i")),this._weekdaysParse[s]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},Zn.weekdaysRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||de.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=gn),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},Zn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||de.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=pn),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Zn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||de.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=wn),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Zn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},Zn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},ye("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===p(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),e.lang=S("moment.lang is deprecated. Use moment.locale instead.",ye),e.langData=S("moment.langData is deprecated. Use moment.localeData instead.",pe);var qn=Math.abs,$n=lt("ms"),Bn=lt("s"),Jn=lt("m"),Qn=lt("h"),Xn=lt("d"),Kn=lt("w"),es=lt("M"),ts=lt("y"),ns=ht("milliseconds"),ss=ht("seconds"),is=ht("minutes"),rs=ht("hours"),as=ht("days"),os=ht("months"),us=ht("years"),ds=Math.round,ls={s:45,m:45,h:22,d:26,M:11},hs=Math.abs,cs=He.prototype;return cs.abs=function(){var e=this._data;return this._milliseconds=qn(this._milliseconds),this._days=qn(this._days),this._months=qn(this._months),e.milliseconds=qn(e.milliseconds),e.seconds=qn(e.seconds),e.minutes=qn(e.minutes),e.hours=qn(e.hours),e.months=qn(e.months),e.years=qn(e.years),this},cs.add=function(e,t){return at(this,e,t,1)},cs.subtract=function(e,t){return at(this,e,t,-1)},cs.as=function(e){var t,n,s=this._milliseconds;if("month"===(e=O(e))||"year"===e)return t=this._days+s/864e5,n=this._months+ut(t),"month"===e?n:n/12;switch(t=this._days+Math.round(dt(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},cs.asMilliseconds=$n,cs.asSeconds=Bn,cs.asMinutes=Jn,cs.asHours=Qn,cs.asDays=Xn,cs.asWeeks=Kn,cs.asMonths=es,cs.asYears=ts,cs.valueOf=function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*p(this._months/12)},cs._bubble=function(){var e,t,n,s,i,r=this._milliseconds,a=this._days,o=this._months,u=this._data;return r>=0&&a>=0&&o>=0||r<=0&&a<=0&&o<=0||(r+=864e5*ot(dt(o)+a),a=0,o=0),u.milliseconds=r%1e3,e=g(r/1e3),u.seconds=e%60,t=g(e/60),u.minutes=t%60,n=g(t/60),u.hours=n%24,a+=g(n/24),i=g(ut(a)),o+=i,a-=ot(dt(i)),s=g(o/12),o%=12,u.days=a,u.months=o,u.years=s,this},cs.get=function(e){return e=O(e),this[e+"s"]()},cs.milliseconds=ns,cs.seconds=ss,cs.minutes=is,cs.hours=rs,cs.days=as,cs.weeks=function(){return g(this.days()/7)},cs.months=os,cs.years=us,cs.humanize=function(e){var t=this.localeData(),n=ft(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)},cs.toISOString=mt,cs.toString=mt,cs.toJSON=mt,cs.locale=Qe,cs.localeData=Xe,cs.toIsoString=S("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",mt),cs.lang=Gn,F("X",0,0,"unix"),F("x",0,0,"valueOf"),j("x",Nt),j("X",qt),N("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),N("x",function(e,t,n){n._d=new Date(p(e))}),e.version="2.15.1",function(e){_t=e}(Ce),e.fn=zn,e.min=function(){return Fe("isBefore",[].slice.call(arguments,0))},e.max=function(){return Fe("isAfter",[].slice.call(arguments,0))},e.now=function(){return Date.now?Date.now():+new Date},e.utc=u,e.unix=function(e){return Ce(1e3*e)},e.months=function(e,t){return it(e,t,"months")},e.isDate=i,e.locale=ye,e.invalid=c,e.duration=Ne,e.isMoment=y,e.weekdays=function(e,t,n){return rt(e,t,n,"weekdays")},e.parseZone=function(){return Ce.apply(null,arguments).parseZone()},e.localeData=pe,e.isDuration=Le,e.monthsShort=function(e,t){return it(e,t,"monthsShort")},e.weekdaysMin=function(e,t,n){return rt(e,t,n,"weekdaysMin")},e.defineLocale=ge,e.updateLocale=function(e,t){if(null!=t){var n,s=kn;null!=Dn[e]&&(s=Dn[e]._config),(n=new Y(t=D(s,t))).parentLocale=Dn[e],Dn[e]=n,ye(e)}else null!=Dn[e]&&(null!=Dn[e].parentLocale?Dn[e]=Dn[e].parentLocale:null!=Dn[e]&&delete Dn[e]);return Dn[e]},e.locales=function(){return vt(Dn)},e.weekdaysShort=function(e,t,n){return rt(e,t,n,"weekdaysShort")},e.normalizeUnits=O,e.relativeTimeRounding=function(e){return void 0===e?ds:"function"==typeof e&&(ds=e,!0)},e.relativeTimeThreshold=function(e,t){return void 0!==ls[e]&&(void 0===t?ls[e]:(ls[e]=t,!0))},e.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},e.prototype=zn,e});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var e;function h(){return e.apply(null,arguments)}function a(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function o(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function i(e,t){for(var n=[],s=0;s<e.length;++s)n.push(t(e[s],s));return n}function c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function u(e,t){for(var n in t)c(t,n)&&(e[n]=t[n]);return c(t,"toString")&&(e.toString=t.toString),c(t,"valueOf")&&(e.valueOf=t.valueOf),e}function l(e,t,n,s){return St(e,t,n,s,!0).utc()}function f(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null}),e._pf}function d(e){if(null==e._isValid){var t=f(e),n=_.call(t.parsedDateParts,function(e){return null!=e}),n=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(n=n&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return n;e._isValid=n}return e._isValid}function r(e){var t=l(NaN);return null!=e?u(f(t),e):f(t).userInvalidated=!0,t}function m(e){return void 0===e}var _=Array.prototype.some||function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1},y=h.momentProperties=[];function g(e,t){var n,s,i;if(m(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),m(t._i)||(e._i=t._i),m(t._f)||(e._f=t._f),m(t._l)||(e._l=t._l),m(t._strict)||(e._strict=t._strict),m(t._tzm)||(e._tzm=t._tzm),m(t._isUTC)||(e._isUTC=t._isUTC),m(t._offset)||(e._offset=t._offset),m(t._pf)||(e._pf=f(t)),m(t._locale)||(e._locale=t._locale),0<y.length)for(n in y)m(i=t[s=y[n]])||(e[s]=i);return e}var t=!1;function p(e){g(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),!1===t&&(t=!0,h.updateOffset(this),t=!1)}function w(e){return e instanceof p||null!=e&&null!=e._isAMomentObject}function v(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function S(e){var t=+e,e=0;return e=0!=t&&isFinite(t)?v(t):e}function M(e,t,n){for(var s=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),r=0,a=0;a<s;a++)(n&&e[a]!==t[a]||!n&&S(e[a])!==S(t[a]))&&r++;return r+i}function k(e){!1===h.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function n(i,r){var a=!0;return u(function(){if(null!=h.deprecationHandler&&h.deprecationHandler(null,i),a){for(var e,t=[],n=0;n<arguments.length;n++){if(e="","object"==typeof arguments[n]){for(var s in e+="\n["+n+"] ",arguments[0])e+=s+": "+arguments[0][s]+", ";e=e.slice(0,-2)}else e=arguments[n];t.push(e)}k(i+"\nArguments: "+Array.prototype.slice.call(t).join("")+"\n"+(new Error).stack),a=!1}return r.apply(this,arguments)},r)}var D={};function Y(e,t){null!=h.deprecationHandler&&h.deprecationHandler(e,t),D[e]||(k(t),D[e]=!0)}function x(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function O(e,t){var n,s=u({},e);for(n in t)c(t,n)&&(o(e[n])&&o(t[n])?(s[n]={},u(s[n],e[n]),u(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)c(e,n)&&!c(t,n)&&o(e[n])&&(s[n]=u({},s[n]));return s}function b(e){null!=e&&this.set(e)}h.suppressDeprecationWarnings=!1,h.deprecationHandler=null;var T=Object.keys||function(e){var t,n=[];for(t in e)c(e,t)&&n.push(t);return n};var P={};function W(e,t){var n=e.toLowerCase();P[n]=P[n+"s"]=P[t]=e}function R(e){return"string"==typeof e?P[e]||P[e.toLowerCase()]:void 0}function U(e){var t,n,s={};for(n in e)c(e,n)&&(t=R(n))&&(s[t]=e[n]);return s}var C={};function F(e,t){C[e]=t}function H(t,n){return function(e){return null!=e?(G(this,t,e),h.updateOffset(this,n),this):L(this,t)}}function L(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function G(e,t,n){e.isValid()&&e._d["set"+(e._isUTC?"UTC":"")+t](n)}function V(e,t,n){var s=""+Math.abs(e);return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,t-s.length)).toString().substr(1)+s}var j=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,E=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,A={},I={};function N(e,t,n,s){var i="string"==typeof s?function(){return this[s]()}:s;e&&(I[e]=i),t&&(I[t[0]]=function(){return V(i.apply(this,arguments),t[1],t[2])}),n&&(I[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function z(e,t){return e.isValid()?(t=Z(t,e.localeData()),A[t]=A[t]||function(s){for(var e,i=s.match(j),t=0,r=i.length;t<r;t++)I[i[t]]?i[t]=I[i[t]]:i[t]=(e=i[t]).match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"");return function(e){for(var t="",n=0;n<r;n++)t+=i[n]instanceof Function?i[n].call(e,s):i[n];return t}}(t),A[t](e)):e.localeData().invalidDate()}function Z(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(E.lastIndex=0;0<=n&&E.test(e);)e=e.replace(E,s),E.lastIndex=0,--n;return e}var q=/\d/,$=/\d\d/,B=/\d{3}/,J=/\d{4}/,Q=/[+-]?\d{6}/,X=/\d\d?/,K=/\d\d\d\d?/,ee=/\d\d\d\d\d\d?/,te=/\d{1,3}/,ne=/\d{1,4}/,se=/[+-]?\d{1,6}/,ie=/\d+/,re=/[+-]?\d+/,ae=/Z|[+-]\d\d:?\d\d/gi,oe=/Z|[+-]\d\d(?::?\d\d)?/gi,ue=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,le={};function de(e,n,s){le[e]=x(n)?n:function(e,t){return e&&s?s:n}}function he(e,t){return c(le,e)?le[e](t._strict,t._locale):new RegExp(ce(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i})))}function ce(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var fe={};function me(e,n){var t,s=n;for("string"==typeof e&&(e=[e]),"number"==typeof n&&(s=function(e,t){t[n]=S(e)}),t=0;t<e.length;t++)fe[e[t]]=s}function _e(e,i){me(e,function(e,t,n,s){n._w=n._w||{},i(e,n._w,n,s)})}var ye,ge=0,pe=1,we=2,ve=3,Se=4,Me=5,ke=6,De=7,Ye=8;function xe(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}ye=Array.prototype.indexOf||function(e){for(var t=0;t<this.length;++t)if(this[t]===e)return t;return-1},N("M",["MM",2],"Mo",function(){return this.month()+1}),N("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),N("MMMM",0,0,function(e){return this.localeData().months(this,e)}),W("month","M"),F("month",8),de("M",X),de("MM",X,$),de("MMM",function(e,t){return t.monthsShortRegex(e)}),de("MMMM",function(e,t){return t.monthsRegex(e)}),me(["M","MM"],function(e,t){t[pe]=S(e)-1}),me(["MMM","MMMM"],function(e,t,n,s){s=n._locale.monthsParse(e,s,n._strict);null!=s?t[pe]=s:f(n).invalidMonth=e});var Oe=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,be="January_February_March_April_May_June_July_August_September_October_November_December".split("_");var Te="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Pe(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=S(t);else if("number"!=typeof(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),xe(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function We(e){return null!=e?(Pe(this,e),h.updateOffset(this,!0),this):L(this,"Month")}var Re=ue;var Ue=ue;function Ce(){function e(e,t){return t.length-e.length}for(var t,n=[],s=[],i=[],r=0;r<12;r++)t=l([2e3,r]),n.push(this.monthsShort(t,"")),s.push(this.months(t,"")),i.push(this.months(t,"")),i.push(this.monthsShort(t,""));for(n.sort(e),s.sort(e),i.sort(e),r=0;r<12;r++)n[r]=ce(n[r]),s[r]=ce(s[r]);for(r=0;r<24;r++)i[r]=ce(i[r]);this._monthsRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}function Fe(e){return He(e)?366:365}function He(e){return e%4==0&&e%100!=0||e%400==0}N("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),N(0,["YY",2],0,function(){return this.year()%100}),N(0,["YYYY",4],0,"year"),N(0,["YYYYY",5],0,"year"),N(0,["YYYYYY",6,!0],0,"year"),W("year","y"),F("year",1),de("Y",re),de("YY",X,$),de("YYYY",ne,J),de("YYYYY",se,Q),de("YYYYYY",se,Q),me(["YYYYY","YYYYYY"],ge),me("YYYY",function(e,t){t[ge]=2===e.length?h.parseTwoDigitYear(e):S(e)}),me("YY",function(e,t){t[ge]=h.parseTwoDigitYear(e)}),me("Y",function(e,t){t[ge]=parseInt(e,10)}),h.parseTwoDigitYear=function(e){return S(e)+(68<S(e)?1900:2e3)};var Le=H("FullYear",!0);function Ge(e,t,n,s,i,r,a){a=new Date(e,t,n,s,i,r,a);return e<100&&0<=e&&isFinite(a.getFullYear())&&a.setFullYear(e),a}function Ve(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&0<=e&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function je(e,t,n){n=7+t-n;return n-(7+Ve(e,0,n).getUTCDay()-t)%7-1}function Ee(e,t,n,s,i){var r,i=1+7*(t-1)+(7+n-s)%7+je(e,s,i),i=i<=0?Fe(r=e-1)+i:i>Fe(e)?(r=e+1,i-Fe(e)):(r=e,i);return{year:r,dayOfYear:i}}function Ae(e,t,n){var s,i,r=je(e.year(),t,n),r=Math.floor((e.dayOfYear()-r-1)/7)+1;return r<1?s=r+Ie(i=e.year()-1,t,n):r>Ie(e.year(),t,n)?(s=r-Ie(e.year(),t,n),i=e.year()+1):(i=e.year(),s=r),{week:s,year:i}}function Ie(e,t,n){var s=je(e,t,n),n=je(e+1,t,n);return(Fe(e)-s+n)/7}N("w",["ww",2],"wo","week"),N("W",["WW",2],"Wo","isoWeek"),W("week","w"),W("isoWeek","W"),F("week",5),F("isoWeek",5),de("w",X),de("ww",X,$),de("W",X),de("WW",X,$),_e(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=S(e)});N("d",0,"do","day"),N("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),N("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),N("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),N("e",0,0,"weekday"),N("E",0,0,"isoWeekday"),W("day","d"),W("weekday","e"),W("isoWeekday","E"),F("day",11),F("weekday",11),F("isoWeekday",11),de("d",X),de("e",X),de("E",X),de("dd",function(e,t){return t.weekdaysMinRegex(e)}),de("ddd",function(e,t){return t.weekdaysShortRegex(e)}),de("dddd",function(e,t){return t.weekdaysRegex(e)}),_e(["dd","ddd","dddd"],function(e,t,n,s){s=n._locale.weekdaysParse(e,s,n._strict);null!=s?t.d=s:f(n).invalidWeekday=e}),_e(["d","e","E"],function(e,t,n,s){t[s]=S(e)});var Ne="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var ze="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var Ze="Su_Mo_Tu_We_Th_Fr_Sa".split("_");var qe=ue;var $e=ue;var Be=ue;function Je(){function e(e,t){return t.length-e.length}for(var t,n,s,i=[],r=[],a=[],o=[],u=0;u<7;u++)s=l([2e3,1]).day(u),t=this.weekdaysMin(s,""),n=this.weekdaysShort(s,""),s=this.weekdays(s,""),i.push(t),r.push(n),a.push(s),o.push(t),o.push(n),o.push(s);for(i.sort(e),r.sort(e),a.sort(e),o.sort(e),u=0;u<7;u++)r[u]=ce(r[u]),a[u]=ce(a[u]),o[u]=ce(o[u]);this._weekdaysRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+i.join("|")+")","i")}function Qe(){return this.hours()%12||12}function Xe(e,t){N(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Ke(e,t){return t._meridiemParse}N("H",["HH",2],0,"hour"),N("h",["hh",2],0,Qe),N("k",["kk",2],0,function(){return this.hours()||24}),N("hmm",0,0,function(){return""+Qe.apply(this)+V(this.minutes(),2)}),N("hmmss",0,0,function(){return""+Qe.apply(this)+V(this.minutes(),2)+V(this.seconds(),2)}),N("Hmm",0,0,function(){return""+this.hours()+V(this.minutes(),2)}),N("Hmmss",0,0,function(){return""+this.hours()+V(this.minutes(),2)+V(this.seconds(),2)}),Xe("a",!0),Xe("A",!1),W("hour","h"),F("hour",13),de("a",Ke),de("A",Ke),de("H",X),de("h",X),de("HH",X,$),de("hh",X,$),de("hmm",K),de("hmmss",ee),de("Hmm",K),de("Hmmss",ee),me(["H","HH"],ve),me(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),me(["h","hh"],function(e,t,n){t[ve]=S(e),f(n).bigHour=!0}),me("hmm",function(e,t,n){var s=e.length-2;t[ve]=S(e.substr(0,s)),t[Se]=S(e.substr(s)),f(n).bigHour=!0}),me("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ve]=S(e.substr(0,s)),t[Se]=S(e.substr(s,2)),t[Me]=S(e.substr(i)),f(n).bigHour=!0}),me("Hmm",function(e,t,n){var s=e.length-2;t[ve]=S(e.substr(0,s)),t[Se]=S(e.substr(s))}),me("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ve]=S(e.substr(0,s)),t[Se]=S(e.substr(s,2)),t[Me]=S(e.substr(i))});var et,tt=H("Hours",!0),nt={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",ordinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:be,monthsShort:Te,week:{dow:0,doy:6},weekdays:Ne,weekdaysMin:Ze,weekdaysShort:ze,meridiemParse:/[ap]\.?m?\.?/i},st={};function it(e){return e&&e.toLowerCase().replace("_","-")}function rt(e){var t;if(!st[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=et._abbr,require("./locale/"+e),at(t)}catch(e){}return st[e]}function at(e,t){var n;return(et=e&&(n=m(t)?ut(e):ot(e,t))?n:et)._abbr}function ot(e,t){if(null===t)return delete st[e],null;var n=nt;return t.abbr=e,null!=st[e]?(Y("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=st[e]._config):null!=t.parentLocale&&(null!=st[t.parentLocale]?n=st[t.parentLocale]._config:Y("parentLocaleUndefined","specified parentLocale is not defined yet. See http://momentjs.com/guides/#/warnings/parent-locale/")),st[e]=new b(O(n,t)),at(e),st[e]}function ut(e){var t;if(!(e=e&&e._locale&&e._locale._abbr?e._locale._abbr:e))return et;if(!a(e)){if(t=rt(e))return t;e=[e]}return function(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=it(e[r]).split("-")).length,n=(n=it(e[r+1]))?n.split("-"):null;0<t;){if(s=rt(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&M(i,n,!0)>=t-1)break;t--}r++}return null}(e)}function lt(e){var t=e._a;return t&&-2===f(e).overflow&&(t=t[pe]<0||11<t[pe]?pe:t[we]<1||t[we]>xe(t[ge],t[pe])?we:t[ve]<0||24<t[ve]||24===t[ve]&&(0!==t[Se]||0!==t[Me]||0!==t[ke])?ve:t[Se]<0||59<t[Se]?Se:t[Me]<0||59<t[Me]?Me:t[ke]<0||999<t[ke]?ke:-1,f(e)._overflowDayOfYear&&(t<ge||we<t)&&(t=we),f(e)._overflowWeeks&&-1===t&&(t=De),f(e)._overflowWeekday&&-1===t&&(t=Ye),f(e).overflow=t),e}var dt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,ht=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,ct=/Z|[+-]\d\d(?::?\d\d)?/,ft=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],mt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],_t=/^\/?Date\((\-?\d+)/i;function yt(e){var t,n,s,i,r,a,o=e._i,u=dt.exec(o)||ht.exec(o);if(u){for(f(e).iso=!0,t=0,n=ft.length;t<n;t++)if(ft[t][1].exec(u[1])){i=ft[t][0],s=!1!==ft[t][2];break}if(null!=i){if(u[3]){for(t=0,n=mt.length;t<n;t++)if(mt[t][1].exec(u[3])){r=(u[2]||" ")+mt[t][0];break}if(null==r)return void(e._isValid=!1)}if(s||null==r){if(u[4]){if(!ct.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),wt(e)}else e._isValid=!1}else e._isValid=!1}else e._isValid=!1}function gt(e,t,n){return null!=e?e:null!=t?t:n}function pt(e){var t,n,s,i,r=[];if(!e._d){for(s=e,i=new Date(h.now()),n=s._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()],e._w&&null==e._a[we]&&null==e._a[pe]&&function(e){var t,n,s,i,r,a,o;null!=(t=e._w).GG||null!=t.W||null!=t.E?(r=1,a=4,n=gt(t.GG,e._a[ge],Ae(Mt(),1,4).year),s=gt(t.W,1),((i=gt(t.E,1))<1||7<i)&&(o=!0)):(r=e._locale._week.dow,a=e._locale._week.doy,n=gt(t.gg,e._a[ge],Ae(Mt(),r,a).year),s=gt(t.w,1),null!=t.d?((i=t.d)<0||6<i)&&(o=!0):null!=t.e?(i=t.e+r,(t.e<0||6<t.e)&&(o=!0)):i=r);s<1||s>Ie(n,r,a)?f(e)._overflowWeeks=!0:null!=o?f(e)._overflowWeekday=!0:(a=Ee(n,s,i,r,a),e._a[ge]=a.year,e._dayOfYear=a.dayOfYear)}(e),e._dayOfYear&&(i=gt(e._a[ge],n[ge]),e._dayOfYear>Fe(i)&&(f(e)._overflowDayOfYear=!0),i=Ve(i,0,e._dayOfYear),e._a[pe]=i.getUTCMonth(),e._a[we]=i.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=r[t]=n[t];for(;t<7;t++)e._a[t]=r[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ve]&&0===e._a[Se]&&0===e._a[Me]&&0===e._a[ke]&&(e._nextDay=!0,e._a[ve]=0),e._d=(e._useUTC?Ve:Ge).apply(null,r),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ve]=24)}}function wt(e){if(e._f!==h.ISO_8601){e._a=[],f(e).empty=!0;for(var t,n,s,i,r,a=""+e._i,o=a.length,u=0,l=Z(e._f,e._locale).match(j)||[],d=0;d<l.length;d++)n=l[d],(t=(a.match(he(n,e))||[])[0])&&(0<(i=a.substr(0,a.indexOf(t))).length&&f(e).unusedInput.push(i),a=a.slice(a.indexOf(t)+t.length),u+=t.length),I[n]?(t?f(e).empty=!1:f(e).unusedTokens.push(n),s=n,r=e,null!=(i=t)&&c(fe,s)&&fe[s](i,r._a,r,s)):e._strict&&!t&&f(e).unusedTokens.push(n);f(e).charsLeftOver=o-u,0<a.length&&f(e).unusedInput.push(a),e._a[ve]<=12&&!0===f(e).bigHour&&0<e._a[ve]&&(f(e).bigHour=void 0),f(e).parsedDateParts=e._a.slice(0),f(e).meridiem=e._meridiem,e._a[ve]=function(e,t,n){if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((n=e.isPM(n))&&t<12&&(t+=12),t=n||12!==t?t:0):t}(e._locale,e._a[ve],e._meridiem),pt(e),lt(e)}else yt(e)}function vt(e){var t=e._i,n=e._f;return e._locale=e._locale||ut(e._l),null===t||void 0===n&&""===t?r({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),w(t)?new p(lt(t)):(a(n)?function(e){var t,n,s,i,r;if(0===e._f.length)return f(e).invalidFormat=!0,e._d=new Date(NaN);for(i=0;i<e._f.length;i++)r=0,t=g({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],wt(t),d(t)&&(r+=f(t).charsLeftOver,r+=10*f(t).unusedTokens.length,f(t).score=r,(null==s||r<s)&&(s=r,n=t));u(e,n||t)}(e):s(t)?e._d=t:n?wt(e):void 0===(n=(t=e)._i)?t._d=new Date(h.now()):s(n)?t._d=new Date(n.valueOf()):"string"==typeof n?function(e){var t=_t.exec(e._i);null===t?(yt(e),!1===e._isValid&&(delete e._isValid,h.createFromInputFallback(e))):e._d=new Date(+t[1])}(t):a(n)?(t._a=i(n.slice(0),function(e){return parseInt(e,10)}),pt(t)):"object"==typeof n?function(e){var t;e._d||(t=U(e._i),e._a=i([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),pt(e))}(t):"number"==typeof n?t._d=new Date(n):h.createFromInputFallback(t),d(e)||(e._d=null),e))}function St(e,t,n,s,i){var r={};return"boolean"==typeof n&&(s=n,n=void 0),(o(e)&&function(e){for(var t in e)return;return 1}(e)||a(e)&&0===e.length)&&(e=void 0),r._isAMomentObject=!0,r._useUTC=r._isUTC=i,r._l=n,r._i=e,r._f=t,r._strict=s,(r=new p(lt(vt(r=r))))._nextDay&&(r.add(1,"d"),r._nextDay=void 0),r}function Mt(e,t,n,s){return St(e,t,n,s,!1)}h.createFromInputFallback=n("value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),h.ISO_8601=function(){};ue=n("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Mt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:r()}),K=n("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Mt.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:r()});function kt(e,t){var n,s;if(!(t=1===t.length&&a(t[0])?t[0]:t).length)return Mt();for(n=t[0],s=1;s<t.length;++s)t[s].isValid()&&!t[s][e](n)||(n=t[s]);return n}function Dt(e){var t=U(e),n=t.year||0,s=t.quarter||0,i=t.month||0,r=t.week||0,a=t.day||0,o=t.hour||0,u=t.minute||0,e=t.second||0,t=t.millisecond||0;this._milliseconds=+t+1e3*e+6e4*u+1e3*o*60*60,this._days=+a+7*r,this._months=+i+3*s+12*n,this._data={},this._locale=ut(),this._bubble()}function Yt(e){return e instanceof Dt}function xt(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ot(e,n){N(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+V(~~(e/60),2)+n+V(~~e%60,2)})}Ot("Z",":"),Ot("ZZ",""),de("Z",oe),de("ZZ",oe),me(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Tt(oe,e)});var bt=/([\+\-]|\d\d)/gi;function Tt(e,t){t=(t||"").match(e)||[],e=((t[t.length-1]||[])+"").match(bt)||["-",0,0],t=60*e[1]+S(e[2]);return"+"===e[0]?t:-t}function Pt(e,t){var n;return t._isUTC?(n=t.clone(),t=(w(e)||s(e)?e:Mt(e)).valueOf()-n.valueOf(),n._d.setTime(n._d.valueOf()+t),h.updateOffset(n,!1),n):Mt(e).local()}function Wt(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Rt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}h.updateOffset=function(){};var Ut=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Ct=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;function Ft(e,t){var n,s=e,i=null;return Yt(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(s={},t?s[t]=e:s.milliseconds=e):(i=Ut.exec(e))?(n="-"===i[1]?-1:1,s={y:0,d:S(i[we])*n,h:S(i[ve])*n,m:S(i[Se])*n,s:S(i[Me])*n,ms:S(xt(1e3*i[ke]))*n}):(i=Ct.exec(e))?(n="-"===i[1]?-1:1,s={y:Ht(i[2],n),M:Ht(i[3],n),w:Ht(i[4],n),d:Ht(i[5],n),h:Ht(i[6],n),m:Ht(i[7],n),s:Ht(i[8],n)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(n=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Pt(t,e),e.isBefore(t)?n=Lt(e,t):((n=Lt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(Mt(s.from),Mt(s.to)),(s={}).ms=n.milliseconds,s.M=n.months),s=new Dt(s),Yt(e)&&c(e,"_locale")&&(s._locale=e._locale),s}function Ht(e,t){e=e&&parseFloat(e.replace(",","."));return(isNaN(e)?0:e)*t}function Lt(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Gt(s,i){return function(e,t){var n;return null===t||isNaN(+t)||(Y(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=e,e=t,t=n),Vt(this,Ft(e="string"==typeof e?+e:e,t),s),this}}function Vt(e,t,n,s){var i=t._milliseconds,r=xt(t._days),t=xt(t._months);e.isValid()&&(s=null==s||s,i&&e._d.setTime(e._d.valueOf()+i*n),r&&G(e,"Date",L(e,"Date")+r*n),t&&Pe(e,L(e,"Month")+t*n),s&&h.updateOffset(e,r||t))}Ft.fn=Dt.prototype;ee=Gt(1,"add"),be=Gt(-1,"subtract");function jt(e){return void 0===e?this._locale._abbr:(null!=(e=ut(e))&&(this._locale=e),this)}h.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",h.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";Te=n("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function Et(){return this._locale}function At(e,t){N(0,[e,e.length],0,t)}function It(e,t,n,s,i){var r;return null==e?Ae(this,s,i).year:(r=Ie(e,s,i),function(e,t,n,s,i){i=Ee(e,t,n,s,i),i=Ve(i.year,0,i.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}.call(this,e,t=r<t?r:t,n,s,i))}N(0,["gg",2],0,function(){return this.weekYear()%100}),N(0,["GG",2],0,function(){return this.isoWeekYear()%100}),At("gggg","weekYear"),At("ggggg","weekYear"),At("GGGG","isoWeekYear"),At("GGGGG","isoWeekYear"),W("weekYear","gg"),W("isoWeekYear","GG"),F("weekYear",1),F("isoWeekYear",1),de("G",re),de("g",re),de("GG",X,$),de("gg",X,$),de("GGGG",ne,J),de("gggg",ne,J),de("GGGGG",se,Q),de("ggggg",se,Q),_e(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=S(e)}),_e(["gg","GG"],function(e,t,n,s){t[s]=h.parseTwoDigitYear(e)}),N("Q",0,"Qo","quarter"),W("quarter","Q"),F("quarter",7),de("Q",q),me("Q",function(e,t){t[pe]=3*(S(e)-1)}),N("D",["DD",2],"Do","date"),W("date","D"),F("date",9),de("D",X),de("DD",X,$),de("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),me(["D","DD"],we),me("Do",function(e,t){t[we]=S(e.match(X)[0])});Ne=H("Date",!0);N("DDD",["DDDD",3],"DDDo","dayOfYear"),W("dayOfYear","DDD"),F("dayOfYear",4),de("DDD",te),de("DDDD",B),me(["DDD","DDDD"],function(e,t,n){n._dayOfYear=S(e)}),N("m",["mm",2],0,"minute"),W("minute","m"),F("minute",14),de("m",X),de("mm",X,$),me(["m","mm"],Se);Ze=H("Minutes",!1);N("s",["ss",2],0,"second"),W("second","s"),F("second",15),de("s",X),de("ss",X,$),me(["s","ss"],Me);var Nt,ze=H("Seconds",!1);for(N("S",0,0,function(){return~~(this.millisecond()/100)}),N(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),N(0,["SSS",3],0,"millisecond"),N(0,["SSSS",4],0,function(){return 10*this.millisecond()}),N(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),N(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),N(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),N(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),N(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),W("millisecond","ms"),F("millisecond",16),de("S",te,q),de("SS",te,$),de("SSS",te,B),Nt="SSSS";Nt.length<=9;Nt+="S")de(Nt,ie);function zt(e,t){t[ke]=S(1e3*("0."+e))}for(Nt="S";Nt.length<=9;Nt+="S")me(Nt,zt);ne=H("Milliseconds",!1);N("z",0,0,"zoneAbbr"),N("zz",0,0,"zoneName");J=p.prototype;J.add=ee,J.calendar=function(e,t){var n=e||Mt(),e=Pt(n,this).startOf("day"),e=h.calendarFormat(this,e)||"sameElse",t=t&&(x(t[e])?t[e].call(this,n):t[e]);return this.format(t||this.localeData().calendar(e,this,Mt(n)))},J.clone=function(){return new p(this)},J.diff=function(e,t,n){var s,i;return this.isValid()&&(s=Pt(e,this)).isValid()?(e=6e4*(s.utcOffset()-this.utcOffset()),"year"===(t=R(t))||"month"===t||"quarter"===t?(i=function(e,t){var n,s=12*(t.year()-e.year())+(t.month()-e.month()),i=e.clone().add(s,"months");i=t-i<0?(n=e.clone().add(s-1,"months"),(t-i)/(i-n)):(n=e.clone().add(1+s,"months"),(t-i)/(n-i));return-(s+i)||0}(this,s),"quarter"===t?i/=3:"year"===t&&(i/=12)):(s=this-s,i="second"===t?s/1e3:"minute"===t?s/6e4:"hour"===t?s/36e5:"day"===t?(s-e)/864e5:"week"===t?(s-e)/6048e5:s),n?i:v(i)):NaN},J.endOf=function(e){return void 0===(e=R(e))||"millisecond"===e?this:this.startOf(e="date"===e?"day":e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms")},J.format=function(e){return e=e||(this.isUtc()?h.defaultFormatUtc:h.defaultFormat),e=z(this,e),this.localeData().postformat(e)},J.from=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||Mt(e).isValid())?Ft({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},J.fromNow=function(e){return this.from(Mt(),e)},J.to=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||Mt(e).isValid())?Ft({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},J.toNow=function(e){return this.to(Mt(),e)},J.get=function(e){return x(this[e=R(e)])?this[e]():this},J.invalidAt=function(){return f(this).overflow},J.isAfter=function(e,t){return e=w(e)?e:Mt(e),!(!this.isValid()||!e.isValid())&&("millisecond"===(t=R(m(t)?"millisecond":t))?this.valueOf()>e.valueOf():e.valueOf()<this.clone().startOf(t).valueOf())},J.isBefore=function(e,t){return e=w(e)?e:Mt(e),!(!this.isValid()||!e.isValid())&&("millisecond"===(t=R(m(t)?"millisecond":t))?this.valueOf()<e.valueOf():this.clone().endOf(t).valueOf()<e.valueOf())},J.isBetween=function(e,t,n,s){return("("===(s=s||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===s[1]?this.isBefore(t,n):!this.isAfter(t,n))},J.isSame=function(e,t){return e=w(e)?e:Mt(e),!(!this.isValid()||!e.isValid())&&("millisecond"===(t=R(t||"millisecond"))?this.valueOf()===e.valueOf():(e=e.valueOf(),this.clone().startOf(t).valueOf()<=e&&e<=this.clone().endOf(t).valueOf()))},J.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},J.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},J.isValid=function(){return d(this)},J.lang=Te,J.locale=jt,J.localeData=Et,J.max=K,J.min=ue,J.parsingFlags=function(){return u({},f(this))},J.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t,n=[];for(t in e)n.push({unit:t,priority:C[t]});return n.sort(function(e,t){return e.priority-t.priority}),n}(e=U(e)),s=0;s<n.length;s++)this[n[s].unit](e[n[s].unit]);else if(x(this[e=R(e)]))return this[e](t);return this},J.startOf=function(e){switch(e=R(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this},J.subtract=be,J.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},J.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},J.toDate=function(){return new Date(this.valueOf())},J.toISOString=function(){var e=this.clone().utc();return 0<e.year()&&e.year()<=9999?x(Date.prototype.toISOString)?this.toDate().toISOString():z(e,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):z(e,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},J.toJSON=function(){return this.isValid()?this.toISOString():null},J.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},J.unix=function(){return Math.floor(this.valueOf()/1e3)},J.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},J.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},J.year=Le,J.isLeapYear=function(){return He(this.year())},J.weekYear=function(e){return It.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},J.isoWeekYear=function(e){return It.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},J.quarter=J.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},J.month=We,J.daysInMonth=function(){return xe(this.year(),this.month())},J.week=J.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},J.isoWeek=J.isoWeeks=function(e){var t=Ae(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},J.weeksInYear=function(){var e=this.localeData()._week;return Ie(this.year(),e.dow,e.doy)},J.isoWeeksInYear=function(){return Ie(this.year(),1,4)},J.date=Ne,J.day=J.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t,n,s=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(t=e,n=this.localeData(),e="string"!=typeof t?t:isNaN(t)?"number"==typeof(t=n.weekdaysParse(t))?t:null:parseInt(t,10),this.add(e-s,"d")):s},J.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},J.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null==e)return this.day()||7;var t=(t=e,e=this.localeData(),"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t);return this.day(this.day()%7?t:t-7)},J.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},J.hour=J.hours=tt,J.minute=J.minutes=Ze,J.second=J.seconds=ze,J.millisecond=J.milliseconds=ne,J.utcOffset=function(e,t){var n,s=this._offset||0;return this.isValid()?null!=e?("string"==typeof e?e=Tt(oe,e):Math.abs(e)<16&&(e*=60),!this._isUTC&&t&&(n=Wt(this)),this._offset=e,this._isUTC=!0,null!=n&&this.add(n,"m"),s!==e&&(!t||this._changeInProgress?Vt(this,Ft(e-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,h.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?s:Wt(this):null!=e?this:NaN},J.utc=function(e){return this.utcOffset(0,e)},J.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Wt(this),"m")),this},J.parseZone=function(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&(0===Tt(ae,this._i)?this.utcOffset(0,!0):this.utcOffset(Tt(ae,this._i))),this},J.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Mt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},J.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},J.isLocal=function(){return!!this.isValid()&&!this._isUTC},J.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},J.isUtc=Rt,J.isUTC=Rt,J.zoneAbbr=function(){return this._isUTC?"UTC":""},J.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},J.dates=n("dates accessor is deprecated. Use date instead.",Ne),J.months=n("months accessor is deprecated. Use month instead",We),J.years=n("years accessor is deprecated. Use year instead",Le),J.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?(this.utcOffset(e="string"!=typeof e?-e:e,t),this):-this.utcOffset()}),J.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!m(this._isDSTShifted))return this._isDSTShifted;var e,t={};return g(t,this),(t=vt(t))._a?(e=(t._isUTC?l:Mt)(t._a),this._isDSTShifted=this.isValid()&&0<M(t._a,e.toArray())):this._isDSTShifted=!1,this._isDSTShifted});se=J;function Zt(e){return e}Q=b.prototype;function qt(e,t,n,s){var i=ut(),t=l().set(s,t);return i[n](t,e)}function $t(e,t,n){if("number"==typeof e&&(t=e,e=void 0),e=e||"",null!=t)return qt(e,t,n,"month");for(var s=[],i=0;i<12;i++)s[i]=qt(e,i,n,"month");return s}function Bt(e,t,n,s){t=("boolean"==typeof e?"number"==typeof t&&(n=t,t=void 0):(t=e,e=!1,"number"==typeof(n=t)&&(n=t,t=void 0)),t||"");var i=ut(),r=e?i._week.dow:0;if(null!=n)return qt(t,(n+r)%7,s,"day");for(var a=[],o=0;o<7;o++)a[o]=qt(t,(o+r)%7,s,"day");return a}Q.calendar=function(e,t,n){return x(e=this._calendar[e]||this._calendar.sameElse)?e.call(t,n):e},Q.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])},Q.invalidDate=function(){return this._invalidDate},Q.ordinal=function(e){return this._ordinal.replace("%d",e)},Q.preparse=Zt,Q.postformat=Zt,Q.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return x(i)?i(e,t,n,s):i.replace(/%d/i,e)},Q.pastFuture=function(e,t){return x(e=this._relativeTime[0<e?"future":"past"])?e(t):e.replace(/%s/i,t)},Q.set=function(e){var t,n;for(n in e)x(t=e[n])?this[n]=t:this["_"+n]=t;this._config=e,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)},Q.months=function(e,t){return e?(a(this._months)?this._months:this._months[(this._months.isFormat||Oe).test(t)?"format":"standalone"])[e.month()]:this._months},Q.monthsShort=function(e,t){return e?(a(this._monthsShort)?this._monthsShort:this._monthsShort[Oe.test(t)?"format":"standalone"])[e.month()]:this._monthsShort},Q.monthsParse=function(e,t,n){var s,i;if(this._monthsParseExact)return function(e,t,n){var s,i,r,e=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=l([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=ye.call(this._shortMonthsParse,e))?i:null:-1!==(i=ye.call(this._longMonthsParse,e))?i:null:"MMM"===t?-1!==(i=ye.call(this._shortMonthsParse,e))||-1!==(i=ye.call(this._longMonthsParse,e))?i:null:-1!==(i=ye.call(this._longMonthsParse,e))||-1!==(i=ye.call(this._shortMonthsParse,e))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=l([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(i="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},Q.monthsRegex=function(e){return this._monthsParseExact?(c(this,"_monthsRegex")||Ce.call(this),e?this._monthsStrictRegex:this._monthsRegex):(c(this,"_monthsRegex")||(this._monthsRegex=Ue),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},Q.monthsShortRegex=function(e){return this._monthsParseExact?(c(this,"_monthsRegex")||Ce.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(c(this,"_monthsShortRegex")||(this._monthsShortRegex=Re),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},Q.week=function(e){return Ae(e,this._week.dow,this._week.doy).week},Q.firstDayOfYear=function(){return this._week.doy},Q.firstDayOfWeek=function(){return this._week.dow},Q.weekdays=function(e,t){return e?(a(this._weekdays)?this._weekdays:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"])[e.day()]:this._weekdays},Q.weekdaysMin=function(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin},Q.weekdaysShort=function(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort},Q.weekdaysParse=function(e,t,n){var s,i;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,e=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=l([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=ye.call(this._weekdaysParse,e))?i:null:"ddd"===t?-1!==(i=ye.call(this._shortWeekdaysParse,e))?i:null:-1!==(i=ye.call(this._minWeekdaysParse,e))?i:null:"dddd"===t?-1!==(i=ye.call(this._weekdaysParse,e))||-1!==(i=ye.call(this._shortWeekdaysParse,e))||-1!==(i=ye.call(this._minWeekdaysParse,e))?i:null:"ddd"===t?-1!==(i=ye.call(this._shortWeekdaysParse,e))||-1!==(i=ye.call(this._weekdaysParse,e))||-1!==(i=ye.call(this._minWeekdaysParse,e))?i:null:-1!==(i=ye.call(this._minWeekdaysParse,e))||-1!==(i=ye.call(this._weekdaysParse,e))||-1!==(i=ye.call(this._shortWeekdaysParse,e))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=l([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".",".?")+"$","i")),this._weekdaysParse[s]||(i="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},Q.weekdaysRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Je.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(c(this,"_weekdaysRegex")||(this._weekdaysRegex=qe),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},Q.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Je.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(c(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=$e),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Q.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Je.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(c(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Be),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Q.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},Q.meridiem=function(e,t,n){return 11<e?n?"pm":"PM":n?"am":"AM"},at("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===S(e%100/10)?"th":1==t?"st":2==t?"nd":3==t?"rd":"th")}}),h.lang=n("moment.lang is deprecated. Use moment.locale instead.",at),h.langData=n("moment.langData is deprecated. Use moment.localeData instead.",ut);var Jt=Math.abs;function Qt(e,t,n,s){n=Ft(t,n);return e._milliseconds+=s*n._milliseconds,e._days+=s*n._days,e._months+=s*n._months,e._bubble()}function Xt(e){return e<0?Math.floor(e):Math.ceil(e)}function Kt(e){return 4800*e/146097}function en(e){return 146097*e/4800}function tn(e){return function(){return this.as(e)}}q=tn("ms"),$=tn("s"),te=tn("m"),B=tn("h"),ee=tn("d"),K=tn("w"),ue=tn("M"),be=tn("y");function nn(e){return function(){return this._data[e]}}tt=nn("milliseconds"),Ze=nn("seconds"),ze=nn("minutes"),ne=nn("hours"),Ne=nn("days"),Le=nn("months"),J=nn("years");var sn=Math.round,rn={s:45,m:45,h:22,d:26,M:11};function an(e,t,n){var s=Ft(e).abs(),i=sn(s.as("s")),r=sn(s.as("m")),a=sn(s.as("h")),o=sn(s.as("d")),u=sn(s.as("M")),s=sn(s.as("y")),s=(i<rn.s?["s",i]:r<=1&&["m"])||r<rn.m&&["mm",r]||a<=1&&["h"]||a<rn.h&&["hh",a]||o<=1&&["d"]||o<rn.d&&["dd",o]||u<=1&&["M"]||u<rn.M&&["MM",u]||s<=1&&["y"]||["yy",s];return s[2]=t,s[3]=0<+e,s[4]=n,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,s)}var on=Math.abs;function un(){var e=on(this._milliseconds)/1e3,t=on(this._days),n=on(this._months),s=v(e/60),i=v(s/60);e%=60,s%=60;var r=v(n/12),a=n%=12,n=t,t=i,i=s,s=e,e=this.asSeconds();return e?(e<0?"-":"")+"P"+(r?r+"Y":"")+(a?a+"M":"")+(n?n+"D":"")+(t||i||s?"T":"")+(t?t+"H":"")+(i?i+"M":"")+(s?s+"S":""):"P0D"}Q=Dt.prototype;return Q.abs=function(){var e=this._data;return this._milliseconds=Jt(this._milliseconds),this._days=Jt(this._days),this._months=Jt(this._months),e.milliseconds=Jt(e.milliseconds),e.seconds=Jt(e.seconds),e.minutes=Jt(e.minutes),e.hours=Jt(e.hours),e.months=Jt(e.months),e.years=Jt(e.years),this},Q.add=function(e,t){return Qt(this,e,t,1)},Q.subtract=function(e,t){return Qt(this,e,t,-1)},Q.as=function(e){var t,n,s=this._milliseconds;if("month"===(e=R(e))||"year"===e)return t=this._days+s/864e5,n=this._months+Kt(t),"month"===e?n:n/12;switch(t=this._days+Math.round(en(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},Q.asMilliseconds=q,Q.asSeconds=$,Q.asMinutes=te,Q.asHours=B,Q.asDays=ee,Q.asWeeks=K,Q.asMonths=ue,Q.asYears=be,Q.valueOf=function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*S(this._months/12)},Q._bubble=function(){var e=this._milliseconds,t=this._days,n=this._months,s=this._data;return 0<=e&&0<=t&&0<=n||e<=0&&t<=0&&n<=0||(e+=864e5*Xt(en(n)+t),n=t=0),s.milliseconds=e%1e3,e=v(e/1e3),s.seconds=e%60,e=v(e/60),s.minutes=e%60,e=v(e/60),s.hours=e%24,t+=v(e/24),n+=e=v(Kt(t)),t-=Xt(en(e)),e=v(n/12),n%=12,s.days=t,s.months=n,s.years=e,this},Q.get=function(e){return this[(e=R(e))+"s"]()},Q.milliseconds=tt,Q.seconds=Ze,Q.minutes=ze,Q.hours=ne,Q.days=Ne,Q.weeks=function(){return v(this.days()/7)},Q.months=Le,Q.years=J,Q.humanize=function(e){var t=this.localeData(),n=an(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)},Q.toISOString=un,Q.toString=un,Q.toJSON=un,Q.locale=jt,Q.localeData=Et,Q.toIsoString=n("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",un),Q.lang=Te,N("X",0,0,"unix"),N("x",0,0,"valueOf"),de("x",re),de("X",/[+-]?\d+(\.\d{1,3})?/),me("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),me("x",function(e,t,n){n._d=new Date(S(e))}),h.version="2.15.1",e=Mt,h.fn=se,h.min=function(){return kt("isBefore",[].slice.call(arguments,0))},h.max=function(){return kt("isAfter",[].slice.call(arguments,0))},h.now=function(){return Date.now?Date.now():+new Date},h.utc=l,h.unix=function(e){return Mt(1e3*e)},h.months=function(e,t){return $t(e,t,"months")},h.isDate=s,h.locale=at,h.invalid=r,h.duration=Ft,h.isMoment=w,h.weekdays=function(e,t,n){return Bt(e,t,n,"weekdays")},h.parseZone=function(){return Mt.apply(null,arguments).parseZone()},h.localeData=ut,h.isDuration=Yt,h.monthsShort=function(e,t){return $t(e,t,"monthsShort")},h.weekdaysMin=function(e,t,n){return Bt(e,t,n,"weekdaysMin")},h.defineLocale=ot,h.updateLocale=function(e,t){return null!=t?((t=new b(t=O(null!=st[e]?st[e]._config:nt,t))).parentLocale=st[e],st[e]=t,at(e)):null!=st[e]&&(null!=st[e].parentLocale?st[e]=st[e].parentLocale:null!=st[e]&&delete st[e]),st[e]},h.locales=function(){return T(st)},h.weekdaysShort=function(e,t,n){return Bt(e,t,n,"weekdaysShort")},h.normalizeUnits=R,h.relativeTimeRounding=function(e){return void 0===e?sn:"function"==typeof e&&(sn=e,!0)},h.relativeTimeThreshold=function(e,t){return void 0!==rn[e]&&(void 0===t?rn[e]:(rn[e]=t,!0))},h.calendarFormat=function(e,t){return(t=e.diff(t,"days",!0))<-6?"sameElse":t<-1?"lastWeek":t<0?"lastDay":t<1?"sameDay":t<2?"nextDay":t<7?"nextWeek":"sameElse"},h.prototype=se,h});
bp-core/js/webcam.js CHANGED
@@ -1,8 +1,8 @@
1
- /* global bp, BP_Uploader, _, Backbone */
2
 
3
  window.bp = window.bp || {};
4
 
5
- ( function() {
6
 
7
  // Bail if not set.
8
  if ( typeof BP_Uploader === 'undefined' ) {
@@ -317,4 +317,4 @@ window.bp = window.bp || {};
317
 
318
  bp.WebCam.start();
319
 
320
- })( bp, jQuery );
1
+ /* global BP_Uploader, _, Backbone */
2
 
3
  window.bp = window.bp || {};
4
 
5
+ ( function( bp ) {
6
 
7
  // Bail if not set.
8
  if ( typeof BP_Uploader === 'undefined' ) {
317
 
318
  bp.WebCam.start();
319
 
320
+ })( window.bp );
bp-core/js/webcam.min.js CHANGED
@@ -1 +1 @@
1
- window.bp=window.bp||{},bp,jQuery,"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(e){if("camera"===e){var a=new bp.Views.WebCamAvatar({model:new Backbone.Model({user_media:!1})});this.params.flipped=!1,bp.Avatar.views.add({id:"camera",view:a}),a.inject(".bp-avatar")}else _.isNull(this.params.video)||(this.stop(),this.removeWarning())},removeView:function(){var e;_.isUndefined(bp.Avatar.views.get("camera"))||((e=bp.Avatar.views.get("camera")).get("view").remove(),bp.Avatar.views.remove({id:"camera",view:e}))},gotStream:function(e){var a=bp.WebCam.params.video;bp.WebCam.params.videoStream=e,bp.WebCam.displayWarning("loaded"),a.onerror=function(){bp.WebCam.displayWarning("videoerror"),a&&bp.WebCam.stop()},e.onended=bp.WebCam.noStream(),"srcObject"in a?a.srcObject=e:a.src=window.URL.createObjectURL(e),a.onloadedmetadata=function(){a.play()},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(e){e.get("url")||bp.WebCam.displayWarning("nocapture"),bp.WebCam.removeView(),bp.Avatar.setAvatar(e)},removeWarning:function(){_.isNull(this.params.warning)||this.params.warning.remove()},displayWarning:function(e){this.removeWarning(),this.params.warning=new bp.Views.uploaderWarning({value:BP_Uploader.strings.camera_warnings[e]}),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 e;navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,void 0!==navigator.getUserMedia&&(e=_.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(e)),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"),void 0===navigator.mediaDevices.getUserMedia?navigator.getUserMedia({audio:!1,video:!0},bp.WebCam.gotStream,bp.WebCam.noStream):navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then(bp.WebCam.gotStream,bp.WebCam.noStream).catch(function(){bp.WebCam.displayWarning("errormsg")}))},captureStream:function(e){var a,t;e.preventDefault(),bp.WebCam.params.capture_enable?this.model.get("h")>this.options.video.el.videoHeight||this.model.get("w")>this.options.video.el.videoWidth?bp.WebCam.displayWarning("videoerror"):(t=this.options.video.el.videoHeight,a=(this.options.video.el.videoWidth-t)/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,a,0,t,t,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),bp.WebCam.displayWarning("ready")):bp.WebCam.displayWarning("loading")},saveCapture:function(e){e.preventDefault(),bp.WebCam.params.capture?(bp.WebCam.stop(),bp.WebCam.setAvatar(this.model)):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());
1
+ window.bp=window.bp||{},function(t){"undefined"!=typeof BP_Uploader&&(t.Models=t.Models||{},t.Collections=t.Collections||{},t.Views=t.Views||{},t.WebCam={start:function(){this.params={video:null,videoStream:null,capture_enable:!1,capture:null,canvas:null,warning:null,flipped:!1},t.Avatar.nav.on("bp-avatar-view:changed",_.bind(this.setView,this))},setView:function(e){"camera"===e?(e=new t.Views.WebCamAvatar({model:new Backbone.Model({user_media:!1})}),this.params.flipped=!1,t.Avatar.views.add({id:"camera",view:e}),e.inject(".bp-avatar")):_.isNull(this.params.video)||(this.stop(),this.removeWarning())},removeView:function(){var e;_.isUndefined(t.Avatar.views.get("camera"))||((e=t.Avatar.views.get("camera")).get("view").remove(),t.Avatar.views.remove({id:"camera",view:e}))},gotStream:function(e){var a=t.WebCam.params.video;t.WebCam.params.videoStream=e,t.WebCam.displayWarning("loaded"),a.onerror=function(){t.WebCam.displayWarning("videoerror"),a&&t.WebCam.stop()},e.onended=t.WebCam.noStream(),"srcObject"in a?a.srcObject=e:a.src=window.URL.createObjectURL(e),a.onloadedmetadata=function(){a.play()},t.WebCam.params.capture_enable=!0},stop:function(){t.WebCam.params.capture_enable=!1,t.WebCam.params.videoStream&&(t.WebCam.params.videoStream.stop?t.WebCam.params.videoStream.stop():t.WebCam.params.videoStream.msStop&&t.WebCam.params.videoStream.msStop(),t.WebCam.params.videoStream.onended=null,t.WebCam.params.videoStream=null),t.WebCam.params.video&&(t.WebCam.params.video.onerror=null,t.WebCam.params.video.pause(),t.WebCam.params.video.mozSrcObject&&(t.WebCam.params.video.mozSrcObject=null),t.WebCam.params.video.src="")},noStream:function(){_.isNull(t.WebCam.params.videoStream)&&(t.WebCam.displayWarning("noaccess"),t.WebCam.removeView())},setAvatar:function(e){e.get("url")||t.WebCam.displayWarning("nocapture"),t.WebCam.removeView(),t.Avatar.setAvatar(e)},removeWarning:function(){_.isNull(this.params.warning)||this.params.warning.remove()},displayWarning:function(e){this.removeWarning(),this.params.warning=new t.Views.uploaderWarning({value:BP_Uploader.strings.camera_warnings[e]}),this.params.warning.inject(".bp-avatar-status")}},t.Views.WebCamAvatar=t.View.extend({tagName:"div",id:"bp-webcam-avatar",template:t.template("bp-avatar-webcam"),events:{"click .avatar-webcam-capture":"captureStream","click .avatar-webcam-save":"saveCapture"},initialize:function(){var e;navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,void 0!==navigator.getUserMedia&&(e=_.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(e)),this.on("ready",this.useStream,this)},useStream:function(){this.model.get("user_media")&&(this.options.video=new t.Views.WebCamVideo,this.options.canvas=new t.Views.WebCamCanvas,this.$el.find("#avatar-to-crop").append(this.options.video.el),this.$el.find("#avatar-crop-pane").append(this.options.canvas.el),t.WebCam.params.video=this.options.video.el,t.WebCam.params.canvas=this.options.canvas.el,t.WebCam.displayWarning("requesting"),void 0===navigator.mediaDevices.getUserMedia?navigator.getUserMedia({audio:!1,video:!0},t.WebCam.gotStream,t.WebCam.noStream):navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then(t.WebCam.gotStream,t.WebCam.noStream).catch(function(){t.WebCam.displayWarning("errormsg")}))},captureStream:function(e){var a;e.preventDefault(),t.WebCam.params.capture_enable?this.model.get("h")>this.options.video.el.videoHeight||this.model.get("w")>this.options.video.el.videoWidth?t.WebCam.displayWarning("videoerror"):(a=this.options.video.el.videoHeight,e=(this.options.video.el.videoWidth-a)/2,t.WebCam.params.flipped||(this.options.canvas.el.getContext("2d").translate(this.model.get("w"),0),this.options.canvas.el.getContext("2d").scale(-1,1),t.WebCam.params.flipped=!0),this.options.canvas.el.getContext("2d").drawImage(this.options.video.el,e,0,a,a,0,0,this.model.get("w"),this.model.get("h")),t.WebCam.params.capture=this.options.canvas.el.toDataURL("image/png"),this.model.set("url",t.WebCam.params.capture),t.WebCam.displayWarning("ready")):t.WebCam.displayWarning("loading")},saveCapture:function(e){e.preventDefault(),t.WebCam.params.capture?(t.WebCam.stop(),t.WebCam.setAvatar(this.model)):t.WebCam.displayWarning("nocapture")}}),t.Views.WebCamVideo=t.View.extend({tagName:"video",id:"bp-webcam-video",attributes:{autoplay:"autoplay"}}),t.Views.WebCamCanvas=t.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)}}),t.WebCam.start())}(window.bp);
bp-core/js/widget-members.js CHANGED
@@ -1,4 +1,4 @@
1
- jQuery(document).ready( function() {
2
  member_widget_click_handler();
3
 
4
  // WP 4.5 - Customizer selective refresh support.
1
+ jQuery( function() {
2
  member_widget_click_handler();
3
 
4
  // WP 4.5 - Customizer selective refresh support.
bp-core/js/widget-members.min.js CHANGED
@@ -1 +1 @@
1
- function member_widget_click_handler(){jQuery(".widget div#members-list-options a").on("click",function(){var e=this;return jQuery(e).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(t){jQuery(e).removeClass("loading"),member_widget_response(t)}),!1})}function member_widget_response(e){e=e.substr(0,e.length-1),"-1"!==(e=e.split("[[SPLIT]]"))[0]?jQuery(".widget ul#members-list").fadeOut(200,function(){jQuery(".widget ul#members-list").html(e[1]),jQuery(".widget ul#members-list").fadeIn(200)}):jQuery(".widget ul#members-list").fadeOut(200,function(){var t="<p>"+e[1]+"</p>";jQuery(".widget ul#members-list").html(t),jQuery(".widget ul#members-list").fadeIn(200)})}jQuery(document).ready(function(){member_widget_click_handler(),"undefined"!=typeof wp&&wp.customize&&wp.customize.selectiveRefresh&&wp.customize.selectiveRefresh.bind("partial-content-rendered",function(){member_widget_click_handler()})});
1
+ function member_widget_click_handler(){jQuery(".widget div#members-list-options a").on("click",function(){var t=this;return jQuery(t).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(e){jQuery(t).removeClass("loading"),member_widget_response(e)}),!1})}function member_widget_response(t){"-1"!==(t=(t=t.substr(0,t.length-1)).split("[[SPLIT]]"))[0]?jQuery(".widget ul#members-list").fadeOut(200,function(){jQuery(".widget ul#members-list").html(t[1]),jQuery(".widget ul#members-list").fadeIn(200)}):jQuery(".widget ul#members-list").fadeOut(200,function(){var e="<p>"+t[1]+"</p>";jQuery(".widget ul#members-list").html(e),jQuery(".widget ul#members-list").fadeIn(200)})}jQuery(function(){member_widget_click_handler(),"undefined"!=typeof wp&&wp.customize&&wp.customize.selectiveRefresh&&wp.customize.selectiveRefresh.bind("partial-content-rendered",function(){member_widget_click_handler()})});
bp-friends/classes/class-bp-rest-friends-endpoint.php CHANGED
@@ -331,7 +331,7 @@ class BP_REST_Friends_Endpoint extends WP_REST_Controller {
331
  if (
332
  ( $current_user_id !== $initiator_id->ID && ! $is_moderator )
333
  || ( $current_user_id === $friend_id->ID && $is_moderator )
334
- || ( ! in_array( $current_user_id, [ $initiator_id->ID, $friend_id->ID ], true ) && ! $is_moderator )
335
  ) {
336
  return new WP_Error(
337
  'bp_rest_friends_create_item_failed',
@@ -813,41 +813,43 @@ class BP_REST_Friends_Endpoint extends WP_REST_Controller {
813
  * @return array
814
  */
815
  public function get_item_schema() {
816
- $schema = array(
817
- '$schema' => 'http://json-schema.org/draft-04/schema#',
818
- 'title' => 'bp_friends',
819
- 'type' => 'object',
820
- 'properties' => array(
821
- 'id' => array(
822
- 'context' => array( 'view', 'edit' ),
823
- 'description' => __( 'Unique numeric identifier of the friendship.', 'buddypress' ),
824
- 'type' => 'integer',
825
- ),
826
- 'initiator_id' => array(
827
- 'context' => array( 'view', 'edit' ),
828
- 'description' => __( 'The ID of the user who is requesting the Friendship.', 'buddypress' ),
829
- 'type' => 'integer',
830
- ),
831
- 'friend_id' => array(
832
- 'context' => array( 'view', 'edit' ),
833
- 'description' => __( 'The ID of the user who is invited to agree to the Friendship request.', 'buddypress' ),
834
- 'type' => 'integer',
835
- ),
836
- 'is_confirmed' => array(
837
- 'context' => array( 'view', 'edit' ),
838
- 'description' => __( 'Whether the friendship been confirmed/accepted.', 'buddypress' ),
839
- 'readonly' => true,
840
- 'type' => 'boolean',
841
- ),
842
- 'date_created' => array(
843
- 'context' => array( 'view', 'edit' ),
844
- 'description' => __( "The date the friendship was created, in the site's timezone.", 'buddypress' ),
845
- 'readonly' => true,
846
- 'type' => 'string',
847
- 'format' => 'date-time',
 
 
848
  ),
849
- ),
850
- );
851
 
852
  /**
853
  * Filters the friends schema.
@@ -856,7 +858,7 @@ class BP_REST_Friends_Endpoint extends WP_REST_Controller {
856
  *
857
  * @param array $schema The endpoint schema.
858
  */
859
- return apply_filters( 'bp_rest_friends_schema', $this->add_additional_fields_schema( $schema ) );
860
  }
861
 
862
  /**
331
  if (
332
  ( $current_user_id !== $initiator_id->ID && ! $is_moderator )
333
  || ( $current_user_id === $friend_id->ID && $is_moderator )
334
+ || ( ! in_array( $current_user_id, array( $initiator_id->ID, $friend_id->ID ), true ) && ! $is_moderator )
335
  ) {
336
  return new WP_Error(
337
  'bp_rest_friends_create_item_failed',
813
  * @return array
814
  */
815
  public function get_item_schema() {
816
+ if ( is_null( $this->schema ) ) {
817
+ $this->schema = array(
818
+ '$schema' => 'http://json-schema.org/draft-04/schema#',
819
+ 'title' => 'bp_friends',
820
+ 'type' => 'object',
821
+ 'properties' => array(
822
+ 'id' => array(
823
+ 'context' => array( 'view', 'edit' ),
824
+ 'description' => __( 'Unique numeric identifier of the friendship.', 'buddypress' ),
825
+ 'type' => 'integer',
826
+ ),
827
+ 'initiator_id' => array(
828
+ 'context' => array( 'view', 'edit' ),
829
+ 'description' => __( 'The unique numeric identifier of the user who is requesting the Friendship.', 'buddypress' ),
830
+ 'type' => 'integer',
831
+ ),
832
+ 'friend_id' => array(
833
+ 'context' => array( 'view', 'edit' ),
834
+ 'description' => __( 'The unique numeric identifier of the user who is invited to agree to the Friendship request.', 'buddypress' ),
835
+ 'type' => 'integer',
836
+ ),
837
+ 'is_confirmed' => array(
838
+ 'context' => array( 'view', 'edit' ),
839
+ 'description' => __( 'Whether the friendship been confirmed/accepted.', 'buddypress' ),
840
+ 'readonly' => true,
841
+ 'type' => 'boolean',
842
+ ),
843
+ 'date_created' => array(
844
+ 'context' => array( 'view', 'edit' ),
845
+ 'description' => __( "The date the friendship was created, in the site's timezone.", 'buddypress' ),
846
+ 'readonly' => true,
847
+ 'type' => 'string',
848
+ 'format' => 'date-time',
849
+ ),
850
  ),
851
+ );
852
+ }
853
 
854
  /**
855
  * Filters the friends schema.
858
  *
859
  * @param array $schema The endpoint schema.
860
  */
861
+ return apply_filters( 'bp_rest_friends_schema', $this->add_additional_fields_schema( $this->schema ) );
862
  }
863
 
864
  /**
bp-friends/js/widget-friends.min.js CHANGED
@@ -1 +1 @@
1
- function friend_widget_click_handler(){jQuery(".widget div#friends-list-options a").on("click",function(){var e=this;return jQuery(e).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(i){jQuery(e).removeClass("loading"),friend_widget_response(i)}),!1})}function friend_widget_response(e){e=e.substr(0,e.length-1),"-1"!==(e=e.split("[[SPLIT]]"))[0]?jQuery(".widget ul#friends-list").fadeOut(200,function(){jQuery(".widget ul#friends-list").html(e[1]),jQuery(".widget ul#friends-list").fadeIn(200)}):jQuery(".widget ul#friends-list").fadeOut(200,function(){var i="<p>"+e[1]+"</p>";jQuery(".widget ul#friends-list").html(i),jQuery(".widget ul#friends-list").fadeIn(200)})}jQuery(document).ready(function(){friend_widget_click_handler(),"undefined"!=typeof wp&&wp.customize&&wp.customize.selectiveRefresh&&wp.customize.selectiveRefresh.bind("partial-content-rendered",function(){friend_widget_click_handler()})});
1
+ function friend_widget_click_handler(){jQuery(".widget div#friends-list-options a").on("click",function(){var i=this;return jQuery(i).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(e){jQuery(i).removeClass("loading"),friend_widget_response(e)}),!1})}function friend_widget_response(i){"-1"!==(i=(i=i.substr(0,i.length-1)).split("[[SPLIT]]"))[0]?jQuery(".widget ul#friends-list").fadeOut(200,function(){jQuery(".widget ul#friends-list").html(i[1]),jQuery(".widget ul#friends-list").fadeIn(200)}):jQuery(".widget ul#friends-list").fadeOut(200,function(){var e="<p>"+i[1]+"</p>";jQuery(".widget ul#friends-list").html(e),jQuery(".widget ul#friends-list").fadeIn(200)})}jQuery(document).ready(function(){friend_widget_click_handler(),"undefined"!=typeof wp&&wp.customize&&wp.customize.selectiveRefresh&&wp.customize.selectiveRefresh.bind("partial-content-rendered",function(){friend_widget_click_handler()})});
bp-groups/admin/js/admin.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){function n(n,o){e("#bp-groups-new-members-list").append('<li data-login="'+o.item.value+'"><a href="#" class="bp-groups-remove-new-member">x</a> '+o.item.label+"</li>")}var o="undefined"!=typeof group_id?"&group_id="+group_id:"";e(document).ready(function(){window.warn_on_leave=!1,e(".bp-suggest-user").autocomplete({source:ajaxurl+"?action=bp_group_admin_member_autocomplete"+o,delay:500,minLength:2,position:"undefined"!=typeof isRtl&&isRtl?{my:"right top",at:"right bottom",offset:"0, -1"}:{offset:"0, -1"},open:function(){e(this).addClass("open")},close:function(){e(this).removeClass("open"),e(this).val("")},select:function(e,o){n(0,o)}}),e("#bp-groups-new-members.bp-suggest-user").prop("placeholder",BP_Group_Admin.add_member_placeholder),e("#bp_group_add_members").on("click",".bp-groups-remove-new-member",function(n){n.preventDefault(),e(n.target.parentNode).remove()}),e(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}),e("input#save").on("click",function(){var n=[];e("#bp-groups-new-members-list li").each(function(){n.push(e(this).data("login"))}),n.length&&e("#bp-groups-new-members").val("").val(n.join(", ")),window.warn_on_leave=!1}),window.onbeforeunload=function(){if(window.warn_on_leave)return BP_Group_Admin.warn_on_leave}})}(jQuery);
1
+ !function(o){var e="undefined"!=typeof group_id?"&group_id="+group_id:"";o(document).ready(function(){window.warn_on_leave=!1,o(".bp-suggest-user").autocomplete({source:ajaxurl+"?action=bp_group_admin_member_autocomplete"+e,delay:500,minLength:2,position:"undefined"!=typeof isRtl&&isRtl?{my:"right top",at:"right bottom",offset:"0, -1"}:{offset:"0, -1"},open:function(){o(this).addClass("open")},close:function(){o(this).removeClass("open"),o(this).val("")},select:function(e,n){n=n,o("#bp-groups-new-members-list").append('<li data-login="'+n.item.value+'"><a href="#" class="bp-groups-remove-new-member">x</a> '+n.item.label+"</li>")}}),o("#bp-groups-new-members.bp-suggest-user").prop("placeholder",BP_Group_Admin.add_member_placeholder),o("#bp_group_add_members").on("click",".bp-groups-remove-new-member",function(e){e.preventDefault(),o(e.target.parentNode).remove()}),o(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}),o("input#save").on("click",function(){var e=[];o("#bp-groups-new-members-list li").each(function(){e.push(o(this).data("login"))}),e.length&&o("#bp-groups-new-members").val("").val(e.join(", ")),window.warn_on_leave=!1}),window.onbeforeunload=function(){if(window.warn_on_leave)return BP_Group_Admin.warn_on_leave}})}(jQuery);
bp-groups/bp-groups-filters.php CHANGED
@@ -69,7 +69,7 @@ add_filter( 'bp_get_total_group_count_for_user', 'bp_core_number_format' );
69
  add_filter( 'bp_activity_at_name_do_notifications', 'bp_groups_disable_at_mention_notification_for_non_public_groups', 10, 4 );
70
 
71
  // Default group avatar.
72
- add_filter( 'bp_core_avatar_default', 'bp_groups_default_avatar', 10, 3 );
73
  add_filter( 'bp_core_avatar_default_thumb', 'bp_groups_default_avatar', 10, 3 );
74
 
75
  // Personal data export.
69
  add_filter( 'bp_activity_at_name_do_notifications', 'bp_groups_disable_at_mention_notification_for_non_public_groups', 10, 4 );
70
 
71
  // Default group avatar.
72
+ add_filter( 'bp_core_default_avatar', 'bp_groups_default_avatar', 10, 3 );
73
  add_filter( 'bp_core_avatar_default_thumb', 'bp_groups_default_avatar', 10, 3 );
74
 
75
  // Personal data export.
bp-groups/bp-groups-functions.php CHANGED
@@ -1669,9 +1669,9 @@ function groups_delete_invite( $user_id, $group_id, $inviter_id = false ) {
1669
  * @type bool $force_resend Whether to resend the email & notification if one has already been sent.
1670
  * }
1671
  */
1672
- function groups_send_invites( $args = array() ) {
1673
  // Backward compatibility with old method of passing arguments.
1674
- if ( ! is_array( $args ) || func_num_args() > 1 ) {
1675
  _deprecated_argument( __METHOD__, '5.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
1676
 
1677
  $old_args_keys = array(
@@ -1679,7 +1679,9 @@ function groups_send_invites( $args = array() ) {
1679
  1 => 'group_id',
1680
  );
1681
 
1682
- $args = bp_core_parse_args_array( $old_args_keys, func_get_args() );
 
 
1683
  }
1684
 
1685
  $r = bp_parse_args( $args, array(
@@ -2008,9 +2010,9 @@ function groups_remove_member( $user_id, $group_id ) {
2008
  * }
2009
  * @return bool True on success, false on failure.
2010
  */
2011
- function groups_send_membership_request( $args = array() ) {
2012
  // Backward compatibility with old method of passing arguments.
2013
- if ( ! is_array( $args ) || func_num_args() > 1 ) {
2014
  _deprecated_argument( __METHOD__, '5.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
2015
 
2016
  $old_args_keys = array(
@@ -2018,7 +2020,9 @@ function groups_send_membership_request( $args = array() ) {
2018
  1 => 'group_id',
2019
  );
2020
 
2021
- $args = bp_core_parse_args_array( $old_args_keys, func_get_args() );
 
 
2022
  }
2023
 
2024
  $r = bp_parse_args( $args, array(
@@ -2040,7 +2044,7 @@ function groups_send_membership_request( $args = array() ) {
2040
 
2041
  // If a new request was created, send the emails.
2042
  if ( $request_id && is_int( $request_id ) ) {
2043
- $invites_class->send_request_notification_by_id( $request_id );
2044
  $admins = groups_get_group_admins( $r['group_id'] );
2045
 
2046
  /**
1669
  * @type bool $force_resend Whether to resend the email & notification if one has already been sent.
1670
  * }
1671
  */
1672
+ function groups_send_invites( ...$args ) {
1673
  // Backward compatibility with old method of passing arguments.
1674
+ if ( ! is_array( $args[0] ) || count( $args ) > 1 ) {
1675
  _deprecated_argument( __METHOD__, '5.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
1676
 
1677
  $old_args_keys = array(
1679
  1 => 'group_id',
1680
  );
1681
 
1682
+ $args = bp_core_parse_args_array( $old_args_keys, $args );
1683
+ } else {
1684
+ $args = reset( $args );
1685
  }
1686
 
1687
  $r = bp_parse_args( $args, array(
2010
  * }
2011
  * @return bool True on success, false on failure.
2012
  */
2013
+ function groups_send_membership_request( ...$args ) {
2014
  // Backward compatibility with old method of passing arguments.
2015
+ if ( ! is_array( $args[0] ) || count( $args ) > 1 ) {
2016
  _deprecated_argument( __METHOD__, '5.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
2017
 
2018
  $old_args_keys = array(
2020
  1 => 'group_id',
2021
  );
2022
 
2023
+ $args = bp_core_parse_args_array( $old_args_keys, $args );
2024
+ } else {
2025
+ $args = reset( $args );
2026
  }
2027
 
2028
  $r = bp_parse_args( $args, array(
2044
 
2045
  // If a new request was created, send the emails.
2046
  if ( $request_id && is_int( $request_id ) ) {
2047
+ $invites_class->send_request_notification_by_id( $request_id, $r );
2048
  $admins = groups_get_group_admins( $r['group_id'] );
2049
 
2050
  /**
bp-groups/bp-groups-notifications.php CHANGED
@@ -382,7 +382,7 @@ function groups_notification_group_invites( &$group, &$member, $inviter_user_id
382
  * @param int $secondary_item_id The secondary item ID.
383
  * @param int $total_items The total number of messaging-related notifications
384
  * waiting for the user.
385
- * @param string $format 'string' for BuddyBar-compatible notifications; 'array'
386
  * for WP Toolbar. Default: 'string'.
387
  * @return string
388
  */
382
  * @param int $secondary_item_id The secondary item ID.
383
  * @param int $total_items The total number of messaging-related notifications
384
  * waiting for the user.
385
+ * @param string $format 'string' for notification HTML link or 'array' for separate link and text.
386
  * for WP Toolbar. Default: 'string'.
387
  * @return string
388
  */
bp-groups/bp-groups-template.php CHANGED
@@ -6033,8 +6033,8 @@ function bp_group_invite_pagination_count() {
6033
  if ( 1 == $invites_template->total_invite_count ) {
6034
  $message = __( 'Viewing 1 invitation', 'buddypress' );
6035
  } else {
6036
- /* translators: 1: group invite from number. 2: group invite to number. 3: total group invites. */
6037
- $message = sprintf( _n( 'Viewing %1$s - %2$s of %3$s invitation', 'Viewing %1$s - %2$s of %3$s invitations', $invites_template->total_invite_count, 'buddypress' ), $from_num, $to_num, $total );
6038
  }
6039
 
6040
  /** This filter is documented in bp-groups/bp-groups-template.php */
6033
  if ( 1 == $invites_template->total_invite_count ) {
6034
  $message = __( 'Viewing 1 invitation', 'buddypress' );
6035
  } else {
6036
+ /* translators: 1: Invitations from number. 2: Invitations to number. 3: Total invitations. */
6037
+ $message = sprintf( _nx( 'Viewing %1$s - %2$s of %3$s invitation', 'Viewing %1$s - %2$s of %3$s invitations', $invites_template->total_invite_count, 'Group invites pagination', 'buddypress' ), $from_num, $to_num, $total );
6038
  }
6039
 
6040
  /** This filter is documented in bp-groups/bp-groups-template.php */
bp-groups/classes/class-bp-groups-component.php CHANGED
@@ -594,7 +594,7 @@ class BP_Groups_Component extends BP_Component {
594
  bp_core_new_nav_item( array(
595
  'name' => __( 'Memberships', 'buddypress' ),
596
  'slug' => $this->current_group->slug,
597
- 'position' => -1, // Do not show in BuddyBar.
598
  'screen_function' => 'groups_screen_group_home',
599
  'default_subnav_slug' => $this->default_extension,
600
  'item_css_id' => $this->id
594
  bp_core_new_nav_item( array(
595
  'name' => __( 'Memberships', 'buddypress' ),
596
  'slug' => $this->current_group->slug,
597
+ 'position' => -1, // Do not show into the navigation.
598
  'screen_function' => 'groups_screen_group_home',
599
  'default_subnav_slug' => $this->default_extension,
600
  'item_css_id' => $this->id
bp-groups/classes/class-bp-rest-attachments-group-avatar-endpoint.php CHANGED
@@ -428,32 +428,36 @@ class BP_REST_Attachments_Group_Avatar_Endpoint extends WP_REST_Controller {
428
  * @return array
429
  */
430
  public function get_item_schema() {
431
- $schema = array(
432
- '$schema' => 'http://json-schema.org/draft-04/schema#',
433
- 'title' => 'bp_attachments_group_avatar',
434
- 'type' => 'object',
435
- 'properties' => array(
436
- 'full' => array(
437
- 'context' => array( 'view', 'edit' ),
438
- 'description' => __( 'Full size of the image file.', 'buddypress' ),
439
- 'type' => 'string',
440
- 'readonly' => true,
441
- ),
442
- 'thumb' => array(
443
- 'context' => array( 'view', 'edit' ),
444
- 'description' => __( 'Thumb size of the image file.', 'buddypress' ),
445
- 'type' => 'string',
446
- 'readonly' => true,
 
 
 
 
447
  ),
448
- ),
449
- );
450
 
451
  /**
452
- * Filters the group avatar schema.
453
  *
454
- * @param string $schema The endpoint schema.
455
  */
456
- return apply_filters( 'bp_rest_attachments_group_avatar_schema', $this->add_additional_fields_schema( $schema ) );
457
  }
458
 
459
  /**
428
  * @return array
429
  */
430
  public function get_item_schema() {
431
+ if ( is_null( $this->schema ) ) {
432
+ $this->schema = array(
433
+ '$schema' => 'http://json-schema.org/draft-04/schema#',
434
+ 'title' => 'bp_attachments_group_avatar',
435
+ 'type' => 'object',
436
+ 'properties' => array(
437
+ 'full' => array(
438
+ 'context' => array( 'view', 'edit' ),
439
+ 'description' => __( 'Full size of the image file.', 'buddypress' ),
440
+ 'type' => 'string',
441
+ 'format' => 'uri',
442
+ 'readonly' => true,
443
+ ),
444
+ 'thumb' => array(
445
+ 'context' => array( 'view', 'edit' ),
446
+ 'description' => __( 'Thumb size of the image file.', 'buddypress' ),
447
+ 'type' => 'string',
448
+ 'format' => 'uri',
449
+ 'readonly' => true,
450
+ ),
451
  ),
452
+ );
453
+ }
454
 
455
  /**
456
+ * Filters the attachments group avatar schema.
457
  *
458
+ * @param array $schema The endpoint schema.
459
  */
460
+ return apply_filters( 'bp_rest_attachments_group_avatar_schema', $this->add_additional_fields_schema( $this->schema ) );
461
  }
462
 
463
  /**
bp-groups/classes/class-bp-rest-attachments-group-cover-endpoint.php CHANGED
@@ -411,26 +411,28 @@ class BP_REST_Attachments_Group_Cover_Endpoint extends WP_REST_Controller {
411
  * @return array
412
  */
413
  public function get_item_schema() {
414
- $schema = array(
415
- '$schema' => 'http://json-schema.org/draft-04/schema#',
416
- 'title' => 'bp_attachments_group_cover',
417
- 'type' => 'object',
418
- 'properties' => array(
419
- 'image' => array(
420
- 'context' => array( 'view', 'edit' ),
421
- 'description' => __( 'Full size of the image file.', 'buddypress' ),
422
- 'type' => 'string',
423
- 'format' => 'uri',
424
- 'readonly' => true,
 
 
425
  ),
426
- ),
427
- );
428
 
429
  /**
430
- * Filters the group cover schema.
431
  *
432
- * @param string $schema The endpoint schema.
433
  */
434
- return apply_filters( 'bp_rest_attachments_group_cover_schema', $this->add_additional_fields_schema( $schema ) );
435
  }
436
  }
411
  * @return array
412
  */
413
  public function get_item_schema() {
414
+ if ( is_null( $this->schema ) ) {
415
+ $this->schema = array(
416
+ '$schema' => 'http://json-schema.org/draft-04/schema#',
417
+ 'title' => 'bp_attachments_group_cover',
418
+ 'type' => 'object',
419
+ 'properties' => array(
420
+ 'image' => array(
421
+ 'context' => array( 'view', 'edit' ),
422
+ 'description' => __( 'Full size of the image file.', 'buddypress' ),
423
+ 'type' => 'string',
424
+ 'format' => 'uri',
425
+ 'readonly' => true,
426
+ ),
427
  ),
428
+ );
429
+ }
430
 
431
  /**
432
+ * Filters the attachments group cover schema.
433
  *
434
+ * @param array $schema The endpoint schema.
435
  */
436
+ return apply_filters( 'bp_rest_attachments_group_cover_schema', $this->add_additional_fields_schema( $this->schema ) );
437
  }
438
  }
bp-groups/classes/class-bp-rest-group-invites-endpoint.php CHANGED
@@ -940,82 +940,84 @@ class BP_REST_Group_Invites_Endpoint extends WP_REST_Controller {
940
  * @return array
941
  */
942
  public function get_item_schema() {
943
- $schema = array(
944
- '$schema' => 'http://json-schema.org/draft-04/schema#',
945
- 'title' => 'bp_group_invites',
946
- 'type' => 'object',
947
- 'properties' => array(
948
- 'id' => array(
949
- 'context' => array( 'view', 'edit' ),
950
- 'description' => __( 'A unique numeric ID for the BP Invitation object.', 'buddypress' ),
951
- 'type' => 'integer',
952
- 'readonly' => true,
953
- ),
954
- 'user_id' => array(
955
- 'context' => array( 'view', 'edit' ),
956
- 'description' => __( 'The ID of the user who is invited to join the Group.', 'buddypress' ),
957
- 'type' => 'integer',
958
- ),
959
- 'invite_sent' => array(
960
- 'context' => array( 'view', 'edit' ),
961
- 'description' => __( 'Whether the invite has been sent to the invitee.', 'buddypress' ),
962
- 'type' => 'boolean',
963
- ),
964
- 'inviter_id' => array(
965
- 'context' => array( 'view', 'edit' ),
966
- 'description' => __( 'The ID of the user who made the invite.', 'buddypress' ),
967
- 'type' => 'integer',
968
- ),
969
- 'group_id' => array(
970
- 'context' => array( 'view', 'edit' ),
971
- 'description' => __( 'The ID of the group to which the user has been invited.', 'buddypress' ),
972
- 'type' => 'integer',
973
- ),
974
- 'date_modified' => array(
975
- 'context' => array( 'view', 'edit' ),
976
- 'description' => __( "The date the object was created or last updated, in the site's timezone.", 'buddypress' ),
977
- 'type' => 'string',
978
- 'format' => 'date-time',
979
- ),
980
- 'type' => array(
981
- 'context' => array( 'view', 'edit' ),
982
- 'description' => __( 'Invitation or request.', 'buddypress' ),
983
- 'type' => 'string',
984
- 'enum' => array( 'invite', 'request' ),
985
- 'default' => 'invite',
986
- ),
987
- 'message' => array(
988
- 'context' => array( 'view', 'edit' ),
989
- 'description' => __( 'The raw and rendered versions for the content of the message.', 'buddypress' ),
990
- 'type' => 'object',
991
- 'arg_options' => array(
992
- 'sanitize_callback' => null,
993
- 'validate_callback' => null,
994
  ),
995
- 'properties' => array(
996
- 'raw' => array(
997
- 'description' => __( 'Content for the object, as it exists in the database.', 'buddypress' ),
998
- 'type' => 'string',
999
- 'context' => array( 'view', 'edit' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1000
  ),
1001
- 'rendered' => array(
1002
- 'description' => __( 'HTML content for the object, transformed for display.', 'buddypress' ),
1003
- 'type' => 'string',
1004
- 'context' => array( 'view', 'edit' ),
1005
- 'readonly' => true,
 
 
 
 
 
 
 
1006
  ),
1007
  ),
1008
- ),
1009
 
1010
- ),
1011
- );
 
1012
 
1013
  /**
1014
  * Filters the group invites schema.
1015
  *
1016
  * @param array $schema The endpoint schema.
1017
  */
1018
- return apply_filters( 'bp_rest_group_invites_schema', $this->add_additional_fields_schema( $schema ) );
1019
  }
1020
 
1021
  /**
940
  * @return array
941
  */
942
  public function get_item_schema() {
943
+ if ( is_null( $this->schema ) ) {
944
+ $this->schema = array(
945
+ '$schema' => 'http://json-schema.org/draft-04/schema#',
946
+ 'title' => 'bp_group_invites',
947
+ 'type' => 'object',
948
+ 'properties' => array(
949
+ 'id' => array(
950
+ 'context' => array( 'view', 'edit' ),
951
+ 'description' => __( 'A unique numeric ID for the BP Invitation object.', 'buddypress' ),
952
+ 'type' => 'integer',
953
+ 'readonly' => true,
954
+ ),
955
+ 'user_id' => array(
956
+ 'context' => array( 'view', 'edit' ),
957
+ 'description' => __( 'The ID of the user who is invited to join the Group.', 'buddypress' ),
958
+ 'type' => 'integer',
959
+ ),
960
+ 'invite_sent' => array(
961
+ 'context' => array( 'view', 'edit' ),
962
+ 'description' => __( 'Whether the invite has been sent to the invitee.', 'buddypress' ),
963
+ 'type' => 'boolean',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
964
  ),
965
+ 'inviter_id' => array(
966
+ 'context' => array( 'view', 'edit' ),
967
+ 'description' => __( 'The ID of the user who made the invite.', 'buddypress' ),
968
+ 'type' => 'integer',
969
+ ),
970
+ 'group_id' => array(
971
+ 'context' => array( 'view', 'edit' ),
972
+ 'description' => __( 'The ID of the group to which the user has been invited.', 'buddypress' ),
973
+ 'type' => 'integer',
974
+ ),
975
+ 'date_modified' => array(
976
+ 'context' => array( 'view', 'edit' ),
977
+ 'description' => __( "The date the object was created or last updated, in the site's timezone.", 'buddypress' ),
978
+ 'type' => 'string',
979
+ 'format' => 'date-time',
980
+ ),
981
+ 'type' => array(
982
+ 'context' => array( 'view', 'edit' ),
983
+ 'description' => __( 'Invitation or request.', 'buddypress' ),
984
+ 'type' => 'string',
985
+ 'enum' => array( 'invite', 'request' ),
986
+ 'default' => 'invite',
987
+ ),
988
+ 'message' => array(
989
+ 'context' => array( 'view', 'edit' ),
990
+ 'description' => __( 'The raw and rendered versions for the content of the message.', 'buddypress' ),
991
+ 'type' => 'object',
992
+ 'arg_options' => array(
993
+ 'sanitize_callback' => null,
994
+ 'validate_callback' => null,
995
  ),
996
+ 'properties' => array(
997
+ 'raw' => array(
998
+ 'description' => __( 'Content for the object, as it exists in the database.', 'buddypress' ),
999
+ 'type' => 'string',
1000
+ 'context' => array( 'view', 'edit' ),
1001
+ ),
1002
+ 'rendered' => array(
1003
+ 'description' => __( 'HTML content for the object, transformed for display.', 'buddypress' ),
1004
+ 'type' => 'string',
1005
+ 'context' => array( 'view', 'edit' ),
1006
+ 'readonly' => true,
1007
+ ),
1008
  ),
1009
  ),
 
1010
 
1011
+ ),
1012
+ );
1013
+ }
1014
 
1015
  /**
1016
  * Filters the group invites schema.
1017
  *
1018
  * @param array $schema The endpoint schema.
1019
  */
1020
+ return apply_filters( 'bp_rest_group_invites_schema', $this->add_additional_fields_schema( $this->schema ) );
1021
  }
1022
 
1023
  /**
bp-groups/classes/class-bp-rest-group-membership-endpoint.php CHANGED
@@ -120,9 +120,8 @@ class BP_REST_Group_Membership_Endpoint extends WP_REST_Controller {
120
  * @return WP_REST_Response
121
  */
122
  public function get_items( $request ) {
123
- $group = $this->groups_endpoint->get_group_object( $request['group_id'] );
124
-
125
- $args = array(
126
  'group_id' => $group->id,
127
  'group_role' => $request['roles'],
128
  'type' => $request['status'],
@@ -416,7 +415,7 @@ class BP_REST_Group_Membership_Endpoint extends WP_REST_Controller {
416
  )
417
  );
418
  }
419
- } elseif ( in_array( $action, [ 'demote', 'ban', 'unban' ], true ) ) {
420
  if ( ! $group_member->$action() ) {
421
  $messages = array(
422
  'demote' => __( 'Could not demote member from the group.', 'buddypress' ),
@@ -503,15 +502,15 @@ class BP_REST_Group_Membership_Endpoint extends WP_REST_Controller {
503
  $group = $this->groups_endpoint->get_group_object( $request['group_id'] );
504
 
505
  if ( ! $group instanceof BP_Groups_Group ) {
506
- $retval = new WP_Error(
507
  'bp_rest_group_invalid_id',
508
  __( 'Invalid group ID.', 'buddypress' ),
509
- array(
510
  'status' => 404,
511
- )
512
- );
513
  } elseif ( bp_current_user_can( 'bp_moderate' ) ) {
514
- $retval = true;
515
  } elseif ( in_array( $request['action'], array( 'ban', 'unban', 'promote', 'demote' ), true ) ) {
516
  if ( groups_is_user_admin( $loggedin_user_id, $group->id ) ) {
517
  if ( $loggedin_user_id !== $user->ID ) {
@@ -699,14 +698,16 @@ class BP_REST_Group_Membership_Endpoint extends WP_REST_Controller {
699
  * @return WP_REST_Response
700
  */
701
  public function prepare_item_for_response( $group_member, $request ) {
702
- $user = bp_rest_get_user( $group_member->user_id );
703
- $context = ! empty( $request['context'] ) ? $request['context'] : 'view';
704
- $member_data = $this->members_endpoint->user_data( $user, $context, $request );
 
705
 
706
  // Merge both info.
707
  $data = array_merge(
708
  $member_data,
709
  array(
 
710
  'is_mod' => (bool) $group_member->is_mod,
711
  'is_admin' => (bool) $group_member->is_admin,
712
  'is_banned' => (bool) $group_member->is_banned,
@@ -719,7 +720,7 @@ class BP_REST_Group_Membership_Endpoint extends WP_REST_Controller {
719
  $data = $this->filter_response_by_context( $data, $context );
720
  $response = rest_ensure_response( $data );
721
 
722
- $response->add_links( $this->prepare_links( $user ) );
723
 
724
  /**
725
  * Filter a group member value returned from the API.
@@ -738,20 +739,23 @@ class BP_REST_Group_Membership_Endpoint extends WP_REST_Controller {
738
  *
739
  * @since 5.0.0
740
  *
741
- * @param WP_User $user User object.
742
  * @return array
743
  */
744
- protected function prepare_links( $user ) {
745
- $base = sprintf( '/%s/%s/', $this->namespace, $this->rest_base );
746
- $url = $base . $user->ID;
747
 
748
  // Entity meta.
749
  $links = array(
750
  'self' => array(
751
- 'href' => rest_url( $url ),
752
  ),
753
  'collection' => array(
754
- 'href' => rest_url( $base ),
 
 
 
 
755
  ),
756
  );
757
 
@@ -760,10 +764,10 @@ class BP_REST_Group_Membership_Endpoint extends WP_REST_Controller {
760
  *
761
  * @since 5.0.0
762
  *
763
- * @param array $links The prepared links of the REST response.
764
- * @param WP_User $user User object.
765
  */
766
- return apply_filters( 'bp_rest_group_members_prepare_links', $links, $user );
767
  }
768
 
769
  /**
@@ -844,50 +848,61 @@ class BP_REST_Group_Membership_Endpoint extends WP_REST_Controller {
844
  * @return array
845
  */
846
  public function get_item_schema() {
 
847
 
848
- // Get schema from members.
849
- $schema = $this->members_endpoint->get_item_schema();
850
 
851
- // Set title to this endpoint.
852
- $schema['title'] = 'bp_group_members';
853
 
854
- $schema['properties']['is_mod'] = array(
855
- 'context' => array( 'view', 'edit' ),
856
- 'description' => __( 'Whether the member is a group moderator.', 'buddypress' ),
857
- 'type' => 'boolean',
858
- );
859
 
860
- $schema['properties']['is_banned'] = array(
861
- 'context' => array( 'view', 'edit' ),
862
- 'description' => __( 'Whether the member has been banned from the group.', 'buddypress' ),
863
- 'type' => 'boolean',
864
- );
865
 
866
- $schema['properties']['is_admin'] = array(
867
- 'context' => array( 'view', 'edit' ),
868
- 'description' => __( 'Whether the member is a group administrator.', 'buddypress' ),
869
- 'type' => 'boolean',
870
- );
871
 
872
- $schema['properties']['is_confirmed'] = array(
873
- 'context' => array( 'view', 'edit' ),
874
- 'description' => __( 'Whether the membership of this user has been confirmed.', 'buddypress' ),
875
- 'type' => 'boolean',
876
- );
877
 
878
- $schema['properties']['date_modified'] = array(
879
- 'context' => array( 'view', 'edit' ),
880
- 'description' => __( "The date of the last time the membership of this user was modified, in the site's timezone.", 'buddypress' ),
881
- 'type' => 'string',
882
- 'format' => 'date-time',
883
- );
 
 
 
 
 
 
 
 
 
 
884
 
885
  /**
886
  * Filters the group membership schema.
887
  *
888
  * @param array $schema The endpoint schema.
889
  */
890
- return apply_filters( 'bp_rest_group_members_schema', $this->add_additional_fields_schema( $schema ) );
891
  }
892
 
893
  /**
120
  * @return WP_REST_Response
121
  */
122
  public function get_items( $request ) {
123
+ $group = $this->groups_endpoint->get_group_object( $request->get_param( 'group_id' ) );
124
+ $args = array(
 
125
  'group_id' => $group->id,
126
  'group_role' => $request['roles'],
127
  'type' => $request['status'],
415
  )
416
  );
417
  }
418
+ } elseif ( in_array( $action, array( 'demote', 'ban', 'unban' ), true ) ) {
419
  if ( ! $group_member->$action() ) {
420
  $messages = array(
421
  'demote' => __( 'Could not demote member from the group.', 'buddypress' ),
502
  $group = $this->groups_endpoint->get_group_object( $request['group_id'] );
503
 
504
  if ( ! $group instanceof BP_Groups_Group ) {
505
+ $retval = new WP_Error(
506
  'bp_rest_group_invalid_id',
507
  __( 'Invalid group ID.', 'buddypress' ),
508
+ array(
509
  'status' => 404,
510
+ )
511
+ );
512
  } elseif ( bp_current_user_can( 'bp_moderate' ) ) {
513
+ $retval = true;
514
  } elseif ( in_array( $request['action'], array( 'ban', 'unban', 'promote', 'demote' ), true ) ) {
515
  if ( groups_is_user_admin( $loggedin_user_id, $group->id ) ) {
516
  if ( $loggedin_user_id !== $user->ID ) {
698
  * @return WP_REST_Response
699
  */
700
  public function prepare_item_for_response( $group_member, $request ) {
701
+ $user = bp_rest_get_user( $group_member->user_id );
702
+ $context = ! empty( $request['context'] ) ? $request['context'] : 'view';
703
+ $member_data = $this->members_endpoint->user_data( $user, $context, $request );
704
+ $group_member->group_id = $request->get_param( 'group_id' );
705
 
706
  // Merge both info.
707
  $data = array_merge(
708
  $member_data,
709
  array(
710
+ 'group' => (int) $group_member->group_id,
711
  'is_mod' => (bool) $group_member->is_mod,
712
  'is_admin' => (bool) $group_member->is_admin,
713
  'is_banned' => (bool) $group_member->is_banned,
720
  $data = $this->filter_response_by_context( $data, $context );
721
  $response = rest_ensure_response( $data );
722
 
723
+ $response->add_links( $this->prepare_links( $group_member ) );
724
 
725
  /**
726
  * Filter a group member value returned from the API.
739
  *
740
  * @since 5.0.0
741
  *
742
+ * @param BP_Groups_Member $group_member Group member object.
743
  * @return array
744
  */
745
+ protected function prepare_links( $group_member ) {
746
+ $base = sprintf( '/%s/%s', $this->namespace, $this->rest_base );
 
747
 
748
  // Entity meta.
749
  $links = array(
750
  'self' => array(
751
+ 'href' => rest_url( bp_rest_get_user_url( $group_member->user_id ) ),
752
  ),
753
  'collection' => array(
754
+ 'href' => rest_url( sprintf( '/%s/%d/members', $base, $group_member->group_id ) ),
755
+ ),
756
+ 'group' => array(
757
+ 'href' => rest_url( sprintf( '/%s/%d', $base, $group_member->group_id ) ),
758
+ 'embeddable' => true,
759
  ),
760
  );
761
 
764
  *
765
  * @since 5.0.0
766
  *
767
+ * @param array $ links The prepared links of the REST response.
768
+ * @param BP_Groups_Member $group_member Group member object.
769
  */
770
+ return apply_filters( 'bp_rest_group_members_prepare_links', $links, $group_member );
771
  }
772
 
773
  /**
848
  * @return array
849
  */
850
  public function get_item_schema() {
851
+ if ( is_null( $this->schema ) ) {
852
 
853
+ // Get schema from members.
854
+ $schema = $this->members_endpoint->get_item_schema();
855
 
856
+ // Set title to this endpoint.
857
+ $schema['title'] = 'bp_group_members';
858
 
859
+ $schema['properties']['group_id'] = array(
860
+ 'context' => array( 'view', 'edit', 'embed' ),
861
+ 'description' => __( 'A unique numeric ID for the Group.', 'buddypress' ),
862
+ 'type' => 'integer',
863
+ );
864
 
865
+ $schema['properties']['is_mod'] = array(
866
+ 'context' => array( 'view', 'edit' ),
867
+ 'description' => __( 'Whether the member is a group moderator.', 'buddypress' ),
868
+ 'type' => 'boolean',
869
+ );
870
 
871
+ $schema['properties']['is_banned'] = array(
872
+ 'context' => array( 'view', 'edit' ),
873
+ 'description' => __( 'Whether the member has been banned from the group.', 'buddypress' ),
874
+ 'type' => 'boolean',
875
+ );
876
 
877
+ $schema['properties']['is_admin'] = array(
878
+ 'context' => array( 'view', 'edit' ),
879
+ 'description' => __( 'Whether the member is a group administrator.', 'buddypress' ),
880
+ 'type' => 'boolean',
881
+ );
882
 
883
+ $schema['properties']['is_confirmed'] = array(
884
+ 'context' => array( 'view', 'edit' ),
885
+ 'description' => __( 'Whether the membership of this user has been confirmed.', 'buddypress' ),
886
+ 'type' => 'boolean',
887
+ );
888
+
889
+ $schema['properties']['date_modified'] = array(
890
+ 'context' => array( 'view', 'edit' ),
891
+ 'description' => __( "The date of the last time the membership of this user was modified, in the site's timezone.", 'buddypress' ),
892
+ 'type' => 'string',
893
+ 'format' => 'date-time',
894
+ );
895
+
896
+ // Cache current schema here.
897
+ $this->schema = $schema;
898
+ }
899
 
900
  /**
901
  * Filters the group membership schema.
902
  *
903
  * @param array $schema The endpoint schema.
904
  */
905
+ return apply_filters( 'bp_rest_group_members_schema', $this->add_additional_fields_schema( $this->schema ) );
906
  }
907
 
908
  /**
bp-groups/classes/class-bp-rest-group-membership-request-endpoint.php CHANGED
@@ -852,27 +852,32 @@ class BP_REST_Group_Membership_Request_Endpoint extends WP_REST_Controller {
852
  * @return array
853
  */
854
  public function get_item_schema() {
 
855
 
856
- // Get schema from the membership endpoint.
857
- $schema = $this->invites_endpoint->get_item_schema();
858
 
859
- // Set title to this endpoint.
860
- $schema['title'] = 'bp_group_membership_request';
861
 
862
- // Adapt some item schema property descriptions to this endpoint.
863
- $schema['properties']['user_id']['description'] = __( 'The ID of the user who requested a Group membership.', 'buddypress' );
864
- $schema['properties']['group_id']['description'] = __( 'The ID of the group the user requested a membership for.', 'buddypress' );
865
- $schema['properties']['type']['default'] = 'request';
866
 
867
- // Remove unused properties.
868
- unset( $schema['properties']['invite_sent'], $schema['properties']['inviter_id'] );
 
 
 
 
869
 
870
  /**
871
  * Filters the group membership request schema.
872
  *
873
  * @param array $schema The endpoint schema.
874
  */
875
- return apply_filters( 'bp_rest_group_membership_requests_schema', $this->add_additional_fields_schema( $schema ) );
876
  }
877
 
878
  /**
852
  * @return array
853
  */
854
  public function get_item_schema() {
855
+ if ( is_null( $this->schema ) ) {
856
 
857
+ // Get schema from the membership endpoint.
858
+ $schema = $this->invites_endpoint->get_item_schema();
859
 
860
+ // Set title to this endpoint.
861
+ $schema['title'] = 'bp_group_membership_request';
862
 
863
+ // Adapt some item schema property descriptions to this endpoint.
864
+ $schema['properties']['user_id']['description'] = __( 'The ID of the user who requested a Group membership.', 'buddypress' );
865
+ $schema['properties']['group_id']['description'] = __( 'The ID of the group the user requested a membership for.', 'buddypress' );
866
+ $schema['properties']['type']['default'] = 'request';
867
 
868
+ // Remove unused properties.
869
+ unset( $schema['properties']['invite_sent'], $schema['properties']['inviter_id'] );
870
+
871
+ // Cache current schema here.
872
+ $this->schema = $schema;
873
+ }
874
 
875
  /**
876
  * Filters the group membership request schema.
877
  *
878
  * @param array $schema The endpoint schema.
879
  */
880
+ return apply_filters( 'bp_rest_group_membership_requests_schema', $this->add_additional_fields_schema( $this->schema ) );
881
  }
882
 
883
  /**
bp-groups/classes/class-bp-rest-groups-endpoint.php CHANGED
@@ -740,11 +740,8 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
740
  'last_activity_diff' => null,
741
  );
742
 
743
- // Get item schema.
744
- $schema = $this->get_item_schema();
745
-
746
- // Avatars.
747
- if ( ! empty( $schema['properties']['avatar_urls'] ) ) {
748
  $data['avatar_urls'] = array(
749
  'full' => bp_core_fetch_avatar(
750
  array(
@@ -960,12 +957,20 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
960
  'collection' => array(
961
  'href' => rest_url( $base ),
962
  ),
963
- 'user' => array(
964
  'href' => rest_url( bp_rest_get_user_url( $group->creator_id ) ),
965
  'embeddable' => true,
966
  ),
967
  );
968
 
 
 
 
 
 
 
 
 
969
  /**
970
  * Filter links prepared for the REST response.
971
  *
@@ -1124,174 +1129,178 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
1124
  * @return array
1125
  */
1126
  public function get_item_schema() {
1127
- $schema = array(
1128
- '$schema' => 'http://json-schema.org/draft-04/schema#',
1129
- 'title' => 'bp_groups',
1130
- 'type' => 'object',
1131
- 'properties' => array(
1132
- 'id' => array(
1133
- 'context' => array( 'view', 'edit' ),
1134
- 'description' => __( 'A unique numeric ID for the Group.', 'buddypress' ),
1135
- 'readonly' => true,
1136
- 'type' => 'integer',
1137
- ),
1138
- 'creator_id' => array(
1139
- 'context' => array( 'view', 'edit' ),
1140
- 'description' => __( 'The ID of the user who created the Group.', 'buddypress' ),
1141
- 'type' => 'integer',
1142
- 'default' => bp_loggedin_user_id(),
1143
- ),
1144
- 'name' => array(
1145
- 'context' => array( 'view', 'edit' ),
1146
- 'description' => __( 'The name of the Group.', 'buddypress' ),
1147
- 'type' => 'string',
1148
- 'required' => true,
1149
- 'arg_options' => array(
1150
- 'sanitize_callback' => 'sanitize_text_field',
1151
  ),
1152
- ),
1153
- 'slug' => array(
1154
- 'context' => array( 'view', 'edit' ),
1155
- 'description' => __( 'The URL-friendly slug for the Group.', 'buddypress' ),
1156
- 'type' => 'string',
1157
- 'arg_options' => array(
1158
- 'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database().
1159
  ),
1160
- ),
1161
- 'link' => array(
1162
- 'context' => array( 'view', 'edit' ),
1163
- 'description' => __( 'The permalink to the Group on the site.', 'buddypress' ),
1164
- 'type' => 'string',
1165
- 'format' => 'uri',
1166
- 'readonly' => true,
1167
- ),
1168
- 'description' => array(
1169
- 'context' => array( 'view', 'edit' ),
1170
- 'description' => __( 'The description of the Group.', 'buddypress' ),
1171
- 'type' => 'object',
1172
- 'required' => true,
1173
- 'arg_options' => array(
1174
- 'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database().
1175
- 'validate_callback' => null, // Note: validation implemented in self::prepare_item_for_database().
1176
  ),
1177
- 'properties' => array(
1178
- 'raw' => array(
1179
- 'description' => __( 'Content for the description of the Group, as it exists in the database.', 'buddypress' ),
1180
- 'type' => 'string',
1181
- 'context' => array( 'view', 'edit' ),
 
 
 
 
 
 
 
 
 
 
1182
  ),
1183
- 'rendered' => array(
1184
- 'description' => __( 'HTML content for the description of the Group, transformed for display.', 'buddypress' ),
1185
- 'type' => 'string',
1186
- 'context' => array( 'view', 'edit' ),
1187
- 'readonly' => true,
 
 
 
 
 
 
 
1188
  ),
1189
  ),
1190
- ),
1191
- 'status' => array(
1192
- 'context' => array( 'view', 'edit' ),
1193
- 'description' => __( 'The status of the Group.', 'buddypress' ),
1194
- 'type' => 'string',
1195
- 'enum' => buddypress()->groups->valid_status,
1196
- 'default' => 'public',
1197
- 'arg_options' => array(
1198
- 'sanitize_callback' => 'sanitize_key',
1199
  ),
1200
- ),
1201
- 'enable_forum' => array(
1202
- 'context' => array( 'view', 'edit' ),
1203
- 'description' => __( 'Whether the Group has a forum enabled or not.', 'buddypress' ),
1204
- 'type' => 'boolean',
1205
- ),
1206
- 'parent_id' => array(
1207
- 'context' => array( 'view', 'edit' ),
1208
- 'description' => __( 'ID of the parent Group.', 'buddypress' ),
1209
- 'type' => 'integer',
1210
- ),
1211
- 'date_created' => array(
1212
- 'context' => array( 'view', 'edit' ),
1213
- 'description' => __( "The date the Group was created, in the site's timezone.", 'buddypress' ),
1214
- 'readonly' => true,
1215
- 'type' => 'string',
1216
- 'format' => 'date-time',
1217
- ),
1218
- 'types' => array(
1219
- 'context' => array( 'view', 'edit' ),
1220
- 'description' => __( 'The type(s) of the Group.', 'buddypress' ),
1221
- 'readonly' => true,
1222
- 'enum' => bp_groups_get_group_types(),
1223
- 'type' => 'array',
1224
- 'items' => array(
1225
- 'type' => 'string',
1226
  ),
1227
- ),
1228
- 'admins' => array(
1229
- 'context' => array( 'edit' ),
1230
- 'description' => __( 'Group administrators.', 'buddypress' ),
1231
- 'readonly' => true,
1232
- 'type' => 'array',
1233
- 'items' => array(
1234
- 'type' => 'object',
1235
  ),
1236
- ),
1237
- 'mods' => array(
1238
- 'context' => array( 'edit' ),
1239
- 'description' => __( 'Group moderators.', 'buddypress' ),
1240
- 'readonly' => true,
1241
- 'type' => 'array',
1242
- 'items' => array(
1243
- 'type' => 'object',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1244
  ),
1245
  ),
1246
- 'total_member_count' => array(
1247
- 'context' => array( 'view', 'edit' ),
1248
- 'description' => __( 'Count of all Group members.', 'buddypress' ),
1249
- 'readonly' => true,
1250
- 'type' => 'integer',
1251
- ),
1252
- 'last_activity' => array(
1253
- 'context' => array( 'view', 'edit' ),
1254
- 'description' => __( "The date the Group was last active, in the site's timezone.", 'buddypress' ),
1255
- 'type' => 'string',
1256
- 'readonly' => true,
1257
- 'format' => 'date-time',
1258
- ),
1259
- 'last_activity_diff' => array(
1260
- 'context' => array( 'view', 'edit' ),
1261
- 'description' => __( "The human diff time the Group was last active, in the site's timezone.", 'buddypress' ),
1262
- 'type' => 'string',
1263
- 'readonly' => true,
1264
- ),
1265
- ),
1266
- );
1267
 
1268
- // Avatars.
1269
- if ( ! bp_disable_group_avatar_uploads() ) {
1270
- $avatar_properties = array();
1271
 
1272
- $avatar_properties['full'] = array(
1273
- /* translators: 1: Full avatar width in pixels. 2: Full avatar height in pixels */
1274
- 'description' => sprintf( __( 'Avatar URL with full image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_full_width() ), number_format_i18n( bp_core_avatar_full_height() ) ),
1275
- 'type' => 'string',
1276
- 'format' => 'uri',
1277
- 'context' => array( 'view', 'edit' ),
1278
- );
1279
 
1280
- $avatar_properties['thumb'] = array(
1281
- /* translators: 1: Thumb avatar width in pixels. 2: Thumb avatar height in pixels */
1282
- 'description' => sprintf( __( 'Avatar URL with thumb image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_thumb_width() ), number_format_i18n( bp_core_avatar_thumb_height() ) ),
1283
- 'type' => 'string',
1284
- 'format' => 'uri',
1285
- 'context' => array( 'view', 'edit' ),
1286
- );
1287
 
1288
- $schema['properties']['avatar_urls'] = array(
1289
- 'description' => __( 'Avatar URLs for the group.', 'buddypress' ),
1290
- 'type' => 'object',
1291
- 'context' => array( 'view', 'edit' ),
1292
- 'readonly' => true,
1293
- 'properties' => $avatar_properties,
1294
- );
 
 
 
 
1295
  }
1296
 
1297
  /**
@@ -1299,7 +1308,7 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
1299
  *
1300
  * @param array $schema The endpoint schema.
1301
  */
1302
- return apply_filters( 'bp_rest_group_schema', $this->add_additional_fields_schema( $schema ) );
1303
  }
1304
 
1305
  /**
740
  'last_activity_diff' => null,
741
  );
742
 
743
+ // Return avatars, if allowed.
744
+ if ( true !== bp_disable_group_avatar_uploads() ) {
 
 
 
745
  $data['avatar_urls'] = array(
746
  'full' => bp_core_fetch_avatar(
747
  array(
957
  'collection' => array(
958
  'href' => rest_url( $base ),
959
  ),
960
+ 'user' => array(
961
  'href' => rest_url( bp_rest_get_user_url( $group->creator_id ) ),
962
  'embeddable' => true,
963
  ),
964
  );
965
 
966
+ // Embed parent group if available.
967
+ if ( ! empty( $group->parent ) ) {
968
+ $links['parent'] = array(
969
+ 'href' => rest_url( $base . $group->parent ),
970
+ 'embeddable' => true,
971
+ );
972
+ }
973
+
974
  /**
975
  * Filter links prepared for the REST response.
976
  *
1129
  * @return array
1130
  */
1131
  public function get_item_schema() {
1132
+ if ( is_null( $this->schema ) ) {
1133
+ $schema = array(
1134
+ '$schema' => 'http://json-schema.org/draft-04/schema#',
1135
+ 'title' => 'bp_groups',
1136
+ 'type' => 'object',
1137
+ 'properties' => array(
1138
+ 'id' => array(
1139
+ 'context' => array( 'view', 'edit', 'embed' ),
1140
+ 'description' => __( 'A unique numeric ID for the Group.', 'buddypress' ),
1141
+ 'readonly' => true,
1142
+ 'type' => 'integer',
 
 
 
 
 
 
 
 
 
 
 
 
 
1143
  ),
1144
+ 'creator_id' => array(
1145
+ 'context' => array( 'view', 'edit', 'embed' ),
1146
+ 'description' => __( 'The ID of the user who created the Group.', 'buddypress' ),
1147
+ 'type' => 'integer',
1148
+ 'default' => bp_loggedin_user_id(),
 
 
1149
  ),
1150
+ 'name' => array(
1151
+ 'context' => array( 'view', 'edit', 'embed' ),
1152
+ 'description' => __( 'The name of the Group.', 'buddypress' ),
1153
+ 'type' => 'string',
1154
+ 'required' => true,
1155
+ 'arg_options' => array(
1156
+ 'sanitize_callback' => 'sanitize_text_field',
1157
+ ),
1158
+ ),
1159
+ 'slug' => array(
1160
+ 'context' => array( 'view', 'edit', 'embed' ),
1161
+ 'description' => __( 'The URL-friendly slug for the Group.', 'buddypress' ),
1162
+ 'type' => 'string',
1163
+ 'arg_options' => array(
1164
+ 'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database().
1165
+ ),
1166
  ),
1167
+ 'link' => array(
1168
+ 'context' => array( 'view', 'edit', 'embed' ),
1169
+ 'description' => __( 'The permalink to the Group on the site.', 'buddypress' ),
1170
+ 'type' => 'string',
1171
+ 'format' => 'uri',
1172
+ 'readonly' => true,
1173
+ ),
1174
+ 'description' => array(
1175
+ 'context' => array( 'view', 'edit', 'embed' ),
1176
+ 'description' => __( 'The description of the Group.', 'buddypress' ),
1177
+ 'type' => 'object',
1178
+ 'required' => true,
1179
+ 'arg_options' => array(
1180
+ 'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database().
1181
+ 'validate_callback' => null, // Note: validation implemented in self::prepare_item_for_database().
1182
  ),
1183
+ 'properties' => array(
1184
+ 'raw' => array(
1185
+ 'description' => __( 'Content for the description of the Group, as it exists in the database.', 'buddypress' ),
1186
+ 'type' => 'string',
1187
+ 'context' => array( 'view', 'edit', 'embed' ),
1188
+ ),
1189
+ 'rendered' => array(
1190
+ 'description' => __( 'HTML content for the description of the Group, transformed for display.', 'buddypress' ),
1191
+ 'type' => 'string',
1192
+ 'context' => array( 'view', 'edit', 'embed' ),
1193
+ 'readonly' => true,
1194
+ ),
1195
  ),
1196
  ),
1197
+ 'status' => array(
1198
+ 'context' => array( 'view', 'edit', 'embed' ),
1199
+ 'description' => __( 'The status of the Group.', 'buddypress' ),
1200
+ 'type' => 'string',
1201
+ 'enum' => buddypress()->groups->valid_status,
1202
+ 'default' => 'public',
1203
+ 'arg_options' => array(
1204
+ 'sanitize_callback' => 'sanitize_key',
1205
+ ),
1206
  ),
1207
+ 'enable_forum' => array(
1208
+ 'context' => array( 'view', 'edit', 'embed' ),
1209
+ 'description' => __( 'Whether the Group has a forum enabled or not.', 'buddypress' ),
1210
+ 'type' => 'boolean',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1211
  ),
1212
+ 'parent_id' => array(
1213
+ 'context' => array( 'view', 'edit', 'embed' ),
1214
+ 'description' => __( 'ID of the parent Group.', 'buddypress' ),
1215
+ 'type' => 'integer',
 
 
 
 
1216
  ),
1217
+ 'date_created' => array(
1218
+ 'context' => array( 'view', 'edit', 'embed' ),
1219
+ 'description' => __( "The date the Group was created, in the site's timezone.", 'buddypress' ),
1220
+ 'readonly' => true,
1221
+ 'type' => 'string',
1222
+ 'format' => 'date-time',
1223
+ ),
1224
+ 'types' => array(
1225
+ 'context' => array( 'view', 'edit', 'embed' ),
1226
+ 'description' => __( 'The type(s) of the Group.', 'buddypress' ),
1227
+ 'readonly' => true,
1228
+ 'enum' => bp_groups_get_group_types(),
1229
+ 'type' => 'array',
1230
+ 'items' => array(
1231
+ 'type' => 'string',
1232
+ ),
1233
+ ),
1234
+ 'admins' => array(
1235
+ 'context' => array( 'edit' ),
1236
+ 'description' => __( 'Group administrators.', 'buddypress' ),
1237
+ 'readonly' => true,
1238
+ 'type' => 'array',
1239
+ 'items' => array(
1240
+ 'type' => 'object',
1241
+ ),
1242
+ ),
1243
+ 'mods' => array(
1244
+ 'context' => array( 'edit' ),
1245
+ 'description' => __( 'Group moderators.', 'buddypress' ),
1246
+ 'readonly' => true,
1247
+ 'type' => 'array',
1248
+ 'items' => array(
1249
+ 'type' => 'object',
1250
+ ),
1251
+ ),
1252
+ 'total_member_count' => array(
1253
+ 'context' => array( 'view', 'edit', 'embed' ),
1254
+ 'description' => __( 'Count of all Group members.', 'buddypress' ),
1255
+ 'readonly' => true,
1256
+ 'type' => 'integer',
1257
+ ),
1258
+ 'last_activity' => array(
1259
+ 'context' => array( 'view', 'edit', 'embed' ),
1260
+ 'description' => __( "The date the Group was last active, in the site's timezone.", 'buddypress' ),
1261
+ 'type' => 'string',
1262
+ 'readonly' => true,
1263
+ 'format' => 'date-time',
1264
+ ),
1265
+ 'last_activity_diff' => array(
1266
+ 'context' => array( 'view', 'edit', 'embed' ),
1267
+ 'description' => __( "The human diff time the Group was last active, in the site's timezone.", 'buddypress' ),
1268
+ 'type' => 'string',
1269
+ 'readonly' => true,
1270
  ),
1271
  ),
1272
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1273
 
1274
+ if ( true !== bp_disable_group_avatar_uploads() ) {
1275
+ $avatar_properties = array();
 
1276
 
1277
+ $avatar_properties['full'] = array(
1278
+ /* translators: 1: Full avatar width in pixels. 2: Full avatar height in pixels */
1279
+ 'description' => sprintf( __( 'Avatar URL with full image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_full_width() ), number_format_i18n( bp_core_avatar_full_height() ) ),
1280
+ 'type' => 'string',
1281
+ 'format' => 'uri',
1282
+ 'context' => array( 'view', 'edit', 'embed' ),
1283
+ );
1284
 
1285
+ $avatar_properties['thumb'] = array(
1286
+ /* translators: 1: Thumb avatar width in pixels. 2: Thumb avatar height in pixels */
1287
+ 'description' => sprintf( __( 'Avatar URL with thumb image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_thumb_width() ), number_format_i18n( bp_core_avatar_thumb_height() ) ),
1288
+ 'type' => 'string',
1289
+ 'format' => 'uri',
1290
+ 'context' => array( 'view', 'edit', 'embed' ),
1291
+ );
1292
 
1293
+ $schema['properties']['avatar_urls'] = array(
1294
+ 'description' => __( 'Avatar URLs for the group.', 'buddypress' ),
1295
+ 'type' => 'object',
1296
+ 'context' => array( 'view', 'edit', 'embed' ),
1297
+ 'readonly' => true,
1298
+ 'properties' => $avatar_properties,
1299
+ );
1300
+ }
1301
+
1302
+ // Cache current schema here.
1303
+ $this->schema = $schema;
1304
  }
1305
 
1306
  /**
1308
  *
1309
  * @param array $schema The endpoint schema.
1310
  */
1311
+ return apply_filters( 'bp_rest_group_schema', $this->add_additional_fields_schema( $this->schema ) );
1312
  }
1313
 
1314
  /**
bp-groups/js/manage-members.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t,i){"undefined"!=typeof bpGroupManageMembersSettings&&t.isRestEnabled&&(_.extend(t,_.pick(e,"Backbone","template")),t.Models=t.Models||{},t.Collections=t.Collections||{},t.Views=t.Views||{},t.Models.groupMember=Backbone.Model.extend({defaults:{id:0,name:"",avatar_urls:{},is_admin:!1,is_banned:!1,is_confirmed:!1,is_mod:!1,link:""},options:{path:bpGroupManageMembersSettings.path,type:"POST",data:{},dataType:"json"},initialize:function(){this.on("sync",this.resetRequestOptions,this)},resetRequestOptions:function(){this.options.data={},this.options.path=bpGroupManageMembersSettings.path},sync:function(e,i,s){(s=s||{}).context=this;var r=s.data||{};if(this.options.path=this.options.path.concat("/"+i.get("id")),_.extend(s,this.options),_.extend(s.data,r),"delete"===e||"update"===e)return s.headers="delete"===e?{"X-HTTP-Method-Override":"DELETE"}:{"X-HTTP-Method-Override":"PUT"},t.apiRequest(s)},parse:function(e){return _.isArray(e)&&(e=_.first(e)),e}}),t.Collections.groupMembers=Backbone.Collection.extend({model:t.Models.groupMember,options:{path:bpGroupManageMembersSettings.path,type:"GET",data:{},dataType:"json"},initialize:function(){this.on("reset",function(){this.options.data={}},this)},sync:function(e,i,s){(s=s||{}).context=this;var r=s.data||{};if(_.extend(s,this.options),_.extend(s.data,r),"read"===e){var o=this,n=s.success;return s.success=function(e,t,i){if(_.isUndefined(i)||(o.totalPages=parseInt(i.getResponseHeader("X-WP-TotalPages"),10),o.totalGroupMembers=parseInt(i.getResponseHeader("X-WP-Total"),10)),o.currentPage=s.data.page||1,n)return n.apply(this,arguments)},t.apiRequest(s)}}}),t.View=t.View||t.Backbone.View.extend({prepare:function(){return!_.isUndefined(this.model)&&_.isFunction(this.model.toJSON)?this.model.toJSON():{}}}),t.Views.GroupMemberUpdatingInfo=t.View.extend({tagName:"p",template:t.template("bp-manage-members-updating"),initialize:function(){this.model=new Backbone.Model({type:this.options.value})}}),t.Views.GroupMemberErrorInfo=t.View.extend({tagName:"p",template:t.template("bp-manage-members-error"),initialize:function(){this.model=new Backbone.Model({message:this.options.value})}}),t.Views.GroupsMembersLabel=t.Views.GroupMemberUpdatingInfo.extend({tagName:"label",template:t.template("bp-manage-members-label")}),t.Views.GroupRolesDropDown=t.View.extend({tagName:"select",filters:_.extend({all:{name:bpGroupManageMembersSettings.strings.allMembers}},bpGroupManageMembersSettings.roles),events:{change:"change"},initialize:function(){this.options.omits&&(this.filters=_.omit(this.filters,this.options.omits)),this.$el.html(_.chain(this.filters).map(function(e,t){var s=i("<option></option>").val(t).html(e.name)[0];return this.options.currentRole&&t===this.options.currentRole?{el:i(s).prop("selected",!0)}:{el:s}},this).pluck("el").value())},change:function(e){var t=i(e.target).val(),s={roles:[t]};this.collection&&("all"===t?(this.collection.currentRole="",s={exclude_admins:!1}):this.collection.currentRole=t,this.collection.currentPage=1,s.page=1,i("#manage-members-search").val(""),this.collection.fetch({data:s,reset:!0}))}}),t.Views.GroupMembersSearch=t.View.extend({className:"bp-dir-search-form",tagName:"form",template:t.template("bp-manage-members-search"),events:{"click #manage-members-search-submit":"searchMember"},searchMember:function(e){e.preventDefault();var t=i("#manage-members-search").val(),s=_.extend(this.collection.options.data,{search:t,page:1});this.collection.currentPage=1,this.collection.currentRole?s.roles=[this.collection.currentRole]:s.exclude_admins=!1,this.collection.fetch({data:s,reset:!0})}}),t.Views.GroupsMembersPagination=t.View.extend({className:"bp-pagination",template:t.template("bp-manage-members-paginate"),events:{"click .group-members-paginate-button":"queryPage"},initialize:function(){this.collection.on("reset",this.setPagination,this)},setPagination:function(e){var t=_.pick(e,["currentPage","totalGroupMembers","totalPages"]);t.totalPages>1&&(t.nextPage=t.currentPage+1,t.prevPage=t.currentPage-1),this.model=new Backbone.Model(t),this.render()},queryPage:function(e){e.preventDefault();var t=i(e.currentTarget).data("page"),s=i("#manage-members-search").val(),r=_.extend(this.collection.options.data,{search:s,page:t});this.collection.currentRole?r.roles=[this.collection.currentRole]:r.exclude_admins=!1,this.collection.fetch({data:r,reset:!0})}}),t.Views.GroupMembersNoMatches=t.View.extend({tagName:"tr",template:t.template("bp-manage-members-empty-row")}),t.Views.GroupMembersListRow=t.View.extend({tagName:"tr",template:t.template("bp-manage-members-row"),events:{"click .group-member-actions a":"doMemberAction","change .group-member-edit select":"editMemberRole"},initialize:function(){var e=["is_admin","is_banned","is_confirmed","is_mod"],t=this;_.each(bpGroupManageMembersSettings.roles,function(i){_.isMatch(t.model.attributes,_.pick(i,e))&&t.model.set("role",_.pick(i,["id","name"]),{silent:!0})}),this.model.collection.on("reset",this.clearRow,this)},clearRow:function(){this.views.view.remove()},renderEditForm:function(){var e=this.model.get("id");this.render(),this.views.set("#edit-group-member-"+e,[new t.Views.GroupsMembersLabel({value:e,attributes:{for:"group-member"+e+"-role"}}),new t.Views.GroupRolesDropDown({id:"group-member"+e+"-role",omits:["all","banned"],currentRole:this.model.get("role").id}).render()])},resetRow:function(){return this.model.set("editing",!1),this.render()},getRoleObject:function(e){var t=bpGroupManageMembersSettings.roles;return _.isUndefined(t[e])?{}:_.extend({role:_.pick(t[e],["id","name"])},_.pick(t[e],["is_admin","is_banned","is_confirmed","is_mod"]))},doMemberAction:function(e){e.preventDefault();var s=i(e.target).data("action"),r=this;if("edit"===s)return this.model.set("editing",!0),this.renderEditForm();if("abort"===s)return this.resetRow();if("ban"===s||"unban"===s){var o="ban"===s?"banned":"member",n=this.getRoleObject(o);if(!n)return this.resetRow();this.model.set("managingBan",!0),this.render(),this.views.set("#edit-group-member-"+this.model.get("id"),new t.Views.GroupMemberUpdatingInfo({value:s}).render()),this.model.save(n,{wait:!0,data:{action:s},success:function(e){return r.model.collection.remove(e),r.clearRow()},error:function(e,i){r.views.set("#edit-group-member-"+e.get("id"),new t.Views.GroupMemberErrorInfo({value:i.responseJSON.message}).render()),e.resetRequestOptions(),e.set("managingBan",!1)}})}else"remove"===s&&(this.model.set("removing",!0),this.render(),this.views.set("#edit-group-member-"+this.model.get("id"),new t.Views.GroupMemberUpdatingInfo({value:s}).render()),this.model.destroy({wait:!0,data:{},success:function(){return r.clearRow()},error:function(e,i){r.views.set("#edit-group-member-"+e.get("id"),new t.Views.GroupMemberErrorInfo({value:i.responseJSON.message}).render()),e.resetRequestOptions(),e.set("removing",!1)}}))},editMemberRole:function(e){var s=i(e.target).val(),r=this.getRoleObject(s),o=this.model.get("role").id,n="promote",a=this;if(s===this.model.get("role").id||!r)return this.resetRow();this.views.set("#edit-group-member-"+this.model.get("id"),(new t.Views.GroupMemberUpdatingInfo).render()),("admin"===o||"mod"===o&&"member"===s)&&(n="demote"),this.model.save(r,{wait:!0,data:{action:n,role:s},success:function(e){return a.model.collection.currentRole&&s!==a.model.collection.currentRole?(a.model.collection.remove(e),a.clearRow()):a.resetRow()},error:function(e,i){a.views.set("#edit-group-member-"+e.get("id"),new t.Views.GroupMemberErrorInfo({value:i.responseJSON.message}).render()),e.resetRequestOptions(),e.set("editing",!1)}})}}),t.Views.GroupMembersListHeader=t.View.extend({tagName:"thead",template:t.template("bp-manage-members-header")}),t.Views.GroupMembersListTable=t.View.extend({tagName:"tbody",initialize:function(){var e=bpGroupManageMembersSettings.preloaded||{},i=[];this.collection.on("reset",this.addListTableRows,this),e.body&&e.body.length>0?(_.each(e.body,function(e){i.push(new t.Models.groupMember(e))}),this.collection.currentPage=1,e.headers&&e.headers["X-WP-TotalPages"]&&(this.collection.totalPages=parseInt(e.headers["X-WP-TotalPages"],10)),e.headers&&e.headers["X-WP-Total"]&&(this.collection.totalGroupMembers=parseInt(e.headers["X-WP-Total"],10)),this.collection.reset(i)):this.collection.fetch({data:{exclude_admins:!1},reset:!0})},addListTableRows:function(e){if(this.views._views){var i=_.findWhere(this.views._views[""],{id:"bp-no-group-members"});i&&i.remove()}e.length?_.each(e.models,function(e){this.views.add(new t.Views.GroupMembersListRow({model:e}))},this):this.views.add(new t.Views.GroupMembersNoMatches({id:"bp-no-group-members"}))}}),t.Views.GroupMembersUI=t.View.extend({className:"group-members",initialize:function(){var e=new t.Collections.groupMembers;this.views.set("#group-roles-filter",[new t.Views.GroupsMembersLabel({attributes:{for:"group-members-role-filter"}}),new t.Views.GroupRolesDropDown({id:"group-members-role-filter",collection:e})]),this.views.set("#group-members-search-form",new t.Views.GroupMembersSearch({id:"group-members-search",collection:e})),this.views.set("#group-members-pagination",new t.Views.GroupsMembersPagination({collection:e})),this.views.set("#group-members-list-table",[new t.Views.GroupMembersListHeader,new t.Views.GroupMembersListTable({collection:e})])}}),t.manageGroupMembersUI=new t.Views.GroupMembersUI({el:"#group-manage-members-ui"}).render())}(window.wp||{},window.bp||{},jQuery);
1
+ !function(e,n,r){"undefined"!=typeof bpGroupManageMembersSettings&&n.isRestEnabled&&(_.extend(n,_.pick(e,"Backbone","template")),n.Models=n.Models||{},n.Collections=n.Collections||{},n.Views=n.Views||{},n.Models.groupMember=Backbone.Model.extend({defaults:{id:0,name:"",avatar_urls:{},is_admin:!1,is_banned:!1,is_confirmed:!1,is_mod:!1,link:""},options:{path:bpGroupManageMembersSettings.path,type:"POST",data:{},dataType:"json"},initialize:function(){this.on("sync",this.resetRequestOptions,this)},resetRequestOptions:function(){this.options.data={},this.options.path=bpGroupManageMembersSettings.path},sync:function(e,t,i){(i=i||{}).context=this;var s=i.data||{};if(this.options.path=this.options.path.concat("/"+t.get("id")),_.extend(i,this.options),_.extend(i.data,s),"delete"===e||"update"===e)return i.headers="delete"===e?{"X-HTTP-Method-Override":"DELETE"}:{"X-HTTP-Method-Override":"PUT"},n.apiRequest(i)},parse:function(e){return e=_.isArray(e)?_.first(e):e}}),n.Collections.groupMembers=Backbone.Collection.extend({model:n.Models.groupMember,options:{path:bpGroupManageMembersSettings.path,type:"GET",data:{},dataType:"json"},initialize:function(){this.on("reset",function(){this.options.data={}},this)},sync:function(e,t,s){(s=s||{}).context=this;var i=s.data||{};if(_.extend(s,this.options),_.extend(s.data,i),"read"===e){var o=this,r=s.success;return s.success=function(e,t,i){if(_.isUndefined(i)||(o.totalPages=parseInt(i.getResponseHeader("X-WP-TotalPages"),10),o.totalGroupMembers=parseInt(i.getResponseHeader("X-WP-Total"),10)),o.currentPage=s.data.page||1,r)return r.apply(this,arguments)},n.apiRequest(s)}}}),n.View=n.View||n.Backbone.View.extend({prepare:function(){return!_.isUndefined(this.model)&&_.isFunction(this.model.toJSON)?this.model.toJSON():{}}}),n.Views.GroupMemberUpdatingInfo=n.View.extend({tagName:"p",template:n.template("bp-manage-members-updating"),initialize:function(){this.model=new Backbone.Model({type:this.options.value})}}),n.Views.GroupMemberErrorInfo=n.View.extend({tagName:"p",template:n.template("bp-manage-members-error"),initialize:function(){this.model=new Backbone.Model({message:this.options.value})}}),n.Views.GroupsMembersLabel=n.Views.GroupMemberUpdatingInfo.extend({tagName:"label",template:n.template("bp-manage-members-label")}),n.Views.GroupRolesDropDown=n.View.extend({tagName:"select",filters:_.extend({all:{name:bpGroupManageMembersSettings.strings.allMembers}},bpGroupManageMembersSettings.roles),events:{change:"change"},initialize:function(){this.options.omits&&(this.filters=_.omit(this.filters,this.options.omits)),this.$el.html(_.chain(this.filters).map(function(e,t){e=r("<option></option>").val(t).html(e.name)[0];return this.options.currentRole&&t===this.options.currentRole?{el:r(e).prop("selected",!0)}:{el:e}},this).pluck("el").value())},change:function(e){var t=r(e.target).val(),e={roles:[t]};this.collection&&("all"===t?(this.collection.currentRole="",e={exclude_admins:!1}):this.collection.currentRole=t,this.collection.currentPage=1,e.page=1,r("#manage-members-search").val(""),this.collection.fetch({data:e,reset:!0}))}}),n.Views.GroupMembersSearch=n.View.extend({className:"bp-dir-search-form",tagName:"form",template:n.template("bp-manage-members-search"),events:{"click #manage-members-search-submit":"searchMember"},searchMember:function(e){e.preventDefault();e=r("#manage-members-search").val(),e=_.extend(this.collection.options.data,{search:e,page:1});this.collection.currentPage=1,this.collection.currentRole?e.roles=[this.collection.currentRole]:e.exclude_admins=!1,this.collection.fetch({data:e,reset:!0})}}),n.Views.GroupsMembersPagination=n.View.extend({className:"bp-pagination",template:n.template("bp-manage-members-paginate"),events:{"click .group-members-paginate-button":"queryPage"},initialize:function(){this.collection.on("reset",this.setPagination,this)},setPagination:function(e){e=_.pick(e,["currentPage","totalGroupMembers","totalPages"]);1<e.totalPages&&(e.nextPage=e.currentPage+1,e.prevPage=e.currentPage-1),this.model=new Backbone.Model(e),this.render()},queryPage:function(e){e.preventDefault();var t=r(e.currentTarget).data("page"),e=r("#manage-members-search").val(),t=_.extend(this.collection.options.data,{search:e,page:t});this.collection.currentRole?t.roles=[this.collection.currentRole]:t.exclude_admins=!1,this.collection.fetch({data:t,reset:!0})}}),n.Views.GroupMembersNoMatches=n.View.extend({tagName:"tr",template:n.template("bp-manage-members-empty-row")}),n.Views.GroupMembersListRow=n.View.extend({tagName:"tr",template:n.template("bp-manage-members-row"),events:{"click .group-member-actions a":"doMemberAction","change .group-member-edit select":"editMemberRole"},initialize:function(){var t=["is_admin","is_banned","is_confirmed","is_mod"],i=this;_.each(bpGroupManageMembersSettings.roles,function(e){_.isMatch(i.model.attributes,_.pick(e,t))&&i.model.set("role",_.pick(e,["id","name"]),{silent:!0})}),this.model.collection.on("reset",this.clearRow,this)},clearRow:function(){this.views.view.remove()},renderEditForm:function(){var e=this.model.get("id");this.render(),this.views.set("#edit-group-member-"+e,[new n.Views.GroupsMembersLabel({value:e,attributes:{for:"group-member"+e+"-role"}}),new n.Views.GroupRolesDropDown({id:"group-member"+e+"-role",omits:["all","banned"],currentRole:this.model.get("role").id}).render()])},resetRow:function(){return this.model.set("editing",!1),this.render()},getRoleObject:function(e){var t=bpGroupManageMembersSettings.roles;return _.isUndefined(t[e])?{}:_.extend({role:_.pick(t[e],["id","name"])},_.pick(t[e],["is_admin","is_banned","is_confirmed","is_mod"]))},doMemberAction:function(e){e.preventDefault();var t=r(e.target).data("action"),i=this;if("edit"===t)return this.model.set("editing",!0),this.renderEditForm();if("abort"===t)return this.resetRow();if("ban"===t||"unban"===t){e=this.getRoleObject("ban"===t?"banned":"member");if(!e)return this.resetRow();this.model.set("managingBan",!0),this.render(),this.views.set("#edit-group-member-"+this.model.get("id"),new n.Views.GroupMemberUpdatingInfo({value:t}).render()),this.model.save(e,{wait:!0,data:{action:t},success:function(e){return i.model.collection.remove(e),i.clearRow()},error:function(e,t){i.views.set("#edit-group-member-"+e.get("id"),new n.Views.GroupMemberErrorInfo({value:t.responseJSON.message}).render()),e.resetRequestOptions(),e.set("managingBan",!1)}})}else"remove"===t&&(this.model.set("removing",!0),this.render(),this.views.set("#edit-group-member-"+this.model.get("id"),new n.Views.GroupMemberUpdatingInfo({value:t}).render()),this.model.destroy({wait:!0,data:{},success:function(){return i.clearRow()},error:function(e,t){i.views.set("#edit-group-member-"+e.get("id"),new n.Views.GroupMemberErrorInfo({value:t.responseJSON.message}).render()),e.resetRequestOptions(),e.set("removing",!1)}}))},editMemberRole:function(e){var t=r(e.target).val(),i=this.getRoleObject(t),s=this.model.get("role").id,e="promote",o=this;if(t===this.model.get("role").id||!i)return this.resetRow();this.views.set("#edit-group-member-"+this.model.get("id"),(new n.Views.GroupMemberUpdatingInfo).render()),this.model.save(i,{wait:!0,data:{action:e="admin"===s||"mod"===s&&"member"===t?"demote":e,role:t},success:function(e){return o.model.collection.currentRole&&t!==o.model.collection.currentRole?(o.model.collection.remove(e),o.clearRow()):o.resetRow()},error:function(e,t){o.views.set("#edit-group-member-"+e.get("id"),new n.Views.GroupMemberErrorInfo({value:t.responseJSON.message}).render()),e.resetRequestOptions(),e.set("editing",!1)}})}}),n.Views.GroupMembersListHeader=n.View.extend({tagName:"thead",template:n.template("bp-manage-members-header")}),n.Views.GroupMembersListTable=n.View.extend({tagName:"tbody",initialize:function(){var e=bpGroupManageMembersSettings.preloaded||{},t=[];this.collection.on("reset",this.addListTableRows,this),e.body&&0<e.body.length?(_.each(e.body,function(e){t.push(new n.Models.groupMember(e))}),this.collection.currentPage=1,e.headers&&e.headers["X-WP-TotalPages"]&&(this.collection.totalPages=parseInt(e.headers["X-WP-TotalPages"],10)),e.headers&&e.headers["X-WP-Total"]&&(this.collection.totalGroupMembers=parseInt(e.headers["X-WP-Total"],10)),this.collection.reset(t)):this.collection.fetch({data:{exclude_admins:!1},reset:!0})},addListTableRows:function(e){var t;!this.views._views||(t=_.findWhere(this.views._views[""],{id:"bp-no-group-members"}))&&t.remove(),e.length?_.each(e.models,function(e){this.views.add(new n.Views.GroupMembersListRow({model:e}))},this):this.views.add(new n.Views.GroupMembersNoMatches({id:"bp-no-group-members"}))}}),n.Views.GroupMembersUI=n.View.extend({className:"group-members",initialize:function(){var e=new n.Collections.groupMembers;this.views.set("#group-roles-filter",[new n.Views.GroupsMembersLabel({attributes:{for:"group-members-role-filter"}}),new n.Views.GroupRolesDropDown({id:"group-members-role-filter",collection:e})]),this.views.set("#group-members-search-form",new n.Views.GroupMembersSearch({id:"group-members-search",collection:e})),this.views.set("#group-members-pagination",new n.Views.GroupsMembersPagination({collection:e})),this.views.set("#group-members-list-table",[new n.Views.GroupMembersListHeader,new n.Views.GroupMembersListTable({collection:e})])}}),n.manageGroupMembersUI=new n.Views.GroupMembersUI({el:"#group-manage-members-ui"}).render())}(window.wp||{},window.bp||{},jQuery);
bp-groups/js/widget-groups.min.js CHANGED
@@ -1 +1 @@
1
- function groups_widget_click_handler(){jQuery(".widget div#groups-list-options a").on("click",function(){var e=this;return jQuery(e).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(t){jQuery(e).removeClass("loading"),groups_widget_response(t)}),!1})}function groups_widget_response(e){e=e.substr(0,e.length-1),"-1"!==(e=e.split("[[SPLIT]]"))[0]?jQuery(".widget ul#groups-list").fadeOut(200,function(){jQuery(".widget ul#groups-list").html(e[1]),jQuery(".widget ul#groups-list").fadeIn(200)}):jQuery(".widget ul#groups-list").fadeOut(200,function(){var t="<p>"+e[1]+"</p>";jQuery(".widget ul#groups-list").html(t),jQuery(".widget ul#groups-list").fadeIn(200)})}jQuery(document).ready(function(){groups_widget_click_handler(),"undefined"!=typeof wp&&wp.customize&&wp.customize.selectiveRefresh&&wp.customize.selectiveRefresh.bind("partial-content-rendered",function(){groups_widget_click_handler()})});
1
+ function groups_widget_click_handler(){jQuery(".widget div#groups-list-options a").on("click",function(){var t=this;return jQuery(t).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(e){jQuery(t).removeClass("loading"),groups_widget_response(e)}),!1})}function groups_widget_response(t){"-1"!==(t=(t=t.substr(0,t.length-1)).split("[[SPLIT]]"))[0]?jQuery(".widget ul#groups-list").fadeOut(200,function(){jQuery(".widget ul#groups-list").html(t[1]),jQuery(".widget ul#groups-list").fadeIn(200)}):jQuery(".widget ul#groups-list").fadeOut(200,function(){var e="<p>"+t[1]+"</p>";jQuery(".widget ul#groups-list").html(e),jQuery(".widget ul#groups-list").fadeIn(200)})}jQuery(document).ready(function(){groups_widget_click_handler(),"undefined"!=typeof wp&&wp.customize&&wp.customize.selectiveRefresh&&wp.customize.selectiveRefresh.bind("partial-content-rendered",function(){groups_widget_click_handler()})});
bp-loader.php CHANGED
@@ -15,7 +15,7 @@
15
  * Description: BuddyPress adds community features to WordPress. Member Profiles, Activity Streams, Direct Messaging, Notifications, and more!
16
  * Author: The BuddyPress Community
17
  * Author URI: https://buddypress.org/
18
- * Version: 7.3.2
19
  * Text Domain: buddypress
20
  * Domain Path: /bp-languages/
21
  * License: GPLv2 or later (license.txt)
15
  * Description: BuddyPress adds community features to WordPress. Member Profiles, Activity Streams, Direct Messaging, Notifications, and more!
16
  * Author: The BuddyPress Community
17
  * Author URI: https://buddypress.org/
18
+ * Version: 8.0.2
19
  * Text Domain: buddypress
20
  * Domain Path: /bp-languages/
21
  * License: GPLv2 or later (license.txt)
bp-members/actions/invitations-bulk-manage.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Member Invitations: Bulk-manage action handler
4
+ *
5
+ * @package BuddyPress
6
+ * @subpackage MembersActions
7
+ * @since 8.0.0
8
+ */
9
+
10
+ /**
11
+ * Handles bulk management (resend, cancellation) of invitations.
12
+ *
13
+ * @since 8.0.0
14
+ *
15
+ * @return bool
16
+ */
17
+ function bp_members_invitations_action_bulk_manage() {
18
+
19
+ // Bail if not the user's invitations screen.
20
+ if ( ! bp_is_my_profile() && ! bp_current_user_can( 'bp_moderate' ) ) {
21
+ return false;
22
+ }
23
+
24
+ // Get the parameters.
25
+ $action = ! empty( $_POST['invitation_bulk_action'] ) ? $_POST['invitation_bulk_action'] : '';
26
+ $nonce = ! empty( $_POST['invitations_bulk_nonce'] ) ? $_POST['invitations_bulk_nonce'] : '';
27
+ $invitations = ! empty( $_POST['members_invitations'] ) ? $_POST['members_invitations'] : '';
28
+
29
+ // Bail if no action or no IDs.
30
+ if ( ( ! in_array( $action, array( 'cancel', 'resend' ), true ) ) || empty( $invitations ) || empty( $nonce ) ) {
31
+ return false;
32
+ }
33
+
34
+ // Check the nonce.
35
+ if ( ! wp_verify_nonce( $nonce, 'invitations_bulk_nonce' ) ) {
36
+ bp_core_add_message( __( 'There was a problem managing your invitations.', 'buddypress' ), 'error' );
37
+ return false;
38
+ }
39
+
40
+ $invitations = wp_parse_id_list( $invitations );
41
+
42
+ // Cancel or resend depending on the user 'action'.
43
+ switch ( $action ) {
44
+ case 'cancel' :
45
+ $success = 0;
46
+ foreach ( $invitations as $invite_id ) {
47
+ if ( bp_members_invitations_delete_by_id( $invite_id ) ) {
48
+ $success++;
49
+ }
50
+ }
51
+ $message = sprintf(
52
+ esc_html(
53
+ /* translators: %d: the number of invitations that were canceled. */
54
+ _n( '%d invitation was canceled.', '%d invitations were canceled.', $success, 'buddypress' )
55
+ ),
56
+ $success
57
+ );
58
+ bp_core_add_message( $message );
59
+ break;
60
+
61
+ case 'resend' :
62
+ $success = 0;
63
+ foreach ( $invitations as $invite_id ) {
64
+ if ( bp_members_invitation_resend_by_id( $invite_id ) ) {
65
+ $success++;
66
+ }
67
+ }
68
+ $message = sprintf(
69
+ esc_html(
70
+ /* translators: %d: the number of invitations that were resent. */
71
+ _n( '%d invitation was resent.', '%d invitations were resent.', $success, 'buddypress' )
72
+ ),
73
+ $success
74
+ );
75
+ bp_core_add_message( $message );
76
+ break;
77
+ }
78
+
79
+ // Redirect.
80
+ bp_core_redirect( bp_displayed_user_domain() . bp_get_members_invitations_slug() . '/' . bp_current_action() . '/' );
81
+ }
82
+ add_action( 'bp_actions', 'bp_members_invitations_action_bulk_manage' );
bp-members/admin/bp-members-admin-classes.php CHANGED
@@ -12,6 +12,7 @@ defined( 'ABSPATH' ) || exit;
12
 
13
  if ( class_exists( 'WP_Users_List_Table' ) ) {
14
  require dirname( dirname( __FILE__ ) ) . '/classes/class-bp-members-list-table.php';
 
15
  }
16
 
17
  if ( class_exists( 'WP_MS_Users_List_Table' ) ) {
12
 
13
  if ( class_exists( 'WP_Users_List_Table' ) ) {
14
  require dirname( dirname( __FILE__ ) ) . '/classes/class-bp-members-list-table.php';
15
+ require dirname( dirname( __FILE__ ) ) . '/classes/class-bp-members-invitations-list-table.php';
16
  }
17
 
18
  if ( class_exists( 'WP_MS_Users_List_Table' ) ) {
bp-members/admin/js/admin.min.js CHANGED
@@ -1 +1 @@
1
- function clear(e){if(e=document.getElementById(e)){var i=e.getElementsByTagName("INPUT"),t=e.getElementsByTagName("OPTION"),n=0;if(i)for(n=0;n<i.length;n++)i[n].checked="";if(t)for(n=0;n<t.length;n++)t[n].selected=!1}}!function(e){e(".visibility-toggle-link").on("click",function(i){i.preventDefault(),e(this).attr("aria-expanded","true").parent().hide().siblings(".field-visibility-settings").show()}),e(".field-visibility-settings-close").on("click",function(i){i.preventDefault(),e(".visibility-toggle-link").attr("aria-expanded","false");var t=e(this).parent(),n=t.find("input:checked").parent().text();t.hide().siblings(".field-visibility-settings-toggle").children(".current-visibility-level").text(n).end().show()})}(jQuery);
1
+ function clear(e){if(e=document.getElementById(e)){var i=e.getElementsByTagName("INPUT"),t=e.getElementsByTagName("OPTION"),n=0;if(i)for(n=0;n<i.length;n++)i[n].checked="";if(t)for(n=0;n<t.length;n++)t[n].selected=!1}}!function(t){t(".visibility-toggle-link").on("click",function(e){e.preventDefault(),t(this).attr("aria-expanded","true").parent().hide().siblings(".field-visibility-settings").show()}),t(".field-visibility-settings-close").on("click",function(e){e.preventDefault(),t(".visibility-toggle-link").attr("aria-expanded","false");var i=t(this).parent(),e=i.find("input:checked").parent().text();i.hide().siblings(".field-visibility-settings-toggle").children(".current-visibility-level").text(e).end().show()})}(jQuery);
bp-members/bp-members-activity.php CHANGED
@@ -27,6 +27,16 @@ function bp_members_register_activity_actions() {
27
  array( 'activity' )
28
  );
29
 
 
 
 
 
 
 
 
 
 
 
30
  /**
31
  * Fires after the default 'new member' activity types are registered.
32
  *
@@ -46,10 +56,29 @@ add_action( 'bp_register_activity_actions', 'bp_members_register_activity_action
46
  * @return string $action
47
  */
48
  function bp_members_format_activity_action_new_member( $action, $activity ) {
49
- $userlink = bp_core_get_userlink( $activity->user_id );
 
 
50
 
51
- /* translators: %s: user link */
52
- $action = sprintf( esc_html__( '%s became a registered member', 'buddypress' ), $userlink );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
  // Legacy filter - pass $user_id instead of $activity.
55
  if ( has_filter( 'bp_core_activity_registered_member_action' ) ) {
@@ -60,11 +89,47 @@ function bp_members_format_activity_action_new_member( $action, $activity ) {
60
  * Filters the formatted 'new member' activity actions.
61
  *
62
  * @since 2.2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  *
64
- * @param string $action Static activity action.
65
  * @param object $activity Activity object.
66
  */
67
- return apply_filters( 'bp_members_format_activity_action_new_member', $action, $activity );
68
  }
69
 
70
  /**
@@ -97,3 +162,42 @@ function bp_core_new_user_activity( $user ) {
97
  ) );
98
  }
99
  add_action( 'bp_core_activated_user', 'bp_core_new_user_activity' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  array( 'activity' )
28
  );
29
 
30
+ // Register the activity stream actions for this component.
31
+ bp_activity_set_action(
32
+ // Older avatar activity items use 'profile' for component. See r4273.
33
+ buddypress()->members->id,
34
+ 'new_avatar',
35
+ __( 'Member changed profile picture', 'buddypress' ),
36
+ 'bp_members_format_activity_action_new_avatar',
37
+ __( 'Updated Profile Photos', 'buddypress' )
38
+ );
39
+
40
  /**
41
  * Fires after the default 'new member' activity types are registered.
42
  *
56
  * @return string $action
57
  */
58
  function bp_members_format_activity_action_new_member( $action, $activity ) {
59
+ $userlink = bp_core_get_userlink( $activity->user_id );
60
+ $inviter_userlink = false;
61
+ $invite_id = bp_get_user_meta( $activity->user_id, 'accepted_members_invitation', true );
62
 
63
+ if ( $invite_id ) {
64
+ $invite = new BP_Invitation( (int) $invite_id );
65
+
66
+ if ( $invite->inviter_id ) {
67
+ $inviter_userlink = bp_core_get_userlink( $invite->inviter_id );
68
+ }
69
+ }
70
+
71
+ if ( $inviter_userlink ) {
72
+ $action = sprintf(
73
+ /* translators: 1: new user link. 2: inviter user link. */
74
+ esc_html__( '%1$s accepted an invitation from %2$s and became a registered member', 'buddypress' ),
75
+ $userlink,
76
+ $inviter_userlink
77
+ );
78
+ } else {
79
+ /* translators: %s: user link */
80
+ $action = sprintf( esc_html__( '%s became a registered member', 'buddypress' ), $userlink );
81
+ }
82
 
83
  // Legacy filter - pass $user_id instead of $activity.
84
  if ( has_filter( 'bp_core_activity_registered_member_action' ) ) {
89
  * Filters the formatted 'new member' activity actions.
90
  *
91
  * @since 2.2.0
92
+ * @since 8.0.0 Added $invite_id
93
+ *
94
+ * @param string $action Static activity action.
95
+ * @param object $activity Activity object.
96
+ * @param int $invite_id The ID of the invite.
97
+ */
98
+ return apply_filters( 'bp_members_format_activity_action_new_member', $action, $activity, $invite_id );
99
+ }
100
+
101
+ /**
102
+ * Format 'new_avatar' activity actions.
103
+ *
104
+ * @since 8.0.0
105
+ *
106
+ * @param string $action Static activity action.
107
+ * @param object $activity Activity object.
108
+ * @return string
109
+ */
110
+ function bp_members_format_activity_action_new_avatar( $action, $activity ) {
111
+ $userlink = bp_core_get_userlink( $activity->user_id );
112
+
113
+ /* translators: %s: user link */
114
+ $action = sprintf( esc_html__( '%s changed their profile picture', 'buddypress' ), $userlink );
115
+
116
+ // Legacy filter - pass $user_id instead of $activity.
117
+ if ( has_filter( 'bp_xprofile_new_avatar_action' ) ) {
118
+ $action = apply_filters( 'bp_xprofile_new_avatar_action', $action, $activity->user_id );
119
+ }
120
+
121
+ /** This filter is documented in wp-includes/deprecated.php */
122
+ $action = apply_filters_deprecated( 'bp_xprofile_format_activity_action_new_avatar', array( $action, $activity ), '8.0.0', 'bp_members_format_activity_action_new_avatar' );
123
+
124
+ /**
125
+ * Filters the formatted 'new_avatar' activity stream action.
126
+ *
127
+ * @since 8.0.0
128
  *
129
+ * @param string $action Formatted action for activity stream.
130
  * @param object $activity Activity object.
131
  */
132
+ return apply_filters( 'bp_members_format_activity_action_new_avatar', $action, $activity );
133
  }
134
 
135
  /**
162
  ) );
163
  }
164
  add_action( 'bp_core_activated_user', 'bp_core_new_user_activity' );
165
+
166
+ /**
167
+ * Adds an activity stream item when a user has uploaded a new avatar.
168
+ *
169
+ * @since 8.0.0
170
+ *
171
+ * @param int $user_id The user id the avatar was set for.
172
+ */
173
+ function bp_members_new_avatar_activity( $user_id = 0 ) {
174
+
175
+ // Bail if activity component is not active.
176
+ if ( ! bp_is_active( 'activity' ) ) {
177
+ return false;
178
+ }
179
+
180
+ if ( empty( $user_id ) ) {
181
+ $user_id = bp_displayed_user_id();
182
+ }
183
+
184
+ /** This filter is documented in wp-includes/deprecated.php */
185
+ $user_id = apply_filters_deprecated( 'bp_xprofile_new_avatar_user_id', array( $user_id ), '8.0.0', 'bp_members_new_avatar_user_id' );
186
+
187
+ /**
188
+ * Filters the user ID when a user has uploaded a new avatar.
189
+ *
190
+ * @since 8.0.0
191
+ *
192
+ * @param int $user_id ID of the user the avatar was set for.
193
+ */
194
+ $user_id = apply_filters( 'bp_members_new_avatar_user_id', $user_id );
195
+
196
+ // Add the activity.
197
+ bp_activity_add( array(
198
+ 'user_id' => $user_id,
199
+ 'component' => buddypress()->members->id,
200
+ 'type' => 'new_avatar'
201
+ ) );
202
+ }
203
+ add_action( 'bp_members_avatar_uploaded', 'bp_members_new_avatar_activity' );
bp-members/bp-members-adminbar.php CHANGED
@@ -23,8 +23,9 @@ function bp_members_admin_bar_my_account_menu() {
23
  global $wp_admin_bar;
24
 
25
  // Bail if this is an ajax request.
26
- if ( defined( 'DOING_AJAX' ) )
27
  return;
 
28
 
29
  // Logged in user.
30
  if ( is_user_logged_in() ) {
@@ -102,7 +103,7 @@ function bp_members_admin_bar_user_admin_menu() {
102
  'parent' => $bp->user_admin_menu_id,
103
  'id' => $bp->user_admin_menu_id . '-edit-profile',
104
  'title' => __( "Edit Profile", 'buddypress' ),
105
- 'href' => bp_get_members_component_link( 'profile', 'edit' )
106
  ) );
107
 
108
  // User Admin > Edit this user's avatar.
@@ -111,7 +112,7 @@ function bp_members_admin_bar_user_admin_menu() {
111
  'parent' => $bp->user_admin_menu_id,
112
  'id' => $bp->user_admin_menu_id . '-change-avatar',
113
  'title' => __( "Edit Profile Photo", 'buddypress' ),
114
- 'href' => bp_get_members_component_link( 'profile', 'change-avatar' )
115
  ) );
116
  }
117
 
@@ -121,7 +122,7 @@ function bp_members_admin_bar_user_admin_menu() {
121
  'parent' => $bp->user_admin_menu_id,
122
  'id' => $bp->user_admin_menu_id . '-change-cover-image',
123
  'title' => __( 'Edit Cover Image', 'buddypress' ),
124
- 'href' => bp_get_members_component_link( 'profile', 'change-cover-image' )
125
  ) );
126
  }
127
 
@@ -178,3 +179,61 @@ function bp_members_remove_edit_page_menu() {
178
  }
179
  }
180
  add_action( 'add_admin_bar_menus', 'bp_members_remove_edit_page_menu' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  global $wp_admin_bar;
24
 
25
  // Bail if this is an ajax request.
26
+ if ( wp_doing_ajax() ) {
27
  return;
28
+ }
29
 
30
  // Logged in user.
31
  if ( is_user_logged_in() ) {
103
  'parent' => $bp->user_admin_menu_id,
104
  'id' => $bp->user_admin_menu_id . '-edit-profile',
105
  'title' => __( "Edit Profile", 'buddypress' ),
106
+ 'href' => bp_get_members_component_link( $bp->profile->id, 'edit' )
107
  ) );
108
 
109
  // User Admin > Edit this user's avatar.
112
  'parent' => $bp->user_admin_menu_id,
113
  'id' => $bp->user_admin_menu_id . '-change-avatar',
114
  'title' => __( "Edit Profile Photo", 'buddypress' ),
115
+ 'href' => bp_get_members_component_link( $bp->profile->id, 'change-avatar' )
116
  ) );
117
  }
118
 
122
  'parent' => $bp->user_admin_menu_id,
123
  'id' => $bp->user_admin_menu_id . '-change-cover-image',
124
  'title' => __( 'Edit Cover Image', 'buddypress' ),
125
+ 'href' => bp_get_members_component_link( $bp->profile->id, 'change-cover-image' )
126
  ) );
127
  }
128
 
179
  }
180
  }
181
  add_action( 'add_admin_bar_menus', 'bp_members_remove_edit_page_menu' );
182
+
183
+ /**
184
+ * Add the "Invitations" menu and submenus.
185
+ *
186
+ * @since 8.0.0
187
+ */
188
+ function bp_members_admin_bar_add_invitations_menu() {
189
+ global $wp_admin_bar;
190
+
191
+ // Bail if this is an ajax request.
192
+ if ( wp_doing_ajax() ) {
193
+ return;
194
+ }
195
+
196
+ if ( bp_current_user_can( 'bp_members_invitations_view_screens' ) ) {
197
+ $bp = buddypress();
198
+ $invitations_link = trailingslashit( bp_loggedin_user_domain() . bp_get_members_invitations_slug() );
199
+
200
+ $wp_admin_bar->add_node(
201
+ array(
202
+ 'id' => $bp->my_account_menu_id . '-invitations',
203
+ 'parent' => $bp->my_account_menu_id,
204
+ 'title' => __( 'Invitations', 'buddypress' ),
205
+ 'href' => $invitations_link,
206
+ 'meta' => array(
207
+ 'class' => 'ab-sub-secondary'
208
+ )
209
+ )
210
+ );
211
+
212
+ if ( bp_current_user_can( 'bp_members_invitations_view_send_screen' ) ) {
213
+ $wp_admin_bar->add_node(
214
+ array(
215
+ 'id' => $bp->my_account_menu_id . '-invitations-send',
216
+ 'parent' => $bp->my_account_menu_id . '-invitations',
217
+ 'title' => __( 'Send Invites', 'buddypress' ),
218
+ 'href' => $invitations_link . 'send-invites/',
219
+ 'meta' => array(
220
+ 'class' => 'ab-sub-secondary'
221
+ )
222
+ )
223
+ );
224
+ }
225
+
226
+ $wp_admin_bar->add_node(
227
+ array(
228
+ 'id' => $bp->my_account_menu_id . '-invitations-list',
229
+ 'parent' => $bp->my_account_menu_id . '-invitations',
230
+ 'title' => __( 'Pending Invites', 'buddypress' ),
231
+ 'href' => $invitations_link . 'list-invites/',
232
+ 'meta' => array(
233
+ 'class' => 'ab-sub-secondary'
234
+ )
235
+ )
236
+ );
237
+ }
238
+ }
239
+ add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_add_invitations_menu', 90 );
bp-members/bp-members-filters.php CHANGED
@@ -127,3 +127,242 @@ function bp_members_edit_profile_url( $url, $user_id, $scheme = 'admin' ) {
127
  return apply_filters( 'bp_members_edit_profile_url', $profile_link, $url, $user_id, $scheme );
128
  }
129
  add_filter( 'edit_profile_url', 'bp_members_edit_profile_url', 10, 3 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  return apply_filters( 'bp_members_edit_profile_url', $profile_link, $url, $user_id, $scheme );
128
  }
129
  add_filter( 'edit_profile_url', 'bp_members_edit_profile_url', 10, 3 );
130
+
131
+ /**
132
+ * Filter the bp_user_can value to determine what the user can do in the members component.
133
+ *
134
+ * @since 8.0.0
135
+ *
136
+ * @param bool $retval Whether or not the current user has the capability.
137
+ * @param int $user_id
138
+ * @param string $capability The capability being checked for.
139
+ * @param int $site_id Site ID. Defaults to the BP root blog.
140
+ * @param array $args Array of extra arguments passed.
141
+ *
142
+ * @return bool
143
+ */
144
+ function bp_members_user_can_filter( $retval, $user_id, $capability, $site_id, $args = array() ) {
145
+
146
+ switch ( $capability ) {
147
+ case 'bp_members_manage_membership_requests':
148
+ $retval = bp_user_can( $user_id, 'bp_moderate' );
149
+ break;
150
+
151
+ case 'bp_members_send_invitation':
152
+ if ( is_user_logged_in() && bp_get_members_invitations_allowed() ) {
153
+ $retval = true;
154
+ }
155
+ break;
156
+
157
+ case 'bp_members_receive_invitation':
158
+ if ( bp_get_members_invitations_allowed() ) {
159
+ $retval = true;
160
+ // The invited user must not already be a member of the network.
161
+ if ( empty( $args['invitee_email'] ) || false !== get_user_by( 'email', $args['invitee_email'] ) ) {
162
+ $retval = false;
163
+ }
164
+ // The invited user must not have opted out from being contacted from this site.
165
+ if ( bp_user_has_opted_out( $args['invitee_email'] ) ) {
166
+ $retval = false;
167
+ }
168
+ }
169
+ break;
170
+
171
+ case 'bp_members_invitations_view_screens':
172
+ $retval = bp_get_members_invitations_allowed() && ( bp_user_can( $user_id, 'bp_members_send_invitation' ) || bp_members_invitations_user_has_sent_invites( $user_id ) );
173
+ break;
174
+
175
+ case 'bp_members_invitations_view_send_screen':
176
+ $retval = is_user_logged_in() && bp_get_members_invitations_allowed();
177
+ break;
178
+ }
179
+
180
+ return $retval;
181
+ }
182
+ add_filter( 'bp_user_can', 'bp_members_user_can_filter', 10, 5 );
183
+
184
+ /**
185
+ * Do not allow the new user to change the email address
186
+ * if they are accepting a community invitation.
187
+ *
188
+ * @since 8.0.0
189
+ *
190
+ * @param array $attributes The field attributes.
191
+ * @param string $name The field name.
192
+ *
193
+ * @return array $attributes The field attributes.
194
+ */
195
+ function bp_members_invitations_make_registration_email_input_readonly_if_invite( $attributes, $name ) {
196
+ if ( 'email' === $name && bp_get_members_invitations_allowed() ) {
197
+ $invite = bp_get_members_invitation_from_request();
198
+ if ( $invite->id ) {
199
+ $attributes['readonly'] = 'readonly';
200
+ }
201
+ }
202
+ return $attributes;
203
+ }
204
+ add_filter( 'bp_get_form_field_attributes', 'bp_members_invitations_make_registration_email_input_readonly_if_invite', 10, 2 );
205
+
206
+ /**
207
+ * Provide a more-specific welcome message if the new user
208
+ * is accepting a network invitation.
209
+ *
210
+ * @since 8.0.0
211
+ *
212
+ * @return string $message The message text.
213
+ */
214
+ function bp_members_invitations_get_registration_welcome_message() {
215
+ $message = '';
216
+ if ( ! bp_get_members_invitations_allowed() ) {
217
+ return $message;
218
+ }
219
+
220
+ $invite = bp_get_members_invitation_from_request();
221
+ if ( ! $invite->id || ! $invite->invitee_email ) {
222
+ return $message;
223
+ }
224
+
225
+ // Check if the user is already a site member.
226
+ $maybe_user = get_user_by( 'email', $invite->invitee_email );
227
+
228
+ // This user is already a member
229
+ if ( $maybe_user ) {
230
+ $message = sprintf(
231
+ /* translators: %s: The log in link `<a href="login_url">log in</a>` */
232
+ esc_html__( 'Welcome! You are already a member of this site. Please %s to continue.', 'buddypress' ),
233
+ sprintf(
234
+ '<a href="%1$s">%2$s</a>',
235
+ esc_url( wp_login_url( bp_get_root_domain() ) ),
236
+ esc_html__( 'log in', 'buddypress' )
237
+ )
238
+ );
239
+
240
+ // This user can register!
241
+ } else {
242
+
243
+ // Fetch the display names of all inviters to personalize the welcome message.
244
+ $args = array(
245
+ 'invitee_email' => $invite->invitee_email,
246
+ 'invite_sent' => 'sent',
247
+ );
248
+
249
+ $all_invites = bp_members_invitations_get_invites( $args );
250
+ $inviters = array();
251
+
252
+ foreach ( $all_invites as $inv ) {
253
+ $inviters[] = bp_core_get_user_displayname( $inv->inviter_id );
254
+ }
255
+
256
+ if ( ! empty( $inviters ) ) {
257
+ $message = sprintf(
258
+ /* translators: %s: The comma separated list of inviters display names */
259
+ _n( 'Welcome! You&#8217;ve been invited to join the site by the following user: %s.', 'Welcome! You&#8217;ve been invited to join the site by the following users: %s.', count( $inviters ), 'buddypress' ),
260
+ implode( ', ', $inviters )
261
+ );
262
+ } else {
263
+ $message = __( 'Welcome! You&#8217;ve been invited to join the site. ', 'buddypress' );
264
+ }
265
+ }
266
+
267
+ return $message;
268
+ }
269
+
270
+ /**
271
+ * Provide a more-specific "registration is disabled" message
272
+ * if registration is available by invitation only.
273
+ * Also provide failure note if new user is trying to accept
274
+ * a network invitation but there's a problem.
275
+ *
276
+ * @since 8.0.0
277
+ *
278
+ * @return string $message The message text.
279
+ */
280
+ function bp_members_invitations_get_modified_registration_disabled_message() {
281
+ $message = '';
282
+ if ( bp_get_members_invitations_allowed() ) {
283
+
284
+ $invite = bp_get_members_invitation_from_request();
285
+ if ( ! $invite->id || ! $invite->invitee_email ) {
286
+ return $message;
287
+ }
288
+
289
+ // Check if the user is already a site member.
290
+ $maybe_user = get_user_by( 'email', $invite->invitee_email );
291
+
292
+ if ( ! $maybe_user ) {
293
+ $message_parts = array( esc_html__( 'Member registration is allowed by invitation only.', 'buddypress' ) );
294
+
295
+ // Is the user trying to accept an invitation but something is wrong?
296
+ if ( ! empty( $_GET['inv'] ) ) {
297
+ $message_parts[] = esc_html__( 'It looks like there is a problem with your invitation. Please try again.', 'buddypress' );
298
+ }
299
+
300
+ $message = implode( ' ', $message_parts );
301
+ } else if ( 'nouveau' === bp_get_theme_package_id() ) {
302
+ $message = sprintf(
303
+ /* translators: 1: The log in link `<a href="login_url">log in</a>`. 2: The lost password link `<a href="lost_password_url">log in</a>` */
304
+ esc_html__( 'Welcome! You are already a member of this site. Please %1$s to continue. If you have forgotten your password, you can %2$s.', 'buddypress' ),
305
+ sprintf(
306
+ '<a href="%1$s">%2$s</a>',
307
+ esc_url( wp_login_url( bp_get_root_domain() ) ),
308
+ esc_html__( 'log in', 'buddypress' )
309
+ ),
310
+ sprintf(
311
+ '<a href="%1$s">%2$s</a>',
312
+ esc_url( wp_lostpassword_url( bp_get_root_domain() ) ),
313
+ esc_html__( 'reset it', 'buddypress' )
314
+ )
315
+ );
316
+ }
317
+ }
318
+
319
+ return $message;
320
+ }
321
+
322
+ /**
323
+ * Sanitize the invitation property output.
324
+ *
325
+ * @since 8.0.0
326
+ *
327
+ * @param int|string $value The value for the requested property.
328
+ * @param string $property The name of the requested property.
329
+ * @param string $context The context of display.
330
+ * @return int|string The sanitized value.
331
+ */
332
+ function bp_members_sanitize_invitation_property( $value = '', $property = '', $context = 'html' ) {
333
+ if ( ! $property ) {
334
+ return '';
335
+ }
336
+
337
+ switch ( $property ) {
338
+ case 'id':
339
+ case 'user_id':
340
+ case 'item_id':
341
+ case 'secondary_item_id':
342
+ $value = absint( $value );
343
+ break;
344
+ case 'invite_sent':
345
+ case 'accepted':
346
+ $value = absint( $value ) ? __( 'Yes', 'buddypress' ) : __( 'No', 'buddypress' );
347
+ $value = 'attribute' === $context ? esc_attr( $value ) : esc_html( $value );
348
+ break;
349
+ case 'invitee_email':
350
+ $value = sanitize_email( $value );
351
+ break;
352
+ case 'content':
353
+ $value = wp_kses( $value, array() );
354
+ $value = wptexturize( $value );
355
+ break;
356
+ case 'date_modified':
357
+ $value = mysql2date( 'Y/m/d g:i:s a', $value );
358
+ $value = 'attribute' === $context ? esc_attr( $value ) : esc_html( $value );
359
+ break;
360
+
361
+ default:
362
+ $value = 'attribute' === $context ? esc_attr( $value ) : esc_html( $value );
363
+ break;
364
+ }
365
+
366
+ return $value;
367
+ }
368
+ add_filter( 'bp_the_members_invitation_property', 'bp_members_sanitize_invitation_property', 10, 3 );
bp-members/bp-members-functions.php CHANGED
@@ -3306,3 +3306,345 @@ function bp_members_avatar_upload_dir( $directory = 'avatars', $user_id = 0 ) {
3306
  'error' => false
3307
  ) );
3308
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3306
  'error' => false
3307
  ) );
3308
  }
3309
+
3310
+ /**
3311
+ * Send welcome email on successful user activation.
3312
+ *
3313
+ * @since 8.0.0
3314
+ *
3315
+ * @param int $user_id The new user's ID
3316
+ */
3317
+ function bp_send_welcome_email( $user_id = 0 ) {
3318
+ if ( ! $user_id ) {
3319
+ return;
3320
+ }
3321
+
3322
+ $profile_url = bp_core_get_user_domain( $user_id );
3323
+
3324
+ /**
3325
+ * Use this filter to add/edit/remove tokens to use for your welcome email.
3326
+ *
3327
+ * @since 8.0.0
3328
+ *
3329
+ * @param array $value An array of BP Email tokens.
3330
+ * @param int $user_id The user ID.
3331
+ */
3332
+ $welcome_tokens = apply_filters(
3333
+ 'bp_send_welcome_email_tokens',
3334
+ array(
3335
+ 'displayname' => bp_core_get_user_displayname( $user_id ),
3336
+ 'profile.url' => $profile_url,
3337
+ 'lostpassword.url' => wp_lostpassword_url( $profile_url ),
3338
+ ),
3339
+ $user_id
3340
+ );
3341
+
3342
+ bp_send_email( 'core-user-activation', $user_id, array( 'tokens' => $welcome_tokens ) );
3343
+ }
3344
+ add_action( 'bp_core_activated_user', 'bp_send_welcome_email', 10, 1 );
3345
+
3346
+ /**
3347
+ * Get invitations to the BP community filtered by arguments.
3348
+ *
3349
+ * @since 8.0.0
3350
+ *
3351
+ * @param array $args Invitation arguments.
3352
+ * See BP_Invitation::get() for list.
3353
+ *
3354
+ * @return array $invites Matching BP_Invitation objects.
3355
+ */
3356
+ function bp_members_invitations_get_invites( $args = array() ) {
3357
+ $invites_class = new BP_Members_Invitation_Manager();
3358
+ return $invites_class->get_invitations( $args );
3359
+ }
3360
+
3361
+ /**
3362
+ * Check whether a user has sent any community invitations.
3363
+ *
3364
+ * @since 8.0.0
3365
+ *
3366
+ * @param int $user_id ID of user to check for invitations sent by.
3367
+ * Defaults to the current user's ID.
3368
+ *
3369
+ * @return bool $invites True if user has sent invites.
3370
+ */
3371
+ function bp_members_invitations_user_has_sent_invites( $user_id = 0 ) {
3372
+ if ( 0 === $user_id ) {
3373
+ $user_id = bp_loggedin_user_id();
3374
+ if ( ! $user_id ) {
3375
+ return false;
3376
+ }
3377
+ }
3378
+ $invites_class = new BP_Members_Invitation_Manager();
3379
+ $args = array(
3380
+ 'inviter_id' => $user_id,
3381
+ );
3382
+ return (bool) $invites_class->invitation_exists( $args );
3383
+ }
3384
+
3385
+ /**
3386
+ * Invite a user to a BP community.
3387
+ *
3388
+ * @since 8.0.0
3389
+ *
3390
+ * @param array|string $args {
3391
+ * Array of arguments.
3392
+ * @type int $invitee_email Email address of the user being invited.
3393
+ * @type int $network_id ID of the network to which the user is being invited.
3394
+ * @type int $inviter_id Optional. ID of the inviting user. Default:
3395
+ * ID of the logged-in user.
3396
+ * @type string $date_modified Optional. Modified date for the invitation.
3397
+ * Default: current date/time.
3398
+ * @type string $content Optional. Message to invitee.
3399
+ * @type bool $send_invite Optional. Whether the invitation should be
3400
+ * sent now. Default: false.
3401
+ * }
3402
+ * @return bool True on success, false on failure.
3403
+ */
3404
+ function bp_members_invitations_invite_user( $args = array() ) {
3405
+ $r = bp_parse_args(
3406
+ $args,
3407
+ array(
3408
+ 'invitee_email' => '',
3409
+ 'network_id' => get_current_network_id(),
3410
+ 'inviter_id' => bp_loggedin_user_id(),
3411
+ 'date_modified' => bp_core_current_time(),
3412
+ 'content' => '',
3413
+ 'send_invite' => 0
3414
+ ),
3415
+ 'members_invitations_invite_user'
3416
+ );
3417
+
3418
+ $inv_args = array(
3419
+ 'invitee_email' => $r['invitee_email'],
3420
+ 'item_id' => $r['network_id'],
3421
+ 'inviter_id' => $r['inviter_id'],
3422
+ 'date_modified' => $r['date_modified'],
3423
+ 'content' => $r['content'],
3424
+ 'send_invite' => $r['send_invite']
3425
+ );
3426
+
3427
+ // Create the invitataion.
3428
+ $invites_class = new BP_Members_Invitation_Manager();
3429
+ $created = $invites_class->add_invitation( $inv_args );
3430
+
3431
+ /**
3432
+ * Fires after the creation of a new network invite.
3433
+ *
3434
+ * @since 8.0.0
3435
+ *
3436
+ * @param array $r Array of parsed arguments for the network invite.
3437
+ * @param int|bool $created The ID of the invitation or false if it couldn't be created.
3438
+ */
3439
+ do_action( 'bp_members_invitations_invite_user', $r, $created );
3440
+
3441
+ return $created;
3442
+ }
3443
+
3444
+ /**
3445
+ * Resend a membership invitation email by id.
3446
+ *
3447
+ * @since 8.0.0
3448
+ *
3449
+ * @param int $id ID of the invitation to resend.
3450
+ * @return bool True on success, false on failure.
3451
+ */
3452
+ function bp_members_invitation_resend_by_id( $id = 0 ) {
3453
+
3454
+ // Find the invitation before resending it.
3455
+ $existing_invite = new BP_Invitation( $id );
3456
+ $invites_class = new BP_Members_Invitation_Manager();
3457
+ $success = $invites_class->send_invitation_by_id( $id );
3458
+
3459
+ if ( ! $success ) {
3460
+ return $success;
3461
+ }
3462
+
3463
+ /**
3464
+ * Fires after the re-sending of a network invite.
3465
+ *
3466
+ * @since 8.0.0
3467
+ *
3468
+ * @param BP_Invitation $existing_invite The invitation that was resent.
3469
+ */
3470
+ do_action( 'bp_members_invitations_resend_invitation', $existing_invite );
3471
+
3472
+ return $success;
3473
+ }
3474
+
3475
+ /**
3476
+ * Delete a membership invitation by id.
3477
+ *
3478
+ * @since 8.0.0
3479
+ *
3480
+ * @param int $id ID of the invitation to delete.
3481
+ * @return int|bool Number of rows deleted on success, false on failure.
3482
+ */
3483
+ function bp_members_invitations_delete_by_id( $id = 0 ) {
3484
+
3485
+ // Find the invitation before deleting it.
3486
+ $existing_invite = new BP_Invitation( $id );
3487
+ $invites_class = new BP_Members_Invitation_Manager();
3488
+ $success = $invites_class->delete_by_id( $id );
3489
+
3490
+ if ( ! $success ) {
3491
+ return $success;
3492
+ }
3493
+
3494
+ // Run a different action depending on the status of the invite.
3495
+ if ( ! $existing_invite->invite_sent ) {
3496
+ /**
3497
+ * Fires after the deletion of an unsent community invite.
3498
+ *
3499
+ * @since 8.0.0
3500
+ *
3501
+ * @param BP_Invitation $existing_invite The invitation to be deleted.
3502
+ */
3503
+ do_action( 'bp_members_invitations_canceled_invitation', $existing_invite );
3504
+ } else if ( ! $existing_invite->accepted ) {
3505
+ /**
3506
+ * Fires after the deletion of a sent, but not yet accepted, community invite.
3507
+ *
3508
+ * @since 8.0.0
3509
+ *
3510
+ * @param BP_Invitation $existing_invite The invitation to be deleted.
3511
+ */
3512
+ do_action( 'bp_members_invitations_revoked_invitation', $existing_invite );
3513
+ } else {
3514
+ /**
3515
+ * Fires after the deletion of a sent and accepted community invite.
3516
+ *
3517
+ * @since 8.0.0
3518
+ *
3519
+ * @param BP_Invitation $existing_invite The invitation to be deleted.
3520
+ */
3521
+ do_action( 'bp_members_invitations_deleted_invitation', $existing_invite );
3522
+ }
3523
+
3524
+ return $success;
3525
+ }
3526
+
3527
+ /**
3528
+ * Delete a membership invitation.
3529
+ *
3530
+ * @since 8.0.0
3531
+ *
3532
+ * @param intring $args {
3533
+ * Array of arguments.
3534
+ * @type int|array $id Id(s) of the invitation(s) to remove.
3535
+ * @type int $invitee_email Email address of the user being invited.
3536
+ * @type int $network_id ID of the network to which the user is being invited.
3537
+ * @type int $inviter_id ID of the inviting user.
3538
+ * @type int $accepted Whether the invitation has been accepted yet.
3539
+ * @type int $invite_sent Whether the invitation has been sent yet.
3540
+ * }
3541
+ * @return bool True if all were deleted.
3542
+ */
3543
+ function bp_members_invitations_delete_invites( $args = array() ) {
3544
+ $r = bp_parse_args(
3545
+ $args,
3546
+ array(
3547
+ 'id' => false,
3548
+ 'invitee_email' => '',
3549
+ 'network_id' => get_current_network_id(),
3550
+ 'inviter_id' => null,
3551
+ 'accepted' => null,
3552
+ 'invite_sent' => null
3553
+ ),
3554
+ 'members_invitations_delete_invites'
3555
+ );
3556
+
3557
+ $inv_args = array(
3558
+ 'id' => $r['id'],
3559
+ 'invitee_email' => $r['invitee_email'],
3560
+ 'item_id' => $r['network_id'],
3561
+ 'inviter_id' => $r['inviter_id'],
3562
+ 'accepted' => $r['accepted'],
3563
+ 'invite_sent' => $r['invite_sent']
3564
+ );
3565
+
3566
+ // Find the invitation(s).
3567
+ $invites = bp_members_invitations_get_invites( $inv_args );
3568
+ $total_count = count( $invites );
3569
+
3570
+ // Loop through, deleting each invitation.
3571
+ $deleted = 0;
3572
+ foreach ( $invites as $invite ) {
3573
+ $success = bp_members_invitations_delete_by_id( $invite->id );
3574
+ if ( $success ) {
3575
+ $deleted++;
3576
+ }
3577
+ }
3578
+
3579
+ return $deleted === $total_count;
3580
+ }
3581
+
3582
+ /**
3583
+ * Get hash based on details of a membership invitation and the inviter.
3584
+ *
3585
+ * @since 8.0.0
3586
+ *
3587
+ * @param BP_Invitation object $invitation Invitation to create hash from.
3588
+ *
3589
+ * @return string $hash Calculated sha1 hash.
3590
+ */
3591
+ function bp_members_invitations_get_hash( BP_Invitation $invitation ) {
3592
+ $hash = false;
3593
+
3594
+ if ( ! empty( $invitation->id ) ) {
3595
+ $inviter_ud = get_userdata( $invitation->inviter_id );
3596
+ if ( $inviter_ud ) {
3597
+ /*
3598
+ * Use some inviter details as part of the hash so that invitations from
3599
+ * users who are subsequently marked as spam will be invalidated.
3600
+ */
3601
+ $hash = wp_hash( "{$invitation->inviter_id}:{$invitation->invitee_email}:{$inviter_ud->user_status}:{$inviter_ud->user_registered}" );
3602
+ }
3603
+ }
3604
+
3605
+ // If there's a problem, return a string that will change and thus fail.
3606
+ if ( ! $hash ) {
3607
+ $hash = wp_generate_password( 32, false );
3608
+ }
3609
+
3610
+ /**
3611
+ * Filters the hash calculated by the invitation details.
3612
+ *
3613
+ * @since 8.0.0
3614
+ *
3615
+ * @param string $hash Calculated sha1 hash.
3616
+ * @param BP_Invitation object $invitation Invitation hash was created from.
3617
+ */
3618
+ return apply_filters( 'bp_members_invitations_get_hash', $hash, $invitation );
3619
+ }
3620
+
3621
+ /**
3622
+ * Get the current invitation specified by the $_GET parameters.
3623
+ *
3624
+ * @since 8.0.0
3625
+ *
3626
+ * @return BP_Invitation $invite Invitation specified by the $_GET parameters.
3627
+ */
3628
+ function bp_get_members_invitation_from_request() {
3629
+ $invites_class = new BP_Members_Invitation_Manager();
3630
+ $invite = $invites_class->get_by_id( 0 );
3631
+
3632
+ if ( bp_get_members_invitations_allowed() && ! empty( $_GET['inv'] ) ) {
3633
+ // Check to make sure the passed hash matches a calculated hash.
3634
+ $maybe_invite = $invites_class->get_by_id( absint( $_GET['inv'] ) );
3635
+ $hash = bp_members_invitations_get_hash( $maybe_invite );
3636
+
3637
+ if ( $_GET['ih'] === $hash ) {
3638
+ $invite = $maybe_invite;
3639
+ }
3640
+ }
3641
+
3642
+ /**
3643
+ * Filters the invitation specified by the $_GET parameters.
3644
+ *
3645
+ * @since 8.0.0
3646
+ *
3647
+ * @param BP_Invitation $invite Invitation specified by the $_GET parameters.
3648
+ */
3649
+ return apply_filters( 'bp_get_members_invitation_from_request', $invite );
3650
+ }
bp-members/bp-members-invitations.php ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * BuddyPress Membersip Invitations
4
+ *
5
+ * @package BuddyPress
6
+ * @subpackage MembersInvitations
7
+ * @since 8.0.0
8
+ */
9
+
10
+ // Exit if accessed directly.
11
+ defined( 'ABSPATH' ) || exit;
12
+
13
+ /**
14
+ * Set up the displayed user's Members Invitations nav.
15
+ *
16
+ * @since 8.0.0
17
+ */
18
+ function bp_members_invitations_setup_nav() {
19
+ if ( ! bp_get_members_invitations_allowed() ) {
20
+ return;
21
+ }
22
+
23
+ $user_has_access = bp_user_has_access();
24
+ $default_subnav_slug = ( bp_is_my_profile() && bp_user_can( bp_displayed_user_id(), 'bp_members_invitations_view_send_screen' ) ) ? 'send-invites' : 'list-invites';
25
+
26
+ /* Add 'Invitations' to the main user profile navigation */
27
+ bp_core_new_nav_item(
28
+ array(
29
+ 'name' => __( 'Invitations', 'buddypress' ),
30
+ 'slug' => bp_get_members_invitations_slug(),
31
+ 'position' => 80,
32
+ 'screen_function' => 'members_screen_send_invites',
33
+ 'default_subnav_slug' => $default_subnav_slug,
34
+ 'show_for_displayed_user' => $user_has_access && bp_user_can( bp_displayed_user_id(), 'bp_members_invitations_view_screens' )
35
+ )
36
+ );
37
+
38
+ $parent_link = trailingslashit( bp_displayed_user_domain() . bp_get_members_invitations_slug() );
39
+
40
+ /* Create two subnav items for community invitations */
41
+ bp_core_new_subnav_item(
42
+ array(
43
+ 'name' => __( 'Send Invites', 'buddypress' ),
44
+ 'slug' => 'send-invites',
45
+ 'parent_slug' => bp_get_members_invitations_slug(),
46
+ 'parent_url' => $parent_link,
47
+ 'screen_function' => 'members_screen_send_invites',
48
+ 'position' => 10,
49
+ 'user_has_access' => $user_has_access && bp_is_my_profile() && bp_user_can( bp_displayed_user_id(), 'bp_members_invitations_view_send_screen' )
50
+ )
51
+ );
52
+
53
+ bp_core_new_subnav_item(
54
+ array(
55
+ 'name' => __( 'Pending Invites', 'buddypress' ),
56
+ 'slug' => 'list-invites',
57
+ 'parent_slug' => bp_get_members_invitations_slug(),
58
+ 'parent_url' => $parent_link,
59
+ 'screen_function' => 'members_screen_list_sent_invites',
60
+ 'position' => 20,
61
+ 'user_has_access' => $user_has_access && bp_user_can( bp_displayed_user_id(), 'bp_members_invitations_view_screens' )
62
+ )
63
+ );
64
+ }
65
+ add_action( 'bp_setup_nav', 'bp_members_invitations_setup_nav' );
66
+
67
+ /**
68
+ * When a user joins the network via an invitation, skip sending the activation email.
69
+ *
70
+ * @since 8.0.0
71
+ *
72
+ * @param bool $send Whether or not to send the activation key.
73
+ * @param int $user_id User ID to send activation key to.
74
+ * @param string $user_email User email to send activation key to.
75
+ * @param string $activation_key Activation key to be sent.
76
+ * @param array $usermeta Miscellaneous metadata about the user (blog-specific
77
+ * signup data, xprofile data, etc).
78
+ * @return bool Whether or not to send the activation key.
79
+ */
80
+ function bp_members_invitations_cancel_activation_email( $send, $user_id = 0, $user_email = '', $activation_key = '', $usermeta = array() ) {
81
+ $invite = bp_members_invitations_get_invites(
82
+ array(
83
+ 'invitee_email' => $user_email,
84
+ 'invite_sent' => 'sent'
85
+ )
86
+ );
87
+
88
+ if ( $invite ) {
89
+ $send = false;
90
+ }
91
+
92
+ return $send;
93
+ }
94
+ add_filter( 'bp_core_signup_send_activation_key', 'bp_members_invitations_cancel_activation_email', 10, 5 );
95
+
96
+ /**
97
+ * When a user joins the network via an invitation:
98
+ * - mark all invitations and requests as accepted
99
+ * - activate the user upon signup
100
+ *
101
+ * @since 8.0.0
102
+ *
103
+ * @param bool|WP_Error $user_id True on success, WP_Error on failure.
104
+ * @param string $user_login Login name requested by the user.
105
+ * @param string $user_password Password requested by the user.
106
+ * @param string $user_email Email address requested by the user.
107
+ */
108
+ function bp_members_invitations_complete_signup( $user_id, $user_login = '', $user_password = '', $user_email = '' ) {
109
+ if ( ! $user_id ) {
110
+ return;
111
+ }
112
+
113
+ // Check to see if this signup is the result of a valid invitation.
114
+ $invite = bp_get_members_invitation_from_request();
115
+ if ( ! $invite->id ) {
116
+ return;
117
+ }
118
+
119
+ // Accept the invitation.
120
+ $invites_class = new BP_Members_Invitation_Manager();
121
+ $args = array(
122
+ 'id' => $invite->id,
123
+ );
124
+ $invites_class->accept_invitation( $args );
125
+
126
+ // User has already verified their email by responding to the invitation, so we can activate.
127
+ $key = bp_get_user_meta( $user_id, 'activation_key', true );
128
+ if ( $key ) {
129
+ /**
130
+ * Filters the activation signup.
131
+ *
132
+ * @since 1.1.0
133
+ *
134
+ * @param bool|int $value Value returned by activation.
135
+ * Integer on success, boolean on failure.
136
+ */
137
+ $user = apply_filters( 'bp_core_activate_account', bp_core_activate_signup( $key ) );
138
+
139
+ // If there were errors, add a message and redirect.
140
+ if ( ! empty( $user->errors ) ) {
141
+ bp_core_add_message( $user->get_error_message(), 'error' );
142
+ bp_core_redirect( trailingslashit( bp_get_root_domain() . '/' . $bp->pages->activate->slug ) );
143
+ }
144
+
145
+ bp_core_add_message( __( 'Your account is now active!', 'buddypress' ) );
146
+ bp_core_redirect( add_query_arg( 'activated', '1', bp_get_activation_page() ) );
147
+ }
148
+ }
149
+ add_action( 'bp_core_signup_user', 'bp_members_invitations_complete_signup', 10, 4 );
150
+
151
+ /**
152
+ * Delete site membership invitations when an opt-out request is saved.
153
+ *
154
+ * @since 8.0.0
155
+ *
156
+ * @param BP_Optout $optout Characteristics of the opt-out just saved.
157
+ */
158
+ function bp_members_invitations_delete_optedout_invites( $optout ) {
159
+
160
+ $args = array(
161
+ 'invitee_email' => $optout->email_address,
162
+ );
163
+ bp_members_invitations_delete_invites( $args );
164
+ }
165
+ add_action( 'bp_optout_after_save', 'bp_members_invitations_delete_optedout_invites' );
bp-members/bp-members-notifications.php ADDED
@@ -0,0 +1,231 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * BuddyPress Members Activity Functions.
4
+ *
5
+ * These functions handle the recording, deleting and formatting of activity
6
+ * for the user and for this specific component.
7
+ *
8
+ * @package BuddyPress
9
+ * @subpackage MembersNotifications
10
+ * @since 8.0.0
11
+ */
12
+
13
+ // Exit if accessed directly.
14
+ defined( 'ABSPATH' ) || exit;
15
+
16
+ /**
17
+ * Notification formatting callback for bp-members notifications.
18
+ *
19
+ * @since 8.0.0
20
+ *
21
+ * @param string $action The kind of notification being rendered.
22
+ * @param int $item_id The primary item ID.
23
+ * @param int $secondary_item_id The secondary item ID.
24
+ * @param int $total_items The total number of members-related notifications
25
+ * waiting for the user.
26
+ * @param string $format 'string' for BuddyBar-compatible notifications;
27
+ * 'array' for WP Toolbar. Default: 'string'.
28
+ * @return array|string
29
+ */
30
+ function members_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
31
+
32
+ switch ( $action ) {
33
+ case 'accepted_invitation':
34
+
35
+ // Set up the string and the filter.
36
+ if ( (int) $total_items > 1 ) {
37
+ $link = bp_get_notifications_permalink();
38
+ $amount = 'multiple';
39
+
40
+ // This is the inviter whose invitation was accepted.
41
+ if ( 0 !== (int) $secondary_item_id ) {
42
+ /* translators: %d: the number of new users */
43
+ $text = sprintf( __( '%d members accepted your membership invitations', 'buddypress' ), (int) $total_items );
44
+ // This is someone who also invited that user to join.
45
+ } else {
46
+ /* translators: %d: the number of new users */
47
+ $text = sprintf( __( '%d members are now members of the site', 'buddypress' ), (int) $total_items );
48
+ }
49
+ } else {
50
+ $link = add_query_arg( 'welcome', 1, bp_core_get_user_domain( $item_id ) );
51
+ $amount = 'single';
52
+
53
+ // This is the inviter whose invitation was accepted.
54
+ if ( 0 !== (int) $secondary_item_id ) {
55
+ /* translators: %s: new user name */
56
+ $text = sprintf( __( '%s accepted your membership invitation', 'buddypress' ), bp_core_get_user_displayname( $item_id ) );
57
+ // This is someone who also invited that user to join.
58
+ } else {
59
+ /* translators: %s: new user name */
60
+ $text = sprintf( __( '%s is now a member of the site', 'buddypress' ), bp_core_get_user_displayname( $item_id ) );
61
+ }
62
+ }
63
+ break;
64
+ }
65
+
66
+ // Return either an HTML link or an array, depending on the requested format.
67
+ if ( 'string' == $format ) {
68
+
69
+ /**
70
+ * Filters the format of members notifications based on type and amount * of notifications pending.
71
+ *
72
+ * This is a variable filter that has several versions.
73
+ * The possible versions are:
74
+ * - bp_members_single_accepted_invitation_notification
75
+ * - bp_members_multiple_accepted_invitation_notification
76
+ *
77
+ * @since 8.0.0
78
+ *
79
+ * @param string|array $value Depending on format, an HTML link to new requests profile tab or array with link and text.
80
+ * @param int $total_items The total number of messaging-related notifications waiting for the user.
81
+ * @param int $item_id The primary item ID.
82
+ * @param int $secondary_item_id The secondary item ID.
83
+ */
84
+ $return = apply_filters( 'bp_members_' . $amount . '_'. $action . '_notification', '<a href="' . esc_url( $link ) . '">' . esc_html( $text ) . '</a>', (int) $total_items, $item_id, $secondary_item_id );
85
+ } else {
86
+ /** This filter is documented in bp-members/bp-members-notifications.php */
87
+ $return = apply_filters( 'bp_members_' . $amount . '_'. $action . '_notification', array(
88
+ 'link' => $link,
89
+ 'text' => $text
90
+ ), (int) $total_items, $item_id, $secondary_item_id );
91
+ }
92
+
93
+ /**
94
+ * Fires at the end of the bp-members notification format callback.
95
+ *
96
+ * @since 8.0.0
97
+ *
98
+ * @param string $action The kind of notification being rendered.
99
+ * @param int $item_id The primary item ID.
100
+ * @param int $secondary_item_id The secondary item ID.
101
+ * @param int $total_items The total number of members-related notifications
102
+ * waiting for the user.
103
+ * @param array|string $return Notification text string or array of link and text.
104
+ */
105
+ do_action( 'members_format_notifications', $action, $item_id, $secondary_item_id, $total_items, $return );
106
+
107
+ return $return;
108
+ }
109
+
110
+ /**
111
+ * Notify one use that another user has accepted their site membership invitation.
112
+ *
113
+ * @since 8.0.0
114
+ *
115
+ * @param BP_Invitation $invite Invitation that was accepted.
116
+ * @param WP_user $new_user User who accepted the membership invite.
117
+ * @param int $inviter_id ID of the user who invited this user to the site.
118
+ */
119
+ function bp_members_invitations_accepted_invitation_notification( $invite, $new_user, $inviter_id ) {
120
+
121
+ // Notify all inviters.
122
+ $args = array(
123
+ 'invitee_email' => $new_user->user_email,
124
+ 'accepted' => 'all',
125
+ );
126
+ $invites = bp_members_invitations_get_invites( $args );
127
+
128
+ if ( ! $invites ) {
129
+ return;
130
+ }
131
+ foreach ( $invites as $invite) {
132
+ // Include the id of the "accepted" invitation.
133
+ if ( $invite->inviter_id === $inviter_id ) {
134
+ $secondary_item_id = $invite->id;
135
+ } else {
136
+ // Else don't store the invite id, so we know this is not the primary.
137
+ $secondary_item_id = 0;
138
+ }
139
+ $res = bp_notifications_add_notification( array(
140
+ 'user_id' => $invite->inviter_id,
141
+ 'item_id' => $new_user->ID,
142
+ 'secondary_item_id' => $secondary_item_id,
143
+ 'component_name' => buddypress()->members->id,
144
+ 'component_action' => 'accepted_invitation',
145
+ 'date_notified' => bp_core_current_time(),
146
+ 'is_new' => 1,
147
+ ) );
148
+ }
149
+ }
150
+ add_action( 'members_invitations_invite_accepted', 'bp_members_invitations_accepted_invitation_notification', 10, 3 );
151
+
152
+ /**
153
+ * Mark accepted invitation notifications as read when user visits new user profile.
154
+ *
155
+ *
156
+ * @since 8.0.0
157
+ */
158
+ function bp_members_mark_read_accepted_invitation_notification() {
159
+ if ( false === is_singular() || false === is_user_logged_in() || ! bp_is_user() || empty( $_GET['welcome'] ) ) {
160
+ return;
161
+ }
162
+
163
+ // Mark notification as read.
164
+ BP_Notifications_Notification::update(
165
+ array(
166
+ 'is_new' => false
167
+ ),
168
+ array(
169
+ 'user_id' => bp_loggedin_user_id(),
170
+ 'item_id' => bp_displayed_user_id(),
171
+ )
172
+ );
173
+ }
174
+ add_action( 'bp_screens', 'bp_members_mark_read_accepted_invitation_notification' );
175
+
176
+ /**
177
+ * Add Members-related settings to the Settings > Notifications page.
178
+ *
179
+ * @since 8.0.0
180
+ */
181
+ function members_screen_notification_settings() {
182
+
183
+ // Bail early if invitations are not allowed--they are the only members notification so far.
184
+ if ( ! bp_get_members_invitations_allowed () ) {
185
+ return;
186
+ }
187
+
188
+ if ( ! $allow_acceptance_emails = bp_get_user_meta( bp_displayed_user_id(), 'notification_members_invitation_accepted', true ) ) {
189
+ $allow_acceptance_emails = 'yes';
190
+ }
191
+ ?>
192
+
193
+ <table class="notification-settings" id="members-notification-settings">
194
+ <thead>
195
+ <tr>
196
+ <th class="icon"></th>
197
+ <th class="title"><?php _ex( 'Members', 'Member settings on notification settings page', 'buddypress' ) ?></th>
198
+ <th class="yes"><?php _e( 'Yes', 'buddypress' ) ?></th>
199
+ <th class="no"><?php _e( 'No', 'buddypress' )?></th>
200
+ </tr>
201
+ </thead>
202
+
203
+ <tbody>
204
+ <tr id="members-notification-settings-invitation_accepted">
205
+ <td></td>
206
+ <td><?php _ex( 'Someone accepts your membership invitation', 'Member settings on notification settings page', 'buddypress' ) ?></td>
207
+ <td class="yes"><input type="radio" name="notifications[notification_members_invitation_accepted]" id="notification-members-invitation-accepted-yes" value="yes" <?php checked( $allow_acceptance_emails, 'yes', true ) ?>/><label for="notification-members-invitation-accepted-yes" class="bp-screen-reader-text"><?php
208
+ /* translators: accessibility text */
209
+ _e( 'Yes, send email', 'buddypress' );
210
+ ?></label></td>
211
+ <td class="no"><input type="radio" name="notifications[notification_members_invitation_accepted]" id="notification-members-invitation-accepted-no" value="no" <?php checked( $allow_acceptance_emails, 'no', true ) ?>/><label for="notification-members-invitation-accepted-no" class="bp-screen-reader-text"><?php
212
+ /* translators: accessibility text */
213
+ _e( 'No, do not send email', 'buddypress' );
214
+ ?></label></td>
215
+ </tr>
216
+
217
+ <?php
218
+
219
+ /**
220
+ * Fires after the last table row on the members notification screen.
221
+ *
222
+ * @since 1.0.0
223
+ */
224
+ do_action( 'members_screen_notification_settings' ); ?>
225
+
226
+ </tbody>
227
+ </table>
228
+
229
+ <?php
230
+ }
231
+ add_action( 'bp_notification_settings', 'members_screen_notification_settings' );
bp-members/bp-members-template.php CHANGED
@@ -274,6 +274,34 @@ function bp_activate_slug() {
274
  return apply_filters( 'bp_get_activate_slug', $slug );
275
  }
276
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
277
  /**
278
  * Initialize the members loop.
279
  *
@@ -2381,8 +2409,14 @@ function bp_signup_email_value() {
2381
  */
2382
  function bp_get_signup_email_value() {
2383
  $value = '';
2384
- if ( isset( $_POST['signup_email'] ) )
2385
  $value = $_POST['signup_email'];
 
 
 
 
 
 
2386
 
2387
  /**
2388
  * Filters the email address submitted during signup.
@@ -2755,6 +2789,24 @@ function bp_signup_allowed() {
2755
  return apply_filters( 'bp_get_signup_allowed', (bool) bp_get_option( 'users_can_register' ) );
2756
  }
2757
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2758
  /**
2759
  * Hook member activity feed to <head>.
2760
  *
@@ -2800,35 +2852,43 @@ function bp_members_component_link( $component, $action = '', $query_args = '',
2800
  * @return string
2801
  */
2802
  function bp_get_members_component_link( $component, $action = '', $query_args = '', $nonce = false ) {
2803
-
2804
  // Must be displayed user.
2805
- if ( !bp_displayed_user_id() )
2806
  return;
 
2807
 
2808
  $bp = buddypress();
2809
 
 
 
 
 
2810
  // Append $action to $url if there is no $type.
2811
- if ( !empty( $action ) )
2812
  $url = bp_displayed_user_domain() . $bp->{$component}->slug . '/' . $action;
2813
- else
2814
  $url = bp_displayed_user_domain() . $bp->{$component}->slug;
 
2815
 
2816
  // Add a slash at the end of our user url.
2817
  $url = trailingslashit( $url );
2818
 
2819
  // Add possible query arg.
2820
- if ( !empty( $query_args ) && is_array( $query_args ) )
2821
  $url = add_query_arg( $query_args, $url );
 
2822
 
2823
  // To nonce, or not to nonce...
2824
- if ( true === $nonce )
2825
  $url = wp_nonce_url( $url );
2826
- elseif ( is_string( $nonce ) )
2827
  $url = wp_nonce_url( $url, $nonce );
 
2828
 
2829
  // Return the url, if there is one.
2830
- if ( !empty( $url ) )
2831
  return $url;
 
2832
  }
2833
 
2834
 
@@ -2861,3 +2921,582 @@ function bp_avatar_delete_link() {
2861
  */
2862
  return apply_filters( 'bp_get_avatar_delete_link', wp_nonce_url( bp_displayed_user_domain() . bp_get_profile_slug() . '/change-avatar/delete-avatar/', 'bp_delete_avatar_link' ) );
2863
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  return apply_filters( 'bp_get_activate_slug', $slug );
275
  }
276
 
277
+ /**
278
+ * Output the members invitation pane slug.
279
+ *
280
+ * @since 8.0.0
281
+ *
282
+ */
283
+ function bp_members_invitations_slug() {
284
+ echo bp_get_members_invitations_slug();
285
+ }
286
+ /**
287
+ * Return the members invitations root slug.
288
+ *
289
+ * @since 8.0.0
290
+ *
291
+ * @return string
292
+ */
293
+ function bp_get_members_invitations_slug() {
294
+
295
+ /**
296
+ * Filters the Members invitations pane root slug.
297
+ *
298
+ * @since 8.0.0
299
+ *
300
+ * @param string $slug Members invitations pane root slug.
301
+ */
302
+ return apply_filters( 'bp_get_members_invitations_slug', _x( 'invitations', 'Member profile invitations pane URL base', 'buddypress' ) );
303
+ }
304
+
305
  /**
306
  * Initialize the members loop.
307
  *
2409
  */
2410
  function bp_get_signup_email_value() {
2411
  $value = '';
2412
+ if ( isset( $_POST['signup_email'] ) ) {
2413
  $value = $_POST['signup_email'];
2414
+ } else if ( bp_get_members_invitations_allowed() ) {
2415
+ $invite = bp_get_members_invitation_from_request();
2416
+ if ( $invite ) {
2417
+ $value = $invite->invitee_email;
2418
+ }
2419
+ }
2420
 
2421
  /**
2422
  * Filters the email address submitted during signup.
2789
  return apply_filters( 'bp_get_signup_allowed', (bool) bp_get_option( 'users_can_register' ) );
2790
  }
2791
 
2792
+ /**
2793
+ * Are users allowed to invite users to join this site?
2794
+ *
2795
+ * @since 8.0.0
2796
+ *
2797
+ * @return bool
2798
+ */
2799
+ function bp_get_members_invitations_allowed() {
2800
+ /**
2801
+ * Filters whether or not community invitations are allowed.
2802
+ *
2803
+ * @since 8.0.0
2804
+ *
2805
+ * @param bool $allowed Whether or not community invitations are allowed.
2806
+ */
2807
+ return apply_filters( 'bp_get_members_invitations_allowed', bp_is_active( 'members', 'invitations' ) && (bool) bp_get_option( 'bp-enable-members-invitations' ) );
2808
+ }
2809
+
2810
  /**
2811
  * Hook member activity feed to <head>.
2812
  *
2852
  * @return string
2853
  */
2854
  function bp_get_members_component_link( $component, $action = '', $query_args = '', $nonce = false ) {
 
2855
  // Must be displayed user.
2856
+ if ( ! bp_displayed_user_id() ) {
2857
  return;
2858
+ }
2859
 
2860
  $bp = buddypress();
2861
 
2862
+ if ( 'xprofile' === $component ) {
2863
+ $component = 'profile';
2864
+ }
2865
+
2866
  // Append $action to $url if there is no $type.
2867
+ if ( ! empty( $action ) ) {
2868
  $url = bp_displayed_user_domain() . $bp->{$component}->slug . '/' . $action;
2869
+ } else {
2870
  $url = bp_displayed_user_domain() . $bp->{$component}->slug;
2871
+ }
2872
 
2873
  // Add a slash at the end of our user url.
2874
  $url = trailingslashit( $url );
2875
 
2876
  // Add possible query arg.
2877
+ if ( ! empty( $query_args ) && is_array( $query_args ) ) {
2878
  $url = add_query_arg( $query_args, $url );
2879
+ }
2880
 
2881
  // To nonce, or not to nonce...
2882
+ if ( true === $nonce ) {
2883
  $url = wp_nonce_url( $url );
2884
+ } elseif ( is_string( $nonce ) ) {
2885
  $url = wp_nonce_url( $url, $nonce );
2886
+ }
2887
 
2888
  // Return the url, if there is one.
2889
+ if ( ! empty( $url ) ) {
2890
  return $url;
2891
+ }
2892
  }
2893
 
2894
 
2921
  */
2922
  return apply_filters( 'bp_get_avatar_delete_link', wp_nonce_url( bp_displayed_user_domain() . bp_get_profile_slug() . '/change-avatar/delete-avatar/', 'bp_delete_avatar_link' ) );
2923
  }
2924
+
2925
+
2926
+ /** The Members Invitations Loop ******************************************************************/
2927
+
2928
+ /**
2929
+ * Initialize the community invitations loop.
2930
+ *
2931
+ * Based on the $args passed, bp_has_invitations() populates
2932
+ * buddypress()->invitations->query_loop global, enabling the use of BP
2933
+ * templates and template functions to display a list of invitations.
2934
+ *
2935
+ * @since 8.0.0
2936
+ *
2937
+ * @param array|string $args {
2938
+ * Arguments for limiting the contents of the invitations loop. Can be
2939
+ * passed as an associative array, or as a URL query string.
2940
+ *
2941
+ * See {@link BP_Invitations_Invitation::get()} for detailed
2942
+ * information on the arguments. In addition, also supports:
2943
+ *
2944
+ * @type int $max Optional. Max items to display. Default: false.
2945
+ * @type string $page_arg URL argument to use for pagination.
2946
+ * Default: 'ipage'.
2947
+ * }
2948
+ * @return bool
2949
+ */
2950
+ function bp_has_members_invitations( $args = '' ) {
2951
+
2952
+ // Get the user ID.
2953
+ if ( bp_displayed_user_id() ) {
2954
+ $user_id = bp_displayed_user_id();
2955
+ } else {
2956
+ $user_id = bp_loggedin_user_id();
2957
+ }
2958
+
2959
+ // Set the search terms (by default an empty string to get all notifications)
2960
+ $search_terms = '';
2961
+
2962
+ if ( isset( $_REQUEST['s'] ) ) {
2963
+ $search_terms = stripslashes( $_REQUEST['s'] );
2964
+ }
2965
+
2966
+ // Parse the args.
2967
+ $r = bp_parse_args( $args, array(
2968
+ 'id' => false,
2969
+ 'inviter_id' => $user_id,
2970
+ 'invitee_email' => false,
2971
+ 'item_id' => false,
2972
+ 'type' => 'invite',
2973
+ 'invite_sent' => 'all',
2974
+ 'accepted' => 'pending',
2975
+ 'search_terms' => $search_terms,
2976
+ 'order_by' => 'date_modified',
2977
+ 'sort_order' => 'DESC',
2978
+ 'page' => 1,
2979
+ 'per_page' => 25,
2980
+ 'fields' => 'all',
2981
+
2982
+ // These are additional arguments that are not available in
2983
+ // BP_Invitations_Invitation::get().
2984
+ 'page_arg' => 'ipage',
2985
+ ), 'has_members_invitations' );
2986
+
2987
+ // Get the notifications.
2988
+ $query_loop = new BP_Members_Invitations_Template( $r );
2989
+
2990
+ // Setup the global query loop.
2991
+ buddypress()->members->invitations->query_loop = $query_loop;
2992
+
2993
+ /**
2994
+ * Filters whether or not the user has network invitations to display.
2995
+ *
2996
+ * @since 8.0.0
2997
+ *
2998
+ * @param bool $value Whether or not there are network invitations to display.
2999
+ * @param BP_Notifications_Template $query_loop BP_Members_Invitations_Template object instance.
3000
+ * @param array $r Array of arguments passed into the BP_Members_Invitations_Template class.
3001
+ */
3002
+ return apply_filters( 'bp_has_members_invitations', $query_loop->has_invitations(), $query_loop, $r );
3003
+ }
3004
+
3005
+ /**
3006
+ * Get the network invitations returned by the template loop.
3007
+ *
3008
+ * @since 8.0.0
3009
+ *
3010
+ * @return array List of network invitations.
3011
+ */
3012
+ function bp_the_members_invitations() {
3013
+ return buddypress()->members->invitations->query_loop->invitations();
3014
+ }
3015
+
3016
+ /**
3017
+ * Get the current network invitation object in the loop.
3018
+ *
3019
+ * @since 8.0.0
3020
+ *
3021
+ * @return object The current network invitation within the loop.
3022
+ */
3023
+ function bp_the_members_invitation() {
3024
+ return buddypress()->members->invitations->query_loop->the_invitation();
3025
+ }
3026
+
3027
+ /**
3028
+ * Output the pagination count for the current network invitations loop.
3029
+ *
3030
+ * @since 8.0.0
3031
+ */
3032
+ function bp_members_invitations_pagination_count() {
3033
+ echo bp_get_members_invitations_pagination_count();
3034
+ }
3035
+ /**
3036
+ * Return the pagination count for the current network invitation loop.
3037
+ *
3038
+ * @since 8.0.0
3039
+ *
3040
+ * @return string HTML for the pagination count.
3041
+ */
3042
+ function bp_get_members_invitations_pagination_count() {
3043
+ $query_loop = buddypress()->members->invitations->query_loop;
3044
+ $start_num = intval( ( $query_loop->pag_page - 1 ) * $query_loop->pag_num ) + 1;
3045
+ $from_num = bp_core_number_format( $start_num );
3046
+ $to_num = bp_core_number_format( ( $start_num + ( $query_loop->pag_num - 1 ) > $query_loop->total_invitation_count ) ? $query_loop->total_invitation_count : $start_num + ( $query_loop->pag_num - 1 ) );
3047
+ $total = bp_core_number_format( $query_loop->total_invitation_count );
3048
+
3049
+ if ( 1 == $query_loop->total_invitation_count ) {
3050
+ $pag = __( 'Viewing 1 invitation', 'buddypress' );
3051
+ } else {
3052
+ /* translators: 1: Invitations from number. 2: Invitations to number. 3: Total invitations. */
3053
+ $pag = sprintf( _nx( 'Viewing %1$s - %2$s of %3$s invitation', 'Viewing %1$s - %2$s of %3$s invitations', $query_loop->total_invitation_count, 'Community invites pagination', 'buddypress' ), $from_num, $to_num, $total );
3054
+ }
3055
+
3056
+ /**
3057
+ * Filters the pagination count for the current network invitation loop.
3058
+ *
3059
+ * @since 8.0.0
3060
+ *
3061
+ * @param string $pag HTML for the pagination count.
3062
+ */
3063
+ return apply_filters( 'bp_get_members_invitations_pagination_count', $pag );
3064
+ }
3065
+
3066
+ /**
3067
+ * Output the pagination links for the current network invitation loop.
3068
+ *
3069
+ * @since 8.0.0
3070
+ */
3071
+ function bp_members_invitations_pagination_links() {
3072
+ echo bp_get_members_invitations_pagination_links();
3073
+ }
3074
+ /**
3075
+ * Return the pagination links for the current network invitations loop.
3076
+ *
3077
+ * @since 8.0.0
3078
+ *
3079
+ * @return string HTML for the pagination links.
3080
+ */
3081
+ function bp_get_members_invitations_pagination_links() {
3082
+
3083
+ /**
3084
+ * Filters the pagination links for the current network invitations loop.
3085
+ *
3086
+ * @since 8.0.0
3087
+ *
3088
+ * @param string $pag_links HTML for the pagination links.
3089
+ */
3090
+ return apply_filters( 'bp_get_members_invitations_pagination_links', buddypress()->members->invitations->query_loop->pag_links );
3091
+ }
3092
+
3093
+ /**
3094
+ * Output the requested property of the invitation currently being iterated on.
3095
+ *
3096
+ * @since 8.0.0
3097
+ *
3098
+ * @param string $property The name of the property to display.
3099
+ * @param string $context The context of display.
3100
+ * Possible values are 'attribute' and 'html'.
3101
+ */
3102
+ function bp_the_members_invitation_property( $property = '', $context = 'html' ) {
3103
+ if ( ! $property ) {
3104
+ return;
3105
+ }
3106
+
3107
+ /**
3108
+ * Use this filter to sanitize the output.
3109
+ *
3110
+ * @since 8.0.0
3111
+ *
3112
+ * @param int|string $value The value for the requested property.
3113
+ * @param string $property The name of the requested property.
3114
+ * @param string $context The context of display.
3115
+ */
3116
+ echo apply_filters( 'bp_the_members_invitation_property', bp_get_the_members_invitation_property( $property ), $property, $context );
3117
+ }
3118
+ /**
3119
+ * Return the value for a property of the network invitation currently being iterated on.
3120
+ *
3121
+ * @since 8.0.0
3122
+ *
3123
+ * @return int ID of the current network invitation.
3124
+ */
3125
+ function bp_get_the_members_invitation_property( $property = 'id' ) {
3126
+
3127
+ switch ( $property ) {
3128
+ case 'id':
3129
+ case 'user_id':
3130
+ case 'item_id':
3131
+ case 'secondary_item_id':
3132
+ case 'invite_sent':
3133
+ case 'accepted':
3134
+ $value = 0;
3135
+ break;
3136
+ case 'invitee_email':
3137
+ case 'type':
3138
+ case 'content':
3139
+ case 'date_modified':
3140
+ $value = '';
3141
+ break;
3142
+ default:
3143
+ // A known property has not been specified.
3144
+ $property = null;
3145
+ $value = '';
3146
+ break;
3147
+ }
3148
+
3149
+ if ( isset( buddypress()->members->invitations->query_loop->invitation->{$property} ) ) {
3150
+ $value = buddypress()->members->invitations->query_loop->invitation->{$property};
3151
+ }
3152
+
3153
+ /**
3154
+ * Filters the property of the network invitation currently being iterated on.
3155
+ *
3156
+ * @since 8.0.0
3157
+ *
3158
+ * @param int|string $value Property value of the network invitation being iterated on.
3159
+ */
3160
+ return apply_filters( 'bp_get_the_members_invitation_property_' . $property, $value );
3161
+ }
3162
+
3163
+ /**
3164
+ * Output the action links for the current invitation.
3165
+ *
3166
+ * @since 8.0.0
3167
+ *
3168
+ * @param array|string $args Array of arguments.
3169
+ */
3170
+ function bp_the_members_invitation_action_links( $args = '' ) {
3171
+ echo bp_get_the_members_invitation_action_links( $args );
3172
+ }
3173
+ /**
3174
+ * Return the action links for the current invitation.
3175
+ *
3176
+ * @since 8.0.0
3177
+ *
3178
+ * @param array|string $args {
3179
+ * @type string $before HTML before the links.
3180
+ * @type string $after HTML after the links.
3181
+ * @type string $sep HTML between the links.
3182
+ * @type array $links Array of links to implode by 'sep'.
3183
+ * @type int $user_id User ID to fetch action links for. Defaults to displayed user ID.
3184
+ * }
3185
+ * @return string HTML links for actions to take on single notifications.
3186
+ */
3187
+ function bp_get_the_members_invitation_action_links( $args = '' ) {
3188
+ // Set default user ID to use.
3189
+ $inviter_id = isset( $args['inviter_id'] ) ? $args['inviter_id'] : bp_displayed_user_id();
3190
+
3191
+ // Parse.
3192
+ $r = wp_parse_args( $args, array(
3193
+ 'before' => '',
3194
+ 'after' => '',
3195
+ 'sep' => ' | ',
3196
+ 'links' => array(
3197
+ bp_get_the_members_invitation_resend_link( $inviter_id ),
3198
+ bp_get_the_members_invitation_delete_link( $inviter_id )
3199
+ )
3200
+ ) );
3201
+
3202
+ // Build the links.
3203
+ $retval = $r['before'] . implode( $r['sep'], $r['links'] ) . $r['after'];
3204
+
3205
+ /**
3206
+ * Filters the action links for the current invitation.
3207
+ *
3208
+ * @since 8.0.0
3209
+ *
3210
+ * @param string $retval HTML links for actions to take on single invitation.
3211
+ * @param array $r Array of parsed arguments.
3212
+ */
3213
+ return apply_filters( 'bp_get_the_members_invitation_action_links', $retval, $r );
3214
+ }
3215
+
3216
+ /**
3217
+ * Output the resend link for the current invitation.
3218
+ *
3219
+ * @since 8.0.0
3220
+ *
3221
+ * @param int $user_id The user ID.
3222
+ */
3223
+ function bp_the_members_invitations_resend_link( $user_id = 0 ) {
3224
+ echo bp_get_the_members_invitation_delete_link( $user_id );
3225
+ }
3226
+ /**
3227
+ * Return the resend link for the current notification.
3228
+ *
3229
+ * @since 8.0.0
3230
+ *
3231
+ * @param int $user_id The user ID.
3232
+ * @return string
3233
+ */
3234
+ function bp_get_the_members_invitation_resend_link( $user_id = 0 ) {
3235
+ // Set default user ID to use.
3236
+ $user_id = 0 === $user_id ? bp_displayed_user_id() : $user_id;
3237
+
3238
+ // Don't allow resending of accepted invitations.
3239
+ if ( bp_get_the_members_invitation_property( 'accepted' ) ) {
3240
+ return;
3241
+ }
3242
+
3243
+ $retval = sprintf( '<a href="%1$s" class="resend secondary confirm bp-tooltip">%2$s</a>', esc_url( bp_get_the_members_invitations_resend_url( $user_id ) ), __( 'Resend', 'buddypress' ) );
3244
+
3245
+ /**
3246
+ * Filters the resend link for the current invitation.
3247
+ *
3248
+ * @since 8.0.0
3249
+ *
3250
+ * @param string $retval HTML for the delete link for the current notification.
3251
+ * @param int $user_id The user ID.
3252
+ */
3253
+ return apply_filters( 'bp_get_the_members_invitation_resend_link', $retval, $user_id );
3254
+ }
3255
+
3256
+ /**
3257
+ * Output the URL used for resending a single invitation.
3258
+ *
3259
+ * Since this function directly outputs a URL, it is escaped.
3260
+ *
3261
+ * @since 8.0.0
3262
+ *
3263
+ * @param int $user_id The user ID.
3264
+ */
3265
+ function bp_the_members_invitations_resend_url( $user_id = 0 ) {
3266
+ echo esc_url( bp_get_the_members_invitations_resend_url( $user_id ) );
3267
+ }
3268
+ /**
3269
+ * Return the URL used for resending a single invitation.
3270
+ *
3271
+ * @since 8.0.0
3272
+ *
3273
+ * @param int $user_id The user ID.
3274
+ * @return string
3275
+ */
3276
+ function bp_get_the_members_invitations_resend_url( $user_id = 0 ) {
3277
+ // Set default user ID to use.
3278
+ $user_id = 0 === $user_id ? bp_displayed_user_id() : $user_id;
3279
+ $link = bp_get_members_invitations_list_invites_permalink( $user_id );
3280
+
3281
+ // Get the ID.
3282
+ $id = bp_get_the_members_invitation_property( 'id' );
3283
+
3284
+ // Get the args to add to the URL.
3285
+ $args = array(
3286
+ 'action' => 'resend',
3287
+ 'invitation_id' => $id
3288
+ );
3289
+
3290
+ // Add the args.
3291
+ $url = add_query_arg( $args, $link );
3292
+
3293
+ // Add the nonce.
3294
+ $url = wp_nonce_url( $url, 'bp_members_invitation_resend_' . $id );
3295
+
3296
+ /**
3297
+ * Filters the URL used for resending a single invitation.
3298
+ *
3299
+ * @since 8.0.0
3300
+ *
3301
+ * @param string $url URL used for deleting a single invitation.
3302
+ * @param int $user_id The user ID.
3303
+ */
3304
+ return apply_filters( 'bp_get_the_members_invitations_resend_url', $url, $user_id );
3305
+ }
3306
+
3307
+ /**
3308
+ * Output the delete link for the current invitation.
3309
+ *
3310
+ * @since 8.0.0
3311
+ *
3312
+ * @param int $user_id The user ID.
3313
+ */
3314
+ function bp_the_members_invitations_delete_link( $user_id = 0 ) {
3315
+ echo bp_get_the_members_invitation_delete_link( $user_id );
3316
+ }
3317
+ /**
3318
+ * Return the delete link for the current invitation.
3319
+ *
3320
+ * @since 8.0.0
3321
+ *
3322
+ * @param int $user_id The user ID.
3323
+ * @return string
3324
+ */
3325
+ function bp_get_the_members_invitation_delete_link( $user_id = 0 ) {
3326
+ // Set default user ID to use.
3327
+ $user_id = 0 === $user_id ? bp_displayed_user_id() : $user_id;
3328
+
3329
+ // Modify the message for accepted/not accepted invitatons.
3330
+ if ( bp_get_the_members_invitation_property( 'accepted' ) ) {
3331
+ $message = __( 'Delete', 'buddypress' );
3332
+ } else {
3333
+ $message = __( 'Cancel', 'buddypress' );
3334
+ }
3335
+
3336
+ $retval = sprintf(
3337
+ '<a href="%1$s" class="delete secondary confirm bp-tooltip">%2$s</a>',
3338
+ esc_url( bp_get_the_members_invitations_delete_url( $user_id ) ),
3339
+ esc_html( $message )
3340
+ );
3341
+
3342
+ /**
3343
+ * Filters the delete link for the current invitation.
3344
+ *
3345
+ * @since 8.0.0
3346
+ *
3347
+ * @param string $retval HTML for the delete link for the current notification.
3348
+ * @param int $user_id The user ID.
3349
+ */
3350
+ return apply_filters( 'bp_get_the_members_invitation_delete_link', $retval, $user_id );
3351
+ }
3352
+
3353
+ /**
3354
+ * Output the URL used for deleting a single invitation.
3355
+ *
3356
+ * Since this function directly outputs a URL, it is escaped.
3357
+ *
3358
+ * @since 8.0.0
3359
+ *
3360
+ * @param int $user_id The user ID.
3361
+ */
3362
+ function bp_the_members_invitations_delete_url( $user_id = 0 ) {
3363
+ echo esc_url( bp_get_the_members_invitations_delete_url( $user_id ) );
3364
+ }
3365
+ /**
3366
+ * Return the URL used for deleting a single invitation.
3367
+ *
3368
+ * @since 8.0.0
3369
+ *
3370
+ * @param int $user_id The user ID.
3371
+ * @return string
3372
+ */
3373
+ function bp_get_the_members_invitations_delete_url( $user_id = 0 ) {
3374
+ // Set default user ID to use.
3375
+ $user_id = 0 === $user_id ? bp_displayed_user_id() : $user_id;
3376
+ $link = bp_get_members_invitations_list_invites_permalink( $user_id );
3377
+
3378
+ // Get the ID.
3379
+ $id = bp_get_the_members_invitation_property( 'id' );
3380
+
3381
+ // Get the args to add to the URL.
3382
+ $args = array(
3383
+ 'action' => 'cancel',
3384
+ 'invitation_id' => $id
3385
+ );
3386
+
3387
+ // Add the args.
3388
+ $url = add_query_arg( $args, $link );
3389
+
3390
+ // Add the nonce.
3391
+ $url = wp_nonce_url( $url, 'bp_members_invitations_cancel_' . $id );
3392
+
3393
+ /**
3394
+ * Filters the URL used for deleting a single invitation.
3395
+ *
3396
+ * @since 8.0.0
3397
+ *
3398
+ * @param string $url URL used for deleting a single invitation.
3399
+ * @param int $user_id The user ID.
3400
+ */
3401
+ return apply_filters( 'bp_get_the_members_invitations_delete_url', $url, $user_id );
3402
+ }
3403
+
3404
+ /**
3405
+ * Output the members invitations list permalink for a user.
3406
+ *
3407
+ * @since 8.0.0
3408
+ *
3409
+ * @param int $user_id The user ID.
3410
+ */
3411
+ function bp_members_invitations_list_invites_permalink( $user_id = 0 ) {
3412
+ echo bp_get_members_invitations_list_invites_permalink( $user_id );
3413
+ }
3414
+ /**
3415
+ * Return the members invitations list permalink for a user.
3416
+ *
3417
+ * @since 8.0.0
3418
+ *
3419
+ * @return string Members invitations list permalink for a user.
3420
+ */
3421
+ function bp_get_members_invitations_list_invites_permalink( $user_id = 0 ) {
3422
+ if ( 0 === $user_id ) {
3423
+ $user_id = bp_loggedin_user_id();
3424
+ $domain = bp_loggedin_user_domain();
3425
+ } else {
3426
+ $domain = bp_core_get_user_domain( (int) $user_id );
3427
+ }
3428
+
3429
+ $retval = trailingslashit( $domain . bp_get_members_invitations_slug() . '/list-invites' );
3430
+
3431
+ /**
3432
+ * Filters the members invitations list permalink for a user.
3433
+ *
3434
+ * @since 8.0.0
3435
+ *
3436
+ * @param string $retval Permalink for the sent invitation list screen.
3437
+ * @param int $user_id The user ID.
3438
+ */
3439
+ return apply_filters( 'bp_get_members_invitations_list_invites_permalink', $retval, $user_id );
3440
+ }
3441
+
3442
+ /**
3443
+ * Output the send invitation permalink for a user.
3444
+ *
3445
+ * @since 8.0.0
3446
+ *
3447
+ * @param int $user_id The user ID.
3448
+ */
3449
+ function bp_members_invitations_send_invites_permalink( $user_id = 0 ) {
3450
+ echo bp_get_members_invitations_send_invites_permalink( $user_id );
3451
+ }
3452
+ /**
3453
+ * Return the send invitations permalink.
3454
+ *
3455
+ * @since 8.0.0
3456
+ *
3457
+ * @param int $user_id The user ID.
3458
+ * @return string The send invitations permalink.
3459
+ */
3460
+ function bp_get_members_invitations_send_invites_permalink( $user_id = 0 ) {
3461
+ if ( 0 === $user_id ) {
3462
+ $user_id = bp_loggedin_user_id();
3463
+ $domain = bp_loggedin_user_domain();
3464
+ } else {
3465
+ $domain = bp_core_get_user_domain( (int) $user_id );
3466
+ }
3467
+
3468
+ $retval = trailingslashit( $domain . bp_get_members_invitations_slug() . '/send-invites' );
3469
+
3470
+ /**
3471
+ * Filters the send invitations permalink.
3472
+ *
3473
+ * @since 8.0.0
3474
+ *
3475
+ * @param string $retval Permalink for the sent invitation list screen.
3476
+ * @param int $user_id The user ID.
3477
+ */
3478
+ return apply_filters( 'bp_get_members_invitations_send_invites_permalink', $retval, $user_id );
3479
+ }
3480
+
3481
+ /**
3482
+ * Output the dropdown for bulk management of invitations.
3483
+ *
3484
+ * @since 8.0.0
3485
+ */
3486
+ function bp_members_invitations_bulk_management_dropdown() {
3487
+ ?>
3488
+ <label class="bp-screen-reader-text" for="invitation-select">
3489
+ <?php
3490
+ esc_html_e( 'Select Bulk Action', 'buddypress' );
3491
+ ?>
3492
+ </label>
3493
+
3494
+ <select name="invitation_bulk_action" id="invitation-select">
3495
+ <option value="" selected="selected"><?php esc_html_e( 'Bulk Actions', 'buddypress' ); ?></option>
3496
+ <option value="resend"><?php echo esc_html_x( 'Resend', 'button', 'buddypress' ); ?></option>
3497
+ <option value="cancel"><?php echo esc_html_x( 'Cancel', 'button', 'buddypress' ); ?></option>
3498
+ </select>
3499
+
3500
+ <input type="submit" id="invitation-bulk-manage" class="button action" value="<?php echo esc_attr_x( 'Apply', 'button', 'buddypress' ); ?>">
3501
+ <?php
3502
+ }
bp-members/classes/class-bp-core-members-template.php CHANGED
@@ -123,9 +123,9 @@ class BP_Core_Members_Template {
123
  * @type string $page_arg Optional. The string used as a query parameter in pagination links.
124
  * }
125
  */
126
- public function __construct( $args ) {
127
  // Backward compatibility with old method of passing arguments.
128
- if ( ! is_array( $args ) || func_num_args() > 1 ) {
129
  _deprecated_argument( __METHOD__, '7.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
130
 
131
  $old_args_keys = array(
@@ -146,7 +146,9 @@ class BP_Core_Members_Template {
146
  14 => 'member_type__not_in'
147
  );
148
 
149
- $args = bp_core_parse_args_array( $old_args_keys, func_get_args() );
 
 
150
  }
151
 
152
  // Support both 'page_number' and 'page' for backward compatibility.
123
  * @type string $page_arg Optional. The string used as a query parameter in pagination links.
124
  * }
125
  */
126
+ public function __construct( ...$args ) {
127
  // Backward compatibility with old method of passing arguments.
128
+ if ( ! is_array( $args[0] ) || count( $args ) > 1 ) {
129
  _deprecated_argument( __METHOD__, '7.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
130
 
131
  $old_args_keys = array(
146
  14 => 'member_type__not_in'
147
  );
148
 
149
+ $args = bp_core_parse_args_array( $old_args_keys, $args );
150
+ } else {
151
+ $args = reset( $args );
152
  }
153
 
154
  // Support both 'page_number' and 'page' for backward compatibility.
bp-members/classes/class-bp-members-admin.php CHANGED
@@ -140,6 +140,8 @@ class BP_Members_Admin {
140
  $this->users_url = bp_get_admin_url( 'users.php' );
141
  $this->users_screen = bp_core_do_network_admin() ? 'users-network' : 'users';
142
 
 
 
143
  // Specific config: BuddyPress is not network activated.
144
  $this->subsite_activated = (bool) is_multisite() && ! bp_is_network_activated();
145
 
@@ -219,6 +221,13 @@ class BP_Members_Admin {
219
  // Registration is turned on.
220
  add_action( 'update_site_option_registration', array( $this, 'multisite_registration_on' ), 10, 2 );
221
  add_action( 'update_option_users_can_register', array( $this, 'single_site_registration_on' ), 10, 2 );
 
 
 
 
 
 
 
222
  }
223
 
224
  /** Users List - Members Types ***************************************
@@ -248,7 +257,9 @@ class BP_Members_Admin {
248
  * @param string $value
249
  */
250
  public function multisite_registration_on( $option_name, $value ) {
251
- if ( 'user' === $value || 'all' === $value ) {
 
 
252
  bp_core_add_page_mappings( array(
253
  'register' => 1,
254
  'activate' => 1
@@ -266,7 +277,7 @@ class BP_Members_Admin {
266
  */
267
  public function single_site_registration_on( $old_value, $value ) {
268
  // Single site.
269
- if ( ! is_multisite() && ! empty( $value ) ) {
270
  bp_core_add_page_mappings( array(
271
  'register' => 1,
272
  'activate' => 1
@@ -490,6 +501,23 @@ class BP_Members_Admin {
490
  );
491
  }
492
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
493
  $edit_page = 'user-edit';
494
  $profile_page = 'profile';
495
  $this->users_page = 'users';
@@ -509,6 +537,8 @@ class BP_Members_Admin {
509
  $this->user_page .= '-network';
510
  $this->users_page .= '-network';
511
  $this->signups_page .= '-network';
 
 
512
  }
513
 
514
  // Setup the screen ID's.
@@ -527,6 +557,9 @@ class BP_Members_Admin {
527
  foreach ( $page_head as $head ) {
528
  add_action( "admin_head-{$head}", array( $this, 'profile_admin_head' ) );
529
  }
 
 
 
530
  }
531
 
532
  /**
@@ -596,6 +629,13 @@ class BP_Members_Admin {
596
  public function admin_head() {
597
  remove_submenu_page( 'users.php', 'bp-profile-edit' );
598
  remove_submenu_page( 'profile.php', 'bp-profile-edit' );
 
 
 
 
 
 
 
599
  }
600
 
601
  /** Community Profile *****************************************************/
@@ -1903,14 +1943,16 @@ class BP_Members_Admin {
1903
  }
1904
 
1905
  if ( ! empty( $_REQUEST['notdeleted'] ) ) {
 
1906
  $notice['message'] .= sprintf(
1907
- /* translators: %s: number of deleted signups not deleted */
1908
- _nx( '%s sign-up was not deleted.', '%s sign-ups were not deleted.',
1909
- absint( $_REQUEST['notdeleted'] ),
1910
- 'signup notdeleted',
1911
- 'buddypress'
 
1912
  ),
1913
- number_format_i18n( absint( $_REQUEST['notdeleted'] ) )
1914
  );
1915
 
1916
  if ( empty( $_REQUEST['deleted'] ) ) {
@@ -2564,5 +2606,568 @@ class BP_Members_Admin {
2564
 
2565
  return $value;
2566
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2567
  }
2568
  endif; // End class_exists check.
140
  $this->users_url = bp_get_admin_url( 'users.php' );
141
  $this->users_screen = bp_core_do_network_admin() ? 'users-network' : 'users';
142
 
143
+ $this->members_invites_page = '';
144
+
145
  // Specific config: BuddyPress is not network activated.
146
  $this->subsite_activated = (bool) is_multisite() && ! bp_is_network_activated();
147
 
221
  // Registration is turned on.
222
  add_action( 'update_site_option_registration', array( $this, 'multisite_registration_on' ), 10, 2 );
223
  add_action( 'update_option_users_can_register', array( $this, 'single_site_registration_on' ), 10, 2 );
224
+
225
+ // Member invitations are enabled.
226
+ if ( bp_is_network_activated() ) {
227
+ add_action( 'update_site_option_bp-enable-members-invitations', array( $this, 'multisite_registration_on' ), 10, 2 );
228
+ } else {
229
+ add_action( 'update_option_bp-enable-members-invitations', array( $this, 'single_site_registration_on' ), 10, 2 );
230
+ }
231
  }
232
 
233
  /** Users List - Members Types ***************************************
257
  * @param string $value
258
  */
259
  public function multisite_registration_on( $option_name, $value ) {
260
+ // Is registration enabled or are network invitations enabled?
261
+ if ( ( 'user' === $value || 'all' === $value )
262
+ || bp_get_members_invitations_allowed() ) {
263
  bp_core_add_page_mappings( array(
264
  'register' => 1,
265
  'activate' => 1
277
  */
278
  public function single_site_registration_on( $old_value, $value ) {
279
  // Single site.
280
+ if ( ! is_multisite() && ( ! empty( $value ) || bp_get_members_invitations_allowed() ) ) {
281
  bp_core_add_page_mappings( array(
282
  'register' => 1,
283
  'activate' => 1
501
  );
502
  }
503
 
504
+ // For consistency with non-Multisite, we add a Tools menu in
505
+ // the Network Admin as a home for our Tools panel.
506
+ if ( is_multisite() && bp_core_do_network_admin() ) {
507
+ $tools_parent = 'network-tools';
508
+ } else {
509
+ $tools_parent = 'tools.php';
510
+ }
511
+
512
+ $hooks['members_invitations'] = $this->members_invites_page = add_submenu_page(
513
+ $tools_parent,
514
+ __( 'Manage Invitations', 'buddypress' ),
515
+ __( 'Manage Invitations', 'buddypress' ),
516
+ $this->capability,
517
+ 'bp-members-invitations',
518
+ array( $this, 'invitations_admin' )
519
+ );
520
+
521
  $edit_page = 'user-edit';
522
  $profile_page = 'profile';
523
  $this->users_page = 'users';
537
  $this->user_page .= '-network';
538
  $this->users_page .= '-network';
539
  $this->signups_page .= '-network';
540
+
541
+ $this->members_invites_page .= '-network';
542
  }
543
 
544
  // Setup the screen ID's.
557
  foreach ( $page_head as $head ) {
558
  add_action( "admin_head-{$head}", array( $this, 'profile_admin_head' ) );
559
  }
560
+
561
+ // Highlight the BuddyPress tools submenu when managing invitations.
562
+ add_action( "admin_head-{$this->members_invites_page}", 'bp_core_modify_admin_menu_highlight' );
563
  }
564
 
565
  /**
629
  public function admin_head() {
630
  remove_submenu_page( 'users.php', 'bp-profile-edit' );
631
  remove_submenu_page( 'profile.php', 'bp-profile-edit' );
632
+
633
+ // Manage Invitations Tool screen is a tab of BP Tools.
634
+ if ( is_network_admin() ) {
635
+ remove_submenu_page( 'network-tools', 'bp-members-invitations' );
636
+ } else {
637
+ remove_submenu_page( 'tools.php', 'bp-members-invitations' );
638
+ }
639
  }
640
 
641
  /** Community Profile *****************************************************/
1943
  }
1944
 
1945
  if ( ! empty( $_REQUEST['notdeleted'] ) ) {
1946
+ $notdeleted = absint( $_REQUEST['notdeleted'] );
1947
  $notice['message'] .= sprintf(
1948
+ _nx(
1949
+ /* translators: %s: number of deleted signups not deleted */
1950
+ '%s sign-up was not deleted.', '%s sign-ups were not deleted.',
1951
+ $notdeleted,
1952
+ 'signup notdeleted',
1953
+ 'buddypress'
1954
  ),
1955
+ number_format_i18n( $notdeleted )
1956
  );
1957
 
1958
  if ( empty( $_REQUEST['deleted'] ) ) {
2606
 
2607
  return $value;
2608
  }
2609
+
2610
+ /**
2611
+ * Set up the signups admin page.
2612
+ *
2613
+ * Loaded before the page is rendered, this function does all initial
2614
+ * setup, including: processing form requests, registering contextual
2615
+ * help, and setting up screen options.
2616
+ *
2617
+ * @since 8.0.0
2618
+ *
2619
+ * @global $bp_members_invitations_list_table
2620
+ */
2621
+ public function members_invitations_admin_load() {
2622
+ global $bp_members_invitations_list_table;
2623
+
2624
+ // Build redirection URL.
2625
+ $redirect_to = remove_query_arg( array( 'action', 'error', 'updated', 'activated', 'notactivated', 'deleted', 'notdeleted', 'resent', 'notresent', 'do_delete', 'do_resend', 'do_activate', '_wpnonce', 'signup_ids' ), $_SERVER['REQUEST_URI'] );
2626
+ $doaction = bp_admin_list_table_current_bulk_action();
2627
+
2628
+ /**
2629
+ * Fires at the start of the member invitations admin load.
2630
+ *
2631
+ * @since 8.0.0
2632
+ *
2633
+ * @param string $doaction Current bulk action being processed.
2634
+ * @param array $_REQUEST Current $_REQUEST global.
2635
+ */
2636
+ do_action( 'bp_members_invitations_admin_load', $doaction, $_REQUEST );
2637
+
2638
+ /**
2639
+ * Filters the allowed actions for use in the user signups admin page.
2640
+ *
2641
+ * @since 8.0.0
2642
+ *
2643
+ * @param array $value Array of allowed actions to use.
2644
+ */
2645
+ $allowed_actions = apply_filters( 'bp_members_invitations_admin_allowed_actions', array( 'do_delete', 'do_resend' ) );
2646
+
2647
+ // Prepare the display of the bulk invitation action screen.
2648
+ if ( ! in_array( $doaction, $allowed_actions ) ) {
2649
+
2650
+ $bp_members_invitations_list_table = self::get_list_table_class( 'BP_Members_Invitations_List_Table', 'users' );
2651
+
2652
+ // The per_page screen option.
2653
+ add_screen_option( 'per_page', array( 'label' => _x( 'Members Invitations', 'Members Invitations per page (screen options)', 'buddypress' ) ) );
2654
+
2655
+ get_current_screen()->add_help_tab( array(
2656
+ 'id' => 'bp-members-invitations-overview',
2657
+ 'title' => __( 'Overview', 'buddypress' ),
2658
+ 'content' =>
2659
+ '<p>' . __( 'This is the administration screen for member invitations on your site.', 'buddypress' ) . '</p>' .
2660
+ '<p>' . __( 'From the screen options, you can customize the displayed columns and the pagination of this screen.', 'buddypress' ) . '</p>' .
2661
+ '<p>' . __( 'You can reorder the list of invitations by clicking on the Invitee, Inviter, Date Modified, Email Sent, or Accepted column headers.', 'buddypress' ) . '</p>' .
2662
+ '<p>' . __( 'Using the search form, you can find specific invitations more easily. The Invitee Email field will be included in the search.', 'buddypress' ) . '</p>'
2663
+ ) );
2664
+
2665
+ get_current_screen()->add_help_tab( array(
2666
+ 'id' => 'bp-members-invitations-actions',
2667
+ 'title' => __( 'Actions', 'buddypress' ),
2668
+ 'content' =>
2669
+ '<p>' . __( 'Hovering over a row in the pending accounts list will display action links that allow you to manage pending accounts. You can perform the following actions:', 'buddypress' ) . '</p>' .
2670
+ '<ul><li>' . __( '"Send" or "Resend" takes you to the confirmation screen before being able to send or resend the invitation email to the desired pending invitee.', 'buddypress' ) . '</li>' .
2671
+ '<li>' . __( '"Delete" allows you to delete an unsent or accepted invitation from your site; "Cancel" allows you to cancel a sent, but not yet accepted, invitation. You will be asked to confirm this deletion.', 'buddypress' ) . '</li></ul>' .
2672
+ '<p>' . __( 'Bulk actions allow you to perform these actions for the selected rows.', 'buddypress' ) . '</p>'
2673
+ ) );
2674
+
2675
+ // Help panel - sidebar links.
2676
+ get_current_screen()->set_help_sidebar(
2677
+ '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
2678
+ '<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
2679
+ );
2680
+
2681
+ // Add accessible hidden headings and text for the Pending Users screen.
2682
+ get_current_screen()->set_screen_reader_content( array(
2683
+ /* translators: accessibility text */
2684
+ 'heading_views' => __( 'Filter invitations list', 'buddypress' ),
2685
+ /* translators: accessibility text */
2686
+ 'heading_pagination' => __( 'Invitation list navigation', 'buddypress' ),
2687
+ /* translators: accessibility text */
2688
+ 'heading_list' => __( 'Invitations list', 'buddypress' ),
2689
+ ) );
2690
+
2691
+ } else {
2692
+ if ( empty( $_REQUEST['invite_ids' ] ) ) {
2693
+ return;
2694
+ }
2695
+ $invite_ids = wp_parse_id_list( $_REQUEST['invite_ids' ] );
2696
+
2697
+ // Handle resent invitations.
2698
+ if ( 'do_resend' == $doaction ) {
2699
+
2700
+ // Nonce check.
2701
+ check_admin_referer( 'invitations_resend' );
2702
+
2703
+ $success = 0;
2704
+ foreach ( $invite_ids as $invite_id ) {
2705
+ if ( bp_members_invitation_resend_by_id( $invite_id ) ) {
2706
+ $success++;
2707
+ }
2708
+ }
2709
+
2710
+ $query_arg = array( 'updated' => 'resent' );
2711
+
2712
+ if ( ! empty( $success ) ) {
2713
+ $query_arg['resent'] = $success;
2714
+ }
2715
+
2716
+ $not_sent = count( $invite_ids ) - $success;
2717
+ if ( $not_sent > 0 ) {
2718
+ $query_arg['notsent'] = $not_sent;
2719
+ }
2720
+
2721
+ $redirect_to = add_query_arg( $query_arg, $redirect_to );
2722
+
2723
+ bp_core_redirect( $redirect_to );
2724
+
2725
+ // Handle invitation deletion.
2726
+ } elseif ( 'do_delete' == $doaction ) {
2727
+
2728
+ // Nonce check.
2729
+ check_admin_referer( 'invitations_delete' );
2730
+
2731
+ $success = 0;
2732
+ foreach ( $invite_ids as $invite_id ) {
2733
+ if ( bp_members_invitations_delete_by_id( $invite_id ) ) {
2734
+ $success++;
2735
+ }
2736
+ }
2737
+
2738
+ $query_arg = array( 'updated' => 'deleted' );
2739
+
2740
+ if ( ! empty( $success ) ) {
2741
+ $query_arg['deleted'] = $success;
2742
+ }
2743
+
2744
+ $notdeleted = count( $invite_ids ) - $success;
2745
+ if ( $notdeleted > 0 ) {
2746
+ $query_arg['notdeleted'] = $notdeleted;
2747
+ }
2748
+
2749
+ $redirect_to = add_query_arg( $query_arg, $redirect_to );
2750
+
2751
+ bp_core_redirect( $redirect_to );
2752
+
2753
+ // Plugins can update other stuff from here.
2754
+ } else {
2755
+ $this->redirect = $redirect_to;
2756
+
2757
+ /**
2758
+ * Fires at end of member invitations admin load
2759
+ * if doaction does not match any actions.
2760
+ *
2761
+ * @since 8.0.0
2762
+ *
2763
+ * @param string $doaction Current bulk action being processed.
2764
+ * @param array $_REQUEST Current $_REQUEST global.
2765
+ * @param string $redirect Determined redirect url to send user to.
2766
+ */
2767
+ do_action( 'bp_members_admin_update_invitations', $doaction, $_REQUEST, $this->redirect );
2768
+
2769
+ bp_core_redirect( $this->redirect );
2770
+ }
2771
+ }
2772
+ }
2773
+
2774
+ /**
2775
+ * Get admin notice when viewing the invitations management page.
2776
+ *
2777
+ * @since 8.0.0
2778
+ *
2779
+ * @return array
2780
+ */
2781
+ private function get_members_invitations_notice() {
2782
+
2783
+ // Setup empty notice for return value.
2784
+ $notice = array();
2785
+
2786
+ // Updates.
2787
+ if ( ! empty( $_REQUEST['updated'] ) ) {
2788
+ switch ( $_REQUEST['updated'] ) {
2789
+ case 'resent':
2790
+ $notice = array(
2791
+ 'class' => 'updated',
2792
+ 'message' => ''
2793
+ );
2794
+
2795
+ if ( ! empty( $_REQUEST['resent'] ) ) {
2796
+ $resent = absint( $_REQUEST['resent'] );
2797
+ $notice['message'] .= sprintf(
2798
+ _nx(
2799
+ /* translators: %s: number of invitation emails sent */
2800
+ '%s invtitation email successfully sent! ', '%s invitation emails successfully sent! ',
2801
+ $resent,
2802
+ 'members invitation resent',
2803
+ 'buddypress'
2804
+ ),
2805
+ number_format_i18n( $resent )
2806
+ );
2807
+ }
2808
+
2809
+ if ( ! empty( $_REQUEST['notsent'] ) ) {
2810
+ $notsent = absint( $_REQUEST['notsent'] );
2811
+ $notice['message'] .= sprintf(
2812
+ _nx(
2813
+ /* translators: %s: number of unsent invitation emails */
2814
+ '%s invitation email was not sent.', '%s invitation emails were not sent.',
2815
+ $notsent,
2816
+ 'members invitation notsent',
2817
+ 'buddypress'
2818
+ ),
2819
+ number_format_i18n( $notsent )
2820
+ );
2821
+
2822
+ if ( empty( $_REQUEST['resent'] ) ) {
2823
+ $notice['class'] = 'error';
2824
+ }
2825
+ }
2826
+
2827
+ break;
2828
+
2829
+ case 'deleted':
2830
+ $notice = array(
2831
+ 'class' => 'updated',
2832
+ 'message' => ''
2833
+ );
2834
+
2835
+ if ( ! empty( $_REQUEST['deleted'] ) ) {
2836
+ $deleted = absint( $_REQUEST['deleted'] );
2837
+ $notice['message'] .= sprintf(
2838
+ _nx(
2839
+ /* translators: %s: number of deleted invitations */
2840
+ '%s invitation successfully deleted!', '%s invitations successfully deleted!',
2841
+ $deleted,
2842
+ 'members invitation deleted',
2843
+ 'buddypress'
2844
+ ),
2845
+ number_format_i18n( $deleted )
2846
+ );
2847
+ }
2848
+
2849
+ if ( ! empty( $_REQUEST['notdeleted'] ) ) {
2850
+ $notdeleted = absint( $_REQUEST['notdeleted'] );
2851
+ $notice['message'] .= sprintf(
2852
+ _nx(
2853
+ /* translators: %s: number of invitations that failed to be deleted */
2854
+ '%s invitation was not deleted.', '%s invitations were not deleted.',
2855
+ $notdeleted,
2856
+ 'members invitation notdeleted',
2857
+ 'buddypress'
2858
+ ),
2859
+ number_format_i18n( $notdeleted )
2860
+ );
2861
+
2862
+ if ( empty( $_REQUEST['deleted'] ) ) {
2863
+ $notice['class'] = 'error';
2864
+ }
2865
+ }
2866
+
2867
+ break;
2868
+ }
2869
+ }
2870
+
2871
+ // Errors.
2872
+ if ( ! empty( $_REQUEST['error'] ) ) {
2873
+ switch ( $_REQUEST['error'] ) {
2874
+ case 'do_resend':
2875
+ $notice = array(
2876
+ 'class' => 'error',
2877
+ 'message' => esc_html__( 'There was a problem sending the invitation emails. Please try again.', 'buddypress' ),
2878
+ );
2879
+ break;
2880
+
2881
+ case 'do_delete':
2882
+ $notice = array(
2883
+ 'class' => 'error',
2884
+ 'message' => esc_html__( 'There was a problem deleting invitations. Please try again.', 'buddypress' ),
2885
+ );
2886
+ break;
2887
+ }
2888
+ }
2889
+
2890
+ return $notice;
2891
+ }
2892
+
2893
+ /**
2894
+ * Member invitations admin page router.
2895
+ *
2896
+ * Depending on the context, display
2897
+ * - the list of invitations,
2898
+ * - or the delete confirmation screen,
2899
+ * - or the "resend" email confirmation screen.
2900
+ *
2901
+ * Also prepare the admin notices.
2902
+ *
2903
+ * @since 8.0.0
2904
+ */
2905
+ public function invitations_admin() {
2906
+ $doaction = bp_admin_list_table_current_bulk_action();
2907
+
2908
+ // Prepare notices for admin.
2909
+ $notice = $this->get_members_invitations_notice();
2910
+
2911
+ // Display notices.
2912
+ if ( ! empty( $notice ) ) :
2913
+ if ( 'updated' === $notice['class'] ) : ?>
2914
+
2915
+ <div id="message" class="<?php echo esc_attr( $notice['class'] ); ?> notice is-dismissible">
2916
+
2917
+ <?php else: ?>
2918
+
2919
+ <div class="<?php echo esc_attr( $notice['class'] ); ?> notice is-dismissible">
2920
+
2921
+ <?php endif; ?>
2922
+
2923
+ <p><?php echo $notice['message']; ?></p>
2924
+ </div>
2925
+
2926
+ <?php endif;
2927
+
2928
+ // Show the proper screen.
2929
+ switch ( $doaction ) {
2930
+ case 'delete' :
2931
+ case 'resend' :
2932
+ $this->invitations_admin_manage( $doaction );
2933
+ break;
2934
+
2935
+ default:
2936
+ $this->invitations_admin_index();
2937
+ break;
2938
+ }
2939
+ }
2940
+
2941
+ /**
2942
+ * This is the list of invitations.
2943
+ *
2944
+ * @since 8.0.0
2945
+ *
2946
+ * @global $plugin_page
2947
+ * @global $bp_members_invitations_list_table
2948
+ */
2949
+ public function invitations_admin_index() {
2950
+ global $plugin_page, $bp_members_invitations_list_table;
2951
+
2952
+ $usersearch = ! empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '';
2953
+
2954
+ // Prepare the group items for display.
2955
+ $bp_members_invitations_list_table->prepare_items();
2956
+
2957
+ if ( is_network_admin() ) {
2958
+ $form_url = network_admin_url( 'admin.php' );
2959
+ } else {
2960
+ $form_url = bp_get_admin_url( 'tools.php' );
2961
+ }
2962
+
2963
+ $form_url = add_query_arg(
2964
+ array(
2965
+ 'page' => 'bp-members-invitations',
2966
+ ),
2967
+ $form_url
2968
+ );
2969
+
2970
+ $search_form_url = remove_query_arg(
2971
+ array(
2972
+ 'action',
2973
+ 'deleted',
2974
+ 'notdeleted',
2975
+ 'error',
2976
+ 'updated',
2977
+ 'delete',
2978
+ 'activate',
2979
+ 'activated',
2980
+ 'notactivated',
2981
+ 'resend',
2982
+ 'resent',
2983
+ 'notresent',
2984
+ 'do_delete',
2985
+ 'do_activate',
2986
+ 'do_resend',
2987
+ 'action2',
2988
+ '_wpnonce',
2989
+ 'invite_ids'
2990
+ ), $_SERVER['REQUEST_URI']
2991
+ );
2992
+
2993
+ ?>
2994
+
2995
+ <div class="wrap">
2996
+ <h1 class="wp-heading-inline"><?php esc_html_e( 'BuddyPress tools', 'buddypress' ); ?></h1>
2997
+ <hr class="wp-header-end">
2998
+
2999
+ <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Manage Invitations', 'buddypress' ), 'tools' ); ?></h2>
3000
+
3001
+ <?php
3002
+ if ( $usersearch ) {
3003
+ printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;', 'buddypress' ) . '</span>', esc_html( $usersearch ) );
3004
+ }
3005
+ ?>
3006
+
3007
+ <?php // Display each invitation on its own row. ?>
3008
+ <?php $bp_members_invitations_list_table->views(); ?>
3009
+
3010
+ <form id="bp-members-invitations-search-form" action="<?php echo esc_url( $search_form_url ) ;?>">
3011
+ <input type="hidden" name="page" value="<?php echo esc_attr( $plugin_page ); ?>" />
3012
+ <?php $bp_members_invitations_list_table->search_box( __( 'Search Invitations', 'buddypress' ), 'bp-members-invitations' ); ?>
3013
+ </form>
3014
+
3015
+ <form id="bp-members-invitations-form" action="<?php echo esc_url( $form_url );?>" method="post">
3016
+ <?php $bp_members_invitations_list_table->display(); ?>
3017
+ </form>
3018
+ </div>
3019
+ <?php
3020
+ }
3021
+
3022
+ /**
3023
+ * This is the confirmation screen for actions.
3024
+ *
3025
+ * @since 8.0.0
3026
+ *
3027
+ * @param string $action Delete or resend invitation.
3028
+ * @return null|false
3029
+ */
3030
+ public function invitations_admin_manage( $action = '' ) {
3031
+ if ( ! current_user_can( $this->capability ) || empty( $action ) ) {
3032
+ die( '-1' );
3033
+ }
3034
+
3035
+ // Get the IDs from the URL.
3036
+ $ids = false;
3037
+ if ( ! empty( $_POST['invite_ids'] ) ) {
3038
+ $ids = wp_parse_id_list( $_POST['invite_ids'] );
3039
+ } elseif ( ! empty( $_GET['invite_id'] ) ) {
3040
+ $ids = absint( $_GET['invite_id'] );
3041
+ }
3042
+
3043
+
3044
+ if ( empty( $ids ) ) {
3045
+ return false;
3046
+ }
3047
+
3048
+ // Check invite IDs and set up strings.
3049
+ switch ( $action ) {
3050
+ case 'delete' :
3051
+ // Query for matching invites, and filter out bad IDs.
3052
+ $args = array(
3053
+ 'id' => $ids,
3054
+ 'invite_sent' => 'all',
3055
+ 'accepted' => 'all',
3056
+ );
3057
+ $invites = bp_members_invitations_get_invites( $args );
3058
+ $invite_ids = wp_list_pluck( $invites, 'id' );
3059
+
3060
+ $header_text = __( 'Delete Invitations', 'buddypress' );
3061
+ if ( 0 === count( $invite_ids ) ) {
3062
+ $helper_text = __( 'No invites were found, nothing to delete!', 'buddypress' );
3063
+ } else {
3064
+ $helper_text = _n( 'You are about to delete the following invitation:', 'You are about to delete the following invitations:', count( $invite_ids ), 'buddypress' );
3065
+ }
3066
+ break;
3067
+
3068
+ case 'resend' :
3069
+ /**
3070
+ * Query for matching invites, and filter out bad IDs
3071
+ * or those that have already been accepted.
3072
+ */
3073
+ $args = array(
3074
+ 'id' => $ids,
3075
+ 'invite_sent' => 'all',
3076
+ 'accepted' => 'pending',
3077
+ );
3078
+ $invites = bp_members_invitations_get_invites( $args );
3079
+ $invite_ids = wp_list_pluck( $invites, 'id' );
3080
+
3081
+ $header_text = __( 'Resend Invitation Emails', 'buddypress' );
3082
+ if ( 0 === count( $invite_ids ) ) {
3083
+ $helper_text = __( 'No pending invites were found, nothing to resend!', 'buddypress' );
3084
+ } else {
3085
+ $helper_text = _n( 'You are about to resend an invitation email to the following address:', 'You are about to resend invitation emails to the following addresses:', count( $invite_ids ), 'buddypress' );
3086
+ }
3087
+ break;
3088
+ }
3089
+
3090
+ // These arguments are added to all URLs.
3091
+ $url_args = array( 'page' => 'bp-members-invitations' );
3092
+
3093
+ // These arguments are only added when performing an action.
3094
+ $action_args = array(
3095
+ 'action' => 'do_' . $action,
3096
+ 'invite_ids' => implode( ',', $invite_ids )
3097
+ );
3098
+
3099
+ if ( is_network_admin() ) {
3100
+ $base_url = network_admin_url( 'admin.php' );
3101
+ } else {
3102
+ $base_url = bp_get_admin_url( 'tools.php' );
3103
+ }
3104
+
3105
+ $cancel_url = add_query_arg( $url_args, $base_url );
3106
+ $action_url = wp_nonce_url(
3107
+ add_query_arg(
3108
+ array_merge( $url_args, $action_args ),
3109
+ $base_url
3110
+ ),
3111
+ 'invitations_' . $action
3112
+ );
3113
+
3114
+ ?>
3115
+
3116
+ <div class="wrap">
3117
+ <h1 class="wp-heading-inline"><?php echo esc_html( $header_text ); ?></h1>
3118
+ <hr class="wp-header-end">
3119
+
3120
+ <p><?php echo esc_html( $helper_text ); ?></p>
3121
+
3122
+ <?php if ( $invites ) : ?>
3123
+
3124
+ <ol class="bp-invitations-list">
3125
+ <?php foreach ( $invites as $invite ) :
3126
+ if ( $invite->invite_sent ) {
3127
+ $last_notified = mysql2date( 'Y/m/d g:i:s a', $invite->date_modified );
3128
+ } else {
3129
+ $last_notified = __( 'Not yet notified', 'buddypress');
3130
+ }
3131
+ ?>
3132
+
3133
+ <li>
3134
+ <strong><?php echo esc_html( $invite->invitee_email ) ?></strong>
3135
+
3136
+ <?php if ( 'resend' === $action ) : ?>
3137
+
3138
+ <p class="description">
3139
+ <?php
3140
+ /* translators: %s: notification date */
3141
+ printf( esc_html__( 'Last notified: %s', 'buddypress'), $last_notified );
3142
+ ?>
3143
+ </p>
3144
+
3145
+ <?php endif; ?>
3146
+
3147
+ </li>
3148
+
3149
+ <?php endforeach; ?>
3150
+ </ol>
3151
+
3152
+ <?php endif ; ?>
3153
+
3154
+ <?php if ( 'delete' === $action ) : ?>
3155
+
3156
+ <p><strong><?php esc_html_e( 'This action cannot be undone.', 'buddypress' ) ?></strong></p>
3157
+
3158
+ <?php endif; ?>
3159
+
3160
+ <?php if ( $invites ) : ?>
3161
+
3162
+ <a class="button-primary" href="<?php echo esc_url( $action_url ); ?>" <?php disabled( ! $invites ); ?>><?php esc_html_e( 'Confirm', 'buddypress' ); ?></a>
3163
+
3164
+ <?php endif; ?>
3165
+
3166
+ <a class="button" href="<?php echo esc_url( $cancel_url ); ?>"><?php esc_html_e( 'Cancel', 'buddypress' ) ?></a>
3167
+ </div>
3168
+
3169
+ <?php
3170
+ }
3171
+
3172
  }
3173
  endif; // End class_exists check.
bp-members/classes/class-bp-members-component.php CHANGED
@@ -39,7 +39,8 @@ class BP_Members_Component extends BP_Component {
39
  buddypress()->plugin_dir,
40
  array(
41
  'adminbar_myaccount_order' => 20,
42
- 'search_query_arg' => 'members_search',
 
43
  )
44
  );
45
  }
@@ -64,6 +65,8 @@ class BP_Members_Component extends BP_Component {
64
  'blocks',
65
  'widgets',
66
  'cache',
 
 
67
  );
68
 
69
  if ( bp_is_active( 'activity' ) ) {
@@ -137,6 +140,17 @@ class BP_Members_Component extends BP_Component {
137
  // Theme compatibility.
138
  new BP_Registration_Theme_Compat();
139
  }
 
 
 
 
 
 
 
 
 
 
 
140
  }
141
 
142
  /**
@@ -178,8 +192,10 @@ class BP_Members_Component extends BP_Component {
178
  'global_tables' => array(
179
  'table_name_invitations' => bp_core_get_table_prefix() . 'bp_invitations',
180
  'table_name_last_activity' => bp_core_get_table_prefix() . 'bp_activity',
 
181
  'table_name_signups' => $wpdb->base_prefix . 'signups', // Signups is a global WordPress table.
182
- )
 
183
  );
184
 
185
  parent::setup_globals( $args );
@@ -232,6 +248,11 @@ class BP_Members_Component extends BP_Component {
232
  $bp->profile->slug = 'profile';
233
  $bp->profile->id = 'profile';
234
  }
 
 
 
 
 
235
  }
236
 
237
  /**
@@ -314,7 +335,7 @@ class BP_Members_Component extends BP_Component {
314
 
315
  $access = bp_core_can_edit_settings();
316
  $slug = bp_get_profile_slug();
317
- $profile_link = bp_get_members_component_link( $slug );
318
 
319
  // Change Avatar.
320
  if ( buddypress()->avatar->show_avatars ) {
@@ -467,7 +488,6 @@ class BP_Members_Component extends BP_Component {
467
  }
468
  }
469
 
470
-
471
  parent::setup_nav( $main_nav, $sub_nav );
472
  }
473
 
@@ -548,6 +568,25 @@ class BP_Members_Component extends BP_Component {
548
  return $wp_admin_nav;
549
  }
550
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
551
  /**
552
  * Set up the Admin Bar.
553
  *
39
  buddypress()->plugin_dir,
40
  array(
41
  'adminbar_myaccount_order' => 20,
42
+ 'search_query_arg' => 'members_search',
43
+ 'features' => array( 'invitations' )
44
  )
45
  );
46
  }
65
  'blocks',
66
  'widgets',
67
  'cache',
68
+ 'invitations',
69
+ 'notifications',
70
  );
71
 
72
  if ( bp_is_active( 'activity' ) ) {
140
  // Theme compatibility.
141
  new BP_Registration_Theme_Compat();
142
  }
143
+
144
+ // Invitations.
145
+ if ( is_user_logged_in() && bp_is_user_members_invitations() ) {
146
+ // Actions.
147
+ if ( isset( $_POST['members_invitations'] ) ) {
148
+ require $this->path . 'bp-members/actions/invitations-bulk-manage.php';
149
+ }
150
+
151
+ // Screens.
152
+ require $this->path . 'bp-members/screens/invitations.php';
153
+ }
154
  }
155
 
156
  /**
192
  'global_tables' => array(
193
  'table_name_invitations' => bp_core_get_table_prefix() . 'bp_invitations',
194
  'table_name_last_activity' => bp_core_get_table_prefix() . 'bp_activity',
195
+ 'table_name_optouts' => bp_core_get_table_prefix() . 'bp_optouts',
196
  'table_name_signups' => $wpdb->base_prefix . 'signups', // Signups is a global WordPress table.
197
+ ),
198
+ 'notification_callback' => 'members_format_notifications',
199
  );
200
 
201
  parent::setup_globals( $args );
248
  $bp->profile->slug = 'profile';
249
  $bp->profile->id = 'profile';
250
  }
251
+
252
+ /** Network Invitations **************************************************
253
+ */
254
+
255
+ $bp->members->invitations = new stdClass;
256
  }
257
 
258
  /**
335
 
336
  $access = bp_core_can_edit_settings();
337
  $slug = bp_get_profile_slug();
338
+ $profile_link = bp_get_members_component_link( buddypress()->profile->id );
339
 
340
  // Change Avatar.
341
  if ( buddypress()->avatar->show_avatars ) {
488
  }
489
  }
490
 
 
491
  parent::setup_nav( $main_nav, $sub_nav );
492
  }
493
 
568
  return $wp_admin_nav;
569
  }
570
 
571
+ /**
572
+ * Get the members invitations admin bar navs.
573
+ *
574
+ * @since 8.0.0
575
+ *
576
+ * @param string $admin_bar_menu_id The Admin bar menu ID to attach sub items to.
577
+ * @return array The members invitations admin navs.
578
+ */
579
+ public function get_members_invitations_admin_navs( $admin_bar_menu_id = '' ) {
580
+ $wp_admin_nav = array();
581
+ $invite_link = trailingslashit( bp_loggedin_user_domain() . bp_get_profile_slug() );
582
+
583
+ if ( ! $admin_bar_menu_id ) {
584
+ $admin_bar_menu_id = $this->id;
585
+ }
586
+
587
+ return $wp_admin_nav;
588
+ }
589
+
590
  /**
591
  * Set up the Admin Bar.
592
  *
bp-members/classes/class-bp-members-invitation-manager.php ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Membership invitations class.
4
+ *
5
+ * @package BuddyPress
6
+ * @subpackage Core
7
+ * @since 8.0.0
8
+ */
9
+
10
+ // Exit if accessed directly.
11
+ defined( 'ABSPATH' ) || exit;
12
+
13
+ /**
14
+ * Membership invitations class.
15
+ *
16
+ * An extension of the core Invitations class that adapts the
17
+ * core logic to accommodate site membership invitation behavior.
18
+ *
19
+ * @since 8.0.0
20
+ */
21
+ class BP_Members_Invitation_Manager extends BP_Invitation_Manager {
22
+ /**
23
+ * Construct parameters.
24
+ *
25
+ * @since 8.0.0
26
+ *
27
+ * @param array|string $args.
28
+ */
29
+ public function __construct( $args = '' ) {
30
+ parent::__construct();
31
+ }
32
+
33
+ /**
34
+ * This is where custom actions are added to run when notifications of an
35
+ * invitation or request need to be generated & sent.
36
+ *
37
+ * @since 8.0.0
38
+ *
39
+ * @param obj BP_Invitation $invitation The invitation to send.
40
+ * @return bool True on success, false on failure.
41
+ */
42
+ public function run_send_action( BP_Invitation $invitation ) {
43
+ // Notify site admins of the pending request
44
+ if ( 'request' === $invitation->type ) {
45
+ // Coming soon to a BuddyPress near you!
46
+ return true;
47
+
48
+ // Notify the invitee of the invitation.
49
+ } else {
50
+ // Stop if the invitation has already been accepted.
51
+ if ( $invitation->accepted ) {
52
+ return false;
53
+ }
54
+
55
+ $inviter_ud = bp_core_get_core_userdata( $invitation->inviter_id );
56
+
57
+ $invite_url = esc_url(
58
+ add_query_arg(
59
+ array(
60
+ 'inv' => $invitation->id,
61
+ 'ih' => bp_members_invitations_get_hash( $invitation ),
62
+ ),
63
+ bp_get_signup_page()
64
+ )
65
+ );
66
+ $unsubscribe_args = array(
67
+ 'user_id' => 0,
68
+ 'email_address' => $invitation->invitee_email,
69
+ 'member_id' => $invitation->inviter_id,
70
+ 'notification_type' => 'bp-members-invitation',
71
+ );
72
+
73
+ $args = array(
74
+ 'tokens' => array(
75
+ 'inviter.name' => bp_core_get_userlink( $invitation->inviter_id, true, false, true ),
76
+ 'inviter.url' => bp_core_get_user_domain( $invitation->inviter_id ),
77
+ 'inviter.id' => $invitation->inviter_id,
78
+ 'invite.accept_url' => esc_url( $invite_url ),
79
+ 'usermessage' => wp_kses( $invitation->content, array() ),
80
+ 'unsubscribe' => esc_url( bp_email_get_unsubscribe_link( $unsubscribe_args ) ),
81
+ ),
82
+ );
83
+
84
+ return bp_send_email( 'bp-members-invitation', $invitation->invitee_email, $args );
85
+ }
86
+ }
87
+
88
+ /**
89
+ * This is where custom actions are added to run when an invitation
90
+ * or request is accepted.
91
+ *
92
+ * @since 8.0.0
93
+ *
94
+ * @param string $type Are we accepting an invitation or request?
95
+ * @param array $r Parameters that describe the invitation being accepted.
96
+ * @return bool True on success, false on failure.
97
+ */
98
+ public function run_acceptance_action( $type, $r ) {
99
+ if ( ! $type || ! in_array( $type, array( 'request', 'invite' ), true ) ) {
100
+ return false;
101
+ }
102
+
103
+ if ( 'invite' === $type ) {
104
+
105
+ $invites = $this->get_invitations( $r );
106
+ if ( ! $invites ) {
107
+ return;
108
+ }
109
+
110
+ foreach ( $invites as $invite ) {
111
+ // Add the accepted invitation ID to the user's meta.
112
+ $new_user = get_user_by( 'email', $invite->invitee_email );
113
+ bp_update_user_meta( $new_user->ID, 'accepted_members_invitation', $invite->id );
114
+
115
+ // We will mark all invitations to this user as "accepted."
116
+ if ( ! empty( $invite->invitee_email ) ) {
117
+ $args = array(
118
+ 'invitee_email' => $invite->invitee_email,
119
+ 'item_id' => get_current_network_id(),
120
+ 'type' => 'all'
121
+ );
122
+ $this->mark_accepted( $args );
123
+ }
124
+
125
+ /**
126
+ * Fires after a user has accepted a site membership invite.
127
+ *
128
+ * @since 8.0.0
129
+ *
130
+ * @param BP_Invitation $invite Invitation that was accepted.
131
+ * @param WP_user $new_user ID of the user who accepted the membership invite.
132
+ * @param int $inviter_id ID of the user who invited this user to the site.
133
+ */
134
+ do_action( 'members_invitations_invite_accepted', $invite, $new_user, $invite->inviter_id );
135
+ }
136
+ }
137
+
138
+ return true;
139
+ }
140
+
141
+ /**
142
+ * Should this invitation be created?
143
+ *
144
+ * @since 8.0.0
145
+ *
146
+ * @param array $args.
147
+ * @return bool
148
+ */
149
+ public function allow_invitation( $args ) {
150
+ // Does the inviter have this capability?
151
+ if ( ! bp_user_can( $args['inviter_id'], 'bp_members_send_invitation' ) ) {
152
+ return false;
153
+ }
154
+
155
+ // Is the invited user eligible to receive an invitation? Hasn't opted out?
156
+ if ( ! bp_user_can( 0, 'bp_members_receive_invitation', $args ) ) {
157
+ return false;
158
+ }
159
+
160
+ return true;
161
+ }
162
+
163
+ /**
164
+ * Should this request be created?
165
+ *
166
+ * @since 8.0.0
167
+ *
168
+ * @param array $args.
169
+ * @return bool.
170
+ */
171
+ public function allow_request( $args ) {
172
+ // Does the requester have this capability?
173
+ if ( ! bp_user_can( 0, 'bp_network_request_membership', $args ) ) {
174
+ return false;
175
+ }
176
+
177
+ return true;
178
+ }
179
+ }
bp-members/classes/class-bp-members-invitations-list-table.php ADDED
@@ -0,0 +1,499 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * BuddyPress Membership Invitation List Table class.
4
+ *
5
+ * @package BuddyPress
6
+ * @subpackage MembersAdminClasses
7
+ * @since 8.0.0
8
+ */
9
+
10
+ // Exit if accessed directly.
11
+ defined( 'ABSPATH' ) || exit;
12
+
13
+ /**
14
+ * List table class for Invitations admin page.
15
+ *
16
+ * @since 8.0.0
17
+ */
18
+ class BP_Members_Invitations_List_Table extends WP_Users_List_Table {
19
+
20
+ /**
21
+ * The type of view currently being displayed.
22
+ *
23
+ * E.g. "All", "Pending", "Sent", "Unsent"...
24
+ *
25
+ * @since 8.0.0
26
+ * @var string
27
+ */
28
+ public $active_filters = array();
29
+
30
+ /**
31
+ * Invitation counts.
32
+ *
33
+ * @since 8.0.0
34
+ * @var int
35
+ */
36
+ public $total_items = 0;
37
+
38
+ /**
39
+ * Constructor.
40
+ *
41
+ * @since 8.0.0
42
+ */
43
+ public function __construct() {
44
+ // Define singular and plural labels, as well as whether we support AJAX.
45
+ parent::__construct( array(
46
+ 'ajax' => false,
47
+ 'plural' => 'invitations',
48
+ 'singular' => 'invitation',
49
+ 'screen' => get_current_screen()->id,
50
+ ) );
51
+ }
52
+
53
+ /**
54
+ * Set up items for display in the list table.
55
+ *
56
+ * Handles filtering of data, sorting, pagination, and any other data
57
+ * manipulation required prior to rendering.
58
+ *
59
+ * @since 8.0.0
60
+ */
61
+ public function prepare_items() {
62
+ global $usersearch;
63
+
64
+ $search = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
65
+ $per_page = $this->get_items_per_page( str_replace( '-', '_', "{$this->screen->id}_per_page" ) );
66
+ $paged = $this->get_pagenum();
67
+
68
+ $args = array(
69
+ 'invite_sent' => 'all',
70
+ 'accepted' => 'all',
71
+ 'search_terms' => $search,
72
+ 'order_by' => 'date_modified',
73
+ 'sort_order' => 'DESC',
74
+ 'page' => $paged,
75
+ 'per_page' => $per_page,
76
+ );
77
+
78
+ if ( isset( $_REQUEST['accepted'] ) && in_array( $_REQUEST['accepted'], array( 'pending', 'accepted' ), true ) ) {
79
+ $args['accepted'] = $_REQUEST['accepted'];
80
+ $this->active_filters[] = $_REQUEST['accepted'];
81
+ }
82
+ if ( isset( $_REQUEST['sent'] ) && in_array( $_REQUEST['sent'], array( 'draft', 'sent' ), true ) ) {
83
+ $args['invite_sent'] = $_REQUEST['sent'];
84
+ $this->active_filters[] = $_REQUEST['sent'];
85
+ }
86
+
87
+ if ( isset( $_REQUEST['orderby'] ) ) {
88
+ $args['order_by'] = $_REQUEST['orderby'];
89
+ }
90
+
91
+ if ( isset( $_REQUEST['order'] ) ) {
92
+ $args['sort_order'] = $_REQUEST['order'];
93
+ }
94
+
95
+ $invites_class = new BP_Members_Invitation_Manager();
96
+ $this->items = $invites_class->get_invitations( $args );
97
+ $this->total_items = $invites_class->get_invitations_total_count( $args );
98
+
99
+ $this->set_pagination_args( array(
100
+ 'total_items' => $this->total_items,
101
+ 'per_page' => $per_page,
102
+ ) );
103
+ }
104
+
105
+ /**
106
+ * Get the list of views available on this table (e.g. "all", "public").
107
+ *
108
+ * @since 8.0.0
109
+ */
110
+ public function views() {
111
+ $tools_url = bp_get_admin_url( 'tools.php' );
112
+
113
+ if ( is_network_admin() ) {
114
+ $tools_url = network_admin_url( 'admin.php' );
115
+ }
116
+
117
+ $url_base = add_query_arg(
118
+ array(
119
+ 'page' => 'bp-members-invitations',
120
+ ),
121
+ $tools_url
122
+ );
123
+ ?>
124
+
125
+ <h2 class="screen-reader-text">
126
+ <?php
127
+ /* translators: accessibility text */
128
+ esc_html_e( 'Filter invitations list', 'buddypress' );
129
+ ?>
130
+ </h2>
131
+ <ul class="subsubsub">
132
+ <li class="all">
133
+ <a href="<?php echo esc_url( $url_base ); ?>" class="<?php if ( empty( $this->active_filters ) ) echo 'current'; ?>">
134
+ <?php esc_html_e( 'All', 'buddypress' ); ?>
135
+ </a> |
136
+ </li>
137
+ <li class="pending">
138
+ <a href="<?php echo esc_url( add_query_arg( 'accepted', 'pending', $url_base ) ); ?>" class="<?php if ( in_array( 'pending', $this->active_filters, true ) ) echo 'current'; ?>">
139
+ <?php esc_html_e( 'Pending', 'buddypress' ); ?>
140
+ </a> |
141
+ </li>
142
+ <li class="accepted">
143
+ <a href="<?php echo esc_url( add_query_arg( 'accepted', 'accepted', $url_base ) ); ?>" class="<?php if ( in_array( 'accepted', $this->active_filters, true ) ) echo 'current'; ?>">
144
+ <?php esc_html_e( 'Accepted', 'buddypress' ); ?>
145
+ </a> |
146
+ </li>
147
+ <li class="draft">
148
+ <a href="<?php echo esc_url( add_query_arg( 'sent', 'draft', $url_base ) ); ?>" class="<?php if ( in_array( 'draft', $this->active_filters, true ) ) echo 'current'; ?>">
149
+ <?ph