var pmaWidgetInstance6033c4d3d9685ed2720cea92 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=bdca4b09c17e9c196726842b385af7dc:955c831891d0e4435aa6f2c224cd65ae1a09c4049c353f13f79166b974a65c11271f025e97770c792c889d76f12d4530ab3d8e6309f1a8fc0dcecb29e452aec60575b1684b083cee9f493977d7d43d6d034d7ab31de889a6a7b2ac27b38542037f2d84c31dd3cfb0117ce64c3c1d4d067c1db6881bcb25917d8a4f6f1a26357320c654b23f646db598bf3463cd2b85c4d627a872b850c0a0547b9be9f89f4be354fda3d3cca834b84064518e8495d57d786b382f8b7f56855c6c3f822b7d81e6", shop_name: "solik.sk", shop_logo: "https://y1.sk/t/s/130x50/59915.jpg", product_price: "177,99 €", product_shipping: "", 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(){ pmaWidgetInstance6033c4d3d9685ed2720cea92.initWidget("6033c4d3d9685ed2720cea92"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }