var pmaWidgetInstance6022ca5ad9685ed2721126b4 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8d71c5ddb52f3800dcc0e2046a243714:eee099ef0447fc10b37b4414b6cb95f88d23901b4f4fa356c116344ce1e60bcbaf40230356db5603e9d669eedf7889619f232f4ae654a0e0a4d9c763041b194cc2ca5fbb5a8d3499d7cc593baa6cc03bda5ff809cdb0bbf77239f4a6706a8633dfc585c9c9352c0db8c373fd6b73e94499c9352f21b6b7a4dbb24adfdeb9a65210cb32d24864cc62a270e5d95e2be94c18d700ec13e66142ea71a7146a69a83505f4716f1a4146f2b9dd9e2bc35645f3fa90233e12532603b7a254d581fdba7ce8dee8153fe1db139eaeec37902106d9", shop_name: "madmat.sk", shop_logo: "https://y1.sk/t/s/130x50/903.jpg", product_price: "170,95 €", 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(){ pmaWidgetInstance6022ca5ad9685ed2721126b4.initWidget("6022ca5ad9685ed2721126b4"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }