var pmaWidgetInstance638b44bfac365ae374f5daf9 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6d82f7ab1bc0e1fba52ac0be267ab84d:cc2bb034bbae4d18aa62ec155540c3bb57917d1fd4098057a625cd88cec0f6bcdcf856d581f828790470a784b44f7decccf25fff42a7a722e9e9ed26ebea2a90aeb5b67622a7d787044ec85892d63b8db75bf738bb5ab5539d83652a0005008ff71e1ab3b79860bc85b4fbd9eb5ee6fcba76edad08c42e1cac2376a95433c643cb0d137fa8888be177998a2637d01644e6e9da19de7d563584464351b2d5adcb8f341775ee0533aef65082ae9f38f55823ad7d64a0618bad9e153bacab539d95a60a316480d0a2c2780d63f69ffa006b", shop_name: "arco.sk", shop_logo: "https://y1.sk/t/s/130x50/45797.jpg", product_price: "458,70 €", product_shipping: "2,00 €", 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(){ pmaWidgetInstance638b44bfac365ae374f5daf9.initWidget("638b44bfac365ae374f5daf9"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }