var pmaWidgetInstance602d23dcd9685ed2723ff549 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ef7ac0351cf19a53b149641f0dcff5a9:29e974275ebb6458d2f6aa726c25cf05b6ab18f1817a8a64b13b881ee02c8c4132de1b172b3d24b5f3a4e048852f4ce5116afe2f5eea85dd4c8b261e0fc72dd2320a1c11e93d57754fe15dc790f0b519fa66ddfd6aed4a67096bc5b4b38ac7c7c1cbec66fef0ac4c8089634ea272d4261a317febfd2fe709d4adf5e301be654224fbfaf61cb0e1f4e9fb6111c0c26a48e22ff55179fb8a170ad2e8c12219072150e58a6028ac6d6a1158d5ed5c3b2fbe31586b5719d81150f4762be7f25e1331", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "606,35 €", product_shipping: "3,99 €", product_availability: "", 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(){ pmaWidgetInstance602d23dcd9685ed2723ff549.initWidget("602d23dcd9685ed2723ff549"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }