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