PageSourceSearch

https://1worldsync.com/wp-content/plugins/one-world-pi-pardot/assets/pi_pardot_form.js?ver=4.0.0

js 1worldsync.com collected 2026-10-09 21:49:30 UTC 14,286 bytes, 395 lines download raw bytes

1var ws_pardot_loader = {
2    defoptions: {
3        title: "Please wait...",
4        message: "Submitting your info. This may take a few moments."
5    },
6    init: function (options) {
7        var lTitle = typeof (options) !== 'undefined' && typeof (options.title) !== 'undefined' ? options.title : this.defoptions.title;
8        var lMessage = typeof (options) !== 'undefined' && typeof (options.message) !== 'undefined' ? options.message : this.defoptions.message;
9
10        var pop_up_html = '<div class="generic-overlay" id="custom_sh_loader">';
11        pop_up_html += '<div class="generic-overlay__content">';
12        pop_up_html += '<div class="generic-overlay__body">';
13        pop_up_html += '<h3 class="h5">' + lTitle + '</h3>';
14        pop_up_html += '<span class="globalPopupDisclaimer">' + lMessage + '</span>';
15        pop_up_html += '<div class="pleaseWait"><svg width="44" height="44" viewBox="0 0 44 44" xmlns="http://www.w3.org/2000/svg" stroke="#fff">' +
16            '<g fill="none" fill-rule="evenodd" stroke-width="2">' +
17            '<circle cx="22" cy="22" r="1">' +
18            '<animate attributeName="r" begin="0s" dur="1.8s" values="1; 20" calcMode="spline" keyTimes="0; 1" keySplines="0.165, 0.84, 0.44, 1" repeatCount="indefinite" />' +
19            '<animate attributeName="stroke-opacity" begin="0s" dur="1.8s" values="1; 0" calcMode="spline" keyTimes="0; 1" keySplines="0.3, 0.61, 0.355, 1" repeatCount="indefinite" />' +
20            '</circle>' +
21            '<circle cx="22" cy="22" r="1">' +
22            '<animate attributeName="r" begin="-0.9s" dur="1.8s" values="1; 20" calcMode="spline" keyTimes="0; 1" keySplines="0.165, 0.84, 0.44, 1" repeatCount="indefinite" />' +
23            '<animate attributeName="stroke-opacity" begin="-0.9s" dur="1.8s" values="1; 0" calcMode="spline" keyTimes="0; 1" keySplines="0.3, 0.61, 0.355, 1" repeatCount="indefinite" />' +
24            '</circle></g></svg></div>';
25        pop_up_html += '</div>';
26        pop_up_html += '</div>';
27        pop_up_html += '</div>';
28        jQuery("body").append(pop_up_html);
29    },
30    setMessage: function (title, message) {
31        jQuery("#custom_sh_loader .h6").html(title);
32        jQuery("#custom_sh_loader .globalPopupDisclaimer").html(message);
33    },
34    resetMessage: function () {
35        jQuery("#custom_sh_loader .h6").html(this.defoptions.title);
36        jQuery("#custom_sh_loader .globalPopupDisclaimer").html(lMessage);
37    },
38    showLoader: function () {
39        jQuery("#custom_sh_loader").fadeIn();
40    },
41    closeLoader: function () {
42        jQuery("#custom_sh_loader").hide();
43    }
44};
45
46jQuery(function () {
47
48    if(pi_site_path === "/de/"){
49        ws_pardot_loader.init({
50            title: "Bitte warten...",
51            message: "Übermittlung Ihrer Informationen. Dies kann einige Augenblicke dauern."
52        });
53    }else{
54        ws_pardot_loader.init();
55    }
56
57    //validationfor inside form button
58    jQuery(document).on('click', '.pardot_generic_form_btn_js', function (e) {
59        e.preventDefault();
60        var form_id = jQuery(this).data("form");
61        var elem = jQuery(this);
62        jQuery('#' + form_id).validate({
63            errorElement: "div",
64            errorClass: "invalid-feedback",
65            highlight: function (element, error) {
66                jQuery(element).closest('div.atrify-form-col').addClass('validation-error');
67                jQuery(element).closest('div.de-contact-form-col ').addClass('validation-error');
68            },
69            unhighlight: function (element, error) {
70                jQuery(element).closest('div.atrify-form-col').addClass('validation-error');
71                jQuery(element).closest('div.de-contact-form-col').addClass('validation-error');
72                if ( jQuery(element).attr("name") == "User Group"){
73                    jQuery(element).closest('div.de-contact-form-col').find('div.invalid-feedback').remove();
74                }
75
76            },
77            errorPlacement: function (error, element) {
78                if (element.attr("name") == "gdpr") {
79                    error.insertAfter(jQuery(element).closest('div.atrify-form-col').find('div.atrify-confirm'));
80                    error.insertAfter(jQuery(element).closest('div.de-contact-form-row').find('div.de-contact-form-confirm'));
81                }
82                else if (element.attr("name") == "User Group") {
83                   error.insertAfter(jQuery(element).closest('div.de-contact-form-row').find('div.de-contact-form-confirm'));
84                }
85                else {
86                    error.insertAfter(element);
87                }
88            },
89            rules: {
90                salutation: {
91                    required: true,
92                },
93                'first-name': {
94                    minlength: 2,
95                    required: true,
96                    maxlength: 250
97                },
98                'last-name': {
99                    minlength: 2,
100                    required: true,
101                    maxlength: 250
102                },
103                'email-address': {
104                    required: true,
105                    email: true,
106                    maxlength: 250
107                },
108                phone: {
109                    required: true,
110                },
111                company: {
112                    minlength: 2,
113                    required: true,
114                    maxlength: 250
115                },
116                country: {
117                    required: true,
118                },
119                message: {
120                    required: true,
121                    maxlength: 30000
122                },
123                'User Group': {
124                    required: true,
125                },
126                gdpr: {
127                    required: true,
128                }
129            },
130            messages: {
131                salutation: "Enter salutation",
132                'first-name': "Enter your first name",
133                'last-name': "Enter your last name",
134                phone: "Enter your phone",
135                company: "Enter your company name",
136                'email-address': {
137                    required: "Enter your email",
138                    email: "Enter a valid email"
139                },
140                country: "Choose your country",
141                message: "Provide some details",
142                gdpr: "Please accept privacy policy",
143                'User Group': "Choose date"
144            }
145        });
146
147        if (jQuery('#' + form_id).valid() == false) {
148            return;
149        }
150        else {
151            submitTopardot(form_id, elem);
152        }
153    });
154
155
156    const isValidUrl = urlString => {
157        let url;
158        try {
159            url = new URL(urlString);
160        }
161        catch (e) {
162            return false;
163        }
164        return url.protocol === "http:" || url.protocol === "https:";
165    }
166
167    function submitTopardot(form_identifier, elem) {
168
169        if (jQuery('#' + form_identifier + " input[name='redirect_url']").length) {
170            var redirectUrl = Base64.decode(jQuery('#' + form_identifier + " input[name='redirect_url']").val());
171        }
172
173        if (jQuery('#' + form_identifier + " input[name='download_url']").length) {
174            var downloadUrl = Base64.decode(jQuery('#' + form_identifier + " input[name='download_url']").val());
175        }
176
177        var successMessage = Base64.decode(jQuery('.' + form_identifier + '_thankyou .generic-form-success__copy').html());
178
179        if (typeof successMessage === 'undefined' || successMessage == "") {
180            successMessage = '<b>Thank You!</b> <br> Your request has been successfully submitted.';
181        }
182
183        jQuery.ajax({
184            url: pi_admin_ajax_url + '?action=oneworldsync_ajax_form_handle',
185            type: 'post',
186            data: jQuery('#' + form_identifier).serialize(),
187            success: function (response) {
188
189                response = jQuery.parseJSON(response);
190                if (response.success == 1) {
191                    ws_pardot_loader.closeLoader();
192                    if (redirectUrl !== '' && isValidUrl(redirectUrl)) {
193                        window.location.href = redirectUrl;
194                    }
195
196                    var prev_load_message = jQuery(".generic-overlay__body").html();
197                    jQuery(".generic-overlay__body").html('<span class="globalPopupDisclaimer">' + successMessage + '</span>');
198                    setTimeout(function () {
199                        ws_pardot_loader.closeLoader();
200                        jQuery(".generic-overlay__body").html(prev_load_message);
201                    }, 5000);
202                }
203            },
204            complete: function (response) {
205
206                ws_pardot_loader.closeLoader();
207
208                var prev_load_message = jQuery(".generic-overlay__body").html();
209                jQuery(".generic-overlay__body").html('<span class="globalPopupDisclaimer">' + successMessage + '</span>');
210                ws_pardot_loader.showLoader();
211
212                setTimeout(function () {
213                    ws_pardot_loader.closeLoader();
214                    jQuery(".generic-overlay__body").html(prev_load_message);
215                    jQuery("#" + form_identifier).trigger("reset");
216                }, 5000);
217
218                if (downloadUrl && downloadUrl.trim() !== "") {
219                    var isClicked = false;
220                    var downloadButton = jQuery('<div class="pt-3"><button class="button-primary--sm download-btn mt-3" id="download">Download</button></div>');
221                    downloadButton.on('click', function () {
222                        var link = document.createElement("a");
223                        link.href = downloadUrl;
224                        link.download = "ebook_einen_regalmeter_bitte-1worldsync";
225                        link.click();
226                    });
227                    jQuery(".generic-overlay__body").append(downloadButton);
228                    downloadButton.on('click', function () {
229                        isClicked = true;
230                    });
231                    setTimeout(function () {
232                        if (!isClicked) {
233                            downloadButton.trigger('click');
234                        }
235                    }, 2000);
236                }
237            },
238            error: function (error) {
239                console.log(error);
240            },
241            beforeSend: function () {
242                ws_pardot_loader.showLoader();
243            }
244        });
245
246    }
247
248});
249
250
251/**
252
253*
254
255*  Base64 encode / decode
256
257*  http://www.webtoolkit.info/
258
259**/
260
261var Base64 = {
262
263    // private property
264    _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
265
266    // public method for encoding
267    encode: function (input) {
268        var output = "";
269        var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
270        var i = 0;
271
272        input = Base64._utf8_encode(input);
273
274        while (i < input.length) {
275
276            chr1 = input.charCodeAt(i++);
277            chr2 = input.charCodeAt(i++);
278            chr3 = input.charCodeAt(i++);
279
280            enc1 = chr1 >> 2;
281            enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
282            enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
283            enc4 = chr3 & 63;
284
285            if (isNaN(chr2)) {
286                enc3 = enc4 = 64;
287            } else if (isNaN(chr3)) {
288                enc4 = 64;
289            }
290
291            output = output +
292                this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
293                this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
294
295        }
296
297        return output;
298    },
299
300    // public method for decoding
301    decode: function (input) {
302        var output = "";
303        var chr1, chr2, chr3;
304        var enc1, enc2, enc3, enc4;
305        var i = 0;
306
307        input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
308
309        while (i < input.length) {
310
311            enc1 = this._keyStr.indexOf(input.charAt(i++));
312            enc2 = this._keyStr.indexOf(input.charAt(i++));
313            enc3 = this._keyStr.indexOf(input.charAt(i++));
314            enc4 = this._keyStr.indexOf(input.charAt(i++));
315
316            chr1 = (enc1 << 2) | (enc2 >> 4);
317            chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
318            chr3 = ((enc3 & 3) << 6) | enc4;
319
320            output = output + String.fromCharCode(chr1);
321
322            if (enc3 != 64) {
323                output = output + String.fromCharCode(chr2);
324            }
325            if (enc4 != 64) {
326                output = output + String.fromCharCode(chr3);
327            }
328
329        }
330
331        output = Base64._utf8_decode(output);
332
333        return output;
334
335    },
336
337    // private method for UTF-8 encoding
338    _utf8_encode: function (string) {
339        string = string.replace(/\r\n/g, "\n");
340        var utftext = "";
341
342        for (var n = 0; n < string.length; n++) {
343
344            var c = string.charCodeAt(n);
345
346            if (c < 128) {
347                utftext += String.fromCharCode(c);
348            }
349            else if ((c > 127) && (c < 2048)) {
350                utftext += String.fromCharCode((c >> 6) | 192);
351                utftext += String.fromCharCode((c & 63) | 128);
352            }
353            else {
354                utftext += String.fromCharCode((c >> 12) | 224);
355                utftext += String.fromCharCode(((c >> 6) & 63) | 128);
356                utftext += String.fromCharCode((c & 63) | 128);
357            }
358
359        }
360
361        return utftext;
362    },
363
364    // private method for UTF-8 decoding
365    _utf8_decode: function (utftext) {
366        var string = "";
367        var i = 0;
368        var c = c1 = c2 = 0;
369
370        while (i < utftext.length) {
371
372            c = utftext.charCodeAt(i);
373
374            if (c < 128) {
375                string += String.fromCharCode(c);
376                i++;
377            }
378            else if ((c > 191) && (c < 224)) {
379                c2 = utftext.charCodeAt(i + 1);
380                string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
381                i += 2;
382            }
383            else {
384                c2 = utftext.charCodeAt(i + 1);
385                c3 = utftext.charCodeAt(i + 2);
386                string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
387                i += 3;
388            }
389
390        }
391
392        return string;
393    }
394
395}

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.