var pmaWidgetInstance5fd0cc8cd9685ed272ccc690 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=37b826e467cf8837a4c8762f81537d24:71c804113a4a41b3a1d4e202c47ed521351d8c2bbb982c3492f96b112fa78f0692756d94a505eb52b7d07d61dbbbbc9be5af5d2e9a9d98c12e96b0c952874bf71b8414b1ded079e38854e6d10a9ce7717507d41797b96cf2678b0f91a2567d1f90fa0778b06c37d1d196e23be375654ba0bbdccf09fc1314af672c474d5aa70f6609181d49926dfca69ba470224f10c8ec9ed26bc0e8f2920a537955b368ad1efdf69b08eb3473404eba7a4c5f4482346d4f1fbf574e5df0e8d1ee266c64559f", shop_name: "Šimek.eu", shop_logo: "https://y1.sk/t/s/130x50/58202.jpg", product_price: "138,12 €", product_shipping: "5,00 €", product_availability: "", 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(){ pmaWidgetInstance5fd0cc8cd9685ed272ccc690.initWidget("5fd0cc8cd9685ed272ccc690"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }