var pmaWidgetInstance605303add9685ed272c2635d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c19463501da554c9a805b4b46ca5c54d:fa1c361315dc021d82a5a931c98d6e6da13996bc2f429256a6a1dbe4612aeeea9f24b05157d8e188727cdc62153ab0220fcca8fd4583f280d19b92b7404029b9c4b1f070cd12b11d7c17e0813ef926668c2b37f244b14728e5e5197a8b7dcbcf164e43ca1a9acd6f6843eb63ca43044ebd6ee438a0fc651f0973ce4937a13dece95690ce05a3779ffc58ce86ac275100d46bab16bf06dfb949499abb31f8f6d219e70ab49de9ae09ee20cad0735128486a095e4520fe70e08ccf93802ef29d0b8678d85669e1773129a32d6c60c6245b", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "299,00 €", 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(){ pmaWidgetInstance605303add9685ed272c2635d.initWidget("605303add9685ed272c2635d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }