var pmaWidgetInstance6030b04dd9685ed2723833f3 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=1f943aae4d3ae4e63e26a67d5ae8919d:514f7c80f2e6953f5021ecc69954830236e42ee2ed9ab64a8859c06e38a8727e5d7dcaaab47ae4cb487d47fd6d37a9103e65d3e434c326b19ffcf2a5449258b8384c1e35a40dde9f061a8cd532922269d1cb7448d9bc6e45154aad2f9a56129aff7a77383fa6e13e33f1f91ce85085577976b5f72e07e768f2bd7e25dd457dbd71b5cdf07fe23f5d6b559bd738813510a9b6dba422ae7d9fde30e098a32693490f06f9ba04c69463ac41afc98fda6185b9f2ff789ac5ef64b73c3c8b57949156", shop_name: "inhodinky.sk", shop_logo: "https://y1.sk/t/s/130x50/4102.jpg", product_price: "89,99 €", 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(){ pmaWidgetInstance6030b04dd9685ed2723833f3.initWidget("6030b04dd9685ed2723833f3"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }