var pmaWidgetInstance5fc8eaf4d9685ed2720b3709 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a124dddd87c99f31f6ab8c0dc98b088b:09ee6ff7d9cd1cec635cd564734bc7bda124a5d7ea559c2bb13a1dae1615b092a93aae0ca12b647ea750a23734133a537d690cd5ef5ffd71b19ae6a59f0c2007b7296d293a2404334c549964d04edd8c1dd5420585d0cf07275895de684ae070f34a5542e7b0f6f04b7a8afb374ae6fd60b530cd11853abfbdb4e41a95d52312b8b50f88027da80b5d12c149d38210cc6d789f084cf3ec4e10beea85b432753f02a6712feea33ec311b63014a04bf3177aa1626d747e4f1eec37c637ea32998a43dfb066a8fc162d4d0e46603a12015f", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "35,97 €", product_shipping: "1,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(){ pmaWidgetInstance5fc8eaf4d9685ed2720b3709.initWidget("5fc8eaf4d9685ed2720b3709"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }