var pmaWidgetInstance5fd089c0d9685ed272a9cce5 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d836bd6e915fd2ba93407673485d4aa2:8f3bb61cf59c8ad9bd0b77d4e35f667c5aa08e87f9f6b40de3d5264d87bac658b12e8934a1e544ee8b0de796007c49e99115fd1bfe8771e1d0993bd3db5317161c2a64cdfee1c4c81a72ee5a74abe103e79723b6488cdc8357076dac2b038c6c82e2e4f6689963a590d027cd82816bfa9407b6b395cf703745cfda3f8b5419c76d783277c2e3fe24e476ccb0cb2b949661fbd5f0caa924d0e95f405c4bcfe992aa9a19865d14df3bd6f9154fc6ad27a392bc86a5f350f9c9fc7ffdc84c8c072c", shop_name: "bugy.sk", shop_logo: "https://y1.sk/t/s/130x50/5276.jpg", product_price: "26,00 €", 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(){ pmaWidgetInstance5fd089c0d9685ed272a9cce5.initWidget("5fd089c0d9685ed272a9cce5"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }