var pmaWidgetInstance60a4d1b90067a2ef59e59922 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c075f32ded4c8f4c3eaf164bc2f8b27a:a1abff35f1125b978b2d8eee1da886d3ea1aa542f45241b72ed0be95b62d2fcdf73a867bbbfb838845e13ff8f4cdad688618c407841a7037bf852bdbc4d8040e13fb60ba785e92b1eaac75250bb1d595c6d845dc92a7bd00b391b83b855fb34def673bb11523bef30b6b724eca923c7d9b5c2568954b4bb53e5557371beb5bd5c81792383bd4c9a1e46a34d084db039b82640404d79479d1d41c37b6761054e77f33abd730b2264c5ec06ae575744a3fe9e656c6a5832e7e5fc8b835a33b348859abb421abb1a22067be765dd95b3969", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "415,69 €", 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(){ pmaWidgetInstance60a4d1b90067a2ef59e59922.initWidget("60a4d1b90067a2ef59e59922"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }