var pmaWidgetInstance5fcdf8c1d9685ed2721ee8c6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=51b876df42e4d054912335c93a9d7929:62bc0667d576c4f25cf67452a35617158dce826b4c3b32f4597f1f07253e9ae3b1050c2e7a6352430430e57119c489b5e5f7a95c942ffad455e86093217370758d5fbb652637f060b3a8d061139ccc62bfc4123a97cd4c4b9ecc4b77e941b4c14595a561b16380f36070cc23e9b5953dd2f1aa420d5f16f68ea772320de8ad022f3b1a9c5b787a33abcebeea02b5e484e65999b50f630a17094b0abd16c33ebbdf6aadca70b4b6ad956e3cfc7e20b72610d124b4804472839808af464c0a176b44318dac82a1b962976282730df474a2", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "68,96 €", product_shipping: "1,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(){ pmaWidgetInstance5fcdf8c1d9685ed2721ee8c6.initWidget("5fcdf8c1d9685ed2721ee8c6"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }