var pmaWidgetInstance5fd089c0d9685ed272a9cce5 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=5a840ae4089e549e45d103f223658001:7a4e4581411c442a8a62043ca99ec97e07b23b1f8cb057213cd343370544f7d9bfb516f0c10f4f656601d20342ae5cb50f35761ed9290811101bfae1d822acee272b3bd113f2a621f4dc4346179d49cc30a37de3e4ce682b767c99880c1b259ba6c456ac14e8144dafc9cc3af5b34626f611c849f634741707395d0ad0b21e29b128d5c95a8a2d1f72366e665b08f1dfa22184f8553cfa5d95915c1cbef6b5732aaa59867d2d7b2e10615bd3e9cb377b82045f73f7e9347ab9c03f6dbb77c430", 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); } }