var pmaWidgetInstance60c3264f0067a2ef59f43f14 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=30710ca9065db129eaa7d732cf2a4db7:f673f6a86dd12bbdcf1a89c95b37b7c81314e562d31dd36be217bdffd230a7c1a5e2073f00f028cc050686c94b4f90816949af0802c0d5491b1933d1ac0f1e36a44535555eef27334c92eab0e388f082785e4b1a862b1c3f598657eaa4aa5c5ad9cfe93ca2504f5cb7d9836b0c3362a194d112a5f88f9d17896c643994c3c0a769c74e3fefadd2b18481f82d7aad39df54e61577aadc6f4ca081bf301fa62b29b5c872f853aad563b2f4106674cabb86d014305778a84525d1ac46b07e8bdaa83c628feceb7dc4871d15d8fa2fde900a", shop_name: "Alpensport", shop_logo: "https://y1.sk/t/s/130x50/56734.jpg", product_price: "77,67 €", 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(){ pmaWidgetInstance60c3264f0067a2ef59f43f14.initWidget("60c3264f0067a2ef59f43f14"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }