1// cookie 2!(function (a) { 3 "function" == typeof define && define.amd 4 ? define(["jquery"], a) 5 : "object" == typeof exports 6 ? a(require("jquery")) 7 : a(jQuery); 8})(function (a) { 9 function b(a) { 10 return h.raw ? a : encodeURIComponent(a); 11 } 12 function c(a) { 13 return h.raw ? a : decodeURIComponent(a); 14 } 15 function d(a) { 16 return b(h.json ? JSON.stringify(a) : String(a)); 17 } 18 function e(a) { 19 0 === a.indexOf('"') && (a = a.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, "\\")); 20 try { 21 return (a = decodeURIComponent(a.replace(g, " "))), h.json ? JSON.parse(a) : a; 22 } catch (b) {} 23 } 24 function f(b, c) { 25 var d = h.raw ? b : e(b); 26 return a.isFunction(c) ? c(d) : d; 27 } 28 var g = /\+/g, 29 h = (a.cookie = function (e, g, i) { 30 if (void 0 !== g && !a.isFunction(g)) { 31 if (((i = a.extend({}, h.defaults, i)), "number" == typeof i.expires)) { 32 var j = i.expires, 33 k = (i.expires = new Date()); 34 k.setTime(+k + 864e5 * j); 35 } 36 return (document.cookie = [ 37 b(e), 38 "=", 39 d(g), 40 i.expires ? "; expires=" + i.expires.toUTCString() : "", 41 i.path ? "; path=" + i.path : "", 42 i.domain ? "; domain=" + i.domain : "", 43 i.secure ? "; secure" : "", 44 ].join("")); 45 } 46 for ( 47 var l = e ? void 0 : {}, m = document.cookie ? document.cookie.split("; ") : [], n = 0, o = m.length; 48 o > n; 49 n++ 50 ) { 51 var p = m[n].split("="), 52 q = c(p.shift()), 53 r = p.join("="); 54 if (e && e === q) { 55 l = f(r, g); 56 break; 57 } 58 e || void 0 === (r = f(r)) || (l[q] = r); 59 } 60 return l; 61 }); 62 (h.defaults = {}), 63 (a.removeCookie = function (b, c) { 64 return void 0 === a.cookie(b) ? !1 : (a.cookie(b, "", a.extend({}, c, { expires: -1 })), !a.cookie(b)); 65 }); 66}); 67 68$(document).ready(function () { 69 if ($("#popup_heyloyalty").length) { 70 let newsletterDone = getCookie("newsletterDone"); 71 if (newsletterDone != "true" && typeof newsletterConfig !== 'undefined') { 72 if (typeof newsletterConfig.newsletterTitle != undefined && newsletterConfig.newsletterTitle != "") { 73 $("#popup_heyloyalty form .input_fields").before("<h4>" + newsletterConfig.newsletterTitle + "</h4>"); 74 } 75 if (typeof newsletterConfig.newsletterHighlight != undefined && newsletterConfig.newsletterHighlight != "") { 76 $("#popup_heyloyalty form .input_fields").before( 77 '<span class="highlighted">' + newsletterConfig.newsletterHighlight + "</span>" 78 ); 79 } 80 if (typeof newsletterConfig.newsletterText != undefined && newsletterConfig.newsletterText != "") { 81 $("#popup_heyloyalty form .input_fields").before("<p>" + newsletterConfig.newsletterText + "</p>"); 82 } 83 if (typeof newsletterConfig.newsletterImage != "undefined" && newsletterConfig.newsletterImage != "") { 84 $("#popup_heyloyalty form").after('<img src="' + newsletterConfig.newsletterImage + '">'); 85 } 86 setTimeout(function () { 87 $("#popup_heyloyalty").slideToggle(); 88 }, 5000); 89 } else { 90 $("#popup_heyloyalty").hide(); 91 } 92 93 $("#popup_heyloyalty_close").on("click", function () { 94 $.cookie("newsletterDone", "true"); 95 $("#popup_heyloyalty").slideToggle(); 96 }); 97 } 98 99 // MOBILE 100 if ($(window).width() < 768) { 101 $("#popup_heyloyalty_container > img").on("click", function () { 102 $(this).siblings("form").show(); 103 $(this).hide(); 104 $("#popup_heyloyalty_close").css("top", "15px"); 105 }); 106 107 // PRODUCTLIST 108 //if($('body').hasClass('webshop-productlist')) { 109 // 110 // var productItems = $('.ProductList_Custom_UL > li'); 111 // productItems.each(function(i, item) { 112 // var shortDesc = $(item).find('.shortDescription'); 113 // var image = $(item).find('.image'); 114 // image.after(shortDesc); 115 // }) 116 // 117 //} 118 } 119}); 120 121function newsletterSignup(signupForm) { 122 var form = $(signupForm); 123 124 var firstNameField = form.find('input[name="fname"]').val(); 125 var hasWhiteSpace = firstNameField.indexOf(" ") >= 0; 126 var firstName = hasWhiteSpace ? firstNameField.substr(0, firstNameField.indexOf(" ")) : firstNameField; 127 var lastName = hasWhiteSpace ? firstNameField.substr(firstNameField.indexOf(" ") + 1) : ""; 128 129 $.ajax({
130 url: "/images/skins/Main/API/HeyLoyalty/NewsletterSignup.asp", 131 type: "GET", 132 data: { 133 listId: newsletterConfig.HeyLoyaltyList, 134 firstName: firstName, 135 lastName: lastName, 136 email: form.find('input[name="email"]').val(), 137 }, 138 complete: function () { 139 form.html(newsletterConfig.thankyoutext); 140 form.parents().find("img").hide(); 141 $.cookie("newsletterDone", "true"); 142 setTimeout(function () { 143 $("#popup_heyloyalty").slideToggle(); 144 }, 1000); 145 }, 146 }); 147}
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.