var pmaWidgetInstance603e07cbd9685ed272a72b73 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3af9bca1cbd6510bea86d0025c89a7ce:d0b6f8f2b692a9c7b9dab5f643f672769bf01061e33d95ea88e2f07801cdabc207f37b5ebca037838e1fc646fa8f64e3d79eca8aa96036397baf79132f1b63f6ce901b565f0807388ea97ca4e8e76368bb6ab9c1bfe45d446ecd7217f59807f4aa6c649e38d606fa7377501d6745102fabc98c9e0debb00d8a5333ca4c644a05c2e5056967d2c043b43980a10c20688d2bd82979f110a2943ec70c0880c5980d117dd321db23b90d6fd10dc9975fc4527aa1af9e769d7f2c91aa7db5b80a4471", shop_name: "Arada.sk", shop_logo: "https://y1.sk/t/s/130x50/59720.jpg", product_price: "17,43 €", product_shipping: "2,29 €", 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(){ pmaWidgetInstance603e07cbd9685ed272a72b73.initWidget("603e07cbd9685ed272a72b73"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }