var pmaWidgetInstance6136fe2b0067a2ef59f7800b = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=10ad761e4f1591f09bd4244f1d53db14:3a543c445f9fdd1f388d1efa8f29edd2b17834d54de2ff8da0dae01232ef68f80727d5dd68c7fbb6104baf4b72b48bd8347bc5ff3c4d299bcb8a2d4c0f74a60ab9317d40f856ba118510041476efdef789cc9177656c374d2e5b8e0236b37939e29924e0396e7dc959f666a0ec20e6d9043e3d14c4ba20da95438c149a38d916af5ed7f670aac2a3a84cdaca85e034597ca6e525f5e16209931de78d560dc3ec53b4e65a16a82789b861b460742b9a0fe92c0e1c6f95f5e24563586374fa8248ad04c5057dd32ade0d7b4dec4f898dc4", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "712,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(){ pmaWidgetInstance6136fe2b0067a2ef59f7800b.initWidget("6136fe2b0067a2ef59f7800b"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }