var pmaWidgetInstance616033e40067a2ef599d44e5 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b6d1389f6a40f032afe50c5c15f1eed4:4166f94eb7412331898e3691a045e370c0ac4444b434da89573948db5a8b65800d4c21950ddce67c97f4964d5d34f0b3fd1128361f82379c4f1bf2ee2b7eaa331623ba6ee9bbc99ec0402f06a0faa5aa34ebb3fb69797c52aac50cda384899d24925fe565d73d407d5a5ed5843e93eacda1196a0f422d5dd5803ac4d5d2c2c3bd22fba4b21401fc3cfa54329ff88cd3e850d02e2322b9fcdcd704a50e678a6e47f2a91cd6fae4dcc6f9cdda1f8ce5a34f9ba5930afb1238b2ff2bb22b0161836", shop_name: "MALL.SK", shop_logo: "https://y1.sk/t/s/130x50/135.jpg", product_price: "73,90 €", product_shipping: "3,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(){ pmaWidgetInstance616033e40067a2ef599d44e5.initWidget("616033e40067a2ef599d44e5"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }