var pmaWidgetInstance6357da6aac365ae374bb20e7 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b48e847cfb0d4179ac779c76bac9b77d:08ffcd602b0500fdb5c32728ee59d36a54db05e9e13e21647ee97acefb3cc4dbcf5d4122e098206ffb47b65213b88df61a0a67bd7ba1671187dbd1b2a5167209fc747f5b04b8a068e6bce0c02e10eb391766f51f2c65111a7f86dd5c7264336aaadba88b9cf9f55cf101b216f42d01a80cd35e2680a56f0e84f5db1a177f42fae8bc8975d24a636984f2b38d3d59101a0fb4a9da88ddda39091e417bae437035e15ad0aab5e4a9ef0580ebd24b7e2d478f415b3e415aa21dc20ab7ef7e6c9cbc775992f1aaf4df8ca2d4baf058ff811f", shop_name: "KNIHCENTRUM.sk", shop_logo: "https://y1.sk/t/s/130x50/6810.jpg", product_price: "14,93 €", product_shipping: "0,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(){ pmaWidgetInstance6357da6aac365ae374bb20e7.initWidget("6357da6aac365ae374bb20e7"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }