1jQuery(document).ready(function($){ 2 3 //WPCF7 remove 40 character attribute on form fields 4 $('.wpcf7 input').removeAttr('size'); 5 6 7 $(window).bind('scroll', function() { 8 if ($(window).scrollTop() > 48) { 9 $('body').addClass('not-top'); 10 $('body').removeClass('at-top'); 11 12 } else { 13 $('body').removeClass('not-top'); 14 $('body').addClass('at-top'); 15 } 16 }); 17 18 19 // Back to top button 20 21 var offset = 800; 22 var duration = 300; 23 var scrollTimeout; // global for any pending scrollTimeout 24 25//var outerPane = $details.find(".details-pane-outer"); 26 function scrollHandler() { 27 28 if ($(this).scrollTop() > offset) { 29 $('.back-to-top').fadeIn(duration); 30 } else { 31 $('.back-to-top').fadeOut(duration); 32 } 33 } 34 35 $(window).scroll(function () { 36 if (scrollTimeout) { 37 // clear the timeout, if one is pending 38 clearTimeout(scrollTimeout); 39 scrollTimeout = null; 40 } 41 scrollTimeout = setTimeout(scrollHandler, 1000); 42 }); 43 44 45 $('.back-to-top').click(function(event) { 46 event.preventDefault(); 47 $('html, body').animate({scrollTop: 0}, duration); 48 return false; 49 }); 50 51 52 53 $('.search-trigger').click(function(){ 54 55 if ($(this).hasClass('active')) { 56 $(this).removeClass('active'); 57 $('.detailed-search').slideUp(); 58 } else { 59 $(this).addClass('active'); 60 $('.detailed-search').slideDown(); 61 $([document.documentElement, document.body]).animate({ 62 scrollTop: $('.detailed-search').offset().top 63 }, 500); 64 65 } 66 67 }); 68 69 $('.detailed-search-trigger').click(function(){ 70 71 $('.detailed-search').slideDown(); 72 $([document.documentElement, document.body]).animate({ 73 scrollTop: $('.detailed-search').offset().top 74 }, 500); 75 76 $('.search-trigger').addClass('active'); 77 78 }); 79 80 $('#search-close').click(function(){ 81 $('.search-trigger').removeClass('active'); 82 $('.detailed-search').slideUp(); 83 }); 84 85 86 $('.tab-header li').click(function(){ 87 88 var tabId= $(this).data('id'); 89 if (tabId === 'quote') { 90 return; 91 } 92 var target = '#tab-content-' + tabId; 93 94 $('.tab-header li').removeClass('active'); 95 $('.tab-content > div').removeClass('active'); 96 97 $(target).addClass('active'); 98 $(this).addClass('active'); 99 100 }); 101 102 103 // Accordion 104 105 $('.accordion-entry').click(function(){ 106 if ($('.accordion-label', this).hasClass('active')) { 107 $('.accordion-label').removeClass('active'); 108 $('.accordion-content',this).slideUp(); 109 } else { 110 $('.accordion-label').removeClass('active'); 111 $('.accordion-label', this).addClass('active'); 112 $('.accordion-content').slideUp(); 113 $('.accordion-content',this).slideDown(); 114 } 115 }); 116 117 // Endorsements 118 119 120 $('.endorsement').click(function(){ 121 if ($('.endorsement-content', this).hasClass('active')) { 122 $('.endorsement-content').removeClass('active'); 123 $('.endorsement-header').removeClass('active'); 124 } else { 125 $('.endorsement-content').removeClass('active'); 126 $('.endorsement-header').removeClass('active'); 127 $('.endorsement-content', this).addClass('active'); 128 $('.endorsement-header', this).addClass('active'); 129 } 130 }); 131 132 133 $(document).on('click','.pop-up .close',function() { 134 $(".pop-up").removeClass("open"); 135 }); 136 137 jQuery(document).on("click",".get_popup_desc_video",function() { 138 var videoId = $(this).data('id'); 139 jQuery(".pop-up").addClass("open"); 140 jQuery('#exampleModal .modal-body').html(''); 141 jQuery.ajax({ 142 url: ajaxPopup.ajaxUrl, 143 type: 'POST', 144 data: ({action : 'popup', id : videoId }), 145 beforeSend:function() 146 { 147 jQuery(".loading_main").fadeIn("slow"); 148 }, 149 success: function(result) 150 { 151 jQuery(".loading_main").fadeOut("slow"); 152 jQuery('#exampleModal .modal-body').html(result); 153 jQuery('#exampleModal').fadeIn(); 154 } 155 156 }); 157 }); 158 159 160 $('li.menu-item-has-children > a').after('<span class=\"opener\"></span>'); 161 162 $('.opener').click(function(){ 163 if ( $(this).hasClass('active')) { 164 $(this).removeClass('active'); 165 return false;
166 } else { 167 $(this).addClass('active'); 168 return false; 169 } 170 171 }); 172 173 174 $('.wpcf7-submit[disabled]').after('<div class="wpcf7-tooltip">Check the consent field to continue</div>'); 175 176 177}); 178 179 180 181/******************************************************/ 182/* AJAX */ 183/******************************************************/ 184 185function sendAjaxRequest(target, region) { 186 187 jQuery.ajax({ 188 type: 'POST', 189 url: ajaxurl, 190 data: { 191 'region': region, 192 'action': 'get_suppliers' 193 }, 194 success: function (result) { 195 jQuery(target).append(result); 196 jQuery('.loading').hide(); 197 }, 198 error: function (error) { 199 jQuery(target).append(error); 200 jQuery('.loading').hide(); 201 } 202 203 }); 204 205} 206 207/* 208//window.addEventListener('resize', breakPointChange); 209 210function breakPointChange() { 211 var qString; 212 var mediaQueryList; 213 var breakPoints = ['400px', '500px', '600px','768px','960px']; 214 215 for (var i = 0; i < breakPoints.length; ++i) { 216 qString = "(max-width:" + breakPoints[i] + ")"; 217 mediaQueryList = window.matchMedia(qString); 218 if (mediaQueryList.matches) { 219 console.log(qString); 220 return qString; 221 } 222 } 223} 224 */ 225 226
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.