var pmaWidgetInstance6022ca5ad9685ed2721126b4 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=19e84874deec905343e789ee50af30cf:ec08b97b15c0c819cf17c3d01a1a45f026a71e23b348017c6af4557e702ee9f5a60ac4166b2236861c5fef5db6ff9ab592f87c403443698685b26784b8c742467ac59ff17173fc770b5171fa1eb97b9b28a315322f6f6df25b4cb832da4c3459eecf5332680d83cfbc821d5bf7489548d2bc80f1a4cbc016d91df9deb92b665524ab8c1e52a1fadb2f434c90899d14984d56d322b31b905ba6164f62b373af40b31f9fa5b388788d6ae1642acd3fc1a3a708d76cf62250b395d0dc766fd9fbbe6ec4f7ce0a2065461c2a5d5e884a9b70", shop_name: "madmat.sk", shop_logo: "https://y1.sk/t/s/130x50/903.jpg", product_price: "179,95 €", 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(){ pmaWidgetInstance6022ca5ad9685ed2721126b4.initWidget("6022ca5ad9685ed2721126b4"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }