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