var pmaWidgetInstance5fca6192d9685ed272e729db = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b19163ef7f4bcad1d8d5383e9849c611:85e0c8d3793cca908de9852f21bd22a402b7a2a48e93c76d6a48f22d58100f0501457b8882f5773fa91b7b91722b46aca82b9229418be9c439702fe4fedbb6db231f610d7fc5881d9cc15b785689db9a657a82ab112fd74f4a7a86124e56c44d68ed000c416ab630b15f0fdc13e019c6db17fe6f3f299cdb7469061694856d48ec283492b388f38b6144915af357e42f3ecc83dfc7d9b349dc352442c7464ee83345f5b4bdf7d12b09f81a19847f71b855a872d517907395d5f48b74a5c5b311", 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); } }