PageSourceSearch

https://www.artemis.bm/wp-content/themes/artemisbm/js/global3.js

js artemis.bm collected 2026-09-24 08:43:20 UTC 3,697 bytes, 118 lines download raw bytes

1document.addEventListener("DOMContentLoaded", function(){
2    /////// Prevent closing from click inside dropdown
3    document.querySelectorAll('.dropdown-menu').forEach(function(element){
4      element.addEventListener('click', function (e) {
5        e.stopPropagation();
6      });
7    })
8  });
9
10jQuery(".navbar-fixed-top").autoHidingNavbar();
11
12jQuery("#search-button").click(function(){
13    jQuery('input[name=s]').focus();
14});
15
16/* links on search results page */
17
18jQuery(".deal-results-link").hide();
19jQuery(".other-results-link").hide();
20if(jQuery(".related-search-results ul").hasClass('yes')){
21jQuery(".deal-results-link").show();
22jQuery(".other-results-link").show();
23
24}
25
26if(jQuery(window).width() < 991){
27    jQuery(document).ready(function()  {
28
29      jQuery('html,body').delegate('#side-menu li.menu-item-has-children>a', 'click', function(e) {
30        e.preventDefault();
31        e.stopPropagation();
32        jQuery(this).next('ul').toggleClass('show-menu');
33
34      });
35  });
36}
37
38// if(jQuery(window).width() > 576){
39//   var maxHeight = 0;
40
41//   jQuery(".subpost-narrow").each(function(){
42//     if (jQuery(this).height() > maxHeight) { maxHeight = jQuery(this).height(); }
43//   });
44
45//   jQuery(".subpost-narrow").height(maxHeight);
46// }
47
48
49jQuery(".fa-list").click(function(){
50  jQuery(".row-cols-md-3").addClass('toggle-full-width');
51   jQuery(".row-cols-md-3 .latest").addClass('border-top');
52   jQuery(".fa-list").addClass('active');
53    jQuery(".fa-th-large").removeClass('active');
54    document.cookie = "listview=true; max-age=" + 60 * 60 * 24 * 30;
55
56  });
57
58  jQuery(".fa-th-large").click(function(){
59   jQuery(".row-cols-md-3").removeClass('toggle-full-width');
60   jQuery(".row-cols-md-3 .latest").removeClass('border-top');
61    jQuery(".fa-list").removeClass('active');
62    jQuery(".fa-th-large").addClass('active');
63    document.cookie= "listview=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
64  });
65
66
67 if (/(^|;)\s*listview=/.test(document.cookie)) {
68   jQuery(".row-cols-md-3").addClass('toggle-full-width');
69   jQuery(".row-cols-md-3 .latest").addClass('border-top');
70   jQuery(".fa-list").addClass('active');
71   jQuery(".fa-th-large").removeClass('active');
72 } else {
73   jQuery(".row-cols-md-3").removeClass('toggle-full-width');
74   jQuery(".row-cols-md-3 .latest").removeClass('border-top');
75   jQuery(".fa-list").removeClass('active');
76   jQuery(".fa-th-large").addClass('active');
77
78 }
79
80 jQuery('#thanks').hide();
81jQuery('.page-template-home-page2 #gform_submit_button_2').click(function() {
82    jQuery('#thanks').show();
83});
84
85// Close dropdown menu on scroll
86let lastScrollTop = 0;
87
88jQuery(window).scroll(function() {
89  let currentScroll = jQuery(this).scrollTop();
90
91  if (currentScroll > lastScrollTop && currentScroll > 200) {
92    // Scrolling down and passed 100px
93    jQuery('.dropdown-menu').addClass("close-dropdown");
94  } else if (currentScroll < lastScrollTop) {
95    // Scrolling up
96    jQuery('.dropdown-menu').removeClass("close-dropdown");
97  }
98
99  lastScrollTop = currentScroll;
100});
101
102
103function getCSSVariable(varName) {
104  return getComputedStyle(document.documentElement).getPropertyValue(varName).trim();
105}
106
107const colors = [
108  getCSSVariable('--highcharts-color-0'),
109  getCSSVariable('--highcharts-color-1'),
110  getCSSVariable('--highcharts-color-2'),
111  getCSSVariable('--highcharts-color-3'),
112  getCSSVariable('--highcharts-color-4'),
113  getCSSVariable('--highcharts-color-5'),
114  getCSSVariable('--highcharts-color-6'),
115  getCSSVariable('--highcharts-color-7'),
116  getCSSVariable('--highcharts-color-8'),
117  getCSSVariable('--highcharts-color-9'),
118];

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.