var pmaWidgetInstance659bbfefae16db3466193682 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=827450a8c82631ae5adaab81b3ec2319:740d26cdd2f2d3d99b8cb8a448d776ed62ba5123388c4a82eb6c778f92540b81f3e6fcb7dc72f2dd170029c72b8b72135438bbb6e135cf13936db6e127b776e3bd8a022bc31987cc11e62a5f420ffa47155ffd99f5c4765c0ce1d0a9da337d0ad9c86da4c89b6dc79f395af9288d6ebf74d93eb2264afad7a73c186c839dfa0886ea42561ea6cea3abbc077bec7a262d0f0e26657c7fe2a2fd31a24e046c5b4a567450482955899aa4d6cf3dab0efe43f272cf4a66868cd5922cac33e2cb98b5", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "926,78 €", product_shipping: "3,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(){ pmaWidgetInstance659bbfefae16db3466193682.initWidget("659bbfefae16db3466193682"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }