var pmaWidgetInstance5fca565cd9685ed272d50b47 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=dafcb550358745d7f26608d2e9df4d2a:bbcb882633901f793f6837d98d892fe03677d74798e8cb87526a817ad81682637e54dc10134a40ce6d0756c5b3a859d82b797d0b9b9d91c8a7b7d5cf7fce460a50b5c498f4d094b215ddf1377d855c8ae4483e216095aef2df891dcc84dce5b618830101e5631189f9bda82d8cbf3f042a1821224d1907b77ecf242f03b1053e098575fdd089a0daa6ee648fe2898522a7984d77990edc429f6fc0d03a3b0e8e40f3723d551600969848f7d37c019f55aa0156bfa66cbab372bba6c6e106f1ad", shop_name: "Xzone.sk", shop_logo: "https://y1.sk/t/s/130x50/9583.jpg", product_price: "31,50 €", product_shipping: "1,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(){ pmaWidgetInstance5fca565cd9685ed272d50b47.initWidget("5fca565cd9685ed272d50b47"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }