var pmaWidgetInstance60ac82b50067a2ef59e7246b = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6cc9d8bf91c67b4bf0d9a7ea524abcac:5d35f558da2a1a9963cbd51a8828e75c29f43f61d79e0319a583d083c5d1da26d556a416d1a296eab73bf627768c2859b27834a5f67839af8205e8d1bf51cb39ba836badf98ea93af481142f0ea5a9e4c2cbd36ca4a51348e78ca5a8a62e246afef1813944a3a96b372a1bb319f683c20d012f580696121213591b211c76d048f5c6d80b583b7bb8f3a3bbbb89351c8d0a3f15e248a0c1151c6bc3d3b71807a8bcdcb874b248441522e7e1d4d9c6107493c32a18c149d15a2882fd687f7e07ec", shop_name: "exkalibr.sk", shop_logo: "https://y1.sk/t/s/130x50/49853.jpg", product_price: "117,19 €", product_shipping: "", 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(){ pmaWidgetInstance60ac82b50067a2ef59e7246b.initWidget("60ac82b50067a2ef59e7246b"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }