var pmaWidgetInstance60924f8a0067a2ef59a2aa06 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2e9b9d47d3b886740f8c977f3178ead6:193fa73ac24ebbfa8acb58b06a62692649f115554d3971f8cbffc3f4f876bddfa6a83dd8c68a9e96382ea05ae81fb7cad5c374b8be75ce6f4a75b74500f6f2f8443719082ee2defed9ccd7e5cd7b2920373c34a5971d512a68002b4a96f27a93ee6e0d5c77f0e556a89f49c4a4922162e18cfab30255d028efd19005894d5245e5e8c2ff26350ae172360a6ab2f271af0e55157884f81e12bfcc3def4e2c35dd50e248fb9d9c791d247d0a458e3400305b3d5be426514757bdc265cae19ae02bb6efa8fe4e657e3987c87120bfb5b276", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "508,88 €", 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(){ pmaWidgetInstance60924f8a0067a2ef59a2aa06.initWidget("60924f8a0067a2ef59a2aa06"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }