var pmaWidgetInstance5fce1aefd9685ed27261d056 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=4020e0050905b4e96e4b4ddbca0757aa:980e47328201f13801d601c5550d1b4c9a1ecf9b3298ba0774a17369d4f245cc6147b75ea4aa26dca4bda9c1972ab4b0ae66a723fa07d1b72bbc335f258c13234d358b5a9f8c2c8e4df5964b2b36ea5b0511fdaa374b160aad901caa1d646b3c8d1899a1c5945bd00285ca8f59cdfe084b7bcccdeeb23305fa602382105f7a34ec1dec993bf395254050742d3f248002ec40fba2d9e32f23bf8bb4811fa123d5629b17dbb1f2e0d9f3a9cbf12069596b92c516cd3a385a55065678d80e92a8b8", shop_name: "inhodinky.sk", shop_logo: "https://y1.sk/t/s/130x50/4102.jpg", product_price: "22,95 €", product_shipping: "0,00 €", product_availability: "", 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(){ pmaWidgetInstance5fce1aefd9685ed27261d056.initWidget("5fce1aefd9685ed27261d056"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }