var pmaWidgetInstance5fcf6896d9685ed27235384c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ac6a3e1a83c2852b7a8a259a2108bcee:81a7f75a9d0d18b76a3b6d39ca81887bd68d006e02a67867cf4edfed2aacef3009b4da58dce179aa4a7bc57506fc3a5740048a1766480791847308c023b525d4cc89ec4118d217a8013f2a0612cc3416175f3e4041a24cebbc0d23f9e42e79642a68fab47fa92745be515210e446bd44fec8a85a5283dca43ae13ed556aec2d3349aeb4d03432d5035db432324ba6d2683325226079baf9d3196fda6d1da799dffb2ffc48b3055b066a6eda09e46f384e073e58bde87a899d8f2ad4e877a476446c3a246bbe9486419e9ba4a8cdabdfd", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "12,08 €", 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(){ pmaWidgetInstance5fcf6896d9685ed27235384c.initWidget("5fcf6896d9685ed27235384c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }