var pmaWidgetInstance6144fefb0067a2ef59a4bc4a = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ffdf5338e328056eefcc3fa65ce1091e:e4c286876b2e459843c04dac5694b8a952001b135708c7551c6f0f4d61b6a953f2696e3611cc43f254091754825b36da73753f549d3193f83e7c0529d98feb2d13e9f93191a7ff7750dd22b5a4869a5a52d9d739f90e8143480967b03e0c95bfffdd4bd3f443d67d6d6e9e76661d3aa980f60d73f0286024414cdabcafe61c43478fb709faa4f55a68da11a3f06d4aa4f8eb08ac1bbc8cf46c828703e1e3211341517d990ae99b8f12308bf67ea7f1d7d03329336b753cd47847aed982097610d2f713d3024dc2d687fc836e4c4faa0c", shop_name: "andreashop.sk", shop_logo: "https://y1.sk/t/s/130x50/530.jpg", product_price: "498,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(){ pmaWidgetInstance6144fefb0067a2ef59a4bc4a.initWidget("6144fefb0067a2ef59a4bc4a"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }