var pmaWidgetInstance5fd0caafd9685ed272c07e36 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=e451da3f36c1c0141c7fbdc7dde45455:abf0eef55a52127ab47322632e519490ddc07a77d93d32b82ab8f8dceeed1a44cc33577f0e8cd7584e9363050b43c8f0202b6ce0bc596942ccd9fc52e61d70fe1d301255762fcafc380bb0ee28ee8f90e628e5ab7398ecb15dedd025f8f5ed5031e75f0a1ca224c0c7ea4ebf34f929fa2cd55b054a435e1aaf30aee824250c9c53e54af5e2c3e54a61ff419c855e05eb6b2676315013a50f8ea659b5543b42b89c350393fe02d17f1789f4eb40ffc6d63675a8079eb30c2ff2ce7f79fb3fce6d", shop_name: "Šimek.eu", shop_logo: "https://y1.sk/t/s/130x50/58202.jpg", product_price: "288,09 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance5fd0caafd9685ed272c07e36.initWidget("5fd0caafd9685ed272c07e36"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }