PageSourceSearch

https://www.cbd.fr/modules/ets_cfultimate/views/js/scripts.js?v=1790061811

js cbd.fr collected 2026-09-26 15:49:13 UTC 30,599 bytes, 822 lines download raw bytes

1/**
2 * 2007-2022 ETS-Soft
3 *
4 * NOTICE OF LICENSE
5 *
6 * This file is not open source! Each license that you purchased is only available for 1 website only.
7 * If you want to use this file on more websites (or projects), you need to purchase additional licenses.
8 * You are not allowed to redistribute, resell, lease, license, sub-license or offer our resources to any third party.
9 *
10 * DISCLAIMER
11 *
12 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
13 * versions in the future. If you wish to customize PrestaShop for your
14 * needs please contact us for extra customization service at an affordable price
15 *
16 *  @author ETS-Soft <[email protected]>
17 *  @copyright  2007-2022 ETS-Soft
18 *  @license    Valid for 1 website (or project) for each purchase of license
19 *  International Registered Trademark & Property of ETS-Soft
20 */
21(function ($) {
22
23    'use strict';
24    var wpcfu = {
25        "apiSettings": {
26            "root": "http:\/\/web.prestahero.com\/chung\/wp494\/wp-json\/contact-form-7\/v1",
27            "namespace": "contact-form-7\/v1"
28        }, "recaptcha": {"messages": {"empty": "Please verify that you are not a robot."}}
29    };
30    if (typeof wpcfu === 'undefined' || wpcfu === null) {
31        return;
32    }
33
34    wpcfu = $.extend({
35        cached: 0,
36        inputs: []
37    }, wpcfu);
38
39    $(function () {
40        wpcfu.supportHtml5 = (function () {
41            var features = {};
42            var input = document.createElement('input');
43
44            features.placeholder = 'placeholder' in input;
45
46            var inputTypes = ['email', 'url', 'tel', 'number', 'range', 'date'];
47
48            $.each(inputTypes, function (index, value) {
49                input.setAttribute('type', value);
50                features[value] = input.type !== 'text';
51            });
52            return features;
53        })();
54
55        $('div.wpcfu > form').each(function () {
56            var $form = $(this);
57            wpcfu.initForm($form);
58
59            if (wpcfu.cached) {
60                wpcfu.refill($form);
61            }
62        });
63    });
64
65    wpcfu.getId = function (form) {
66        return parseInt($('input[name="_wpcfu"]', form).val(), 10);
67    };
68
69    wpcfu.initForm = function (form) {
70        var $form = $(form);
71        $form.submit(function (event) {
72            if (typeof window.FormData !== 'function') {
73                return;
74            }
75            wpcfu.submit($form);
76            event.preventDefault();
77        });
78        if ($form.find('.ajax-loader').length <= 0)
79            $form.find('.wpcfu-submit').after('<span class="ajax-loader"></span>');
80        wpcfu.toggleSubmit($form);
81
82        $form.on('click', '.wpcfu-acceptance', function () {
83            wpcfu.toggleSubmit($form);
84        });
85
86        // Exclusive Checkbox
87        $('.wpcfu-exclusive-checkbox', $form).on('click', 'input:checkbox', function () {
88            var name = $(this).attr('name');
89            $form.find('input:checkbox[name="' + name + '"]').not(this).prop('checked', false);
90        });
91
92        // Free Text Option for Checkboxes and Radio Buttons
93        $('.wpcfu-list-item.has-free-text', $form).each(function () {
94            var $freetext = $(':input.wpcfu-free-text', this);
95            var $wrap = $(this).closest('.wpcfu-form-control');
96            if ($(':checkbox, :radio', this).is(':checked')) {
97                $freetext.prop('disabled', false);
98            } else {
99                $freetext.prop('disabled', true);
100            }
101            $wrap.on('change', ':checkbox, :radio', function () {
102                var $cb = $('.has-free-text', $wrap).find(':checkbox, :radio');
103                if ($cb.is(':checked')) {
104                    $freetext.prop('disabled', false).focus();
105                } else {
106                    $freetext.prop('disabled', true);
107                }
108            });
109        });
110
111        // Placeholder Fallback
112        if (!wpcfu.supportHtml5.placeholder) {
113            $('[placeholder]', $form).each(function () {
114                $(this).val($(this).attr('placeholder'));
115                $(this).addClass('placeheld');
116
117                $(this).focus(function () {
118                    if ($(this).hasClass('placeheld')) {
119                        $(this).val('').removeClass('placeheld');
120                    }
121                });
122
123                $(this).blur(function () {
124                    if ('' === $(this).val()) {
125                        $(this).val($(this).attr('placeholder'));
126                        $(this).addClass('placeheld');
127                    }
128                });
129            });
130        }
131
132        if (wpcfu.jqueryUi && !wpcfu.supportHtml5.date) {
133            $form.find('input.wpcfu-date[type="date"]').each(function () {
134                $(this).datepicker({
135                    dateFormat: 'yy-mm-dd',
136                    minDate: new Date($(this).attr('min')),
137                    maxDate: new Date($(this).attr('max'))
138                });
139            });
140        }
141
142        if (wpcfu.jqueryUi && !wpcfu.supportHtml5.number) {
143            $form.find('input.wpcfu-number[type="number"]').each(function () {
144                $(this).spinner({
145                    min: $(this).attr('min'),
146                    max: $(this).attr('max'),
147                    step: $(this).attr('step')
148                });
149            });
150        }
151
152        // Character Count
153        $('.wpcfu-character-count', $form).each(function () {
154            var $count = $(this);
155            var name = $count.attr('data-target-name');
156            var down = $count.hasClass('down');
157            var starting = parseInt($count.attr('data-starting-value'), 10);
158            var maximum = parseInt($count.attr('data-maximum-value'), 10);
159            var minimum = parseInt($count.attr('data-minimum-value'), 10);
160
161            var updateCount = function (target) {
162                var $target = $(target);
163                var length = $target.val().length;
164                var count = down ? starting - length : length;
165                $count.attr('data-current-value', count);
166                $count.text(count);
167
168                if (maximum && maximum < length) {
169                    $count.addClass('too-long');
170                } else {
171                    $count.removeClass('too-long');
172                }
173
174                if (minimum && length < minimum) {
175                    $count.addClass('too-short');
176                } else {
177                    $count.removeClass('too-short');
178                }
179            };
180
181            $(':input[name="' + name + '"]', $form).each(function () {
182                updateCount(this);
183
184                $(this).keyup(function () {
185                    updateCount(this);
186                });
187            });
188        });
189
190        // URL Input Correction
191        $form.on('change', '.wpcfu-validates-as-url', function () {
192            var val = $.trim($(this).val());
193
194            if (val
195                && !val.match(/^[a-z][a-z0-9.+-]*:/i)
196                && -1 !== val.indexOf('.')) {
197                val = val.replace(/^\/+/, '');
198                val = 'http://' + val;
199            }
200
201            $(this).val(val);
202        });
203    };
204
205    wpcfu.grecaptchaReset = function () {
206
207    }
208
209    wpcfu.submit = function (form) {
210        if (typeof tinyMCE !== 'undefined' && tinyMCE.editors.length > 0 && $('.autoload_rte_cfu').length) {
211            tinyMCE.triggerSave();
212        }
213        if (typeof window.FormData !== 'function') {
214            return;
215        }
216        var $form = $(form);
217        if ($form.hasClass('is-active'))
218            return false;
219        $('.ajax-loader', $form).addClass('is-active');
220        $form.addClass('is-active');
221        $('[placeholder].placeheld', $form).each(function (i, n) {
222            $(n).val('');
223        });
224
225        wpcfu.clearResponse($form);
226
227        var formData = new FormData($form.get(0));
228
229        var detail = {
230            id: $form.closest('div.wpcfu').attr('id'),
231            status: 'init',
232            inputs: [],
233            formData: formData
234        };
235
236        $.each($form.serializeArray(), function (i, field) {
237            if ('_wpcfu' == field.name) {
238                detail.contactFormId = field.value;
239            } else if ('_ets_cfu_version' == field.name) {
240                detail.pluginVersion = field.value;
241            } else if ('_ets_cfu_locale' == field.name) {
242                detail.contactFormLocale = field.value;
243            } else if ('_ets_cfu_unit_tag' == field.name) {
244                detail.unitTag = field.value;
245            } else if ('_ets_cfu_container_post' == field.name) {
246                detail.containerPostId = field.value;
247            } else if (field.name.match(/^_ets_cfu_\w+_free_text_/)) {
248                var owner = field.name.replace(/^_ets_cfu_\w+_free_text_/, '');
249                detail.inputs.push({
250                    name: owner + '-free-text',
251                    value: field.value
252                });
253            } else if (field.name.match(/^_/)) {
254                // do nothing
255            } else {
256                detail.inputs.push(field);
257            }
258        });
259        wpcfu.triggerEvent($form.closest('div.wpcfu'), 'beforesubmit', detail);
260        var ajaxSuccess = function (data, status, xhr, $form) {
261
262            detail.id = $(data.into).attr('id');
263            detail.status = data.status;
264            detail.apiResponse = data;
265            var $message = $('.wpcfu-response-output', $form);
266
267            $message.removeClass('alert-warning');
268            $message.removeClass('alert-success');
269            if (data.status && typeof grecaptcha !== "undefined" && $form.find(':input[name=g-recaptcha-response]').length > 0) {
270                if (!ets_cfu_recaptcha_v3) {
271                    grecaptcha.reset();
272                }
273            }
274            switch (data.status) {
275                case 'validation_failed':
276                    $.each(data.invalidFields, function (i, n) {
277                        $(n.into, $form).each(function () {
278                            wpcfu.notValidTip(this, n.message);
279                            $('.wpcfu-form-control', this).addClass('wpcfu-not-valid');
280                            $('[aria-invalid]', this).attr('aria-invalid', 'true');
281                        });
282                    });
283                    $message.addClass('alert alert-warning');
284                    $form.addClass('invalid');
285                    wpcfu.triggerEvent(data.into, 'invalid', detail);
286                    break;
287                case 'acceptance_missing':
288                    $message.addClass('alert alert-warning');
289                    $form.addClass('unaccepted');
290                    wpcfu.triggerEvent(data.into, 'unaccepted', detail);
291                    break;
292                case 'spam':
293                    $message.addClass('alert alert-warning');
294                    $form.addClass('spam');
295                    $('[name="g-recaptcha-response"]', $form).each(function () {
296                        if ('' === $(this).val()) {
297                            var $recaptcha = $(this).closest('.wpcfu-form-control-wrap');
298                            wpcfu.notValidTip($recaptcha, wpcfu.recaptcha.messages.empty);
299                        }
300                    });
301                    wpcfu.triggerEvent(data.into, 'spam', detail);
302                    break;
303                case 'aborted':
304                    $message.addClass('alert alert-warning');
305                    $form.addClass('aborted');
306
307                    wpcfu.triggerEvent(data.into, 'aborted', detail);
308                    break;
309                case 'mail_sent':
310                    $message.addClass('alert alert-success');
311                    $form.addClass('sent');
312                    wpcfu.triggerEvent(data.into, 'mailsent', detail);
313                    break;
314                case 'mail_failed':
315                    $message.addClass('alert alert-warning');
316                    $form.addClass('failed');
317                    wpcfu.triggerEvent(data.into, 'mailfailed', detail);
318                    break;
319                case 'mail_redirect':
320                    $message.hide().remove();
321                    window.location.href = data.message;
322                    break;
323                case 'load_thank_page':
324                    $message.hide().remove();
325                    window.location.href = data.message;
326                    break;
327                case 'not_found':
328                    $message.addClass('alert alert-danger');
329                    $form.addClass('failed');
330                    break;
331                default:
332                    var customStatusClass = 'custom-' + data.status.replace(/[^0-9a-z]+/i, '-');
333                    $message.addClass('wpcfu-' + customStatusClass);
334                    $form.addClass(customStatusClass);
335            }
336
337            wpcfu.refill($form, data);
338
339            wpcfu.triggerEvent(data.into, 'submit', detail);
340
341            if ('mail_sent' === data.status) {
342                $form.each(function () {
343                    this.reset();
344                });
345            }
346
347            $form.find('[placeholder].placeheld').each(function (i, n) {
348                $(n).val($(n).attr('placeholder'));
349            });
350
351            $message.html('').append(data.message).slideDown('fast');
352            $message.attr('role', 'alert');
353
354            $('.screen-reader-response', $form.closest('.wpcfu')).each(function () {
355                var $response = $(this);
356                $response.html('').attr('role', '').append(data.message);
357
358                if (data.invalidFields) {
359                    var $invalids = $('<ul></ul>');
360
361                    $.each(data.invalidFields, function (i, n) {
362                        if (n.idref) {
363                            var $li = $('<li></li>').append($('<a></a>').attr('href', '#' + n.idref).append(n.message));
364                        } else {
365                            var $li = $('<li></li>').append(n.message);
366                        }
367
368                        $invalids.append($li);
369                    });
370
371                    $response.append($invalids);
372                }
373
374                $response.attr('role', 'alert').focus();
375            });
376        };
377        $.ajax({
378            type: 'POST',
379            url: $form.attr('action'),
380            data: formData,
381            dataType: 'json',
382            processData: false,
383            contentType: false
384        }).done(function (data, status, xhr) {
385            ajaxSuccess(data, status, xhr, $form);
386            $('.ajax-loader', $form).removeClass('is-active');
387            $form.removeClass('is-active');
388            if ($form.find('.pa-captcha-refesh').length)
389                refeshImage($form.find('.pa-captcha-refesh'));
390        }).fail(function (xhr, status, error) {
391            $form.find('.wpcfu-response-output').removeClass('alert-warning');
392            $form.find('.wpcfu-response-output').removeClass('alert-success');
393            $form.find('.wpcfu-response-output').html('There was a technical error when submitting the form. Please contact webmaster for more information');
394            $form.find('.wpcfu-response-output').addClass('alert alert-warning');
395            $form.find('.wpcfu-response-output').addClass('invalid').show();
396            $form.find('.ajax-loader').removeClass('is-active');
397            $form.removeClass('is-active');
398            if ($form.find('.pa-captcha-refesh'))
399                refeshImage($form.find('.pa-captcha-refesh'));
400        });
401    };
402    wpcfu.triggerEvent = function (target, name, detail) {
403        var $target = $(target);
404
405        /* DOM event */
406        var event = new CustomEvent('wpcfu' + name, {
407            bubbles: true,
408            detail: detail
409        });
410        /* jQuery event */
411        $target.trigger('wpcfu:' + name, detail);
412        $target.trigger(name + '.wpcfu', detail); // deprecated
413    };
414
415    wpcfu.toggleSubmit = function (form, state) {
416        var $form = $(form);
417        var $submit = $('input:submit', $form);
418
419        if (typeof state !== 'undefined') {
420            $submit.prop('disabled', !state);
421            return;
422        }
423
424        if ($form.hasClass('wpcfu-acceptance-as-validation')) {
425            return;
426        }
427        $submit.prop('disabled', false);
428
429        $('.wpcfu-acceptance', $form).each(function () {
430            var $span = $(this);
431            var $input = $('input:checkbox', $span);
432
433            if (!$span.hasClass('optional')) {
434                if ($span.hasClass('invert') && $input.is(':checked')
435                    || !$span.hasClass('invert') && !$input.is(':checked')) {
436                    $submit.prop('disabled', true);
437                    return false;
438                }
439            }
440        });
441    };
442
443    wpcfu.notValidTip = function (target, message) {
444        var $target = $(target);
445        console.log(target);
446        $('.wpcfu-not-valid-tip', $target).remove();
447        $('<span role="alert" class="wpcfu-not-valid-tip"></span>')
448            .text(message).appendTo($target);
449
450        if ($target.is('.use-floating-validation-tip *')) {
451            var fadeOut = function (target) {
452                $(target).not(':hidden').animate({
453                    opacity: 0
454                }, 'fast', function () {
455                    $(this).css({'z-index': -100});
456                });
457            };
458
459            $target.on('mouseover', '.wpcfu-not-valid-tip', function () {
460                fadeOut(this);
461            });
462
463            $target.on('focus', ':input', function () {
464                fadeOut($('.wpcfu-not-valid-tip', $target));
465            });
466        }
467    };
468
469    wpcfu.refill = function (form, data) {
470        var $form = $(form);
471
472        var refillCaptcha = function ($form, items) {
473            $.each(items, function (i, n) {
474                $form.find(':input[name="' + i + '"]').val('');
475                $form.find('img.wpcfu-captcha-' + i).attr('src', n);
476                var match = /([0-9]+)\.(png|gif|jpeg)$/.exec(n);
477                $form.find('input:hidden[name="_ets_cfu_captcha_challenge_' + i + '"]').attr('value', match[1]);
478            });
479        };
480
481        var refillQuiz = function ($form, items) {
482            $.each(items, function (i, n) {
483                $form.find(':input[name="' + i + '"]').val('');
484                $form.find(':input[name="' + i + '"]').siblings('span.wpcfu-quiz-label').text(n[0]);
485                $form.find('input:hidden[name="_ets_cfu_quiz_answer_' + i + '"]').attr('value', n[1]);
486            });
487        };
488
489        if (typeof data === 'undefined') {
490            $.ajax({
491                type: 'GET',
492                url: wpcfu.apiSettings.getRoute(
493                    '/contact-forms/' + wpcfu.getId($form) + '/refill'),
494                beforeSend: function (xhr) {
495                    var nonce = $form.find(':input[name="_wpnonce"]').val();
496
497                    if (nonce) {
498                        xhr.setRequestHeader('X-WP-Nonce', nonce);
499                    }
500                },
501                dataType: 'json'
502            }).done(function (data, status, xhr) {
503                if (data.captcha) {
504                    refillCaptcha($form, data.captcha);
505                }
506
507                if (data.quiz) {
508                    refillQuiz($form, data.quiz);
509                }
510            });
511
512        } else {
513            if (data.captcha) {
514                refillCaptcha($form, data.captcha);
515            }
516
517            if (data.quiz) {
518                refillQuiz($form, data.quiz);
519            }
520        }
521    };
522
523    wpcfu.clearResponse = function (form) {
524        var $form = $(form);
525        $form.removeClass('invalid spam sent failed');
526        $form.siblings('.screen-reader-response').html('').attr('role', '');
527
528        $('.wpcfu-not-valid-tip', $form).remove();
529        $('[aria-invalid]', $form).attr('aria-invalid', 'false');
530        $('.wpcfu-form-control', $form).removeClass('wpcfu-not-valid');
531
532        $('.wpcfu-response-output', $form)
533            .hide().empty().removeAttr('role')
534            .removeClass('wpcfu-mail-sent-ok wpcfu-mail-sent-ng wpcfu-validation-errors wpcfu-spam-blocked');
535    };
536
537    wpcfu.apiSettings.getRoute = function (path) {
538        var url = wpcfu.apiSettings.root;
539
540        url = url.replace(
541            wpcfu.apiSettings.namespace,
542            wpcfu.apiSettings.namespace + path);
543
544        return url;
545    };
546
547})(jQuery);
548
549/*
550 * Polyfill for Internet Explorer
551 * See https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
552 */
553(function () {
554    if (typeof window.CustomEvent === "function") return false;
555
556    function CustomEvent(event, params) {
557        params = params || {bubbles: false, cancelable: false, detail: undefined};
558        var evt = document.createEvent('CustomEvent');
559        evt.initCustomEvent(event,
560            params.bubbles, params.cancelable, params.detail);
561        return evt;
562    }
563
564    CustomEvent.prototype = window.Event.prototype;
565
566    window.CustomEvent = CustomEvent;
567})();
568
569$(document).ready(function () {
570    $('.wpcfu input[type="url"]').each(function () {
571        if ($(this).val()) {
572            $(this).val($(this).val().replace('default:current_url', window.location.href));
573        }
574    });
575    $(document).on('click', '.wpcfu .ets_cfu_show_hide', function () {
576        if ($(this).find('i.fa-eye-slash').length > 0) {
577            $(this).find('i').removeClass('fa-eye-slash').addClass('fa-eye');
578            $(this).prev('input').attr('type', 'text');
579        } else {
580            $(this).find('i').removeClass('fa-eye').addClass('fa-eye-slash');
581            $(this).prev('input').attr('type', 'password');
582        }
583    });
584    $(document).on('click', '.ctf_click_open_contactform7', function () {
585        var id = $(this).attr('data-id');
586        $('#ctf-popup-wapper-' + id).addClass('show');
587        if (!$(this).hasClass('addlogded')) {
588            ajaxAddLoger($('#ctf-popup-wapper-' + id).find('.wpcfu').attr('data-id'));
589            $(this).addClass('addlogded');
590        }
591    });
592    $(document).on('click', '.wpcfu.hook', function () {
593        var id = $(this).attr('data-id');
594        $('#ctf-popup-wapper-' + id).addClass('show');
595        if (!$(this).hasClass('addlogded')) {
596            ajaxAddLoger(id);
597            $(this).addClass('addlogded');
598        }
599    });
600    $(document).on('click', '.ctf_close_popup', function () {
601        $(this).closest('.ctf-popup-wapper').removeClass('show');
602    });
603    $(document).mouseup(function (e) {
604        var container = $('.ctf-popup-content');
605        var datepicker = $('.ui-datepicker');
606        if (!container.is(e.target) && container.has(e.target).length === 0 && !datepicker.is(e.target) && datepicker.has(e.target).length === 0) {
607            $('.ctf-popup-wapper').removeClass('show');
608        }
609    });
610    $(document).keyup(function (e) {
611        if (e.keyCode == 27) { // escape key maps to keycode `27`
612            $('.ctf-popup-wapper').removeClass('show');
613        }
614    });
615    if ($(".wpcfu .datetimepicker").length > 0) {
616        $(".wpcfu .datetimepicker").datetimepicker({
617            timepicker: true,
618            format: 'Y-m-d h:i'
619        });
620    }
621    if ($(".wpcfu .datepicker").length > 0) {
622        $(".wpcfu .datepicker").datetimepicker({
623            timepicker: false,
624            format: 'Y-m-d'
625        });
626    }
627    $('.pa-captcha-refesh').click(function () {
628        refeshImage($(this));
629        return false;
630    });
631    if ($('input[type="range"]').length) {
632        $('input[type="range"]').each(function () {
633            if ($(this).prev('.rang-value').length > 0)
634                $(this).prev('.rang-value').html($(this).val());
635        });
636    }
637    $('input[type="range"]').change(function () {
638        if ($(this).prev('.rang-value').length > 0)
639            $(this).prev('.rang-value').html($(this).val());
640    });
641
642
643    //Init MCE
644    if (typeof tinyMCE !== 'undefined' && $('.autoload_rte_cfu').length > 0) {
645        tinyMCE.init({
646            selector: '.autoload_rte_cfu',
647            plugins: "align link image media code emoticons",
648            browser_spellcheck: true,
649            toolbar1: "emoticons,bold,italic,underline,link,align,bulli,numlist,table,image",
650            convert_urls: false,
651        });
652    }
653});
654
655function getDataContent(object) {
656    var idEl = object[0].id,
657        body = tinyMCE.get(idEl).getBody(),
658        text = body.innerText || body.textContent;
659    var re = /\n$/g;
660    var OK = re.exec(text);
661    if (OK) {
662        text = text.replace(/\n$/g, '');
663    }
664    return {
665        idEl: idEl,
666        chars: text.replace(/[\t\n]+/g, ' ').length,
667        words: text.split(/[\w\u2019\'-]+/).length
668    };
669};
670
671function excuteType(objectData) {
672    var elMax = $('#' + objectData['idEl']).next('.number_max'),
673        elIndex = elMax.find('.index_type').first();
674
675    if (parseInt(objectData['chars']) >= parseInt($('#' + objectData['idEl']).attr('maxlength'))) {
676        elIndex.html(parseInt($('#' + objectData['idEl']).attr('maxlength')));
677        return false;
678    }
679    elIndex.html(parseInt(objectData['chars']));
680    return true;
681}
682
683
684function refeshImage($this) {
685    if ($this.prev('.pa-captcha-img-data').length) {
686        originalCapcha = $this.prev('.pa-captcha-img-data').attr('src');
687        originalCode = $this.attr('data-rand');
688        newCode = Math.random();
689        $this.prev('.pa-captcha-img-data').attr('src', originalCapcha.replace(originalCode, newCode));
690        $this.attr('data-rand', newCode);
691        $('input[type="captcha"]').val('');
692    }
693}
694
695function ajaxAddLoger(id_contact) {
696    $.ajax({
697        type: 'POST',
698        headers: {"cache-control": "no-cache"},
699        url: link_contact_ets,
700        dataType: "json",
701        data: 'action=etsCfuAddLogger&id_contact=' + id_contact,
702        success: function (jsonData) {
703
704        }
705    });
706}
707
708function ets_cfu_loading_captcha() {
709    var img = $('.pa-captcha-img-data:not(.loaded)').first();
710    if (img.length > 0) {
711        img.load(function () {
712            if (!img.hasClass('loaded')) {
713                ets_cfu_refresh_captcha(img);
714            }
715            if (img[0].complete && img.hasClass('loaded')) {
716                ets_cfu_loading_captcha();
717            }
718        }).filter(function () {
719            return this.complete;
720        }).load();
721    }
722}
723
724function ets_cfu_refresh_captcha(img) {
725    if (img.length && !img.hasClass('loaded')) {
726        var org_link = img.attr('src'),
727            org_code = img.attr('data-rand'),
728            rand = Math.random();
729        img.attr({'src': org_link.replace(org_code, rand), 'data-rand': rand});
730        if (!img.hasClass('loaded')) {
731            img.addClass('loaded');
732        }
733        img.next(".pa-captcha-refesh").attr('data-rand', rand);
734    }
735}
736
737document.addEventListener("DOMContentLoaded", function (event) {
738    if ($('.pa-captcha-img-data').length > 1) {
739        ets_cfu_loading_captcha();
740    }
741});
742
743var ets_cfu_update = {
744    init: function () {
745        this.check_maxlength_number();
746        this.caculate_maxleng();
747        this.hidden_referrence();
748    },
749    check_maxlength_number: function () {
750        var input_number = $('.ets_cfu_form-control-wrap input[type="number"]');
751        if (input_number.length > 0) {
752            input_number.on("keyup", function (e) {
753                var $field = $(this),
754                    val = this.value; // retrieve the index
755                if (val.length > Number($field.attr("maxlength"))) {
756                    val = val.slice(0, $field.attr('maxlength'));
757                    $field.val(val);
758                }
759            });
760        }
761    },
762    caculate_maxleng: function () {
763        $(document).on('keyup', 'input[maxlength], textarea[maxlength]', function () {
764            var leng = $(this).val().length;
765            if (leng > $(this).attr('maxlength')) {
766                return;
767            }
768            var el_numbermax = $(this).next('.number_max');
769            el_numbermax.find('.index_type').first().html(leng);
770        });
771    },
772    hidden_referrence: function () {
773        if ($('.ets_cfu_input_referrence').length > 0 && typeof hidden_referrence !== "undefined" && hidden_referrence) {
774            $('.ets_cfu_input_referrence').hide();
775        }
776    },
777
778};
779
780$(document).ready(function () {
781    ets_cfu_update.init();
782});
783
784$(document).on('click', '.ets_cfu_form-control-wrap .number_plus,.ets_cfu_form-control-wrap .number_minus', function () {
785    var $qty = $(this).closest('.ets_cfu_form-control-wrap').find('.ets_cfu-number').first(),
786        currentVal = parseFloat($qty.val()),
787        max = parseFloat($qty.attr('max')),
788        min = parseFloat($qty.attr('min')),
789        step = $qty.attr('step');
790
791    // Format values
792    if (!currentVal || currentVal === '' || currentVal === 'NaN') currentVal = 0;
793    if (max === '' || max === 'NaN') max = '';
794    if (min === '' || min === 'NaN') min = 0;
795    if (step === 'any' || step === '' || step === undefined || parseFloat(step) === 'NaN') step 
795= 1;
796
797    // Change the value
798    if ($(this).is('.ets_cfu_form-control-wrap .number_plus')) {
799        if (max && (currentVal >= max)) {
800            $qty.val(max);
801        } else {
802            $qty.val((currentVal + parseFloat(step)));
803        }
804    } else {
805        if (min && (currentVal <= min)) {
806            $qty.val(min);
807        } else if (currentVal > 0) {
808            $qty.val((currentVal - parseFloat(step)));
809        }
810    }
811
812    // Trigger change event
813    $qty.trigger('change');
814});
815
816$(".access_numer input").keypress(function (event) {
817    var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
818    if ((keyCode >= 65 && keyCode <= 90) || (keyCode >= 97 && keyCode <= 122))
819        return false;
820    else return true;
821});
822

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.