var pmaWidgetInstance5fc0d5d4d9685ed27295c482 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=094f5740267b542d5e48f0c2a4d8c445:c28f0b1719f94aa2bb87756b58dcef1a938a94261e6fd08831965df926f357364dbbad345789646aba5c59e423992a7c80d25195f0f1cf36248847cf5688029832a659b1123658520c12246a1afccc39d1dec8ed337bcebed1ae2971fad58679e1a33e670b221f9ce64d0034a88f43a85976e8085b67565f93a553be93f515de3fd8d44a74ebf54ba0b47ecc2e6988b793659542f11e173687534fd45c924e3c8ce106b6442b2975c073d56d3e7f105488bd87f66ee739414da56299c6bd4cdc50401138fa51f1c55d0efc5a42946d90", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "87,01 €", 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(){ pmaWidgetInstance5fc0d5d4d9685ed27295c482.initWidget("5fc0d5d4d9685ed27295c482"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }