var pmaWidgetInstance639da0f3ac365ae37426b8ae = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a4faa70524458d53ac2af1adb3b65714:182c4798a76601c7d562e5d06209deb98800c1f8642916ade470201c1f91a6fc680fba6b70fbe7a5b98d1c37d96289ce7f13d78be12e4efea3870a2b9aea285da5417647642f869aa22355d4d2e3b832a869bdd28285f49fb982f7f06a9449d96d5a83341e669c608606e794905948ed5da75229471ec0419f2b12aa1a07ad3db1982c9362ccf58f52e2b15e091079917da8dd854a3eddd851e24b26bf7e0ccabc11779c347744ab31486c6a534cd5d375df43c32fd743eadc562e50f2538809c52c4bff500845834fd32e29415ae075", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "659,00 €", product_shipping: "8,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(){ pmaWidgetInstance639da0f3ac365ae37426b8ae.initWidget("639da0f3ac365ae37426b8ae"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }