var pmaWidgetInstance5fc0d5e8d9685ed27295d449 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c7ab846322db07cf165993876906e857:09298a5d35fc295191e2e473cfbc38c0d5109a9620e89aa479dbc3c353a2d9fe90fe5a86175395a2271d019ae43dce811fbbef51b925ce5a4372f17143b06effd2e01ae2ce2c10cd276623bf49f4603de13721f2c1014e405c930b8e3546cb6f0aa27cb5b148c9726c12f28ea3364a9bc41146477f983aa01c2550956abf4e025262f7f291deaf80181aa2551ead101b7e5634d00a220751a72d37fc4aeb9132f1050d4a0779bcbdf68c052dd6c2e49dd290dad20fd8711f12f205ff4342057f", shop_name: "Best2Buy.eu", shop_logo: "https://y1.sk/t/s/130x50/60439.jpg", product_price: "49,99 €", product_shipping: "3,90 €", 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(){ pmaWidgetInstance5fc0d5e8d9685ed27295d449.initWidget("5fc0d5e8d9685ed27295d449"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }