PageSourceSearch

https://euphoria.eu/templates/euphoria_frontend/js/mainCart.js?v=3.6

js euphoria.eu collected 2026-10-04 03:33:37 UTC 2,184 bytes, 84 lines download raw bytes

1$('#selectAddress').change(function () {
2    let json = $(this).find(":selected").data('json');
3
4    if (json) {
5        $.each(json, function (key, value) {
6            if (key == 'country') {
7                if (checkOptionValueExists('#' + key, value)) {
8                    $('#' + key).val(value);
9                } else {
10                    $('#' + key).val(null);
11                }
12            } else {
13                $('#' + key).val(value);
14            }
15        });
16    }
17});
18
19$('#selectDeliveryAddress').change(function () {
20    let json = $(this).find(":selected").data('json');
21
22    if (json) {
23        $.each(json, function (key, value) {
24            if (key == 'country') {
25                if (checkOptionValueExists('#delivery_' + key, value)) {
26                    $('#delivery_' + key).val(value);
27                } else {
28                    $('#delivery_' + key).val(null);
29                }
30            } else {
31                $('#delivery_' + key).val(value);
32            }
33        });
34    }
35});
36
37function checkOptionValueExists(id, value) {
38    let exists = false;
39
40    $(id+' option').each(function(){
41        if (this.value == value) {
42            exists = true;
43        }
44    });
45
46    return exists;
47}
48
49$(document).ready(function() {
50    $('.show-cart-widget').click(function () {
51        $('#sideCartWidgetContainer').show();
52    });
53
54    $('#hideCart').click(function () {
55        $('#sideCartWidgetContainer').hide();
56    });
57
58    $('input[type="radio"][name="delivery_address_radiolist"]').on('change', function() {
59        $('input[type="radio"][name="delivery_address_radiolist"]').each(function() {
60            var parentDiv = $(this).closest('div').parent();
61            if ($(this).is(':checked')) {
62                parentDiv.addClass('grayBg');
63
64            } else {
65                parentDiv.removeClass('grayBg');
66
67            }
68        });
69    });
70});
71
72function formatState (state) {
73    if (!state.id) {
74        return state.text;
75    }
76
77    var imageUrl = $(state.element).data('flag');
78
79    var $state = $(
80        '<span>' + '<img src="' + imageUrl + '" class="select2-img-flag" /> ' + state.text + '</span>'
81    );
82
83    return $state;
84};

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.