var pmaWidgetInstance641084c142183289051ff11d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=de8e706e7d996c154bb1fe7843e920ee:69b4ae485a187905a981983bd1c560eb9df2a996806d96aaa456b67702d3d281d3097e8da2dcdb179828199338957408c1a7aa91e72b5d89d2921e8513269c53210f4b0600d58c424b82fd238a7afdd80e1a15076ca48e4cfa1555f84549bcaeee21d24238d4a745c761284121fbae33da9eca2c60806bc856b7ebd29df4c4c36480151ac4a8aad16dffc9ff34211f07942056f6e26343c479f56ed7d3056332b1d476ea74e5906a7e076c03e27eb480ab61b3097fad40748e307298a4f8e4ca0800c553e6b2e14e54d9c62e4e60b7d0", shop_name: "GalaxyMarket", shop_logo: "https://y1.sk/t/s/130x50/59525.jpg", product_price: "126,59 €", 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(){ pmaWidgetInstance641084c142183289051ff11d.initWidget("641084c142183289051ff11d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }