var pmaWidgetInstance64ae74e4421832890530edca = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7fb22c894fd1036ca8c7410f691c5a0f:15254ceb6320f46ce3f92209e501d2aa7fe066a6429819ee1a867bcf5d264838400ad4d22515db7ac48259e4facf80ce0e894042a509b9dc8aa9ab4e9bb96c9b9a93666619399989d1f9cb824f2854994eb3370d16ca7cbd389c4b62c5e43a784357890eae8823033f3956b902c51df54220ab0cd3040f0ebbcc31e364d3d23aa9a0199d22e44949e773e827691350305aa1112fd296e6a678bfc7e0e4f3660603fb88b13060c05952fb4148632d1c670176d2a4a11c049520e706a3e808474b7f3c4cf354f894b4338b3d726a649f8f", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "204,60 €", product_shipping: "4,40 €", 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(){ pmaWidgetInstance64ae74e4421832890530edca.initWidget("64ae74e4421832890530edca"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }