diff --git bp-templates/bp-legacy/js/buddypress.js bp-templates/bp-legacy/js/buddypress.js
index 889c919..1d90310 100644
|
|
|
jq(document).ready( function() { |
| 834 | 834 | |
| 835 | 835 | jq('.field-visibility-settings-close').on( 'click', function() { |
| 836 | 836 | var settings_div = jq(this).parent(); |
| | 837 | var vis_setting_text = settings_div.find('input:checked').parent().text(); |
| 837 | 838 | |
| 838 | | jq(settings_div).slideUp( 400, function(){ |
| 839 | | jq(settings_div).siblings('.field-visibility-settings-toggle').fadeIn(800); |
| | 839 | |
| | 840 | settings_div.slideUp( 400, function(){ |
| | 841 | settings_div.siblings('.field-visibility-settings-toggle').fadeIn(800); |
| | 842 | settings_div.siblings('.field-visibility-settings-toggle').children('.current-visibility-level').html(vis_setting_text); |
| 840 | 843 | }); |
| 841 | 844 | |
| 842 | 845 | return false; |
| 843 | 846 | } ); |
| 844 | 847 | |
| | 848 | jq("#profile-edit-form input:not(:submit),#profile-edit-form textarea,#profile-edit-form select,#signup_form input:not(:submit),#signup_form textarea,#signup_form select").change(function(){ |
| | 849 | |
| | 850 | var shouldconfirm = true; |
| | 851 | |
| | 852 | jq('#profile-edit-form input:submit,#signup_form input:submit').on( 'click', function() { |
| | 853 | shouldconfirm = false; |
| | 854 | }); |
| | 855 | |
| | 856 | window.onbeforeunload = function(e) { |
| | 857 | if ( shouldconfirm ) { |
| | 858 | return 'You have unsaved changes on this page. Do you want to leave this page and discard your changes or stay on this page?'; |
| | 859 | } |
| | 860 | }; |
| | 861 | }); |
| 845 | 862 | |
| 846 | 863 | /** Friendship Requests **************************************/ |
| 847 | 864 | |
diff --git bp-xprofile/bp-xprofile-template.php bp-xprofile/bp-xprofile-template.php
index c6ecda3..5a949e3 100644
|
|
|
function bp_the_profile_field_visibility_level() { |
| 730 | 730 | */ |
| 731 | 731 | function bp_get_the_profile_field_visibility_level() { |
| 732 | 732 | global $field; |
| 733 | | |
| 734 | | $retval = !empty( $field->visibility_level ) ? $field->visibility_level : 'public'; |
| | 733 | //On the registration page, values stored in POST should take precedence over default visibility |
| | 734 | if ( bp_is_register_page() && !empty( $_POST['field_' . $field->id . '_visibility'] ) ) { |
| | 735 | $retval = $_POST['field_' . $field->id . '_visibility']; |
| | 736 | } else { |
| | 737 | $retval = !empty( $field->visibility_level ) ? $field->visibility_level : 'public'; |
| | 738 | } |
| 735 | 739 | |
| 736 | 740 | return apply_filters( 'bp_get_the_profile_field_visibility_level', $retval ); |
| 737 | 741 | } |
| … |
… |
function bp_the_profile_field_visibility_level_label() { |
| 747 | 751 | */ |
| 748 | 752 | function bp_get_the_profile_field_visibility_level_label() { |
| 749 | 753 | global $field; |
| | 754 | //On the registration page, values stored in POST should take precedence over default visibility |
| | 755 | if ( bp_is_register_page() && !empty( $_POST['field_' . $field->id . '_visibility'] ) ) { |
| | 756 | $level = $_POST['field_' . $field->id . '_visibility']; |
| | 757 | } else { |
| | 758 | $level = !empty( $field->visibility_level ) ? $field->visibility_level : 'public'; |
| | 759 | } |
| 750 | 760 | |
| 751 | | $level = !empty( $field->visibility_level ) ? $field->visibility_level : 'public'; |
| 752 | 761 | $fields = bp_xprofile_get_visibility_levels(); |
| 753 | 762 | |
| 754 | 763 | return apply_filters( 'bp_get_the_profile_field_visibility_level_label', $fields[$level]['label'] ); |