var pmaWidgetInstance60886e823975337b9e939710 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=45353158499e934f9b3acfc8fbcb7532:1fa9b28dc82436810d858492a79df20bc71c9850cca33a290fa7891bfb6be3bb2f58e34f82f6d5c88db29feabfd8bcab2e822dc663939b726c0d38d2ca808c9b1c134511e7d4f2592a1bb8e7010e85e8f79c97356bfa1ce53d3c6251938423f4eee9e21cf666808ea8f62c84e7265e8b4f5eb3b26a5da7e04a82a29b739f83c123d69fd7a28c9bfc8426c310cf518545719bbf77021a5a86d601a9b66c5fed2624cc7dec47e4725399fcd374dc5296e6f80932dafed57de9a3f6b694ccb0ff7e", shop_name: "muziker.sk", shop_logo: "https://y1.sk/t/s/130x50/47997.jpg", product_price: "41,40 €", product_shipping: "1,90 €", 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(){ pmaWidgetInstance60886e823975337b9e939710.initWidget("60886e823975337b9e939710"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }