var pmaWidgetInstance615d994d0067a2ef598a3dee = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a0a04e747a245db057b06d2cc22bfaab:34f622a59c55dfac6ac9cff299d7748064b45fd3667be46d3b5c242140961750eeed382ac33cdfad41bd3896bde3ac734a1565c4e074f2819cb1eebcacc7e518fdeb4090faaf72c7f53685356332359a1ec27bb67a006fab5e699c28a4f11ce15c1ec9b934c6345a2cb867d8746cbc93846c96bc10d2b647b431f21a42a0157a88d2c98c5e1b49d5b61406ffe2a120fd26d3fff2a8f0fec7ea19405d99b05eb023e7e5a189b2e89ca71e3a5692b9223c33214ef4b4f7db85afcccb3cbf0771ba0a8efe0b9492308023347d13c86307ef", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "727,90 €", 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(){ pmaWidgetInstance615d994d0067a2ef598a3dee.initWidget("615d994d0067a2ef598a3dee"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }