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