var pmaWidgetInstance654cc4fd4218328905f1b52d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=776a548a0b65477325490c779af27c92:f7fe14199e9e2a7df71c5adfdac5ab2e3748c85046a50cac77ae44d01c08220491296dfed16dad253cf3e2e269ec64b01d482771b61acbaa117c9a824f7611c90aa728c96a3509e740b23215e53febf8a932cef831d88e9d9c97113156fb05e0a8b553517ba2b91f65053fa1a2e0ae9ca1cc17fba2d5e75740fc07fcbc350051778a2b48c24aeafd9a919c5a613c88b02717490340cd945a61c46d6ae97dec1975af4c03b538fa15ce49d885c376b55c096fabbe9f408c85161a308e5ed7be96670e5b79244f6d872463259b4d079b69", shop_name: "bux.sk", shop_logo: "https://y1.sk/t/s/130x50/528.jpg", product_price: "17,11 €", product_shipping: "", product_availability: "", 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(){ pmaWidgetInstance654cc4fd4218328905f1b52d.initWidget("654cc4fd4218328905f1b52d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }