var pmaWidgetInstance5fcdf333d9685ed2721b8b80 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b2a8e25e0a30e83eed7624f9cb78b10c:dfc7d846af881b1c5127854e68bd05b7c27b6a3b33eb60d8976e0b7ecbbee70c7e8967ac92a47a550cad32baa41dbb91647735c4b0134ae08994498355a73e76e2e7136ab67805df3c7b84e3421b79a93451c8216def124c9897b3dcad91a0803f60bbac97c2ffb965d07989df6622fba1be15dcd03a9954d63e34c2fdd575eed6620e80785009f7ebe9c05f1460388771d54ab2284864cdf00042666d61a2d033f75fe32ff65ee420537df7d47acabf9ecd3b36d8107a02b38c3bccb26ae78c", shop_name: "DAMO-Slovakia", shop_logo: "https://y1.sk/t/s/130x50/1493.jpg", product_price: "40,90 €", product_shipping: "3,00 €", 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(){ pmaWidgetInstance5fcdf333d9685ed2721b8b80.initWidget("5fcdf333d9685ed2721b8b80"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }