var pmaWidgetInstance60c9b0c60067a2ef598bae19 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=15e9464775a255b10163aa3db2e613d9:788ff5417acca487888e82ce902d532822cb587e5e9825f01deaf10e3ecc762fa7d8312f7904aa38d0e007acd5a308010d38b9d9dbb6846e3cafe85f6ddf9143b14a014bbd9caf0a2c319196fa3580febf8cd9897bb64078f437ec44bf2cccdb9972d2063ddd106acd2f59efe8d371986f04469cb003dfcaf991d961e1d8a57deff27adaf8ee9e447779e1ef9d26d405982d8ebe094d6ecf0c731c35a49c7f93d95c3f097ae342e6306aca244d078a2aaa62c98ebcca17056ac50c40be90b0536444fdc8c8fa84a28f6bd278ee6c903b", shop_name: "elu.sk", shop_logo: "https://y1.sk/t/s/130x50/59355.jpg", product_price: "46,90 €", product_shipping: "0,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(){ pmaWidgetInstance60c9b0c60067a2ef598bae19.initWidget("60c9b0c60067a2ef598bae19"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }