PageSourceSearch

https://www.eco360.ca/themes/eco360/js/app.js?v=1.x

js eco360.ca collected 2026-10-08 10:45:19 UTC 4,675 bytes, 106 lines download raw bytes

1jQuery(document).ready(function() {
2  // if (jQuery(".paragraph--type--two-boxes.field--type-text-long").matchHeight(), jQuery(".paragraph--type--two-columns-text-gray-bg > div").matchHeight(), jQuery(".paragraph--type--two-columns-text > div").matchHeight(), jQuery(".paragraph--type--tab-widget").length) {
3  //   var e = jQuery("<ul></ul>"),
4  //     a = 1;
5  //   jQuery(".paragraph--type--tab-content.field--name-field-tab-title").each(function() {
6  //     var t = jQuery(this),
7  //       r = t.next();
8  //     e.append('<li><a href="#tab-' + a + '">' + t.text() + "</a></li>"), r.attr("id", "tab-" + a), t.remove(), a++
9  //   }), jQuery(".paragraph--type--tab-widget >.col-sm-12").prepend(e);
10  //   var t = 100 / (a - 1);
11  //   jQuery(e).find("li").css("width", t + "%"), jQuery(".paragraph--type--tab-widget >.col-sm-12").responsiveTabs()
12  // }
13  var r = jQuery('<div id="mobile-menu"></div>'),
14    i = jQuery('<div id="mobile-menu-content"></div>');
15
16  jQuery("#block-eco360-main-menu")
17    .parent()
18    .append(r),
19    jQuery("body")
20      .append(i),
21    r.click(function() {
22      i.hasClass("active")?
23        (jQuery("body").css("overflow", "inherit"), i.removeClass("active"), r.removeClass("active"))
24        :
25        (jQuery("body").css("overflow", "hidden"), i.addClass("active"), r.addClass("active"))
26    }),
27    i.append(jQuery("#block-eco360-main-menu ul.menu").clone()),
28    i.append(jQuery("#block-sortingguidemenu ul.menu").clone()),
29    i.append(jQuery("#top-bar ul").clone()),
30
31    jQuery('a.modal, a[href^="/blocks/"], a[href^="/fr/blocks/"]').click(function(e) {
32      e.preventDefault();
33      var a = this.href;
34      jQuery("body").hasClass("lang-fr") && a.indexOf("/fr/") === -1 && (a = "/fr/blocks/" + a.split("/").pop()), jQuery.getJSON(a, function(e) {
35        jQuery('<div class="modal">' + e.block + "</div>").appendTo("body").modal()
36      })
37    })
38
39
40  // MOBILE SEARCH
41
42  let search = '<div class="search-container" >\n' +
43    '          <img src="" id="searchIcon" class="search-icon searchIcon mobileSearch" alt="search">\n' +
44    '          <form action="/search" method="get" id="searchFormMobile" class="search-form-top hidden searchFormMobile">\n' +
45    '            <input type="text" id="searchFieldMobile" name="search" class="search-text-field searchFieldMobile" placeholder="Enter search term..." >\n' +
46    '            <img src="" class="close-icon mobileClose"  alt="close">\n' +
47    '          </form>\n' +
48    '        </div>'
49  i.append(search)
50  let baseURL = new URL(window.location.href).origin;
51  let imageUrl = `${baseURL}/themes/eco360/images/search.svg`;
52  jQuery('.mobileSearch').attr('src', imageUrl);
53  imageUrl = `${baseURL}/themes/eco360/images/close.svg`;
54  jQuery('.mobileClose').attr('src', imageUrl);
55
56  // TOGGLE SEARCH FORM
57  jQuery('.searchIcon').click(function(){
58    jQuery('.search-form-top').toggleClass('hidden');
59    jQuery('.search-icon').toggleClass('hidden');
60  });
61
62  jQuery('.close-icon').click(function(){
63    jQuery('.search-form-top').toggleClass('hidden');
64    jQuery('.search-icon').toggleClass('hidden');
65  });
66
67  let language = jQuery('body').hasClass('lang-fr') ? 'fr' : 'en';
68
69
70  jQuery('.searchForm').on('submit', function(event){
71    event.preventDefault();
72    // REDIRECT TO SEARCH PAGE WITH TEXT VALUE
73    var searchValue = jQuery('.searchField').val();
74    var searchUrl = (language == "fr" ? '/fr' : '') + '/search/node?keys=' + encodeURIComponent(searchValue);
75    window.location.href = searchUrl;
76  });
77
78  jQuery('.searchFormMobile').on('submit', function(event){
79    event.preventDefault();
80    // REDIRECT TO SEARCH PAGE WITH TEXT VALUE
81    var searchValue = jQuery('.searchFieldMobile').val();
82    var searchUrl = (language == "fr" ? '/fr' : '') + '/search/node?keys=' + encodeURIComponent(searchValue);
83    window.location.href = searchUrl;
84  });
85
86
87  // jQuery('.single-tab-title').first().addClass('active');
88  let firstTabTitle = jQuery('.single-tab-title').first();
89  let dataTabValue = firstTabTitle.data('tab');
90  firstTabTitle.addClass('active');
91  jQuery('.single-tab[data-single-tab="' + dataTabValue + '"]').addClass('active');
92
93  jQuery('.single-tab-title').on('click', function() {
94    let dataTabValue = jQuery(this).data('tab');
95
96    // Remove 'active' class from all .single-tab-title and .single-tab elements
97    jQuery('.single-tab-title, .single-tab').removeClass('active');
98
99    // Add 'active' class to the clicked .single-tab-title
100    jQuery(this).addClass('active');
101
102    // Find the corresponding .single-tab and add the 'active' class
103    jQuery('.single-tab[data-single-tab="' + dataTabValue + '"]').addClass('active');
104  });
105
106});

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.