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