var pmaWidgetInstance63612769ac365ae3747e10ea = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8f05b044ad867f2e07983de57c3c867d:d87ab115c2506181bcbd9606b40b79d9d9c48e21d55a86006564b098981bb4f5c16264d0b0cc646f6d75d6f9d30619f088f3a08674adc5f353aeb99b9024ccfedfaf6563192da819db9705f2aecd672b988a2b27f3e67bc355b2f2872250bfeaba1733d0bceceb2ea052644877067ff64295939c3c1ad60fc6f9fee772d5e09306e9bf11bd7113d8df44f30b50cb3de1553998a019b880d2aa69f51df5438ad6b4f878f723c787965ef4f7298875207dc3d65845699dce6084fcc10cb7b8e815c2fc3409de692a1d3c1fb97d58758294", shop_name: "Supermobily.sk", shop_logo: "https://y1.sk/t/s/130x50/10067.jpg", product_price: "445,00 €", 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(){ pmaWidgetInstance63612769ac365ae3747e10ea.initWidget("63612769ac365ae3747e10ea"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }