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