var pmaWidgetInstance60c6f1ea0067a2ef59e5796e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ff91506d5597cde114d8a1a448df124b:1d785d45266573f01e078fe772e5f1990c910536f7f03adbe29e3370e54d1154f4b4bd08535d6fa9fb1d31479dd9806381dfda95808f1ee066c928b273d08d2940433c5ec4485d00595cd92843672af4f7278c74df70a4f4c55036add14830dd9a17cf792cc89f7f30289a83d2f04d131a20f105134671500568f684b82532b4f62749aacdc7aa040803f9f6ce89619f4e6c379fcfa593052791cd5d61d72383521f79e7be486ff5ec428500e84ba5cc5d04ba040f4a0f3256ba3e2043033cedd74c5693d98c6ac7eac2b79fb5a48159", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "23,20 €", product_shipping: "8,99 €", product_availability: "", 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(){ pmaWidgetInstance60c6f1ea0067a2ef59e5796e.initWidget("60c6f1ea0067a2ef59e5796e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }