1(function(w, d) { 2 function isLegacyWidgetScript() { 3 return "https://loyaltyloop.com/js/apps/testimonials/iframe?test_pub_key=6y5mle&test_pub_key=yho9p5".includes("test_pub_key=") || 4 "https://loyaltyloop.com/js/apps/testimonials/iframe?test_pub_key=6y5mle&test_pub_key=yho9p5".includes("iframe_test_new_widget"); 5 } 6 7 function resizeIframe(ev) { 8 if (!ev.data.startsWith('LoyaltyLoopTestimonialWidget:')) 9 return; 10 11 var data = ev.data.substring(29).split(':'); // {widgetId}:{height} 12 if (data.length > 1) { 13 var widget_id = parseInt(data[0]); // widgetId of 0 indicates legacy (1-per-page) widgets. 14 var h = parseInt(data[1]) + 30; 15 16 var el; 17 if(widget_id > 0) { 18 el = document.querySelector('.survey_advantage-testimonials-widget[data-widget-id="' + widget_id + '"], .loyaltyloop-testimonials-widget[data-widget-id="' + widget_id + '"]'); 19 } else { 20 var els = document.querySelectorAll(".survey_advantage-testimonials-widget, .loyaltyloop-testimonials-widget"); 21 els.forEach(function(item){ 22 if(!item.getAttribute("data-feed-ids")) { 23 el = item; 24 } 25 }); 26 } 27 28 el.style.height = h + 'px'; 29 } 30 } 31 32 if (!w.LoyaltyLoopEventListenerInitialised) { 33 w.LoyaltyLoopEventListenerInitialized = true; 34 35 if (w.addEventListener) { 36 w.addEventListener('message', resizeIframe, false); 37 } else if (w.attachEvent) { 38 w.attachEvent('message', resizeIframe); 39 } 40 } 41 42 var els = document.querySelectorAll(".survey_advantage-testimonials-widget, .loyaltyloop-testimonials-widget"); 43 for (var i = 0; i < els.length; i++) { 44 var el = els[i]; 45 var config_ids = el.getAttribute("data-feed-ids"); 46 47 if (config_ids) { 48 processElement(el); 49 } else if (isLegacyWidgetScript()) { 50 processElementLegacy(el); 51 } 52 } 53 54 function processElement(el) { 55 var processed = el.getAttribute('data-sa-processed'); 56 if (processed === 'done') 57 return; 58 59 if(!w.countOfLoyaltyLoopTestimonialWidgets) 60 w.countOfLoyaltyLoopTestimonialWidgets = 0; 61 var widget_id = w.countOfLoyaltyLoopTestimonialWidgets += 1; 62 63 var config_params = ""; 64 var config_ids = el.getAttribute("data-feed-ids"); 65 if(config_ids) { 66 config_params = "?widget_id=" + widget_id; 67 68 config_ids = config_ids.split(","); 69 config_ids.forEach(function(id){ 70 config_params += "&test_pub_key=" + id.trim(); 71 }); 72 } 73 74 var url = "https://loyaltyloop.com/js/apps/testimonials/iframe?test_pub_key=6y5mle&test_pub_key=yho9p5" + config_params; 75 if(url.includes("?test_pub_key=") && url.includes("?widget_id=")) 76 return; 77 78 createIFrame(el, widget_id, url); 79 } 80 81 function processElementLegacy(el) { 82 var processed = el.getAttribute('data-sa-processed'); 83 if (processed === 'done') 84 return; 85 86 if(!w.countOfLoyaltyLoopTestimonialWidgets) 87 w.countOfLoyaltyLoopTestimonialWidgets = 0; 88 var widget_id = w.countOfLoyaltyLoopTestimonialWidgets += 1; 89 90 createIFrame(el, widget_id, "https://loyaltyloop.com/js/apps/testimonials/iframe?test_pub_key=6y5mle&test_pub_key=yho9p5"); 91 } 92 93 function createIFrame(el, widget_id, src) { 94 el.innerHTML = ""; 95 el.style.position = 'relative'; 96 el.style.height= '0'; 97 el.style.overflow = 'hidden'; 98 el.setAttribute('data-widget-id', widget_id); 99 100 var iframe = d.createElement('iframe'); 101 iframe.setAttribute('src', src); 102 iframe.setAttribute('allowfullscreen', true); 103 iframe.setAttribute('frameborder', '0'); 104 iframe.setAttribute('scrolling', 'no'); 105 iframe.style.border = 'line'; 106 iframe.style.height = '100%'; 107 iframe.style.width = '100%'; 108 iframe.style.top = '0'; 109 iframe.style.left = '0'; 110 iframe.style.position = 'absolute'; 111 iframe.style.overflowX = 'hidden'; 112 iframe.style.overflowY = 'hidden'; 113 el.appendChild(iframe); 114 el.setAttribute('data-sa-processed', 'done'); 115 } 116}(window, document));
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.