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