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