var pmaWidgetInstance6033c4d3d9685ed2720cea92 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=518c51238bd1a7444d77e8393bee6295:fbad47e6cbc6f6ae50f697831354b5664a0ab8637b7f587abe3094ca5bba859a65a47eba1f1d68243da4a5c9cc365384682d76e9cde8e54684eb44d5ba2e9da86837bcb12f6f9fcfd3d5f3d581b17b2a842b28b99763547503a493c31ded1ea3c8d276bdc47d38838b5eeb8e798b8c1075d4da597ca3459d1a7251e32cbe81b066a62b6474ac85bb0bf4962b739f66b9c1b02f04b4659154aa05c85f36d2da12211a83b17f54d41ddd12734dac0952584d4994a67f9b294b9eb3fc538631773a", shop_name: "solik.sk", shop_logo: "https://y1.sk/t/s/130x50/59915.jpg", product_price: "177,99 €", 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(){ pmaWidgetInstance6033c4d3d9685ed2720cea92.initWidget("6033c4d3d9685ed2720cea92"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }