var pmaWidgetInstance5fca565cd9685ed272d50b47 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8ab6866a6e24aaebbe8db05040fdd9d0:e46c53c689b47b877e690fd0f415438eeefbada4740906e95cebed53e0da61de761144e6ee837495f32a37801c8bb9f8498ffbe985547cf7ee5cb1b287e233ab4cdc18adf1d66d99a0c449b30ac4a42c8c22b03e585bb9875df2ff29ef9633f73e0f9b596ca03173864fd104ba43ede6ab24a5a174531a791a32562e6b4e6378f0530b799d3f5679d63292dcc0b2da5a353bc8473f15b05f4437b95e4beb7fa9cc20c9975c32e3f920874be2c14cd8f42d50acce14b5fe244d0e06c34f81df83", 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); } }