var pmaWidgetInstance6051d47cd9685ed272ad97c2 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=57a8f4d26c3107b4b57dbdb1fdbc8b94:3a92e1fd6b30a11d636b7733db459d016ab81f056b53d7d5e261e38ab454c7c28c03676fb6a5aa3c3bf2915be9eee7400220720b313e6854d52b80223416ec3870549403c0fac7418020cce0c0525abefc0d14726019642287cb64a992a52667817589a64d8a79a4752aa04ed53fac2ef005767b51688a994637a7785f27556a365a4bbd06a610c3b0aa8e90ca806db921844d57173d32b8d3cc594f55b0096f308b6f169659069eb1328ecb25a66d1be220b410920e8fa6001ce1b85585d24f", shop_name: "pneunaj.com", shop_logo: "https://y1.sk/t/s/130x50/52071.jpg", product_price: "106,45 €", product_shipping: "", 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(){ pmaWidgetInstance6051d47cd9685ed272ad97c2.initWidget("6051d47cd9685ed272ad97c2"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }