var pmaWidgetInstance62fb6ea1524818ceae3ffa1e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=e69c50dd430ce0f01be2d1385ac73afb:fc36147bc1fd412eb1c34491e3ae846fbe3982ed70cfa38f7df8eac090cbc4ab6054a0aa04e7040202beb0e35d54c93306f28e4e563dd6ff1ebdd526359128a30a81bb9002d7dc769cb0ab9ef758ff24adb708e3b6b0f870a740e6f068cc80e8b45e56307ab487e56ac027b5c1bf8f2dad3201f0d6c9f9b8b5e277fc606ec2670f1c2ee280742f932f3abc3c0c9a2df6347132ee132df8f64bac739f256e4535f25bdb6fc18c47107976b65f834bc9d9ece5eecb4fea282432c431f0c0f97fda", shop_name: "svetnapojov.sk", shop_logo: "https://y1.sk/t/s/130x50/4380.jpg", product_price: "44,90 €", product_shipping: "4,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(){ pmaWidgetInstance62fb6ea1524818ceae3ffa1e.initWidget("62fb6ea1524818ceae3ffa1e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }