var pmaWidgetInstance60c219580067a2ef594f8e3a = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0037d495dc5e2b29e2724146500ba3ab:1f7d63a1344785f14496bde7773edc1b6b6d97e8a4a5d77b835cc69ece8a18d0e9d0eb77952f2da121cf8f8181832a3e9c40f20a7962f6f81421370f9500ca5431424e3ce55a0a5ef2905b40e468f0c8c9e322f0441e1e2f26247303ac45fe7668d219e928ac0159e93dbd41aaaaea564466faf2a0f303fb008d6422a97d0972c8586f50292c3f64f30084ef719a78f5a62f38e0504748371a57109bc7670dba0010f943dc2350f3a9463f9619d73fa940a409f2b88105c5387243a10101e39c58157e0e06f85833cd0dfcc44c089d09", shop_name: "andreashop.sk", shop_logo: "https://y1.sk/t/s/130x50/530.jpg", product_price: "898,99 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance60c219580067a2ef594f8e3a.initWidget("60c219580067a2ef594f8e3a"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }