var pmaWidgetInstance603df98dd9685ed272533c92 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=f8487af156985544b3dd0654af235c6b:f8e0b2e19716c0c8c38da17bc00a37efff613c200a1298c2408a104f61a3b04d8ffe9676a3808b7bf349f8f5885c69e3aa47fcd129f6d68b827ce6dcbc57606d799a504741a8ed7455cdc3768d801dd73466e5e6b94a52f649e4f27d9a1750238bf6bf13ced3d23bac1391d71097b39a0597b3f0d2ed866ed84fbb18dd817f985531444a212561972a9bf5fee751b685ea160094a169e896c2c47ee33e9a12bc212de7ba134e360f37f68f94e7dfa7001396aafe0d9999d9736f2621d00a6c31", shop_name: "KAVA.eu", shop_logo: "https://y1.sk/t/s/130x50/59165.jpg", product_price: "25,90 €", product_shipping: "2,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(){ pmaWidgetInstance603df98dd9685ed272533c92.initWidget("603df98dd9685ed272533c92"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }