var pmaWidgetInstance5fce1bc9d9685ed27263b87a = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=67304da25fd5622f9af12a4f41a1df6f:82abac55bd7f643fbace765e5dd803a5d15744163cb43d09da622207deb642bea3655444fc2f3b8d2fef7b47c8819746357b39063421cd0ec352e5d1b2dd853ad51531b8f227fe9a1e7432a760aeddf293911d99220a1c8878e01f06823beea34ed2621b6c4c97f8cce77a2af2cb4c01a842d6ffff5a323925992fcd6e8069749cc0d4001da7369e68c2ff84724a8782c14b9aedfcf64c01ba604513cffb41d1ae9d37a3b5c5b3698e57257575289c1b65a2c23da7e3e58a47f8dbe2f3ac93b2", shop_name: "muziker.sk", shop_logo: "https://y1.sk/t/s/130x50/47997.jpg", product_price: "6,19 €", product_shipping: "1,90 €", 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(){ pmaWidgetInstance5fce1bc9d9685ed27263b87a.initWidget("5fce1bc9d9685ed27263b87a"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }