var pmaWidgetInstance6034d963d9685ed272ee437d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7365ac842480647e791a01f7eab404f1:2d9d3105b944678bc56ab3ffe5f7ca58e15be65b2def50e9309ff44ebd075cb55055d479fb394e068b8e45ff3ba61453313c863be9d83df6da83ea9dd0a1845d2682de4c2950b42226193d64d614e9b71f69cc591d1d43c3b5149442d401a28207a2e9d5aef4a10ae27a4f869532b2de9f3d25374fada0a5b660f1aa536fd665a7f73f79c12cf3538d3113daf49dfbab9a0a988d461426517a40227895ee1553fe528105a4b616a09dd60a3e67e29695f5962a8c16ad57f6d763b2aac6b447824138d36656d62681b6aa0cfc463c7705", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "512,39 €", 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(){ pmaWidgetInstance6034d963d9685ed272ee437d.initWidget("6034d963d9685ed272ee437d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }