var pmaWidgetInstance60f15a4d0067a2ef5968a3a1 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2b68eacc9552414b739cc4a3a2f2f8b2:3dae1185e06dee5454038b8dfe3ce3430ff8d1f8d248bad9fc0d88a641ed06928e826a463ae4990ceaf9c7eac31c57b1a74cea0b6adbf29cbdc1021b1793d291aef881c9436213fa8b0a87c93e5639acc13590a1e175ffb4a48f4e6eaf1c9e633b94cb17f9f0915eb7671c269be2fce53133ff65096bc4a08d43c5938e9efaf292ba4aa48532626ba6835237e616d9c5ddf6e0cf47cb2ac4c0b12360bb52ffe41a2a55c773240e063efcc0152e9aac96169d8aae5d324c51a27b8f0f32c460b0", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "855,45 €", product_shipping: "3,99 €", 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(){ pmaWidgetInstance60f15a4d0067a2ef5968a3a1.initWidget("60f15a4d0067a2ef5968a3a1"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }