var pmaWidgetInstance63e4ec3a42183289054ef8c0 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=cb17de86e5ca3dcabf7783f52f70d256:21b0cd2368e2b76e56c55781dc68d66985884b297e0b37160a383585976fd9630ae0153add0ca0e80b31ead497f4a288f2377c8e1535ea7273e648cfc10a5c72166cccda6d33acbd658a90759a1b95e9ed8af3fc85d319a62c60f7dc8bbfcce60325e47bc8bea31450d8a23f3195770efd249f1457903808112cd8d589b8f53afd48b8526445c790c3dfde8624e3e9396afd612dbf5e1e5390819e345613f060a574adb328017cc7aaf0ee10f531b50c014b5ffa538f43ddc93f513c25074382dc3dcca1bc6d3a6e06b449af094944bd", shop_name: "klarstein.sk", shop_logo: "https://y1.sk/t/s/130x50/52719.jpg", product_price: "154,90 €", product_shipping: "2,99 €", 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(){ pmaWidgetInstance63e4ec3a42183289054ef8c0.initWidget("63e4ec3a42183289054ef8c0"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }