var pmaWidgetInstance5fcdedf1d9685ed27219cd50 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=73c02596f733a589a830b2718ca86408:6bb7411bba8b1a490488238febd52dc4a6906b68a420928eaa6be43a255271a828c518c2380492a388aac6650c65e16c7afb0ba963e854f3af0a77b82413566012d6aea1fab9ad13d424ff3b0556a7d33fa2b584b4329d01a1bd3c0271ed6ab40f1dcb01fc9208efada3a553e58fa85d42a408d1e89e803fdd3f100a662ab351471d675bfcd907bb241a0e1ab52c286cc9b9ee7fbe136947d03e701d05cfb4acdeff610624f56a10f03d207da15834c9dff477f2e6291ce8dfdbef4cdf2d95a9a83dba4949dbfdce437aed3ebe1a523e", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "75,58 €", product_shipping: "1,99 €", 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(){ pmaWidgetInstance5fcdedf1d9685ed27219cd50.initWidget("5fcdedf1d9685ed27219cd50"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }