var pmaWidgetInstance6040c670d9685ed272e93de8 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0530fad3bf930450739a800181cdb10f:a8545500ec7f377cd545a04293e4a27c6492dd4ced047e1fc10fdc6d69d8557461ec74eed00c15782eef56588b0939938e651276bbfd3ddb39b2f91f4c334f1faa715e01ca696132757f014b26a7a1d12cf1fe4fda525ed25df3e5ce2f0bf8ac1de7493048d07f10ac79c5a9a36b098f3c836a22bab5aaf53d5dcb8587643cd54e9fb4f36586e01d5a564d4f0eede82d6dbff621ad9ed6188cafa41c770514689f117cf64dd34f3f42b38b2c1f4f2af054b06688e5f49d66eadf8ad778de9738", shop_name: "zahradnyeshop.sk/", shop_logo: "https://y1.sk/t/s/130x50/59055.jpg", product_price: "45,68 €", product_shipping: "", 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(){ pmaWidgetInstance6040c670d9685ed272e93de8.initWidget("6040c670d9685ed272e93de8"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }