var pmaWidgetInstance607eddccd9685ed272db42db = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7d397a7bb1a417e428a6731f7a8099ba:abd8a8e855fe28c1efe25033cf5e31fcc83aa96363f19e6e76746468d4133454d39131bf5b556f5b07647ca9dd9906140e00a3958b912a7d7f08cd31767bd765316768fe359940abf1c6e6cc865f94f3f3f3e7a02c29acf3d424ba6b8c44e60564c463463f8cac1bf410bca47aead838b76acdc48bd60cf2f253dfa21436869f679281aeda51554957c4d0971a652d8b4735b9dcb75b25472bd5621e70cc520f6fded853649446f898e83b25fc52bf653f5c87658c14e8dc5b69e8597807c16f3a3dbfcca3fc488b8e46db758341d38f", shop_name: "MALL.SK", shop_logo: "https://y1.sk/t/s/130x50/135.jpg", product_price: "258,20 €", product_shipping: "15,00 €", 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(){ pmaWidgetInstance607eddccd9685ed272db42db.initWidget("607eddccd9685ed272db42db"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }