var pmaWidgetInstance652397ea4218328905785f8a = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=05a76cb824e5d6228ac24ca084f3e331:1c4441c0495d020e725913d02ff7d8a68f761e2d68b3a6a9a303fe447314c096dc9bb9b55928d2b6d8f92a1143a70a703aa1c704c5f52f36590bbff65e19f59ba936507ae8bf539c44af6d0694f01c8c069ab2439b216140f0267b2a52bee41b729843095f1eb2be377b6d38c10498b6123f1473e13463a1a2d851eba0a082e4af2af6d3b1e7948cd24aae8c96888fab1a3a026bc423a7d585516f6a3a1df1b4b424db90d45bce96d03b97e2824115ab914a6d2214a5f0aa71aa398b8517985420de487f82a9c449e8e69d2e628f9229", shop_name: "bux.sk", shop_logo: "https://y1.sk/t/s/130x50/528.jpg", product_price: "11,17 €", product_shipping: "", 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(){ pmaWidgetInstance652397ea4218328905785f8a.initWidget("652397ea4218328905785f8a"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }