var pmaWidgetInstance60c35c380067a2ef59a74030 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8c380dc5ed413c12cc39937bfaea2ae6:9e003f48c63b4e37ed790c73bfbf7663412f7927e711c598f8ca6e225fc64b238ca133fb5a3598c4273f013b5a50829636ea817fc3e466e61ed20c45d6603d2e99dd1c734cf7d673bc714a542ea2184d0ef4e42f0069e8d43553381a1bf878cd9b377b0662d6bab56ce5ef682053de9a6e500290ff48dd729254cd1d52cc5dd0fd620462a5f945c740e04d4a094ab9d62bb26527b6759dfc60846a0c2bf5b44f9f114a7142429f5516dcc7c8bde4f04f046f5eeae2bde74aad127ad32a9a25009b00cd851d6633faf5579c7efa6c9e25", shop_name: "andreashop.sk", shop_logo: "https://y1.sk/t/s/130x50/530.jpg", product_price: "109,00 €", product_shipping: "1,29 €", 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(){ pmaWidgetInstance60c35c380067a2ef59a74030.initWidget("60c35c380067a2ef59a74030"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }