var pmaWidgetInstance5fce15fbd9685ed27256578c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=68b830cbd5297136fc4a57b288cfd514:98edcd69fdf55edaf723126af7812778beba43e4f8281f067b7cd67d19534bcc5d246a14cd6c5a63f9fc3ccb8662db6e08cc66e9551bbef2900daf68a88a65ae60fb3d4ee1fb2213c9c500b040ba4e5358c42a426b687b25b660e61fdef9358bf898735d2c6d31245f37dad33e87e9651f4e31149b021c33766333001954a9d2a5944a0b5a83e154d3432ede601abe157ce3838bfe07fbbe9cd7fad522592d038c7558d610412c63947e3d59e577dc52f585d1d6d5552e2d909d3f4cbbb70a37", shop_name: "tescoma.sk", shop_logo: "https://y1.sk/t/s/130x50/41149.jpg", product_price: "169,00 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance5fce15fbd9685ed27256578c.initWidget("5fce15fbd9685ed27256578c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }