var pmaWidgetInstance5fc0c3d9d9685ed272779758 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2f1cc979d1d6d1dc1fc5cf703ecbe8bf:10816893f9b01ab21879146ed6ade1ee603881d4850e8d943e433bae590318262371549a26f1291c6d1f79b00c7dd018ff565ed36581e8289be61a82a568fb69409bb008ee92b53f710139eeaa1a15383cad97eb333df7c684dfabaf6b2bd2ae32975d18ce181a1c0dade77627f8b6994bf85f97a94145fb72616b819dcccc4426886ae78dcb9f110c0d1c74ec61bfb977489c5abf74fb8bdb89748da669552aea20ebc139eba0e74eb452386fa9a589da87c9761fc8c0e7e58530a426d517cc", shop_name: "GalaxyMarket", shop_logo: "https://y1.sk/t/s/130x50/59525.jpg", product_price: "13,98 €", product_shipping: "3,50 €", 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(){ pmaWidgetInstance5fc0c3d9d9685ed272779758.initWidget("5fc0c3d9d9685ed272779758"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }