PageSourceSearch

https://aegh.org/wp-content/plugins/profile-builder-pro/add-ons-ad…/assets/js/epaa-frontend.js?ver=3.14.8

js aegh.org collected 2026-10-02 11:19:42 UTC 4,389 bytes, 115 lines download raw bytes

1jQuery(function(){
2
3    // handle Edit Profile form admin approval
4    handleAdminApproval();
5
6});
7
8
9/**
10 * Handle the admin approval on Edit Profile form
11 *
12 */
13function handleAdminApproval() {
14    if( jQuery( '#wppb-epaa-finish-review' ).length != 0 ) {
15
16        jQuery('.wppb-user-forms.wppb-edit-user #wppb-epaa-finish-review').click(function (e) {
17            e.preventDefault();
18
19            $field_ids = jQuery(this).attr('data-wppb-epaa-approve-fields');
20            $user_id = jQuery(this).attr('data-wppb-epaa-user-id');
21
22            $unapproved_field_is = [];
23            jQuery('.wppb-epaa-switch input').each(function(){
24                if ( ! jQuery(this).is(":checked") ) {
25                    $unapproved_field_is.push( jQuery(this).attr('data-wppb-epaa-field-id') );
26                }
27            });
28
29
30            jQuery('.wppb-user-forms.wppb-edit-user').css('opacity', '0.6');
31
32            jQuery.post(wppb_epaa.ajaxurl, {
33                action: "wppb_epaa_approve_values",
34                fieldIDS: $field_ids,
35                unapprovedIDS: $unapproved_field_is,
36                userID: $user_id
37            }, function (response) {
38                if( response == 'success' ){
39                    approvedFieldIds = $field_ids.split(',');
40                    for (var i = 0; i < approvedFieldIds.length; i++) {
41                        //remove on each field the approve actions and the attribute
42                        jQuery( '#wppb-form-element-' + approvedFieldIds[i] + ' *[data-wppb-epaa-approval-action="true"]' ).removeAttr('data-wppb-epaa-approval-action');
43                        jQuery( '#wppb-form-element-' + approvedFieldIds[i] + ' .wppb-epaa-actions' ).remove();
44                    }
45
46                    // remove the approved fields from the list of field to be approved
47                    jQuery('#wppb-epaa-finish-review').attr('data-wppb-epaa-approve-fields', '');
48
49                    /* remove the buttons if there are no more fields to approve */
50                    if( jQuery('.wppb-user-forms.wppb-edit-user *[data-wppb-epaa-approval-action="true"]').length === 0 ){
51                        jQuery('.wppb-user-forms.wppb-edit-user .wppb-epaa-admin-actions').remove();
52                    }
53
54                }
55                jQuery('.wppb-user-forms.wppb-edit-user').css('opacity', '1.0');
56            });
57
58        });
59
60
61        jQuery("#wppb-epaa-approve-all").click(function (e) {
62            e.preventDefault();
63
64            fieldIDS = [];
65
66            jQuery('.wppb-epaa-switch input').prop('checked', true);
67
68            jQuery('.wppb-user-forms.wppb-edit-user *[data-wppb-epaa-approval-action="true"]').each(function () {
69                $field_id = jQuery(this).attr('data-wppb-epaa-field-id');
70                fieldIDS.push($field_id);
71            });
72
73            fieldIDS = fieldIDS.join(',');
74
75            jQuery('#wppb-epaa-finish-review').attr('data-wppb-epaa-approve-fields', fieldIDS);
76
77            jQuery(this).prop('disabled', true);
78
79        });
80
81
82        jQuery('.wppb-epaa-switch input').click(function (e) {
83
84            $field_id = jQuery(this).attr('data-wppb-epaa-field-id');
85            $all_field_ids_to_be_approved = jQuery('#wppb-epaa-finish-review').attr('data-wppb-epaa-approve-fields');
86            if ($all_field_ids_to_be_approved != '') {
87                $all_field_ids_to_be_approved = $all_field_ids_to_be_approved.split(',');
88            }
89            else {
90                $all_field_ids_to_be_approved = new Array();
91            }
92
93
94            if (jQuery(this).is(":checked")) {
95                $all_field_ids_to_be_approved.push($field_id);
96                if( jQuery('.wppb-epaa-switch input:checked').length ==jQuery('.wppb-epaa-switch input').length ){
97                    jQuery("#wppb-epaa-approve-all").prop('disabled', true);
98                }
99            }
100            else {
101                var index = $all_field_ids_to_be_approved.indexOf($field_id);
102                if (index > -1) {
103                    $all_field_ids_to_be_approved.splice(index, 1);
104                }
105
106                jQuery("#wppb-epaa-approve-all").prop('disabled', false);
107
108            }
109
110            $all_field_ids_to_be_approved = $all_field_ids_to_be_approved.join(',');
111            jQuery('#wppb-epaa-finish-review').attr('data-wppb-epaa-approve-fields', $all_field_ids_to_be_approved);
112
113        });
114    }
115}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.