var pmaWidgetInstance5fcf701fd9685ed2723b5923 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=91a8b7d5553fb7cdf7b47b1b3e809c81:f95ef4efaef1bcc708099b21f3acaac086f448b1ed0c4d323597b6b9f0310920ab737096fba3e039e90832ed520dd21d4b5f3a956ea886ee0c438154cf7db94b967642a017fe0b52345808a3cccc6fabeac08cf0610511be8755ccca1c75c16c6890ae9c98d7c9f3f42adf2aebc66101162cf92747e28b98b6dd494695183903a42166d2ded492cc26cc61914d560e1d1b112d31040ed8f722a44e5c16c4625a8330a00bc59a956cfcb03a9fe65f3e257abba2e6480f97215c19b07fd6af78b5", shop_name: "SADAJ.sk", shop_logo: "https://y1.sk/t/s/130x50/59800.jpg", product_price: "601,66 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance5fcf701fd9685ed2723b5923.initWidget("5fcf701fd9685ed2723b5923"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }