var pmaWidgetInstance60c6f27b0067a2ef59e7b831 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=49f44ee5462d214aee330d8635d8e334:c6cccda082341733ca90873517b837fa2564c24c65693eb36f7978ac7c08a30ed9512319b98e48ba0422fc88f4b6fd89070267cd1293c80175eb415ae5bde63d73c36f39811c377ea09c243573d9f70b98c5e118e34f2d7a93a048e7009fd4df738e908f14f9174b1a8f1196295a9d4c1d06554f76c44275325335df9187c6c313b74dec3e45d6af9ddc1df3402ada40c9f3b22936a68902be51e94e0d4ea2ee1ab36069f39fe389bf843b0c79345aeec57c214a5dabdf795bf8fdc9c35f00ca4780c67a032e242903007c63ad0f5c29", shop_name: "kancelarskezidle.com", shop_logo: "https://y1.sk/t/s/130x50/5760.jpg", product_price: "13,50 €", product_shipping: "4,58 €", 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(){ pmaWidgetInstance60c6f27b0067a2ef59e7b831.initWidget("60c6f27b0067a2ef59e7b831"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }