var pmaWidgetInstance6054bdeed9685ed2725cc72d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a236f3e3383815438918bd88402dc9dd:9acc12a3f9fa6d14e24630f00487871df65d2253685e45658531e2b2e6b8719df49018ee583208bc79e739541d1d4863b69fcece8f2eb49ce99269263b58325d0c2d5fea3c56a090d1e6befa78ddc76f4cd2c69cab27191b317ad4931254439d969317e8407e7547ec08a7038ad27bbbd42d5fd1e0b7131f699b8901fca2abf2ada13b4428ac70a15e44443b8b39beb325eb6256d47e71fb645383826dbe18a5cb07ec3fc885420d94c8f180de4ce96e532c9aec907d191983d9f83928423ca6", shop_name: "muziker.sk", shop_logo: "https://y1.sk/t/s/130x50/47997.jpg", product_price: "46,00 €", product_shipping: "1,90 €", 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(){ pmaWidgetInstance6054bdeed9685ed2725cc72d.initWidget("6054bdeed9685ed2725cc72d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }