var pmaWidgetInstance60c3528f0067a2ef5990da3c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a022c1abeb3841abe775b4a9f3214403:fafb32759ade05682a81aab10f06e5f2e5caebe4e4e8becbb0489a83c5bd34a05a3ac9bf1469ed98d775b2e64aa4d3f49426241396d5d8a3529a30139f6c1e770d3cc9578d3ba1185eaccc5a7cd0bf1e379a5ad551a23b3f436b4154cbe6b208b29fde05087c99ee3c203e37fb88c45f3f0227f2a602183e6dc9f8610fb118fe4452b680996834d4943a8b6cd12b360d62b951a03096867b5ee91ef1e60d0c237e0c3ef1f8c0914b861f15c1a126f991f5b4986477678c2a033126c837e0e807", shop_name: "www.aldoshop.sk", shop_logo: "https://y1.sk/t/s/130x50/59034.jpg", product_price: "4,30 €", 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(){ pmaWidgetInstance60c3528f0067a2ef5990da3c.initWidget("60c3528f0067a2ef5990da3c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }