var pmaWidgetInstance60c6f27b0067a2ef59e7b831 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=4692f7543bbebd7bcd340658a6e54e1c:beb73d752b725b12e8dd3e8ee61bfbe323f52525c0701eb070e57e8aff248abc0c59253837454cb5b69c87e17911fe82ae79bb1ee051fe4d41f1f25745b0ca704c672edeb2d0eaed0887e348d76f3dea312a7f799875915c4ad87cc8aa32a233bbb05c35fbc4ff39b12898280802c10c1a2ee3d0c68a461bd322d315ece660b147cfe528a6fc379b2cfce20f0cdde772faa4f8bdfde827b76c48e5176f52ce7cb6de9c0a093bded4cee6509a6059f2e67792c49f5fd4c46b34b7a98aaac87dfbe8bee3eee92b4b19956b64fbe50ad97f", 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); } }