PageSourceSearch

https://orca.eu/wp-content/plugins/orca_brand/includes/js/collection-view.js

js orca.eu collected 2026-10-02 20:03:54 UTC 2,759 bytes, 78 lines download raw bytes

1function GetURLParameter(sParam) {
2
3    var sPageURL = window.location.search.substring(1);
4    var sURLVariables = sPageURL.split('&');
5
6    for (var i = 0; i < sURLVariables.length; i++) {
7        var sParameterName = sURLVariables[i].split('=');
8        if (sParameterName[0] == sParam) {
9            return sParameterName[1];
10        }
11    }
12}
13
14(function ($) {
15
16    $(document).on('click', '.brand-range .range-item', function (e) {
17        e.preventDefault();
18
19        if ($(this).attr('data-iteration') == 0) {
20            $(this).show();
21        }
22
23        var gamme = $(this).attr('data-gamme');
24        window.history.pushState(null, null, "?brand=orca-en&gamme="+gamme);
25        $(".produit").each(function () {
26            if ($(this).attr('data-gamme').indexOf(gamme) >= 0) {
27                $(this).show();
28            } else {
29                $(this).hide();
30            }
31        });
32
33        $range_title = $(this).attr('data-gamme-name');
34        $('.rrange-descange-title').html($range_title);
35
36        $('.range-item').removeClass('selected');
37        $(this).addClass('selected');
38        $(".brand-range .selected-item").html($(this).text());
39        $(".range-wrapper .range-title").html($(".selected-item").text());
40        $(".brand-range .range-item").hide();
41    });
42
43    $(document).ready(function () {
44        /**
45         * Useful function for checking the presence of parameter brand in the url of Page Brand
46         */
47        if (GetURLParameter('brand') == 'brand') {
48            /**
49             * If we do have the parameter brand in the url, then we send a click event to the first 
50             * 'gamme' which will in turn display every product of that brand belonging to the clicked 'gamme'
51             */
52            $('.brand-range').children()[0].click();
53        }
54
55        var gamme = jQuery(".brand-range .range-item.selected").attr('data-gamme');
56
57        if (gamme) {
58            window.history.pushState(null, null, "?brand=orca-en&gamme="+gamme);
59            jQuery(".produit").each(function () {
60                if (jQuery(this).attr('data-gamme').indexOf(gamme) >= 0) {
61                    jQuery(this).show();
62                } else {
63                    jQuery(this).hide();
64                }
65            });
66        }
67
68        $(".brand-range .selected-item").html($(".brand-range .range-item.selected").text());
69        $(".range-wrapper .range-title").html($(".selected-item").text());
70
71        $(".brand-range").click(function () {
72            $(".brand-range .icon-arrow").toggleClass("icon-arrow-down");
73            $(this).parent().toggleClass("open");
74            $(".brand-range .range-item").show();
75            $(".brand-range .range-item").toggleClass("hide");
76        });
77    });
78})(jQuery);

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.