var pmaWidgetInstance5fc0d5d4d9685ed27295c482 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=317e29eb2b4ee5700cad3212b5a609a8:16d4177b255c78ef54b3f73e20bc7a62f95b1f9c27e62f1574119461f5f23781e522530524ca15d85d05af551c9cfa4dd5a0880000bef3aa7a1de099ec91ae990fc10bbf4f02d484c56016b05d9b7ec8062174a4adbb0cd1a7d0493e565853eabbf6ef94daa7535d665e43bfec57e7933f99a4a9f3825fa99815b83161d1b1832e7238cf22ad95255c126ef3ccd1280b705ddb2fbb716ae88e429d79252b0c3a8443e1f6412ba000850903da0265c0b9eba69da97b47f736fbb9ca475f43779f", shop_name: "GalaxyMarket", shop_logo: "https://y1.sk/t/s/130x50/59525.jpg", product_price: "82,83 €", product_shipping: "3,50 €", 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(){ pmaWidgetInstance5fc0d5d4d9685ed27295c482.initWidget("5fc0d5d4d9685ed27295c482"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }