var pmaWidgetInstance6357cc58ac365ae3746f976d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=dc6fe78f6f805d17a03fe1d84f4e83e3:c4cf9e52690240bb6a35bd9fc9f1631d6cf56f5a24b72c40b77f35901f92ed22c3ee2b4e38a1cf7110d9e1debe8f5b614a8c131328e6bacbb4b9670c7059728ab13bd653320652d58d012703e373b1afd01faf3590e9c2a7bf90aca8da263673c9c7aaee6c46fdc8197d0ba19a102f0a546e5f2456edf5cb0cc6857a0133722decdf21f09671e6c5822ef7da5908698c538fa3ebe10fad626aed375e702e534cf36bb1665fc8ce7ee64d8824610bf4ade81ab8b74da4864f32b4f59ecb0d448021f76acb1a330c72f629904d3c0dbe33", shop_name: "beletry.sk", shop_logo: "https://y1.sk/t/s/130x50/4500.jpg", product_price: "24,90 €", 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(){ pmaWidgetInstance6357cc58ac365ae3746f976d.initWidget("6357cc58ac365ae3746f976d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }