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