var pmaWidgetInstance63fc8ec94218328905f4cd0a = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=bfc7f890150f20e00db1b3b59864a050:e0c14f8b2aede68bb0a88f07ef97c5753a4594d6edb44f1cd5aa36fe60514c8e448fad2e0d14597a3f48249a077b41e07a819ef02f008b650b7252ef58b2a53b12dbf4b4b9ae6f7a80e70379c338556e14154fd87ce42ab4d8a28c5a497be57500fce9741ed273ef1db5935491bde0085c033b42555fadf18578176e0f5ef0db645844f75380112ea9f45b7baa198743d34010248582daf51368a8c4c07833a5a1ae586c8b43977c426fd26c17b619c3a1df4fdf8a2716ee66fd34eeedb3eae1587cea3fda2995f2aee57c7b4eafb90c", shop_name: "arco.sk", shop_logo: "https://y1.sk/t/s/130x50/45797.jpg", product_price: "769,00 €", product_shipping: "2,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(){ pmaWidgetInstance63fc8ec94218328905f4cd0a.initWidget("63fc8ec94218328905f4cd0a"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }