var pmaWidgetInstance6177f12f069a975de5977126 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c5d23d7f3be010a08e864f9958d7b2a0:da6858734ea872ddc705d699384d384fa0e356d66545b2d20d0a3af3193750c2669f4dd26ddc5f9336b82f00990baf8a7fe2ef87487b8ad78a91cf3fa3453f4a9e8648ef81fa5eeb5b5c864df757241e74c529b55a17e6ba005e8c857ea87ce7f5fdb7d5f46617e67b1d5981effb2a6ef1a3431097a24e0a01d2b392bcd83c7c3c114b3d611e89f27222c69fe1be6cf070a4494c8a4bdca5db1f3fa698b0aff7f119735c2699144176e73dde680bef3a75422d28203013680309acb28d76e2d93dab8aca7b0c06916c2a1f78323fd137", shop_name: "tescoma.sk", shop_logo: "https://y1.sk/t/s/130x50/41149.jpg", product_price: "20,20 €", product_shipping: "2,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(){ pmaWidgetInstance6177f12f069a975de5977126.initWidget("6177f12f069a975de5977126"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }