var pmaWidgetInstance63e4f3dc42183289055db4e4 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=fc8d2b5c5c5211449662bc9ce628a7a7:b051638ad1132c29a6b68cb1950c9fe1fd5f2c9cc8224d8c4b290176468120d84e6e09def4141b0dbe7c4b65c84f5ab964d75aebd5193f16452fd80afec5ddb3f014db1f2e39bfd166afe8de3ce42cd074a3377c5f61f8be4d6abc754f0212a043665919df8014f4c2d7c39c24321bde7c5fd1c22624c5df75fd08da28086d960aeff789ab4ba54e916188cb2c31bf89ca1ea1c6e4924e9ddcdd95d7ec37590a81b42800ec9a83be7df2164456bc2ce4af615df345750b4bbdbda8bcbc27bc1e711c493720d1de1de102a7a330d956e5", shop_name: "electronic-star.sk", shop_logo: "https://y1.sk/t/s/130x50/44673.jpg", product_price: "273,90 €", product_shipping: "2,99 €", 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(){ pmaWidgetInstance63e4f3dc42183289055db4e4.initWidget("63e4f3dc42183289055db4e4"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }