1/* 2 FastClick: polyfill to remove click delays on browsers with touch UIs. 3 4 @version 1.0.3 5 @codingstandard ftlabs-jsv2 6 @copyright The Financial Times Limited [All Rights Reserved] 7 @license MIT License (see LICENSE.txt) 8*/ 9(function ($) { "use strict"; function e(t, r) { function s(e, t) { return function () { return e.apply(t, arguments) } } var i; r = r || {}; this.trackingClick = false; this.trackingClickStart = 0; this.targetElement = null; this.touchStartX = 0; this.touchStartY = 0; this.lastTouchIdentifier = 0; this.touchBoundary = r.touchBoundary || 10; this.layer = t; this.tapDelay = r.tapDelay || 200; this.tapTimeout = r.tapTimeout || 700; if (e.notNeeded(t)) { return } var o = ["onMouse", "onClick", "onTouchStart", "onTouchMove", "onTouchEnd", "onTouchCancel"]; var u = this; for (var a = 0, f = o.length; a < f; a++) { u[o[a]] = s(u[o[a]], u) } if (n) { t.addEventListener("mouseover", this.onMouse, true); t.addEventListener("mousedown", this.onMouse, true); t.addEventListener("mouseup", this.onMouse, true) } t.addEventListener("click", this.onClick, true); t.addEventListener("touchstart", this.onTouchStart, false); t.addEventListener("touchmove", this.onTouchMove, false); t.addEventListener("touchend", this.onTouchEnd, false); t.addEventListener("touchcancel", this.onTouchCancel, false); if (!Event.prototype.stopImmediatePropagation) { t.removeEventListener = function (e, n, r) { var i = Node.prototype.removeEventListener; if (e === "click") { i.call(t, e, n.hijacked || n, r) } else { i.call(t, e, n, r) } }; t.addEventListener = function (e, n, r) { var i = Node.prototype.addEventListener; if (e === "click") { i.call(t, e, n.hijacked || (n.hijacked = function (e) { if (!e.propagationStopped) { n(e) } }), r) } else { i.call(t, e, n, r) } } } if (typeof t.onclick === "function") { i = t.onclick; t.addEventListener("click", function (e) { i(e) }, false); t.onclick = null } } var t = navigator.userAgent.indexOf("Windows Phone") >= 0; var n = navigator.userAgent.indexOf("Android") > 0 && !t; var r = /iP(ad|hone|od)/.test(navigator.userAgent) && !t; var i = r && /OS 4_\d(_\d)?/.test(navigator.userAgent); var s = r && /OS ([6-9]|\d{2})_\d/.test(navigator.userAgent); var o = navigator.userAgent.indexOf("BB10") > 0; e.prototype.needsClick = function (e) { switch (e.nodeName.toLowerCase()) { case "button": case "select": case "textarea": if (e.disabled) { return true } break; case "input": if (r && e.type === "file" || e.disabled) { return true } break; case "label": case "iframe": case "video": return true }return /\bneedsclick\b/.test(e.className) }; e.prototype.needsFocus = function (e) { switch (e.nodeName.toLowerCase()) { case "textarea": return true; case "select": return !n; case "input": switch (e.type) { case "button": case "checkbox": case "file": case "image": case "radio": case "submit": return false }return !e.disabled && !e.readOnly; default: return /\bneedsfocus\b/.test(e.className) } }; e.prototype.sendClick = function (e, t) { var n, r; if (document.activeElement && document.activeElement !== e) { document.activeElement.blur() } r = t.changedTouches[0]; n = document.createEvent("MouseEvents"); n.initMouseEvent(this.determineEventType(e), true, true, window, 1, r.screenX, r.screenY, r.clientX, r.clientY, false, false, false, false, 0, null); n.forwardedTouchEvent = true; e.dispatchEvent(n) }; e.prototype.determineEventType = function (e) { if (n && e.tagName.toLowerCase() === "select") { return "mousedown" } return "click" }; e.prototype.focus = function (e) { var t; if (r && e.setSelectionRange && e.type.indexOf("date") !== 0 && e.type !== "time" && e.type !== "month") { t = e.value.length; e.setSelectionRange(t, t) } else { e.focus() } }; e.prototype.updateScrollParent = function (e) { var t, n; t = e.fastClickScrollParent; if (!t || !t.contains(e)) { n = e; do { if (n.scrollHeight > n.offsetHeight) { t = n; e.fastClickScrollParent = n; break } n = n.parentElement } while (n) } if (t) { t.fastClickLastScrollTop = t.scrollTop } }; e.prototype.getTargetElementFromEventTarget = function (e) { if (e.nodeType === Node.TEXT_NODE) { return e.parentNode } return e }; e.prototype.onTouchStart = function (e) { var t, n, s; if (e.targetTouches.length > 1) { return true } t = this.getTargetElementFromEventTarget(e.target); n = e.targetTouches[0]; if (r) { s = window.getSelection(); if (s.rangeCount && !s.isCollapsed) { return true } if (!i) { if (n.identifier && n.identifier === this.lastTouchIdentifier) { e.preventDefault(); return false } this.lastTouchIdentifier = n.identifier; this.updateScrollParent(t) } } this.trackingClick = true; this.trackingClickStart = e.timeStamp; this.targetElement = t; this.touchStartX = n.pageX; this.touchStartY = n.pageY; if (e.timeStamp - this.lastClickTime < this.tapDelay) { e.preventDefault() } return true }; e.prototype.touchHasMoved = function (e) { var t = e.changedTouches[0], n = this.touchBoundary; if (Math.abs(t.pageX - this.touchStartX) > n || Math.abs(t.pageY - this.touchStartY) > n) { return true } return false }; e.prototype.onTouchMove = function (e) { if (!this.trackingClick) { return true } if (this.targetElement !== this.getTargetElementFromEventTarget(e.target) || this.touchHasMoved(e)) { this.trackingClick = false; this.targetElement = null } return true }; e.prototype.findControl = function (e) { if (e.control !== undefined) { return e.control } if (e.htmlFor) { return document.getElementById(e.htmlFor) }
9 return e.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea") }; e.prototype.onTouchEnd = function (e) { var t, o, u, a, f, l = this.targetElement; if (!this.trackingClick) { return true } if (e.timeStamp - this.lastClickTime < this.tapDelay) { this.cancelNextClick = true; return true } if (e.timeStamp - this.trackingClickStart > this.tapTimeout) { return true } this.cancelNextClick = false; this.lastClickTime = e.timeStamp; o = this.trackingClickStart; this.trackingClick = false; this.trackingClickStart = 0; if (s) { f = e.changedTouches[0]; l = document.elementFromPoint(f.pageX - window.pageXOffset, f.pageY - window.pageYOffset) || l; l.fastClickScrollParent = this.targetElement.fastClickScrollParent } u = l.tagName.toLowerCase(); if (u === "label") { t = this.findControl(l); if (t) { this.focus(l); if (n) { return false } l = t } } else if (this.needsFocus(l)) { if (e.timeStamp - o > 100 || r && window.top !== window && u === "input") { this.targetElement = null; return false } this.focus(l); this.sendClick(l, e); if (!r || u !== "select") { this.targetElement = null; e.preventDefault() } return false } if (r && !i) { a = l.fastClickScrollParent; if (a && a.fastClickLastScrollTop !== a.scrollTop) { return true } } if (!this.needsClick(l)) { e.preventDefault(); this.sendClick(l, e) } return false }; e.prototype.onTouchCancel = function () { this.trackingClick = false; this.targetElement = null }; e.prototype.onMouse = function (e) { if (!this.targetElement) { return true } if (e.forwardedTouchEvent) { return true } if (!e.cancelable) { return true } if (!this.needsClick(this.targetElement) || this.cancelNextClick) { if (e.stopImmediatePropagation) { e.stopImmediatePropagation() } else { e.propagationStopped = true } e.stopPropagation(); e.preventDefault(); return false } return true }; e.prototype.onClick = function (e) { var t; if (this.trackingClick) { this.targetElement = null; this.trackingClick = false; return true } if (e.target.type === "submit" && e.detail === 0) { return true } t = this.onMouse(e); if (!t) { this.targetElement = null } return t }; e.prototype.destroy = function () { var e = this.layer; if (n) { e.removeEventListener("mouseover", this.onMouse, true); e.removeEventListener("mousedown", this.onMouse, true); e.removeEventListener("mouseup", this.onMouse, true) } e.removeEventListener("click", this.onClick, true); e.removeEventListener("touchstart", this.onTouchStart, false); e.removeEventListener("touchmove", this.onTouchMove, false); e.removeEventListener("touchend", this.onTouchEnd, false); e.removeEventListener("touchcancel", this.onTouchCancel, false) }; e.notNeeded = function (e) { var t; var r; var i; if (typeof window.ontouchstart === "undefined") { return true } r = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [, 0])[1]; if (r) { if (n) { t = document.querySelector("meta[name=viewport]"); if (t) { if (t.content.indexOf("user-scalable=no") !== -1) { return true } if (r > 31 && document.documentElement.scrollWidth <= window.outerWidth) { return true } } } else { return true } } if (o) { i = navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/); if (i[1] >= 10 && i[2] >= 3) { t = document.querySelector("meta[name=viewport]"); if (t) { if (t.content.indexOf("user-scalable=no") !== -1) { return true } if (document.documentElement.scrollWidth <= window.outerWidth) { return true } } } } if (e.style.msTouchAction === "none") { return true } if (e.style.touchAction === "none") { return true } return false }; e.attach = function (t, n) { return new e(t, n) }; if (typeof define == "function" && typeof define.amd == "object" && define.amd) { define(function () { return e }) } else if (typeof module !== "undefined" && module.exports) { module.exports = e.attach; module.exports.FastClick = e } else { window.FastClick = e } })(jQuery); 10 11jQuery(function () { 12 FastClick.attach(document.body); 13}); 14/*! 15 hey, [be]Lazy.js - v1.8.2 - 2016.10.25 16 A fast, small and dependency free lazy load script (https://github.com/dinbror/blazy) 17 (c) Bjoern Klinggaard - @bklinggaard - http://dinbror.dk/blazy 18*/ 19(function (q, m) { "function" === typeof define && define.amd ? define(m) : "object" === typeof exports ? module.exports = m() : q.Blazy = m
vendor: 11,538 bytes, lines 19-234
19() })(this, function () { function q(b) { var c = b._util; c.elements = E(b.options); c.count = c.elements.length; c.destroyed && (c.destroyed = !1, b.options.container && l(b.options.container, function (a) { n(a, "scroll", c.validateT) }), n(window, "resize", c.saveViewportOffsetT), n(window, "resize", c.validateT), n(window, "scroll", c.validateT)); m(b) } function m(b) { for (var c = b._util, a = 0; a < c.count; a++) { var d = c.elements[a], e; a: { var g = d; e = b.options; var p = g.getBoundingClientRect(); if (e.container && y && (g = g.closest(e.containerClass))) { g = g.getBoundingClientRect(); e = r(g, f) ? r(p, { top: g.top - e.offset, right: g.right + e.offset, bottom: g.bottom + e.offset, left: g.left - e.offset }) : !1; break a } e = r(p, f) } if (e || t(d, b.options.successClass)) b.load(d), c.elements.splice(a, 1), c.count--, a-- } 0 === c.count && b.destroy() } function r(b, c) { return b.right >= c.left && b.bottom >= c.top && b.left <= c.right && b.top <= c.bottom } function z(b, c, a) { if (!t(b, a.successClass) && (c || a.loadInvisible || 0 < b.offsetWidth && 0 < b.offsetHeight)) if (c = b.getAttribute(u) || b.getAttribute(a.src)) { c = c.split(a.separator); var d = c[A && 1 < c.length ? 1 : 0], e = b.getAttribute(a.srcset), g = "img" === b.nodeName.toLowerCase(), p = (c = b.parentNode) && "picture" === c.nodeName.toLowerCase(); if (g || void 0 === b.src) { var h = new Image, w = function () { a.error && a.error(b, "invalid"); v(b, a.errorClass); k(h, "error", w); k(h, "load", f) }, f = function () { g ? p || B(b, d, e) : b.style.backgroundImage = 'url("' + d + '")'; x(b, a); k(h, "load", f); k(h, "error", w) }; p && (h = b, l(c.getElementsByTagName("source"), function (b) { var c = a.srcset, e = b.getAttribute(c); e && (b.setAttribute("srcset", e), b.removeAttribute(c)) })); n(h, "error", w); n(h, "load", f); B(h, d, e) } else b.src = d, x(b, a) } else "video" === b.nodeName.toLowerCase() ? (l(b.getElementsByTagName("source"), function (b) { var c = a.src, e = b.getAttribute(c); e && (b.setAttribute("src", e), b.removeAttribute(c)) }), b.load(), x(b, a)) : (a.error && a.error(b, "missing"), v(b, a.errorClass)) } function x(b, c) { v(b, c.successClass); c.success && c.success(b); b.removeAttribute(c.src); b.removeAttribute(c.srcset); l(c.breakpoints, function (a) { b.removeAttribute(a.src) }) } function B(b, c, a) { a && b.setAttribute("srcset", a); b.src = c } function t(b, c) { return -1 !== (" " + b.className + " ").indexOf(" " + c + " ") } function v(b, c) { t(b, c) || (b.className += " " + c) } function E(b) { var c = []; b = b.root.querySelectorAll(b.selector); for (var a = b.length; a--; c.unshift(b[a])); return c } function C(b) { f.bottom = (window.innerHeight || document.documentElement.clientHeight) + b; f.right = (window.innerWidth || document.documentElement.clientWidth) + b } function n(b, c, a) { b.attachEvent ? b.attachEvent && b.attachEvent("on" + c, a) : b.addEventListener(c, a, { capture: !1, passive: !0 }) } function k(b, c, a) { b.detachEvent ? b.detachEvent && b.detachEvent("on" + c, a) : b.removeEventListener(c, a, { capture: !1, passive: !0 }) } function l(b, c) { if (b && c) for (var a = b.length, d = 0; d < a && !1 !== c(b[d], d); d++); } function D(b, c, a) { var d = 0; return function () { var e = +new Date; e - d < c || (d = e, b.apply(a, arguments)) } } var u, f, A, y; return function (b) { if (!document.querySelectorAll) { var c = document.createStyleSheet(); document.querySelectorAll = function (a, b, d, h, f) { f = document.all; b = []; a = a.replace(/\[for\b/gi, "[htmlFor").split(","); for (d = a.length; d--;) { c.addRule(a[d], "k:v"); for (h = f.length; h--;)f[h].currentStyle.k && b.push(f[h]); c.removeRule(0) } return b } } var a = this, d = a._util = {}; d.elements = []; d.destroyed = !0; a.options = b || {}; a.options.error = a.options.error || !1; a.options.offset = a.options.offset || 100; a.options.root = a.options.root || document; a.options.success = a.options.success || !1; a.options.selector = a.options.selector || ".b-lazy"; a.options.separator = a.options.separator || "|"; a.options.containerClass = a.options.container; a.options.container = a.options.containerClass ? document.querySelectorAll(a.options.containerClass) : !1; a.options.errorClass = a.options.errorClass || "b-error"; a.options.breakpoints = a.options.breakpoints || !1; a.options.loadInvisible = a.options.loadInvisible || !1; a.options.successClass = a.options.successClass || "b-loaded"; a.options.validateDelay = a.options.validateDelay || 25; a.options.saveViewportOffsetDelay = a.options.saveViewportOffsetDelay || 50; a.options.srcset = a.options.srcset || "data-srcset"; a.options.src = u = a.options.src || "data-src"; y = Element.prototype.closest; A = 1 < window.devicePixelRatio; f = {}; f.top = 0 - a.options.offset; f.left = 0 - a.options.offset; a.revalidate = function () { q(a) }; a.load = function (a, b) { var c = this.options; void 0 === a.length ? z(a, b, c) : l(a, function (a) { z(a, b, c) }) }; a.destroy = function () { var a = this._util; this.options.container && l(this.options.container, function (b) { k(b, "scroll", a.validateT) }); k(window, "scroll", a.validateT); k(window, "resize", a.validateT); k(window, "resize", a.saveViewportOffsetT); a.count = 0; a.elements.length = 0; a.destroyed = !0 }; d.validateT = D(function () { m(a) }, a.options.validateDelay, a); d.saveViewportOffsetT = D(function () { C(a.options.offset) }, a.options.saveViewportOffsetDelay, a); C(a.options.offset); l(a.options.breakpoints, function (a) { if (a.width >= window.screen.width) return u = a.src, !1 }); setTimeout(function () { q(a) }) } }); 20 21 22 23 24window.addEventListener('load', function () { $('body').addClass('is-loaded'); 25 26var bLazy = new Blazy({ 27 success: function () { 28 updateCounter(); 29 } 30}); 31var bLazier = new Blazy({ 32 container: '#productGallery', // Default is window 33 selector: 'b-lazy-carousel' 34}); 35// not needed, only here to illustrate amount of loaded images 36var imageLoaded = 0; 37var imageLoaded2 = 0; 38//var eleCountLoadedImages = document.getElementById('loaded-images'); 39 40function updateCounter() { 41 imageLoaded++; 42 //eleCountLoadedImages.innerHTML = imageLoaded; 43} 44function updateCounter2() { 45 imageLoaded2++; 46 //eleCountLoadedImages.innerHTML = imageLoaded; 47} 48 49 50 51}); 52 53jQuery(document).ready(function ($) { 54 $('body').addClass('is-ready'); 55// new mlPushMenu(document.getElementById('mp-menu'), document.getElementById('trigger')); 56 /* Open */ 57 $(document).on('click', '.search_toggle', function() { 58 document.querySelector('.top_bar .autocomplete__field').focus(); 59 }); 60 61 62 63 64 $('a.venobox').venobox(); 65 66 // jQuery(window).on("resize", function () { 67 // if ($('#homepage_video').length) { 68 // WidthChange('#homepage_video'); 69 // } 70 // }); 71 // jQuery(document).ready(function ($) { 72 // if ($('#homepage_video').length) { 73 // WidthChange('#homepage_video'); 74 // } 75 // }); 76 77 // function WidthChange(el) { 78 // var small = '', medium = '', large = ''; 79 // if (vids.length) { 80 // small = vids[0].small; 81 // medium = vids[0].medium; 82 // large = vids[0].large; 83 // } 84 85 // //this.dataset.shipId 86 // if (jQuery(window).width() <= 640) { 87 // jQuery(el).html('<source src="' + small + '" type="video/mp4"></source>'); 88 // } else if (jQuery(window).width() <= 960) { 89 // jQuery(el).html('<source src="' + medium + '" type="video/mp4"></source>'); 90 // } else { 91 // jQuery(el).html('<source src="' + large + '" type="video/mp4"></source>'); 92 93 // } 94 95 // jQuery(el)[0].load(); 96 // var promise = jQuery(el)[0].play(); 97 // } 98 99 // Toggle mobile nav 100 $('i[class="icon-nav"]').on('click touchstart', function (event) { 101 event.preventDefault(); 102 $('body').toggleClass('nav-open'); 103 $('.search.top_bar').slideUp(); 104 105 }); 106 // Toggle mobile nav (close button) 107 $('.mobile-nav i[class="icon-close"]').on('click touchstart', function (event) { 108 event.preventDefault(); 109 $('body').toggleClass('nav-open'); 110 $('.search.top_bar').slideUp(); 111 112 }); 113 114 // start jed 115 // $('#header a.Places').on('click ', function (event) { 116 // event.preventDefault(); 117 // $('.overlay').removeClass('open'); 118 // $('.overlay.Places').addClass('open'); 119 // $('body').addClass('panel-open'); 120 // $('.search.top_bar').slideUp(); 121 // }); 122 // $('#header a.Experiences').on('click ', function (event) { 123 // event.preventDefault(); 124 // $('.overlay').removeClass('open'); 125 // $('.overlay.Experiences').addClass('open'); 126 // $('body').addClass('panel-open'); 127 // $('.search.top_bar').slideUp(); 128 // }); 129 // $('#header a.Stories').on('click ', function (event) { 130 // event.preventDefault(); 131 // $('.overlay').removeClass('open'); 132 // $('.overlay.Stories').addClass('open'); 133 // $('body').addClass('panel-open'); 134 // $('.search.top_bar').slideUp(); 135 // }); 136 // $('#header a.Stay').on('click ', function (event) { 137 // event.preventDefault(); 138 // $('.overlay').removeClass('open'); 139 // $('.overlay.Stay').addClass('open'); 140 // $('body').addClass('panel-open'); 141 // $('.search.top_bar').slideUp(); 142 // }); 143 // $('#header a.Dine').on('click ', function (event) { 144 // event.preventDefault(); 145 // $('.overlay').removeClass('open'); 146 // $('.overlay.Eat').addClass('open'); 147 // $('body').addClass('panel-open'); 148 // $('.search.top_bar').slideUp(); 149 150 // }); 151 // end jed 152 /* 153 $('#header a.Cruise').on('click ', function(event){ 154 event.preventDefault(); 155 $('.overlay').removeClass('open'); 156 $('.overlay.Cruise').addClass('open'); 157 $('body').addClass('panel-open'); 158 $('.search.top_bar').slideUp(); 159 });*/ 160 $('#header a.Locals').on('click ', function (event) { 161 event.preventDefault(); 162 $('.overlay').removeClass('open'); 163 $('.overlay.Cruise').addClass('open'); 164 $('body').addClass('panel-open'); 165 $('.search.top_bar').slideUp(); 166 }); 167/* 168 $('#header a.Events').on('click ', function (event) { 169 event.preventDefault(); 170 $('.overlay').removeClass('open'); 171 $('.overlay.Events').addClass('open'); 172 $('body').addClass('panel-open'); 173 $('.search.top_bar').slideUp(); 174 }); 175 */ 176 $('#header a.search_toggle').on('click ', function (event) { 177 event.preventDefault(); 178 $('html, body').animate({ scrollTop: 0 }, duration); 179 $('.search.top_bar').slideToggle(); 180 181 }); 182 183 184 $('a.closebtn').on('click ', function (event) { 185 event.preventDefault(); 186 $('.overlay').removeClass('open'); 187 $('body').removeClass('panel-open'); 188 }); 189 190 /// ajax handler 191 /* Pagination 192 if ($('.pagination').length) { 193 $('body').on('click','.pagination a', function (e) { 194 console.log("click"); 195 e.preventDefault(); 196 $('.pagination li').removeClass("active"); 197 $(this).parent().addClass("active"); 198 var url = $(this).attr('href'); 199 console.log("click"); 200 $.ajax(url) 201 .done(function (response) { 202 console.log(response); 203 $('.main').html(response); 204 205 }) 206 .fail (function (xhr) { 207 alert('Error: ' + xhr.responseText); 208 }); 209 }); 210 } 211 */ 212 /// ajax handler 213 // Pagination 214 if ($('.pagination.ajax').length) { 215 $('body').on('click', '.pagination.ajax a', function (e) { 216 e.preventDefault(); 217 $('.pagination.ajax li').removeClass("active"); 218 $(this).parent().addClass("active"); 219 var url = $(this).attr('href'); 220 $.ajax(url) 221 .done(function (response) { 222 $('.main').html(response); 223 AOS.refresh(); 224 225 }) 226 .fail(function (xhr) { 227 alert('Error: ' + xhr.responseText); 228 }); 229 var target = $("#Results"); 230 if (target.length) { 231 $('html,body').animate({ 232 scrollTop: target.offset().top 233 }, 1000); 234 return false;
235 } 236 }); 237 } 238 239 240 $('#Form_ProductSearchForm').submit(function (e) { 241 // get the form data 242 // there are many ways to get this data using jQuery (you can use the class or id also) 243 var formData = { 244 'Keywords': $('input[name=Keywords]').val(), 245 'Type': $('select[name=Type]').val(), 246 'Region': $('select[name=Region]').val(), 247 'Category': $('select[name=Category]').val() 248 }; 249 $('.pagination li').removeClass("active"); 250 $('.pagination li:first-child').addClass("active"); 251 252 e.preventDefault(); 253 var url = $(this).attr('action'); 254 $.ajax({ url: $(this).attr('action'), type: 'GET', data: formData, encode: true }) 255 256 .done(function (response) { 257 //console.log(response); 258 $('.main').html(response); 259 AOS.refresh(); 260 }) 261 .fail(function (xhr) { 262 $('.main').html(xhr.responseText); 263 //alert('Error: ' + xhr.responseText); 264 AOS.refresh(); 265 }); 266 var target = $("#Results"); 267 if (target.length) { 268 $('html,body').animate({ 269 scrollTop: target.offset().top 270 }, 1000); 271 return false; 272 } 273 }); 274 275 //console.log('ajax Form_ProductsSearchFormElement'); 276 277 // $('#Form_ProductsSearchFormElement').submit(function(e) { 278 // console.log('ajax search'); 279 280 // // get the form data 281 // // there are many ways to get this data using jQuery (you can use the class or id also) 282 // var formData = { 283 // 'Keywords' : $('input[name=Keywords]').val(), 284 // 'Type' : $('select[name=Type]').val(), 285 // 'Region' : $('select[name=Region]').val(), 286 // 'Category' : $('select[name=Category]').val() 287 // }; 288 // $('.pagination li').removeClass("active"); 289 // $('.pagination li:first-child').addClass("active"); 290 291 // e.preventDefault(); 292 // console.log(formData); 293 294 // var url = $(this).attr('action'); 295 // var formUrl = url; 296 // //console.log('http://localhost:8888/tairawhiti/'); 297 // $.ajax({url: formUrl, type : 'GET',data : formData, encode : true}) 298 299 // .done(function (response) { 300 // //console.log(response); 301 // $('.main').html(response); 302 // AOS.refresh(); 303 // }) 304 // .fail (function (xhr) { 305 // $('.main').html(xhr.responseText); 306 // AOS.refresh(); 307 // //alert('Error: ' + xhr.responseText); 308 // }); 309 310 // var target = $("#Results"); 311 // if (target.length) { 312 // $('html,body').animate({ 313 // scrollTop: target.offset().top 314 // }, 1000); 315 // return false; 316 // } 317 // }); 318 $('#____Form_ProductSearchForm').submit(function (e) { 319 // get the form data 320 // there are many ways to get this data using jQuery (you can use the class or id also) 321 var formData = { 322 'Keywords': $('input[name=Keywords]').val(), 323 'Category': $('select[name=Category]').val(), 324 'Region': $('select[name=Region]').val() 325 }; 326 $('.pagination li').removeClass("active"); 327 $('.pagination li:first-child').addClass("active"); 328 e.preventDefault(); 329 var url = $(this).attr('action'); 330 $.ajax({ 331 url: $(this).attr('action'), type: 'GET', data: formData, // what type of data do we expect back from the server 332 encode: true 333 }) 334 .done(function (response) { 335 $('.main').html(response); 336 }) 337 .fail(function (xhr) { 338 //$('.main').html(xhr.responseText); 339 alert('Error: ' + xhr.responseText); 340 }); 341 342 343 }); 344 $('#SearchForm_SearchForm_action_results').click(function (e) { 345 //e.preventDefault(); 346 $(this).val('submitting...');//Replace with whatever you want 347 $('#SearchForm_SearchForm .loader').removeClass('hidden'); 348 }); 349 350 $('#productGallery').lightSlider({ 351 gallery: true, 352 adaptiveHeight: true, 353 item: 1, 354 loop: true, 355 thumbItem: 6, 356 slideMargin: 0, 357 currentPagerPosition: 'left', 358 onSliderLoad: function (el) { 359 el.removeClass('cS-hidden'); 360 // el.removeStyle('height'); 361 el.lightGallery({ 362 selector: '#productGallery .lslide', 363 download: false, 364 actualSize: false, 365 }); 366 } 367 }); 368 369 370 if (location.hash == '') { 371 // $("html, body").animate({ scrollTop: 0 }, 600); 372 } else { 373 var targetOffset = Math.floor($(location.hash).offset().top); 374 //scroll 375 $('html,body').animate({ scrollTop: targetOffset }, 1000, function () { 376 jQuery(window).scroll(); 377 }); 378 } 379 380 381 $('html,body').on("scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove", function () { $('html,body').stop(); }); 382 //Back to top 383 var offset = $(window).height() * 1.5;; 384 var duration = 500; 385 var toggleShow = false;
386 $(window).scroll(function () { 387 if ($(this).scrollTop() > offset) { 388 if (!toggleShow) { 389 toggleShow = true; 390 $('.back-to-top').stop().fadeIn(duration); 391 AOS.refresh(); 392 } 393 394 } else { 395 if (toggleShow) { 396 toggleShow = false; 397 $('.back-to-top').stop().fadeOut('150'); 398 } 399 } 400 }); 401 402 $('.back-to-top').click(function (event) { 403 event.preventDefault(); 404 $('html, body').animate({ scrollTop: 0 }, duration); 405 return false; 406 }); 407 408 $('a.readmore').on('click', function (event) { 409 var moretext = "+ Read more"; 410 var lesstext = "- Show less"; 411 event.preventDefault(); 412 //console.log($(this).find('.readmore-toggle')) 413 414 if ($(this).hasClass("more")) { 415 $(this).removeClass("more") 416 $($(this).data("target")).removeClass('hidden'); 417 $(this).html(lesstext); 418 } else { 419 $(this).addClass("more") 420 $($(this).data("target")).addClass('hidden'); 421 $(this).html(moretext); 422 } 423 424 425 //event.hide(); 426 }); 427 428 429 $('h1').each(function (i, elem) { 430 //console.log(i); 431 432 $(this).attr('data-aos', "fade-up"); 433 $(this).attr('data-aos-anchor-placement', "top-bottom"); 434 435 }); 436 var n = 2;//layer.clearfix.grid.grid-nogutter 437 $('.layer').each(function () { 438 n = 50; 439 //console.log('loop'); 440 $(this).find('article').each( 441 function () { 442 //console.log(n); 443 n += 50; 444 //console.log(i);data-aos-delay= "<?php echo $i; ?>00" 445 $(this).attr('data-aos', "fade-up"); 446 $(this).attr('data-aos-anchor-placement', "top-bottom"); 447 $(this).attr('data-aos-delay', n); 448 }); 449 }); 450 $('.top_destinations article, .features article').each(function (i, elem) { 451 $(this).attr('data-aos', "zoom-in"); 452 }); 453 $('h2, h3, p, blockquote').each(function (i, elem) { 454 // console.log(i); 455 $(this).attr('data-aos', "fade-up"); 456 $(this).attr('data-aos-anchor-placement', "top-bottom"); 457 $(this).attr('data-aos-delay', "300"); 458 459 460 }); 461 $('h4').each(function (i, elem) { 462 $(this).attr('data-aos', "fade-up"); 463 $(this).attr('data-aos-anchor-placement', "top-bottom"); 464 $(this).attr('data-aos-delay', "300"); 465 466 }); 467 $('.blog-card').each(function (i, elem) { 468 //console.log(i + ' ' + elem); 469 $(this).attr('data-aos-delay', i + "00"); 470 $(this).attr('data-aos', "fade-up"); 471 }); 472 $('.blog-panel').each(function (i, elem) { 473 //console.log(i + ' ' + elem); 474 $(this).attr('data-aos-delay', i + "00"); 475 $(this).attr('data-aos', "fade-up"); 476 }); 477 478 $('#responsive li').each(function (i, elem) { 479 //console.log(i + ' ' + elem); 480 $(this).attr('data-aos-delay', i + "00"); 481 $(this).attr('data-aos', "fade-up"); 482 }); 483 $('footer .col').each(function (i, elem) { 484 //console.log(i + ' ' + elem); 485 $(this).attr('data-aos-delay', i + "00"); 486 $(this).attr('data-aos', "fade-up"); 487 }); 488 489 $('.imgwrap img').each(function (i, elem) { 490 //console.log(i + ' ' + elem); 491 //$(this).attr('data-aos-delay', i + "00"); 492 $(this).attr('data-aos', "zoom-in"); 493 }); 494 495 $('.work_carousel .logo img').each(function (i, elem) { 496 //console.log(i + ' ' + elem); 497 $(this).attr('data-aos-delay', i + "00"); 498 $(this).attr('data-aos', "zoom-in"); 499 }); 500 $('.affiliates li').each(function (i, elem) { 501 //console.log(i + ' ' + elem); 502 $(this).attr('data-aos-delay', i + "00"); 503 $(this).attr('data-aos', "fade-up"); 504 }); 505 $('.sbi_item').each(function (i, elem) { 506 //console.log(i + ' ' + elem); 507 $(this).attr('data-aos-delay', i + "90"); 508 $(this).attr('data-aos', "fade-up"); 509 }); 510 511 512 $('.subpages article img').each(function (i, elem) { 513 //console.log(i + ' ' + elem); 514 $(this).attr('data-aos-delay', i + "00"); 515 $(this).attr('data-aos', "zoom-in"); 516 }); 517 518 $('.top_nav .level0.animation_name, .top_nav .social-links a').each(function (i, elem) { 519 // console.log(i + ' ' + elem); 520 //$(this).css('opacity', 1); 521 $(this).attr('data-aos-delay', i + "00"); 522 $(this).attr('data-aos', "fade-in"); 523 //$(this).attr('data-aos', "fade-in"); 524 525 //$(this).attr('data-aos-anchor-placement', "top-bottom"); 526 527 }); 528 $('footer .animation_name').each(function (i, elem) { 529 //$(this).css('opacity', 1); 530 $(this).attr('data-aos-delay', i + "00"); 531 $(this).attr('data-aos', "fade-in"); 532 //$(this).attr('data-aos', "fade-in"); 533 534 //$(this).attr('data-aos-anchor-placement', "top-bottom"); 535 536 }); 537 538 /*$('#intro h1').each(function(i, elem){ 539 console.log(i); 540 $(this).attr('data-anim-id','header-'+i); 541 $(this).attr('data-aos-id', "super-duper"); 542 $(this).attr('data-aos', "fade-in"); 543 $(this).attr('data-aos-anchor-placement', "top-bottom"); 544 $(this).attr('data-aos-mirror', "true"); 545 // $(this).hide(); 546 //$(this).attr('data-aos-once', "true"); 547 548 549 });*/
550 $('.element_content h3').addClass('h2'); 551 552 $('.page_layout p').each(function (i, elem) { 553 //console.log(i); 554 //$(this).attr('data-anim-id','header-'+i); 555 //$(this).attr('data-aos-id', "super-duper"); 556 $(this).attr('data-aos', "fade-up"); 557 558 $(this).attr('data-aos-anchor-placement', "top-bottom"); 559 560 //$(this).attr('data-aos', "fade-up"); 561 // $(this).hide(); 562 //$(this).attr('data-aos-once', "true"); 563 564 565 }); 566 $('ul.gallery_images').each(function (i, elem) { 567 568 $(this).attr('data-aos', "flip-left"); 569 //$(this).attr('data-aos-mirror', "true"); 570 $(this).attr('data-aos-anchor-placement', "top-bottom"); 571 572 573 574 }); 575 $('.col.tile .card').each(function (i, elem) { 576 $(this).attr('data-aos-delay', i + "00"); 577 //$(this).attr('data-aos', "flip-left"); 578 $(this).attr('data-aos', "fade-up"); 579 580 //$(this).attr('data-aos-once', "true"); 581 //$(this).attr('data-aos-mirror', "true"); 582 $(this).attr('data-aos-anchor-placement', "top-bottom"); 583 584 }); 585 586 /* 587 $('.col.tile').each(function(i, elem){ 588 $(this).attr('data-aos-delay', i + "00"); 589 $(this).attr('data-aos', "fade-in"); 590 //$(this).attr('data-aos-mirror', "true"); 591 $(this).attr('data-aos-anchor-placement', "top-bottom"); 592 593 }); 594 */ 595 $('a.button').each(function (i, elem) { 596 //console.log(i); 597 //$(this).attr('data-anim-id','header-'+i); 598 //$(this).attr('data-aos-id', "super-duper"); 599 $(this).attr('data-aos', "fade-up"); 600 // $(this).attr('data-aos-delay', i + "00"); 601 $(this).attr('data-aos-anchor-placement', "top-bottom"); 602 603 604 605 606 }); 607 $('.discover article').each(function (i, elem) { 608 $(this).attr('data-aos-delay', i + "00"); 609 $(this).attr('data-aos-anchor-placement', "top-bottom"); 610 611 }); 612 613 614 //AOS.refresh(); 615 AOS.init(); 616 window.addEventListener('resize', AOS.refresh()); 617 618 // smooth scrolling for anchors 619 $('a[href*="#"]:not([href="#"])').click(function () { 620 if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { 621 622 var target = $(this.hash); 623 624 target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); 625 if (target.length) { 626 $('html,body').animate({ 627 scrollTop: target.offset().top 628 }, 1000); 629 return false; 630 } 631 } 632 }); 633 634 $('a.contactme').mailme(); 635 636 637 638 639}); 640 641 642 643/* MAIL ME */ 644jQuery.fn.mailme = function () { 645 var host = window.location.host; 646 this.each(function () { 647 //var addr = jQuery(this).text().replace(at,"@").replace(dot,"."); 648 var title = encodeURI("Website enquiry - " + host); 649 jQuery(this).attr('href', 'mailto:' + jQuery(this).attr('data-user') + '@' + jQuery(this).attr('data-domain') + '?subject=' + title); 650 }); 651};
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.