var pmaWidgetInstance650d354e4218328905085f67 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=51cc8000615e4cc2fd111fba66841e33:555cba6cde5b3a5a0fc1bc6308a626fef01b4713c2a390f30bf2810e207c74f2811db38cbb0e6520fa21e53d7350064bf082ff414235041626f71c518c132acc85d7b42608be6060f6fbdaee035052fa3cfa340644bb2616fad864c69bc26fd511289e5e22020c419e7f7e79c4bd0bbe19a577df43617d846ab3996e4484bc7fc9be8d8d7b8ef5ad6df0c9f10c7aa34610b65e8d076b5a83f0002583d2fc3e73551fcd09cfd53affed0c738d40891538abab461cf7f7698575ca2868c2d68a4555af5f3d7791fa7daf077b6599c39508", shop_name: "svetnapojov.sk", shop_logo: "https://y1.sk/t/s/130x50/4380.jpg", product_price: "78,50 €", 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(){ pmaWidgetInstance650d354e4218328905085f67.initWidget("650d354e4218328905085f67"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }