var pmaWidgetInstance614b5f590067a2ef59b8b01b = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=e47039884d5ab8b6a91015e72e371240:64c0bea5b068805ac9f412629ecd24850a3a9ce868e24684688526230a0ae4a6b9169081542ec7cb32a680e855043acf826dc5721f9f915bb804dfee5392c434ab578fdcccbf7d81fcc12870bd57be6a9f7e7e3f179bf05b3827b6c784e2c538fb226e618a326925ffa2b1096778b10d6471c46a8679f90b923618f272f3b25d239b69c41a22df2611a4a2be0c183c97e266749cbdbbe9e516989aae4b5d83ab3c65416335c55804bcd2e4f8bc608d042ce13b932158addd3801a1fe16c3cb91c9e4c094893173fbef6ac6bfd4c4d16c", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "350,90 €", product_shipping: "", product_availability: "Skladom", 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(){ pmaWidgetInstance614b5f590067a2ef59b8b01b.initWidget("614b5f590067a2ef59b8b01b"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }