var pmaWidgetInstance603cb4abd9685ed2720dc313 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d3970ee1ae038498a7479fd89405eaa1:12debfe8c2f9071de5194b8b4145627cc5da9e13b646e0db2fc90470e6ecf14019bca6cf8d40729233490c37d7ad2c0631fe4bad490741e29dcae54bf3be7d487a7549ba4e1c5fa2aee02aa541d22113a56c8eac0b33123c37e25a825873facfb33151e2845fe6e28fc793c49ea5d95106c1f32f5174dc2f37cb45e6d8348bf9d501a238b5f02e73c2281dac559f500e4129ed39a8ffcfa9087fbf593e9bfd45f6f5420c5f512863cfe71d6fa940e951310bea8d3aa005c6ab4e01ffdaea9e9258be560109cbd7e3ef4ed25a69019831", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "350,90 €", 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(){ pmaWidgetInstance603cb4abd9685ed2720dc313.initWidget("603cb4abd9685ed2720dc313"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }