var pmaWidgetInstance607e88b1d9685ed2728b60f4 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=961c93576a32de899b2dff02358828b1:9f51d197721aadf5186bf660e41e7baaf2974a553e61c261002000d3b9053d0e7a20bd2ce206e8c2bff62cb04e867e74414ac8374b3cf14fcc9840f4ab8b27824787798922d32059374d9bf8b35cf05e4c28717ae809a1a0a3abab3a6cf8c755d92a667b1c758cc2528bba189530db8ea56b304c315f0c77590175cf7b994a8cc275f24f98ca2e58b9774d4ecf07967701cdde6c872f30d9a2831073596d52998c32d491250444e4de1ce397a8b50c11cdbf3c4a6ed7eecb2292dac061ef198e24f92940fffe13594eaa9aa23e5bcf0a", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "313,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(){ pmaWidgetInstance607e88b1d9685ed2728b60f4.initWidget("607e88b1d9685ed2728b60f4"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }