var pmaWidgetInstance5fca6192d9685ed272e729db = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c6c5686eddc2b8865a20cc4d9b755b6d:de8142d60e8100b75e1d29baea70aac296f90e7fe2ca4815dc143b0fa892d09b98747ddaf03c1aa34f9866596f4e774400ec9bcc31da718ff8736dccc92f654b9cbf143def9a21379223e03cedbb5ace365a7433545e135ec017150ced560ef5c5f3ef40395408e0bb7959cb4736622d661ef16d07dd4e15d026c147237a6e90c23848e28d41fb1c36dd83c356448bcd6282216d884e5bf779587558526f8f74efac9330ac9cb944f76f16fb9f6204df180fb8ebfc527e7a28a8d796033da17b", shop_name: "efarby.sk", shop_logo: "https://y1.sk/t/s/130x50/47665.jpg", product_price: "6,35 €", product_shipping: "", product_availability: "", 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(){ pmaWidgetInstance5fca6192d9685ed272e729db.initWidget("5fca6192d9685ed272e729db"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }