var pmaWidgetInstance6155cef30067a2ef5922c390 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d4aa7319c833460d2e30ac068a0bf803:9f855dd9c872e00bf02ccb1051366c07ec1e0ab9288e23cecfd0b244ba29f9539e4fc2b305dff7c8f4a1e79b809ef0ca2d70aad14acba790cb70f610a6e56a9b067d2f0768af9db12f3b50d0b0a5024a0ba24d1a4b84db4e639c99ebdfbb8cd38327452067fb568ff3fba1847fefeed7ebf689738a26426e81be73a37456fb5ecf627ae4a1c8aeabf4f42f1cfb49cbdd10dc4e0508fc9cb017f0ea28fe5045ccb7af44d60f56697965cabad5bb1df08a6a6c4775bcba3fe66f40751677bff00e474f1c872d4f04ce73a3f697c200f5cc", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "512,39 €", 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(){ pmaWidgetInstance6155cef30067a2ef5922c390.initWidget("6155cef30067a2ef5922c390"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }