var pmaWidgetInstance5fdb5431d9685ed27268af7e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=39d6ee6fd865f9f5c70eec6bf4dc5d94:c664a087fcf520da693422bda429a05d186f9f2bc916d0648853d7fae9cf14ff5e8effc35085b20d0f6a5187ef547a6afcd2a923a4342d564b7f41927bc80181504f7b7cfb37aa671ee3681d9bd6bb40551c7920ea57e9e6c4c6f8b461efa6f9fed1e34a28f4ee888116cf809bd0fe454edb1a010605f37859cf43bbbc60c15a370fa5133151a4e79304a7438d625751e047d8e9bdeb1b20261784cbe64278cf19bbdff9733e4fcd0968b22101cb05f272d34a30e7db3aa9d1c7200bf644ad4e", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "223,34 €", 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(){ pmaWidgetInstance5fdb5431d9685ed27268af7e.initWidget("5fdb5431d9685ed27268af7e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }