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