var pmaWidgetInstance62fa25c1524818ceae9d0dd3 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0462f45290433cbb52447744a2c448db:2523b227e0a570c5cb7b74f1d297ef28868685dc9beb1ff82fa46f37b3e195b6fb6bfcb0da7264a984b99b17b536611acdcd95a5eb3be7d871a6f1fec5c6383ea082ffcba9f21d7f13a0fac848c51e2a4d32a0862fec97aa1bd1a0cb45a9f2867a676ad03f9403278bf71ccc8f6547f83ca89ccc066259362330935414878f1579549c4a809612aa765563630e591eb118ba7d416d95d5f8e8d3f24362b9f39b084ddb96fa3367eed4bdb835d4844e2084e3f0c207f43f478518c58c5dc81049", shop_name: "svetnapojov.sk", shop_logo: "https://y1.sk/t/s/130x50/4380.jpg", product_price: "15,20 €", product_shipping: "4,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(){ pmaWidgetInstance62fa25c1524818ceae9d0dd3.initWidget("62fa25c1524818ceae9d0dd3"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }