var pmaWidgetInstance5fca6192d9685ed272e729db = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=be91b3080de5601a556b6738f14aa6cf:00cfb69903f5c27cc9a53a73e3a70dde17f17a4369af41a5e4defba774cd19130ba3441ff76085dc85a951847b10dcac27f138a1d2cb7215cffeb585e5727d41df5e5667e208b8a4ccf22b99412e028dc5c82ebd58f35ef14e4024896d1dace11379ac9dc67f2057d0381bc38b9ed909f58e90e5626dacc1c65196b678f3791852d564c0328d877cd49bb47465b16fe48a53b0a99d4621d7ee5327d3faf1c42441109117d3ef371f7c6cf1912763a41f3c9a09c5360b35e4f8f73e061e48bbef", shop_name: "efarby.sk", shop_logo: "https://y1.sk/t/s/130x50/47665.jpg", product_price: "5,19 €", 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); } }