PageSourceSearch

https://beitissie.org.il/wp-content/themes/starter-template/assets/js/ajax_functions.js?v=1790242235&ver=7.1.2

js beitissie.org.il collected 2026-09-24 09:30:46 UTC 10,486 bytes, 229 lines download raw bytes

1$(function () {
2    document.addEventListener('wpcf7mailsent', function (event) {
3        formID = event.detail.contactFormId;
4        if (formID == '510' || formID == '519' || formID == '28598') { //510 is side sticky || 519 is banner for open day || 28598 is courses landing form
5            var inputs = event.detail.inputs;
6            $page_title = $(document).attr('title');
7            $form_element = $('input[value="' + formID + '"]').parents('form');
8            $mailing_list = 0;
9            $date = 0;
10            $group = 0;
11            $plando_course_id = [];
12
13            for (var i = 0; i < inputs.length; i++) {
14                if ('first-name' == inputs[i].name) {
15                    $first_name = (inputs[i].value);
16                } else if ('last-name' == inputs[i].name) {
17                    $last_name = (inputs[i].value);
18                } else if ('phone' == inputs[i].name) {
19                    $phone = (inputs[i].value);
20                } else if ('your-email' == inputs[i].name) {
21                    $email = (inputs[i].value);
22                } else if ('mailing-list' == inputs[i].name) {
23                    $mailing_list = (inputs[i].value);
24                } else if (formID == '519' && 'menu-825' == inputs[i].name){ // if is date field (only on banner form)
25                    $date = (inputs[i].value);
26                } else if (formID == '28598' && 'choose-courses[]' == inputs[i].name) { // if is course (only on landing form)
27                    $plando_course_id.push(inputs[i].value);
28                    
29                }   
30            }            
31            
32            if ($form_element.hasClass('plando')) {
33                if (formID == '28598') {
34                    if ($plando_course_id.length > 0) {
35                        $plando_course_id = $plando_course_id.join(',');
36                    }else{
37                        $plando_course_id = '';
38                    }
39                }else{
40                    $plando_course_id = $('#page-wrap').data('plandocourse') ? $('#page-wrap').data('plandocourse') : false;
41                }
42
43                console.log($plando_course_id);
44                
45
46                $.ajax({
47                    url: ajaxurl,
48                    type: 'post',
49                    data: {
50                        action: 'send_contact_to_plando',
51                        page_title: $page_title,
52                        first_name: $first_name,
53                        last_name: $last_name,
54                        phone: $phone,
55                        email: $email,
56                        mailing_list: $mailing_list,
57                        date: $date,
58                        plando_course_id: $plando_course_id
59                    },
60                    dataType: 'json',
61    
62                }).done(function (response) {
63                    if (response) {
64                        var payLink = response.pay_link;
65                        $date = response.date;
66                        $page_title = response.page_title;
67                        console.log(response.data);
68                        
69                        if ($date) {
70                            console.log('is_date');
71                            $.ajax({
72                                url: ajaxurl,
73                                type: 'post',
74                                data: {
75                                    action: 'send_record_to_plando',
76                                    contact_id: payLink['contact_id'],
77                                    page_title: $page_title,
78                                    date: $date
79                                },
80                                dataType: 'json',
81
82                            }).done(function (response) {
83                                if (response) {
84                                    var recordLink = response.record_link;
85                                    // console.log(recordLink);
86                                    // console.log(response.date_text);
87                                    // console.log('record-sent');
88                                    
89                                }
90                                else { console.log('no response'); }
91
92                            });
93                        }
94    
95                    }
96                    else { console.log('no response'); }
97    
98                });
99            }
100
101            if ($form_element.hasClass('smoove')) {
102                console.log('smoove');
103                $.ajax({
104                    url: ajaxurl,
105                    type: 'post',
106                    data: {
107                        action: 'send_contact_to_smoove',
108                        page_title: $page_title,
109                        first_name: $first_name,
110                        last_name: $last_name,
111                        phone: $phone,
112                        email: $email,
113                        mailing_list: $mailing_list
114                    },
115                    dataType: 'json',
116
117                }).done(function (response) {
118                    if (response) {
119                        var payLink = response.pay_link;
120                        console.log(payLink);
121                        //$('#peleform').attr('src', payLink)
122                        //console.log(payLink);
123                        //window.location.href = payLink;
124                    }
125                    else { console.log('no response'); }
126
127                });
128            }
129
130            setTimeout(() => {
131                if ($('html').attr('lang') == 'en-US') {
132                    location = 'https://beitissie.org.il/en/thank-you/';
133                } else {
134                    location = 'https://beitissie.org.il/%d7%aa%d7%95%d7%93%d7%94/'
135                }
136            }, 4000); // Wait for 3 seconds to redirect.
137        } else if (formID == '15936') { // is Donation form 
138            var $first_name = $last_name = $phone = $amount = $company = $street = $city = $house_number = $is_dedicated = $for_first_name = $for_last_name = $for_text = $how_send = $for_email = $for_address = false;
139            var inputs = event.detail.inputs;
140            $form_element = $('input[value="' + formID + '"]').parents('form');
141            
142            for (var i = 0; i < inputs.length; i++) {
143                if ('first-name' == inputs[i].name) {
144                    $first_name = (inputs[i].value);
145                } else if ('last-name' == inputs[i].name) {
146                    $last_name = (inputs[i].value);
147                } else if ('phone' == inputs[i].name) {
148                    $phone = (inputs[i].value);
149                } else if ('your-email' == inputs[i].name) {
150                    $email = (inputs[i].value);
151                } else if ('amount' == inputs[i].name) {
152                    $amount = (inputs[i].value);
153                } else if ('company' == inputs[i].name) {
154                    $company = (inputs[i].value);
155                } else if ('street' == inputs[i].name) {
156                    $street = (inputs[i].value);
157                } else if ('city' == inputs[i].name) {
158                    $city = (inputs[i].value);
159                } else if ('house-number' == inputs[i].name) {
160                    $house_number = (inputs[i].value);
161                } else if ('acceptance-dedicate' == inputs[i].name) {
162                    $is_dedicated = (inputs[i].value);
163                } else if ('for-first-name' == inputs[i].name) {
164                    $for_first_name = (inputs[i].value);
165                } else if ('for-last-name' == inputs[i].name) {
166                    $for_last_name = (inputs[i].value);
167                } else if ('for-text' == inputs[i].name) {
168                    $for_text = (inputs[i].value);
169                } else if ('how-send' == inputs[i].name) {
170                    $how_send = (inputs[i].value);
171                } else if ('for-email' == inputs[i].name) {
172                    $for_email = (inputs[i].value);
173                } else if ('for-address' == inputs[i].name) {
174                    $for_address = (inputs[i].value);
175                }
176            }
177            $('form').css('opacity','0.5');
178            grecaptcha.ready(function () {
179                grecaptcha.execute(donationAjax.recaptcha_site_key, { action: 'donation' }).then(function (token) {
180                    $.ajax({
181                        url: ajaxurl,
182                        type: 'post',
183                        data: {
184                            action: 'get_donation_iframe',
185                            security: donationAjax.nonce,
186                            recaptcha_token: token, 
187                            amount: $amount,
188                            first_name: $first_name,
189                            last_name: $last_name,
190                            phone: $phone,
191                            email: $email,
192                            company: $company,
193                            city: $city,
194                            street: $street,
195                            house_number: $house_number,
196                            is_dedicated: $is_dedicated,
197                            for_first_name: $for_first_name,
198                            for_last_name: $for_last_name,
199                            for_text: $for_text,
200                            how_send: $how_send,
201                            for_email: $for_email,
202                            for_address: $for_address,
203                        },
204                        dataType: 'json',
205
206                    }).done(function (response) {
207                        if (response) {
208                            window.location.replace(response);
209                        } else { console.log('no response'); }
210                        
211                    });
212                });
213            });
214
215        } else {
216            console.log('wrong_form: '+formID);
217            
218            setTimeout(() => {
219                if ($('html').attr('lang') == 'en-US') {
220                    location = 'https://beitissie.org.il/en/thank-you/'
221                } else {
222                    location = 'https://beitissie.org.il/%d7%aa%d7%95%d7%93%d7%94/'
223                }
224            }, 3000); // Wait for 3 seconds to redirect.
225        }
226    }, false);
227})
228
229

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.