1// This file will be run in the footer on every page. 2// It should be used for content that relates 3// to your site as a whole, it should not be used for 4// plugin-specific js 5 6require(["jquery", "site_gtm", "sv_load!plugins_dynamic_content", "lodash", "sv_siteFoundation", "domReady!"], function($, gtm, dynamic, lodash) { 7 $(document).foundation(); 8 var $root = $("[data-guid='4']"); 9 var page = $('.panel_page') 10 // CRM FORM STYLING HELPER JS. This should exist in footer JS file. 11 if (location.search.indexOf('action=popupCal') > -1 && document.body.querySelectorAll('.lookup-calHolder')) { 12 $('.lookup-calHolder').parents().show().addClass('crm-calendar-parent'); 13 } 14 $(".resp-filters-hit").click(function() { 15 $('body').toggleClass('resp-filter-filters-active').removeClass('resp-filter-view-active resp-filter-sort-active resp-filter-display-active'); 16 }); 17 $(".resp-view-hit").click(function() { 18 $('body').toggleClass('resp-filter-view-active').removeClass('resp-filter-filters-active resp-filter-sort-active resp-filter-display-active'); 19 }); 20 $(".resp-sort-hit").click(function() { 21 $('body').toggleClass('resp-filter-sort-active').removeClass('resp-filter-filters-active resp-filter-view-active resp-filter-display-active'); 22 }); 23 $(".resp-display-hit").click(function() { 24 $('body').toggleClass('resp-filter-display-active').removeClass('resp-filter-sort-active resp-filter-filters-active resp-filter-view-active'); 25 }); 26 $('.resp-filter-dropdown').click(function(){ 27 $('body').removeClass('resp-filter-sort-active resp-filter-filters-active resp-filter-view-active resp-filter-display-active'); 28 }); 29 $root.find("[data-mobile-nav-hamburger]").on("click", toggle_mobile_nav); 30 31 function toggle_mobile_nav(){ 32 $root.toggleClass('active'); 33 34 if ($root.hasClass('active')) { 35 var top = $('[data-mobile-nav-hamburger]').offset().top; 36 if (page.hasClass('route66')) { 37 $('.widget-mobile-nav.active .container').css('top',top - 22); 38 } else { 39 $('.widget-mobile-nav.active .container').css('top',top + 75); 40 } 41 $('body').append('<div class="mobile-menu-overlay" data-menu-overlay></div>'); 42 43 // close the menu when the dark overlay is clicked 44 $('[data-menu-overlay]').one('click', function(e) { 45 toggle_mobile_nav(); 46 }); 47 } else { 48 $('[data-menu-overlay]').remove(); 49 } 50 } 51 52 if (page.hasClass('route66')) { 53 $('.nav-item.has-children').hover(function() { 54 page.toggleClass('dropdown'); 55 }) 56 57 window.setInterval(function() { 58 if ($('.widget-mobile-nav.hide-for-large-up').hasClass('active')) { 59 console.log("yolo") 60 $('body').css("overflow", "hidden"); 61 } else { 62 $('body').css("overflow", "unset"); 63 } 64 }, 200) 65 } 66 67 // close the menu when resizing to desktop 68 var listenResize = function() { 69 if (window.innerWidth > 1024 && $root.hasClass('active')) { 70 toggle_mobile_nav(); 71 } 72 } 73 $(window).on('resize', lodash.debounce(listenResize, 500)); 74 75 $('.contentRender_name_plugins_core_textbox a').each(function() { 76 if ($(this).attr('name')) { 77 $(this).addClass('offset-hash-for-sticky-nav'); 78 } 79 }); 80 81 gtm.sendCustomPageview({ 82 tClient_pageview: { type: "Content" }, 83 tCore_pageview : {} 84 }, 85 "shared_footerJs" 86 ); 87 //gtm update should remain last item 88 gtm.update(); 89 90}); 91 92// require lazyload 93(require(['plugins_common_custom_lazyload'], function(lazyload) { 94 var widgetsToLoad = []; 95 var els = document.querySelectorAll('[data-js]'); 96 97 for (var i = 0; i < els.length; i++) { 98 widgetsToLoad.push(els[i]); 99 } 100 101 lazyload.lazy(widgetsToLoad, function(entry, io) { 102 var target = entry.target; 103 var jsFile = target.dataset.js; 104 var guid = target.dataset.guid; 105 106 require([jsFile], function(widget) { 107 widget.init(guid); 108 io.unobserve(target); 109 }); 110 }); 111}))(); 112 113// T545991 request to disable right click on images 114(function() { 115 window.addEventListener("load", function(e) { 116 117 let images = document.querySelectorAll("body .root_panel.panel_page img"); 118 let overlayDivs = document.querySelectorAll("body .contentRender_name_plugins_core_textbox .cr__asset__overlay"); 119 let protectModal = document.getElementById("protectModal"); 120
121 overlayDivs.forEach(function(image){ 122 image.addEventListener("contextmenu", function(e){ 123 e.preventDefault(); 124 protectModal.classList.remove("hide"); 125 return false; 126 }) 127 }) 128 129 images.forEach(function(image) { 130 image.addEventListener("contextmenu", function(e) { 131 e.preventDefault(); 132 protectModal.classList.remove("hide"); 133 return false; 134 }) 135 }) 136 137 protectModal.addEventListener('click', e => { 138 protectModal.classList.toggle("hide"); 139 return false; 140 }) 141 }) 142})(); 143 144// Lazy-load FontAwesome 145(function() { 146 var css = document.createElement('link'); 147 css.href = 'https://use.fontawesome.com/releases/v5.14.0/css/all.css'; 148 css.rel = 'stylesheet'; 149 css.type = 'text/css'; 150 document.getElementsByTagName('head')[0].appendChild(css); 151})();
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.