var pmaWidgetInstance6033c4d3d9685ed2720cea92 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b70baf2c522ebbaaa172d82d47a07f39:eaaea18eeff385ed38435c2167b36819301a95ca2fcd677da1c2fe2f9991601ef824edaf0b8fb48219dbca0d21579a5df917055b065661e6e5cc3f0e578e77028c113d6b6677cce5ce68d579873b256e6f21f5ab2d9f2717e557b5d3edadd22946aa56cae59a6ad58da94acfdc87ae9cd2977f6248a568a35b3133299e3553eb32e1b0d9c5b02115006af76ce4d738b8b2a671dc81738926ff5b6fd33c2212862f224796ab982d3480a164fc9e42b5a70933165778198a3bd6dcf88e3bbf4d5a", shop_name: "solik.sk", shop_logo: "https://y1.sk/t/s/130x50/59915.jpg", product_price: "170,13 €", product_shipping: "", 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(){ pmaWidgetInstance6033c4d3d9685ed2720cea92.initWidget("6033c4d3d9685ed2720cea92"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }