var pmaWidgetInstance63f9de6c4218328905b51868 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=5d74ad0b6f79b1ad06a44ac15bbf9820:fde712d22e121d5778acf24ad46e43afd64f488155c38aaef9f364886caa256dca5b2b746d5ec676171ca92ffa4236f96e3c842938380c5783418ed127943d4219969eab2b7b8590a39e5a1656d02abef04a8463254b838f315df80106f05277bc9e5dc8ad7713fe46c5e6db6b398a90c0937937cb72d29f3b32f15fedb6ec80a4a0f7e5c3f5b3f30cd810985e19665421f7bd730a2a5bca9c5b7f224b1c5887b8a01a3a18bb20e07f1b3549494e6c637fd37f13f3808c40b4607b7ed26455cdc91ac75b25e0f528955bd4ca3a02bcc6", shop_name: "electronic-star.sk", shop_logo: "https://y1.sk/t/s/130x50/44673.jpg", product_price: "203,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(){ pmaWidgetInstance63f9de6c4218328905b51868.initWidget("63f9de6c4218328905b51868"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }