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