var pmaWidgetInstance5fcf8c3ad9685ed272f131e2 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c4ed33f1a40ef0ac33ea713f77ff01d0:c7183243ff68018f1da69b46b2ddd70d2705f04163f0f756e2642f237d303c5b67bc7b72832e1f40f3f05491137f50eea0b5e7acf4239e405d4d6b28f494a6e332e9cb8f4835d9a8d6ec6adaac1352884df86503415f3214ac766e35dd29410894b8ca0d1bb2d675f9753a51dcad9e9f7e90985ae32d9b69afde4df474d1f966019c2cfbe8d00f40681cc83cf7e12ef154717f340068877da95ccdd0966898f43ccccaf800fc2268504c5901aada0af3dc5761b8fe5c422adef741b78307df6f", shop_name: "boukal.sk", shop_logo: "https://y1.sk/t/s/130x50/5806.jpg", product_price: "365,91 €", product_shipping: "", 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(){ pmaWidgetInstance5fcf8c3ad9685ed272f131e2.initWidget("5fcf8c3ad9685ed272f131e2"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }