1var $j = jQuery.noConflict(); 2 3(function( $ ) { 4 'use strict'; 5 6 $(window).load(function() { 7 8 $(".page-content .countdown-row").each( function(i, row) { 9 var wrapper = $(row).find(".countdown .fc-wrapper"); 10 var countdownDate = $(row).find(".countdown .fc-wrapper").data("date").replace(' ', 'T'); 11 var countdownDay = $(wrapper).data("day"); 12 var countdownMonth = $(wrapper).data("month") - 1; 13 var countdownYear = $(wrapper).data("year"); 14 var countdownHour = $(wrapper).data("hour"); 15 var countdownMinutes = $(wrapper).data("minute"); 16 17 if (!!countdownDate) { 18 var date = new Date(); 19 date.setDate(countdownDay); 20 date.setMonth(countdownMonth); 21 date.setYear(countdownYear); 22 date.setHours(countdownHour); 23 date.setMinutes(countdownMinutes); 24 date.setSeconds(0); 25 26 var now = new Date(); 27 var dif = date.getTime() - now.getTime(); 28 if (dif >= 0) { 29 var countDown = true; 30 } 31 else { 32 // hide counter 33 } 34 35 var clock = $(row).find(".countdown .fc-wrapper .fc").FlipClock(dif/1000, { 36 clockFace: 'DailyCounter', 37 countdown: countDown 38 }); 39 } 40 }) 41 42 $(".photo_gallery.show-more").each(function() { 43 $(this).find(".gallery .image-container:nth-child(n+7)").hide(); 44 }); 45 46 $(".photo_gallery.show-more .button-container .button").click(function() { 47 $(this).closest(".photo_gallery").find(".gallery .image-container").show(); 48 $(this).hide(); 49 }); 50 51 $(document).click(function(e) { 52 if (!$(e.target).is(".modal, .modal *")) { 53 if ($('.photo_gallery .modal').is(':visible')) { 54 $('.photo_gallery .modal-mask').hide(); 55 } 56 } 57 }); 58 59 $(".photo_gallery .modal a.close").click( function(e) { 60 e.preventDefault(); 61 $(this).closest(".photo_gallery .modal-mask").hide(); 62 }); 63 64 $(".photo_gallery .image-container").click( function(e) { 65 e.stopPropagation(); 66 var index = $(this).data("image"); 67 $(this).closest(".photo_gallery").find(".modal-mask").show().css("display", "table"); 68 $(this).closest(".photo_gallery").find(".modal-image").hide(); 69 $(this).closest(".photo_gallery").find(".modal-image.slide-" + index).show(); 70 71 if (index == 1) { 72 $(this).closest(".photo_gallery").find(".modal .previous").hide(); 73 $(this).closest(".photo_gallery").find(".modal .next").show(); 74 } 75 else if (index == $(this).closest(".photo_gallery").find(".modal-image").length) { 76 $(this).closest(".photo_gallery").find(".modal .previous").show(); 77 $(this).closest(".photo_gallery").find(".modal .next").hide(); 78 } 79 else { 80 $(this).closest(".photo_gallery").find(".modal .previous").show(); 81 $(this).closest(".photo_gallery").find(".modal .next").show(); 82 } 83 }); 84 85 $(".photo_gallery .modal .previous").click( function(e) { 86 e.preventDefault(); 87 var index = $(this).closest(".modal").find(".modal-image:visible").data("slide") - 1; 88 $(this).closest(".photo_gallery").find(".modal-image").hide(); 89 $(this).closest(".photo_gallery").find(".modal-image.slide-" + index).show().css("display", "flex"); 90 if (index == 1) { 91 $(this).closest(".photo_gallery").find(".modal .previous").hide(); 92 } 93 else if (index == $(this).closest(".photo_gallery").find(".modal-image").length) { 94 $(this).closest(".photo_gallery").find(".modal .next").hide(); 95 } 96 else { 97 $(this).closest(".photo_gallery").find(".modal .next").show(); 98 } 99 }); 100 101 $("body").keyup( function(e) { 102 if ($('.photo_gallery .modal').is(':visible')) { 103 var index = $(".photo_gallery .modal:visible").find(".modal-image:visible").data("slide"); 104 if (e.keyCode == 27) { 105 $(".photo_gallery .modal-mask:visible").hide(); 106 } 107 else if (e.keyCode == 37) { 108 if (index > 1) { 109 var newIndex = index - 1; 110 } 111 } 112 else if (e.keyCode == 39) { 113 if (index < $(".photo_gallery .modal-image").length) { 114 var newIndex = index + 1; 115 } 116 } 117 if (!!newIndex) { 118 $(".photo_gallery .modal:visible .modal-image").hide(); 119 $(".modal:visible .modal-image.slide-" + newIndex).show().css("display", "flex"); 120 121 if (newIndex == 1) { 122 $(".photo_gallery .modal:visible .previous").hide(); 123 } 124 else if (newIndex == $(".photo_gallery .modal-image").length) { 125 $(".photo_gallery .modal:visible .next").hide(); 126 } 127 else { 128 $(".photo_gallery .modal:visible .previous").show(); 129 $(".photo_gallery .modal:visible .next").show(); 130 } 131 } 132 } 133 }); 134 135 $(".photo_gallery .modal .next").click( function(e) { 136 e.preventDefault();
137 var index = $(this).closest(".modal").find(".modal-image:visible").data("slide") + 1; 138 $(this).closest(".photo_gallery").find(".modal-image").hide(); 139 $(this).closest(".photo_gallery").find(".modal-image.slide-" + index).show().css("display", "flex"); 140 if (index == 1) { 141 $(this).closest(".photo_gallery").find(".modal .previous").hide(); 142 } 143 else if (index == $(this).closest(".photo_gallery").find(".modal-image").length) { 144 $(this).closest(".photo_gallery").find(".modal .next").hide(); 145 } 146 else { 147 $(this).closest(".photo_gallery").find(".modal .previous").show() 148 } 149 }); 150 151 $(".page-content .filter ul.dropdown").hide().css("visibility", "visible"); 152 153 $(".row").on("click", ".filter a.dropdown-toggle", function(e) { 154 e.stopPropagation(); 155 $(".filter .dropdown").not($(this).next(".dropdown")).hide().closest(".filter").removeClass("open"); 156 157 if ($(this).next(".dropdown").is(":visible")) { 158 $(this).next(".dropdown").hide(); 159 $(this).closest(".filter").removeClass("open"); 160 } 161 else { 162 $(this).next(".dropdown").show(); 163 $(this).closest(".filter").addClass("open"); 164 } 165 }); 166 167 $(".row").on("click", ".filter .dropdown li", function(e) { 168 e.stopPropagation(); 169 var classes = $(this).data("value"); 170 171 $(this).closest(".filter").find(".dropdown-toggle").data("value", classes); 172 173 if ($(this).closest(".careers").length > 0) { 174 var closestClass = ".careers"; 175 176 var baseCSS = ".careers-container .career-card"; 177 } 178 179 var otherFilters = $(this).closest(".filter").siblings(); 180 var otherClasses = []; 181 182 if (otherFilters.length > 0) { 183 $(otherFilters).each( function(i, filter) { 184 if (!!$(filter).find(".dropdown-toggle").data("value")) { 185 otherClasses.push($(filter).find(".dropdown-toggle").data("value")); 186 } 187 }); 188 } 189 190 // This block of code used to be only for 'Show All', but we now use it to reset 191 // everything either way before filtering. 192 var dropdownToggleName = $(this).closest(".filter").find(".dropdown-toggle .name"); 193 $(dropdownToggleName).html($(dropdownToggleName).data("name")); 194 // Reset the list of elements 195 if (closestClass == ".careers") { 196 if (otherClasses.length > 0) { 197 var showCards = baseCSS; 198 199 otherClasses.forEach( function(otherClass) { 200 otherClass = otherClass.replace(" ", "."); 201 otherClass = "." + otherClass; 202 showCards += otherClass; 203 }); 204 205 $(this).closest(closestClass).find(showCards).show() 206 } 207 else { 208 $(this).closest(closestClass).find(baseCSS).show(); 209 } 210 } 211 212 // If there ARE classes to filter, go for it! 213 if (!!classes) { 214 $(this).closest(".filter").find(".dropdown-toggle .name").html($(this).html()); 215 216 classes = classes.replace(" ", "."); 217 classes = "." + classes; 218 219 var hideElems = baseCSS + ":not(" + classes; 220 221 otherClasses.forEach( function(otherClass) { 222 otherClass = otherClass.replace(" ", "."); 223 otherClass = "." + otherClass; 224 hideElems += otherClass; 225 }); 226 227 hideElems += "):visible"; 228 229 // Hide all elements that don't match classes provided 230 $(this).closest(closestClass).find(hideElems).hide(); 231 } 232 233 $(this).closest(".dropdown").hide(); 234 $(this).closest(".filter").removeClass("open"); 235 236 if (closestClass == ".careers" && $(baseCSS + ":visible").length % 3 == 2) { 237 $(this).closest(".careers").find(".careers-container").append('<div style="width: calc(33% - 15px);"></div>'); 238 } 239 }); 240 241 $(document).click( function() { 242 $(".filter .dropdown").hide().closest(".filter").removeClass("open"); 243 }); 244 245 $(".row.careers-row").on("keyup", ".search-filters .search input", function() { 246 var search = $(this).val().toLowerCase(); 247 $(this).closest(".careers").find(".careers-container .career-card").each( function(i, career) { 248 var careerData = $(career).find(".career").data("career").toLowerCase(); 249 if (careerData.indexOf(search) == -1) { 250 $(career).hide(); 251 } 252 else { 253 $(career).show(); 254 } 255 }); 256 if ($(this).closest(".careers").find(".careers-container .career-card" + ":visible").length % 3 == 2) { 257 $(this).closest(".careers").find(".careers-container").append('<div style="width: calc(33% - 15px);"></div>'); 258 } 259 260 if ($(this).closest(".careers").find(".career-card:visible").length === 0) { 261 $(this).closest(".careers").find(".empty-state").show(); 262 } else { 263 $(this).closest(".careers").find(".empty-state").hide(); 264 } 265 }); 266 267 $(".careers-container").each( function(i, career) { 268 if ($(this).find(".career-card:visible").length % 3 == 2) { 269 $(this).closest(".careers").find(".careers-container").append('<div style="width: calc(33% - 15px);"></div>'); 270 } 271 }); 272 273 $(".careers-row").each( function() { 274 if ($(this).find(".career-card:visible").length === 0) { 275 $(this).find(".empty-state").show(); 276 } 277 }); 278 279 $(".latest_news.rows").each( function(i, latestNews) { 280 if ($(window).width() >= 1024 && $(this).find(".first-card, .news-card").length % 5 == 2) { 281 $(this).append('<div style="width: calc(33% - 15px);"></div>'); 282 } 283 }); 284 285 // Select all links with hashes 286 $('a[href*="#"]') 287 // Remove links that don't actually link to anything 288 .not('[href="#"]') 289 .not('[href="#0"]') 290 .not('[href*="#modal_"]') 291 .click(function(event) { 292 const isWooCommerceSingleProduct = $("body").hasClass("single-product"); 293 // On-page links 294 if (
295 location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && 296 location.hostname == this.hostname && 297 ! isWooCommerceSingleProduct 298 ) { 299 // Figure out element to scroll to 300 var target = $(this.hash); 301 target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); 302 // Does a scroll target exist? 303 if (target.length) { 304 // Only prevent default if animation is actually gonna happen 305 event.preventDefault(); 306 $('html, body').animate({ 307 scrollTop: target.offset().top 308 }, 1000); 309 } 310 } 311 }); 312 313 314 }); 315 316})( 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.