var pmaWidgetInstance60408dffd9685ed272d8f526 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0bc9bcc894849218823f5c1765b448ed:53b6511127e5ef641e0a46c259b57611949721c4919b3b6461ef61b37d66606af95426a497b2ca41109db042d764191989fa1838731face92b02de6412cc1263735f4e01bf14310d105f7c55c83760b6fbe4f28796a244ca7dae28f05e4c4e2105997f855efd55d5ef1d91a27bbda60279e305eebb4d14ea617853fe23904eaaeff2dc655e8bdd49176b70edea2d69eb2b5ef35b30d4da41d9fd5974d76c1ac137a07889a6014edcb8718a3886d6149716712726a8c73dc9becc08dc5ee2b1616c1497ad55754c0df2c0c690836461e5", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "496,99 €", product_shipping: "0,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(){ pmaWidgetInstance60408dffd9685ed272d8f526.initWidget("60408dffd9685ed272d8f526"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }