var pmaWidgetInstance65098b1c4218328905debcdc = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=57cab42284911b44a4172f1df9896141:57331c690734d3703bc416667222fafc47b1427d9b556f0a998f4664035283113f064fb5b0e245f7ee8b92e73f44844d3c204261dad81ea1980e4edb15bfa8c72b2d3f66c429b6a95b0594908389dc21bdc36e268f02e0c77daca2534cdbde32c1de6a880882690a90bf6474a40f0c5be1b59d2ee5ae242d6bc57ac4d351bad84ef3c1f995896c15ebf3ac31c761bdc943f058ddbfb15efb2d49124555759c0a2ff1ae4fb9ea7fcf4de7a3a0efa96e734048b9fe86dcac9afdbe7b68c7eaa4b4eac14f2713e43aa13c8bd71f0e76dfc7", shop_name: "kotollacno.sk", shop_logo: "https://y1.sk/t/s/130x50/52905.jpg", product_price: "2840 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance65098b1c4218328905debcdc.initWidget("65098b1c4218328905debcdc"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }