var pmaWidgetInstance5fcf6896d9685ed27235384c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c88976333b8e93eadb844cf3481f3912:3be955987bc5c72d9beb9f5a8e6c1e03bdec973a9443c7bc358248504ca158dfc33632324ae43eb154a1074b48fe795238114d5d3b92cf19f361c3fb01e7203b90c364adf7a504448ccbeedb0f5800263b2a8670ea4143a1449013f2786e7d34ab09f8b195b91cec460de3652e41a9c2cf2d92e7d129d16eaf8810c611470c8ae68a27a6911c549f489d7344eca98635610182da0d3917c5fd3389c5e58732eec23cd2524894eb4f2e6597a13323442004d06631eaaaadd2427932366144a833b4954235bbff2484735447680b12b264", 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); } }