var pmaWidgetInstance60127705d9685ed272a02592 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=46fb13dca1c384dcce3eae5a21b1dbc4:337438019ad80bad78ab7e7e4c9eaf7989b74b33dbda30ca55c8d00f9537dd9a35d76d93c4d3dacd000595a5b1e70911211d0d71307c972fe1088fd42d26b03d4941dc113726e81b8b378f49d7258368eafcedb9662c269fe036a4c51ee9153ac7d9a6d7fba1bd40f658c02dbbd94ae428346542f9f7f6d9d3adcda5285fcc04794f059f5d741eab038733ae09e34369b26855fa9e9b9f8f5bcc4009c53e925b4b238fccea6441761497087b95a45e2cbe1d32767f0ba813a98a7a479584786d", shop_name: "lekarenvkocke.sk", shop_logo: "https://y1.sk/t/s/130x50/57146.jpg", product_price: "8,98 €", product_shipping: "2,19 €", 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(){ pmaWidgetInstance60127705d9685ed272a02592.initWidget("60127705d9685ed272a02592"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }