var pmaWidgetInstance603e2ce7d9685ed27232c2ee = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=4b86511d674cba41ac5a3985c106ce9b:850c0c23d4a1ed2aff5e68d28aa25fc70fe14be56783a132db9a61722ab01ab2d4b4bf83b9ab29a1ae9bd45a7b6b4478d368dbe2083ec0bc975d93873f0c416a4544e94148d3052037c62470e588ea328eddbc045ade020be789bdb2e75617c3171037f4d6f03a9cf0e1e15b401c31d95ad305f435a015a9f341301dd99b3b3dc30aa22ad5c6c97c7eef625101f36c3afa68b4e59dc2f7a8a9e4017dc90511e4c69c3b326c346a7be905d92cb0258d9c15d5a0780a225d4b9de17ad47174bfa0", shop_name: "KNIHCENTRUM.sk", shop_logo: "https://y1.sk/t/s/130x50/6810.jpg", product_price: "10,44 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance603e2ce7d9685ed27232c2ee.initWidget("603e2ce7d9685ed27232c2ee"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }