var pmaWidgetInstance60c6f1ea0067a2ef59e5796e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=df925f2be1ed8a1f6fdbcf39d9ecf724:c5d2a06224ba736c48f313e6cc3eb8e7e8c3e1820d90e20efa56edafa6645623f850fd96aa5c27c9cc8737739ec150c10e98e1d17329145c1a3190d24bf2320b9edc5ac63c1946369b4f3886209507106767799c95f3e1dd1b37e2c2e70cd3e7ecbd1bdfb5cfd623ae6bfb855c6644a39bc7bb15c5574a25178cb9b9f45632371ad1195d1ec926eed9659fab9cc24168badd97877b6bbd62cb52f110ed6f7204ae6061eae31e51b64f097e4c463438abd34490b721c8b99cda87c1836889b1e4b8a40236d2d043d01b5b0896b5d01bcb", 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); } }