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