var pmaWidgetInstance65a00ed3ae16db3466544698 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ada79a574ed021a605fadab9ae9450cb:e5ce8572c271741d9d8ac8498aceb35d35283fecf5014592ee88fe81d387d73c5288215ac8853168a83f46225ebf73a4c24b8c3afc62c0690154c143022afd31cd9fc639200666c3cffdbe6653da960704b75fe872122d85a5f47ce2ea513f8206161b7b47f279fe9d811cd3bce2eea2517f44956ddb8b6b1e4d73a51b8e2c3019e3abad31d0b683a408a6fd5874d87daef6575f420b0ef3f471bf95e9e14a584850b23f8ae315be487973cdcd633048fe77d05a7d358e04409689c09cc562623f1d92d4df9cce37742ecfe5135c7eab", shop_name: "Lemitas", shop_logo: "https://y1.sk/t/s/130x50/59490.jpg", product_price: "2,06 €", product_shipping: "3,60 €", 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(){ pmaWidgetInstance65a00ed3ae16db3466544698.initWidget("65a00ed3ae16db3466544698"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }