var pmaWidgetInstance603e4810d9685ed272721431 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=5ec9b4f34e8c59ba183e8357e4940483:53b9c7c241c7a7fdb0cefb45a594122dce3040fcfdc6fadbe4ce8365ca6aac9d9984a6fb803f0280196c6f3b6af0410955151853e7d03d05c2c85b345dabef582d43d3f8cc7b4d582af6e8e76a583f55b5ecc402b1231570737801baa43999c7e0fc064bede4561d06154ef63f786c3a49ace945c5904c7a842134467ebc515bf0dead20822076f6ff9981938c6a86af6e1eaf0674ccd937253dc9231d65c21cbe03653dc5212d73b52e423a41c6ae0ad87ae11533cca9329f3edaeed3df8005", shop_name: "knihyprekazdeho.sk", shop_logo: "https://y1.sk/t/s/130x50/56613.jpg", product_price: "2,99 €", product_shipping: "1,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(){ pmaWidgetInstance603e4810d9685ed272721431.initWidget("603e4810d9685ed272721431"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }