var pmaWidgetInstance6040a310d9685ed2725883e9 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=463688f814563bcda47df8011ee6f6c4:1c8b21a8e7ed79abdd6de4a772c8cfa652f264e8d42d2e88dbda18efb0412e39bdfbb93af6728b599299e694d638b2ffe364aa29e00c9d9cc98d1b9c5615c0b97a2fd4b570924a6f55aeb43712ae2094d42e47ca10271a7dac376b05f393d86ae9e0e3eed381d5225452a2484c8a5f15adcaa9b1744448dcf5e5c2917000db0e1dd14e8ccc0b2ed89519f98dd723605dd4ec9e389f48a0c3ed7f498c54f941a98ff5be8b02c0160d6cf6a894299b77ef150941b91ff389193c77100d893267246de61759ed9784713fc16b19f5363afc", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "265,00 €", product_shipping: "1,00 €", 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(){ pmaWidgetInstance6040a310d9685ed2725883e9.initWidget("6040a310d9685ed2725883e9"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }