var pmaWidgetInstance633bef51ac365ae374c17828 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=74173ce93c79021374f323be9031c7aa:de053ed09914f1d5067d47d12fd8c72bf3b1fbdfb15e2002c6d6f663c5af2d6c94aeccd93a41e317b9a30c4fd0dda897e22353c25e22ba5b5f3b2d7db5cdf96c4e8c0c0ef5d22ea291ef4567041a7c54fb4c367aa44ed89fa277b7d00a12ff3c295ab3b1ce7b94728fc59c1d7b3167ec92bdd5e4c5f884f117196796bf85690c2a1db97d6b4331fe478eed36775b49fd1c24ce7d9d8689ad4bcc309935a489d1600bf3063f393c88215acd5ea9638f08cc9bdb2889fb2a1986ba90088f30517e5aa6ea641eb8fce117d4e5b15f95150c", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "20,69 €", 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(){ pmaWidgetInstance633bef51ac365ae374c17828.initWidget("633bef51ac365ae374c17828"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }