var pmaWidgetInstance6040cb20d9685ed272f4779e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=efd6f383bd8e708e5b64b42e0a492a98:6f9cdd506cce29ad70f75a84c1ca3417d2daf91cf724342ded3c61cf2c7d2d0cb6b88c6bebd15550e4534d4536a930cf7dccc88f0c8a4c90c23267c4bd3374ce608cce2141c11f51589b0a9e9cebb411ad0875be99df1d46689d28a533ef04b1dd259c11b72d26864e5841127399c7fec4ad5a17aa599b78c3308fa8bd2d90fac32f46a43c8f9612cbbd732269f7aec87865511aad5fc624ce5b6784ded42cdd0a876c58114d4f8a8a39cf39bebaff264a08157e45c86b34752af0da6288d60dc4d54eff94e48a9643b7be7cce3c0057", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "168,89 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance6040cb20d9685ed272f4779e.initWidget("6040cb20d9685ed272f4779e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }