diff --git bp-templates/bp-legacy/buddypress-functions.php bp-templates/bp-legacy/buddypress-functions.php
index 13b407b..e368c01 100644
|
|
class BP_Legacy extends BP_Theme_Compat { |
238 | 238 | 'mark_as_fav' => __( 'Favorite', 'buddypress' ), |
239 | 239 | 'remove_fav' => __( 'Remove Favorite', 'buddypress' ), |
240 | 240 | 'unsaved_changes' => __( 'Your profile has unsaved changes. If you leave the page, the changes will be lost.', 'buddypress' ), |
| 241 | 'leave_group_confirm' => __( 'Are you sure you want to leave this group?', 'buddypress' ), |
241 | 242 | ); |
242 | 243 | wp_localize_script( $asset['handle'], 'BP_DTheme', $params ); |
243 | 244 | |
diff --git bp-templates/bp-legacy/js/buddypress.js bp-templates/bp-legacy/js/buddypress.js
index 1109940..dc2359d 100644
|
|
jq(document).ready( function() { |
1021 | 1021 | |
1022 | 1022 | var thelink = jq(this); |
1023 | 1023 | |
| 1024 | //If leaving a group, ask user to confirm before processing the request |
| 1025 | if ( jq(this).hasClass('leave-group') && ( false == confirm( BP_DTheme.leave_group_confirm ) ) ) |
| 1026 | return false; |
| 1027 | |
1024 | 1028 | jq.post( ajaxurl, { |
1025 | 1029 | action: 'joinleave_group', |
1026 | 1030 | 'cookie': bp_get_cookies(), |
… |
… |
jq(document).ready( function() { |
1044 | 1048 | return false; |
1045 | 1049 | } ); |
1046 | 1050 | |
| 1051 | //Previous case only handles directory listings. This case handles the button on the group page. |
| 1052 | jq('#item-buttons').on('click', '.group-button a.leave-group', function() { |
| 1053 | |
| 1054 | //Ask user to confirm before processing the request |
| 1055 | if ( false == confirm( BP_DTheme.leave_group_confirm ) ) |
| 1056 | return false; |
| 1057 | }); |
| 1058 | |
1047 | 1059 | /** Button disabling ************************************************/ |
1048 | 1060 | |
1049 | 1061 | jq('#buddypress').on( 'click', '.pending', function() { |
diff --git bp-themes/bp-default/_inc/global.js bp-themes/bp-default/_inc/global.js
index ae05558..2c6264d 100644
|
|
jq(document).ready( function() { |
992 | 992 | |
993 | 993 | var thelink = jq(this); |
994 | 994 | |
| 995 | //If leaving a group, ask user to confirm before processing the request |
| 996 | if ( jq(this).hasClass('leave-group') && ( false == confirm( BP_DTheme.leave_group_confirm ) ) ) |
| 997 | return false; |
| 998 | |
995 | 999 | jq.post( ajaxurl, { |
996 | 1000 | action: 'joinleave_group', |
997 | 1001 | 'cookie': bp_get_cookies(), |
… |
… |
jq(document).ready( function() { |
1015 | 1019 | return false; |
1016 | 1020 | } ); |
1017 | 1021 | |
| 1022 | //Previous case only handles directory listings. This case handles the button on the group page. |
| 1023 | jq('#item-buttons').on('click', '.group-button a.leave-group', function() { |
| 1024 | |
| 1025 | //Ask user to confirm before processing the request |
| 1026 | if ( false == confirm( BP_DTheme.leave_group_confirm ) ) |
| 1027 | return false; |
| 1028 | }); |
| 1029 | |
1018 | 1030 | /** Button disabling ************************************************/ |
1019 | 1031 | |
1020 | 1032 | jq('.pending').click(function() { |
diff --git bp-themes/bp-default/functions.php bp-themes/bp-default/functions.php
index 78f5107..3de6fc0 100644
|
|
function bp_dtheme_enqueue_scripts() { |
165 | 165 | 'close' => __( 'Close', 'buddypress' ), |
166 | 166 | 'view' => __( 'View', 'buddypress' ), |
167 | 167 | 'mark_as_fav' => __( 'Favorite', 'buddypress' ), |
168 | | 'remove_fav' => __( 'Remove Favorite', 'buddypress' ) |
| 168 | 'remove_fav' => __( 'Remove Favorite', 'buddypress' ), |
| 169 | 'leave_group_confirm' => __( 'Are you sure you want to leave this group?', 'buddypress' ), |
169 | 170 | ); |
170 | 171 | wp_localize_script( 'dtheme-ajax-js', 'BP_DTheme', $params ); |
171 | 172 | |