var pmaWidgetInstance5fcf6637d9685ed27233a851 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2bcb6435aeffb729c7c1e5acf1613aa0:79c5da9c0204ef6c9ceb22589cd278713baf87b4825e15a4f9792f4320e847a0d1236a58e6f53afd9d4347d2f8f88710cca9cc8340662ba5965a3a84002fe8841fd0b6d80b016fd5f74030b74e6c19ae46c8ea03ebc91269a20e4489e5cd9b2e4ffad441a2a1a46bc74267c7d4f99e5bfb411051afac2decba755fe6ff5fb49985d5b32f5b4db838ed97458ce81fce50ccdf22b4d6bed03aa7801d9c08bcd0ce2671c58bc1f463abacfea6fab24d2e4ca20108108632bf1b7a9bf23b91f48de5", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "70,19 €", product_shipping: "2,99 €", 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(){ pmaWidgetInstance5fcf6637d9685ed27233a851.initWidget("5fcf6637d9685ed27233a851"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }