var pmaWidgetInstance6123d6da0067a2ef5972547b = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=edb1227453373adf856c42fb25be7759:b1715f64b5203e232259b473f11b49df5f7760b4de220c177ceee41256ab0797424ab48fef1811155be79f17003578c370414f9985260fa452b61bb606561fe9a4372c01e2e8b09e04c319bb5037f04aa45d069ce7de20eae2df897f70e29ae7acff34e5cf53107addd32e0a641dcfc1483f4c7025e4e15fe904fafe2adaed1738585f9982bf37d22039e2f7324e96ea088225df9b55c0dc9ad01245c1e8a6d1162c084972e83a1467055b9ed84d6fd761f80376a63f8afc301e63a98e8b8c7f6c87376b036100f731b904d08cc34952", shop_name: "extremepcshop.sk", shop_logo: "https://y1.sk/t/s/130x50/50665.jpg", product_price: "59,90 €", product_shipping: "3,00 €", 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(){ pmaWidgetInstance6123d6da0067a2ef5972547b.initWidget("6123d6da0067a2ef5972547b"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }