var pmaWidgetInstance6155cc9c0067a2ef591f6fcd = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6b74cab6f9c40666c7cfd32bc3d86b21:78ffbfb519abc2f62b215e9cb7554bfd51b7f29a4666c7c94c774192d9e36732e2a959845007cd23c6e3512bb81ba842bbdf510f671e7469cc238c8e16a34ab9c043d64505238b825df82d64ffe0e165ccc1a0a63c0ed4c81b28689a68c9b1702c25687b74915d62de27bfe1314e5bf79ac72c63d737f9547a82e8cfaa45cfb68f02a27feb5cff53220a56ca4829e33fdc8e9aa1808c0c56ee002b1877eb53e553dab2c4c9f43693fa5c6525240a5620b94c8324518cbb9d56b63b8b4ccb5e61", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "399,29 €", product_shipping: "3,99 €", 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(){ pmaWidgetInstance6155cc9c0067a2ef591f6fcd.initWidget("6155cc9c0067a2ef591f6fcd"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }