var pmaWidgetInstance5fca7ec9d9685ed2720a99db = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ecb2d6184ca393c4ed938071195bc21c:d063a0982e674f72f0521b89310692f05e815500c27fcd69e7159e158d7161dd4458750a98096635c0c7373616bc11a3da78c01facdfcbff50e02e078b458485f794e80e8b8a858266f624fcc8d207205c98cd7e3ba1cceb0a22152eced047be8d296458b1e5a6be26be8d547161384a69e27544c86d6f5a0372682fea009400e20d36ac2268804a617e0d124f5e66f5e8e833b52deee548cc39d2595f689110fd9f51de7f2673c7cf66c9c2c2ac371dffab9357f4fb02ce6ac25d971c4bb5f5627974494d474a679c312e4bd88eaf20", shop_name: "Supermobily.sk", shop_logo: "https://y1.sk/t/s/130x50/10067.jpg", product_price: "125,00 €", product_shipping: "3,50 €", product_availability: "", 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(){ pmaWidgetInstance5fca7ec9d9685ed2720a99db.initWidget("5fca7ec9d9685ed2720a99db"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }