var pmaWidgetInstance60128011d9685ed272bc2fd4 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a4f2cd80031cb039df60f1dc4c1b896a:553202f8fc882c49385d8b87e1e3fe29fc9742a8e5ee1863c9affa990f183169dd9d412d2b7d6c3cc633528e3bc2e14206587fbf87bfe631560e5920bd215b3b6abc1bd083332301bc57df012d4e777b0d2d838f69ce98b96edc4bea971332532eefa90e6e5750726e5e442ae17bc3d74afc5ca22541afadf2df7d04f1c916ccbfb1703f94ada721cb6f3fe584f06a4e45a26e29a5e396902f314bb26df1cc6b525f9b1528410bc63c99dd9355b8a0bf51ff67b0488e88cb9ab7cbd71acad5ed5760f98931e3417fe59cdde836ed59ce", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "10,11 €", product_shipping: "1,99 €", product_availability: "", 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(){ pmaWidgetInstance60128011d9685ed272bc2fd4.initWidget("60128011d9685ed272bc2fd4"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }