var pmaWidgetInstance603e2b99d9685ed2722f3eb6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=f48f41adf6307bba3ef9f158794837e5:8aa0871b9f97d84373eaa9c31cbddd35f69ed38dd589e70cfb6fb8ddb02936fc71d4166d49e818ca0dbbc31ce700f4caf252d44f91cd99ee86f6842619f3a4c2363d061ea303bff96c99c81a0c62751e8810342ebbdc512d4d4ef4ba4783d4ce32e6ffa9343aa09cf723271d7b50fe42f482aec4b8c75a3748ff2af4dccfceb59519224d43b1c1d0f4cbda8869dac390e572cae81236b0f2e684b6990939a629b3602a22327dcd852641ebbadb563d2408765ce988d00359d4070927c675fa7f", shop_name: "Arada.sk", shop_logo: "https://y1.sk/t/s/130x50/59720.jpg", product_price: "12,23 €", product_shipping: "2,29 €", 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(){ pmaWidgetInstance603e2b99d9685ed2722f3eb6.initWidget("603e2b99d9685ed2722f3eb6"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }