var pmaWidgetInstance650d357142183289050921f8 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=93e488be2a31451a6bc0a56627973eaa:4f20dfa40536e8eb3ae76f7678695fbd9f52a5dd3b60079d064350473b5427847f8109672bfc30fc192051d8aa349d7b24a34583bb2de435ead5db20fa08f91eca28424bbdc65fd2d19aa950a0a8446437aa122435edb9ee0fc42abcc4b9d084c56f0b9f5528f5c6bc32ca3afb95d6ffb21e3b097b5053b0a61596c9ed1553c6fd85af0e91adb87ebd4d069fc863beaa5a901e128d04a6cd1816098c057c42c52809ee673942c2556cdc76bd041337c338fab1a03a496c7e2375bc5f3608dedda3809787c851fcb80c3bc0d0629b1ddb", shop_name: "svetnapojov.sk", shop_logo: "https://y1.sk/t/s/130x50/4380.jpg", product_price: "14,50 €", product_shipping: "4,90 €", 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(){ pmaWidgetInstance650d357142183289050921f8.initWidget("650d357142183289050921f8"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }