var pmaWidgetInstance601133ddd9685ed272bf5733 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2354d9f51b30a01f7918aed928cf8ec7:483487ccf1006cf5de810a12d6160eca037fb379f1f42aee2381d1f30054562c40612df5814f7074b1a1c549a4a7519190cf5499580b8d8f5ff39aa0a0a4479bf4b429880f4658374ddc7146352fb5e0bf6aea23f7f149c7d24e5b1e7d54265680d4dad6742e9beebe8d2f683a8a78e24bb4707614518125e6de6a2f43a6ecb2f8c2925ab0a8bdd6b8efc092a0d47dcad3ffecf4fb3dbd88f6d01d17dacf4d13c68e68091700c9de7ec188696fbe20b67219545cf8b2325debc65f79f1a12697", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "109,99 €", product_shipping: "3,99 €", 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(){ pmaWidgetInstance601133ddd9685ed272bf5733.initWidget("601133ddd9685ed272bf5733"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }