var pmaWidgetInstance64ae74e4421832890530edca = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0d3d53ac6eaee25a7abba7da38481d04:c9f2fb9d35f8330b57467abf2bf5c86330aa7a16273b4efe8763465a0e76538fbe46e6d334d9e121abb552a97972b928b3a2aa1b3b909868d6efe9962fb1b10bceda94cf7932f9247647382ebfd1d2aff1142497b5c2d9989131e6019c552b653410dca4d913f5a89fdb90710915c47ca3f715f8dede65d860e0d7a26d07e820f3b58aeaaef031a1a859071794deb446db070e04a77487f3e1b4b4ede1bc4861a964c3b50ebea0877afdcac2eee436cc0e0a7b1c8a1dd0a0489b25f5e1e02b11666d11dd3a0d5bf33b3cce2d405c9141", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "200,11 €", 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); } }