var pmaWidgetInstance63441d63ac365ae374fb0a6b = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0128efb903521e90431ba0842689d5c0:cda09e3694bb4abbb920b10b769c3592271756d0a359e1f960b223a5019ae1fc63d97e2f0a5905cd5086b02136dfd4913028d973a6fbbd28bf2b87f9c49b204e112397bb9b39bef7397a752028f913dddf5a758d95a0d9e96047784dd196a585d390c69708db80451757fadf215f54b8217b76ed07df9e1dccf9494fed538eaa4665629bbb707a5c57a908d8c324c2c13a40d0358e93dea63d35e57286b3388a502c1f99901956c4d53d3a4af4ddca807208867e6de9e07eb207f2818a2b40f5a7f64beac261847c68b3a956dd8a112a", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "742,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(){ pmaWidgetInstance63441d63ac365ae374fb0a6b.initWidget("63441d63ac365ae374fb0a6b"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }