var pmaWidgetInstance60119ad0d9685ed272c9f6fd = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=fd1216a384db827cefaab87a1f05349e:78504efcd908e0b70ea82caa5b971706dde6322c7fce897b028bd1e27a2958ff85d15a179787354dc751d5dad7979ef0dd9321284db3f001a510fef04b27ace87323140fee9c3c14f661fce63271e8476eeb59260ceae90db02f1fe76bf5ff3cfc8812f3457625aa4e9188ad6aff4c20d59c88077d5cbc39d0ee46dd8c11e9a1c408db96a329b2fad4eab0af0ce4d246b5c27c5d3bf307e1ebc8094598242538c8abe38c023e8ff13e03e0b7aee5d1611a73c7dd36aeea08692b4fc37041fe06", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "32,90 €", product_shipping: "", product_availability: "Skladom", initWidget: function(widgetId){ this.insertLinkToButton(widgetId); }, insertLinkToButton: function(widgetId){ const instance = this; const btns = this.findButtonWidgets(widgetId); for(var btn of btns){ instance.insertButtonVariables(btn); if(btn.tagName == "A"){ btn.href = this.exitLink; btn.target = "_blank"; btn.rel = "nofollow"; } else { btn.onclick = function(event){ event.stopPropagation(); window.open(instance.exitLink); } } } }, findButtonWidgets: function(widgetId){ var currentModalButtons = []; var modalButtons = document.getElementsByClassName(`pma-widget`); for(var modalButton of modalButtons){ if(modalButton.getAttribute('data-id') == widgetId){ currentModalButtons.push(modalButton); } } return currentModalButtons; }, insertButtonVariables: function(element){ element.innerHTML = element.innerHTML.replaceAll("{{shop_name}}",this.shop_name?this.shop_name:""); element.innerHTML = element.innerHTML.replaceAll("{{shop_logo}}",this.shop_logo?this.shop_logo:""); element.innerHTML = element.innerHTML.replaceAll("{{product_price}}",this.product_price?this.product_price:""); element.innerHTML = element.innerHTML.replaceAll("{{product_shipping}}",this.product_shipping?this.product_shipping:""); element.innerHTML = element.innerHTML.replaceAll("{{product_availability}}",this.product_availability?this.product_availability:""); } } docReady(function(){ pmaWidgetInstance60119ad0d9685ed272c9f6fd.initWidget("60119ad0d9685ed272c9f6fd"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }