// ######## modul 'chatVUBnew' verzia 16.09.2024 12.16.29 //zmena ikony chatu - vyzera to ako animacia :-) $("div.align-floating-icons-horizontal").addClass("hide"); $("div.align-floating-icons-horizontal span").first().removeClass("icon-ic_intesa").addClass("icon-ic_advisor"); var envAPI = "testappvubsk"; if (window.location.hostname.endsWith('www.vub.sk')) envAPI = "app.vub.sk"; function initializeChat(widgetPath, enableDebug) { console.log("## chat VUB inic..."); widgetPath = widgetPath.replace(/\/$/, ""); //debugger; var mapTema = [ {url: "/magnifica", tema: "magnifica"}, {url: "/en/magnifica", tema: "magnifica"}, {url: "/privatne-bankovnictvo", tema: "private"}, {url: "/en/privatne-bankovnictvo", tema: "private"} ]; var VUBchatTheme = "retail"; //retail, magnifica, private, quatro, univerzal mapTema.forEach(tema => { if (window.location.pathname.startsWith(tema.url)) { VUBchatTheme = tema.tema; } }); console.log("## chat VUB theme: " + VUBchatTheme); var mapInst = [ {url: "/en", inst: "english"}, {url: "/ludia/hypoteky", inst: "hypoteka"}, {url: "/ludia/sporenie", inst: "investicie"}, {url: "/ludia/poistenie", inst: "poistenia"}, {url: "/ludia/investovanie", inst: "investicie"}, {url: "/firmy-a-podnikatelia", inst: "podnikatelia"} ]; var VUBchatInstance = "vub"; //hypoteka, investicie, kampan, podnikatelia, poistenia, quatro, quatrocar, vub, english mapInst.forEach(inst => { if (window.location.pathname.startsWith(inst.url)) { VUBchatInstance = inst.inst; } }); console.log("## chat VUB instance: " + VUBchatInstance); //nové chat VUB tlacidlo var startVubChatBtn = $("#startChatBtn").clone(); startVubChatBtn.prop("id","startVubChatBtn") $("#startChatBtn").after(startVubChatBtn) $("#startChatBtn").hide(); $("#startVubChatBtn") .removeAttr("data-bs-toggle") .removeAttr("data-bs-target") .click(function (event){ CXBus.command('WebChat.open'); window.dataLayer.push({ event: "service", serviceCat: "chat", serviceAction: "chat", serviceLabel: window.dataLayer[0].pageName }) }); var VUBoperatorReady = false; window._vubCXWidget = { widgetPath: widgetPath, apiHost: envAPI, theme: VUBchatTheme, instance: VUBchatInstance, downloadFont: false, enableChatButton: function($) { VUBoperatorReady = true; console.log("## => chat operator ready"); $("div.align-floating-icons-horizontal").removeClass("hide"); }, disableChatButton: function($) { console.log("## => chat operator unavailable"); $("div.align-floating-icons-horizontal").addClass("hide"); //$("div.align-floating-icons-horizontal").removeClass("hide"); }, chatOpened: function($) { console.log("## => chat otvoreny"); $("div.align-floating-icons-horizontal").addClass("hide"); }, chatClosed: function($) { console.log("## => chat zatvoreny"); if (VUBoperatorReady) { $("div.align-floating-icons-horizontal").removeClass("hide"); } } } // load css $("", {rel: "stylesheet", href: widgetPath + "/themes/" + window._vubCXWidget.theme + ".css", id: "cx-widget-vub-style-overrides"}).appendTo("head"); // load widget $.getScript(widgetPath + "/cxbus.min.js", function() { CXBus.configure({debug:enableDebug,pluginsPath: widgetPath + "/plugins/"}); CXBus.loadFile(widgetPath + "/widgets.config.js").done(function(){ CXBus.loadFile(widgetPath + "/plugins/vubwebchat.min.js").done(function(){ CXBus.loadPlugin("widgets-core"); }); }); }); } $(document).ready(function() { initializeChat("https://" + envAPI + "/genesys/widgets", true); }); // ######## modul 'call-me-back_CONTACT' verzia 10.09.2025 22.28.34 //odchytenie odoslania call me back $(document).ready(function() { function cakajNaCMB() { return new Promise(function(resolve, reject) { var cakajNaCMB_int = setInterval(function() { //console.log("## => CMB button " + $("button.cmb__modal__btnSend.btn").length); if ($("button.cmb__modal__btnSend.btn").length == 1) { console.log("## => CMB button najdeny"); clearInterval(cakajNaCMB_int); resolve(); } }, 2000); }); } cakajNaCMB().then(function() { console.log("## => CMB handler inic"); $("button.cmb__modal__btnSend.btn").click(() => { CMBtrackVUB(); }); }); function CMBtrackVUB() { console.log("## => CMB click event"); var mapProductType = [ {url: "/hypoteky/", pt: "Hypotéka"}, {url: "/pozicky/", pt: "Pôžička"}, {url: "/ludia/kreditne-karty", pt: "Kreditná karta"}, {url: "/investovanie/", pt: "Investície"}, {url: "/sporenie/", pt: "Sporenie"}, {url: "/osobny-financny-plan", pt: "Osobné financie"}, {url: "/magnifica/", pt: "Osobné financie"}, {url: "/firmy-a-podnikatelia/", pt: "Firmy a podnikatelia"}, {url: "/firmy-a-podnikatelia/kreditne-karty", pt: "Firemná kreditná karta"} ]; var VUBproductType = ""; mapProductType.forEach(zaznam => { if (window.location.pathname.includes(zaznam.url)) { VUBproductType = zaznam.pt; } }); //vynimky... if (window.location.pathname.includes("/sporenie/") && window.location.pathname.includes("vklad")) { VUBproductType = "Termínovaný účet"; } var mapAttrName = [ {url: "/firmy-a-podnikatelia/financovanie-pre-firmy/financovanie-pre-polnohospodarov", name: "Financovanie pre poľnohospodárov"}, {url: "/firmy-a-podnikatelia/financovanie-pre-malych-podnikatelov/profihypo-uvery", name: "Profi-hypo úver"}, {url: "/firmy-a-podnikatelia/financovanie-pre-malych-podnikatelov/profiuver", name: "Profiúver"}, {url: "/firmy-a-podnikatelia/financovanie-pre-malych-podnikatelov/profiuver-pre-polnohospodarov", name: "Profiúver pre poľnohospodarov"}, {url: "/firmy-a-podnikatelia/financovanie-pre-malych-podnikatelov/uvery-pre-male-mesta-a-obce", name: "Úvery pre malé mestá a?obce"}, {url: "/firmy-a-podnikatelia/kreditne-karty", name: "Firemné kreditné karty"}, {url: "/firmy-a-podnikatelia/kreditne-karty/mastercard-business-gold", name: "Kreditná karta Mastercard business Gold"}, {url: "/firmy-a-podnikatelia/kreditne-karty/mastercard-business-world", name: "Kreditná karta Mastercard business World"}, {url: "/firmy-a-podnikatelia/platby/platobny-terminal", name: "Platobný terminál"}, {url: "/firmy-a-podnikatelia/ucty/vub-biznis-ucet", name: "VÚB Biznis účet"}, {url: "/firmy-a-podnikatelia/vyhody", name: "Výhody pre podnikateľov"}, {url: "/firmy-a-podnikatelia/vyhody", name: "VÚB Biznis účet"}, {url: "/ludia/hypoteky/bezucelova-hypoteka", name: "Bezúčelová hypotéka"}, {url: "/ludia/hypoteky/hypotekabezkompromisov", name: "Hypotéka bez kompromisov"}, {url: "/ludia/hypoteky/hypoteka-na-byvanie", name: "Hypotéka na bývanie"}, {url: "/ludia/hypoteky/hypoteka-na-refinancovanie", name: "Hypotéka na refinancovanie"}, {url: "/ludia/hypoteky/hypoteka-pre-mladych", name: "Hypotéka pre mladých"}, {url: "/ludia/investovanie", name: "Investície"}, {url: "/ludia/investovanie/investicne-sporenie-lux", name: "Investičné sporenie LUX"}, {url: "/ludia/investovanie/investicne-sporenie-sk", name: "Investičné sporenie SK"}, {url: "/ludia/investovanie/kombiprodukt", name: "Kombiprodukt"}, {url: "/ludia/investovanie/podielove-fondy-eurizon-capital", name: "Podielové fondy Eurizon Capital"}, {url: "/ludia/investovanie/podielove-fondy-eurizon-sk", name: "Podielové fondy Eurizon SK"}, {url: "/ludia/kreditne-karty", name: "Kreditné karty"}, {url: "/ludia/kreditne-karty/mastercard-standard", name: "Kreditná karta Mastercard Standard"}, {url: "/ludia/kreditne-karty/mastercard-world", name: "Kreditná karta Mastercard World"}, {url: "/ludia/kreditne-karty/sikovna-karta", name: "Kreditná karta Šikovná karta"}, {url: "/ludia/osobny-financny-plan", name: "Osobný finančný plán"}, {url: "/ludia/pozicky/mamauver", name: "Mama úver"}, {url: "/ludia/pozicky/pozicka-na-cokolvek", name: "Pôžička na čokoľvek"}, {url: "/ludia/pozicky/pozicka-na-refinancovanie", name: "Pôžička na refinancovanie"}, {url: "/ludia/pozicky/zelena-pozicka", name: "Zelená pôžička"}, {url: "/ludia/sporenie/premiovy-vklad", name: "Prémiový vklad"}, {url: "/ludia/sporenie/sporiaci-ucet", name: "Sporiaci účet"}, {url: "/ludia/sporenie/sporiaci-ucet-k-hypoteke", name: "Sporiaci účet k hypotéke"}, {url: "/ludia/sporenie/sporiaci-ucet-pre-juniorov", name: "Sporiaci účet pre juniorov"}, {url: "/ludia/sporenie/sporiaci-ucet-pre-seniorov", name: "Sporiaci účet pre seniorov"}, {url: "/ludia/sporenie/terminovany-vklad", name: "Termínovaný vklad"}, {url: "/magnifica/exkluzivne-produkty/osobny-financny-plan", name: "Magnifica Osobný finančný plán"}, {url: "/magnifica/investplan", name: "Magnifica Investplan"}, {url: "/magnifica/kontakt", name: "Magnifica kontakt"}, {url: "/magnifica/vyhody", name: "Magnifica výhody"} ]; var VUBattrName = ""; mapAttrName.forEach(zaznam => { if (window.location.pathname.includes(zaznam.url)) { VUBattrName = zaznam.name; } }); //vynimky... if (window.location.pathname.includes("/ludia/sporenie/sporiaci-ucet") &&typeof deviceIndexAkt !== "undefined") { let $select = $("select[name='savingsAccountType']").eq(deviceIndexAkt); if ($select.length) VUBattrName = $select.find("option:selected").text(); } if (window.location.pathname.includes("/firmy-a-podnikatelia/platby/kontakt") &&typeof deviceIndexAkt !== "undefined") { let $select = $("select[name='produkt']").eq(deviceIndexAkt); if ($select.length) VUBattrName = $select.find("option:selected").text(); } var cookieTrackName = 'web-p-track'; var paramsPost = new Object(); paramsPost["p0"] = ''; paramsPost["p1"] = document.URL; paramsPost["p2"] = document.referrer; paramsPost["p3"] = screen.height; paramsPost["p4"] = screen.width; paramsPost["p-product"] = document.title.slice(0, document.title.indexOf("|")).trim(); paramsPost["p-productType"] = VUBproductType; paramsPost["p-calcType"] = ""; paramsPost["p-name"] = VUBattrName; paramsPost["p-formName"] = "Call me back"; paramsPost["p-mail"] = $("input#item_email").val(); paramsPost["p-mobilePhone"] = $("div#cmbModal input[name='countryPrefix']").val() + $("div#cmbModal input[name='phoneNumber']").val(); paramsPost["p-clientName"] = $("input#item_firstname").val(); paramsPost["p-actualUrl"] = window.location.href; if ($.vubTrackGetCookie(cookieTrackName) != null) { var webTrack = $.vubTrackGetCookie(cookieTrackName); paramsPost["p0"] = webTrack; if (window.console) console.log('cookie: ' + webTrack); vubTrackFormAjax('contact',paramsPost); } else { paramsPost["p0"] = "00000000-0000-0000-0000-000000000000"; if (window.console) console.log('cookie: XX'); vubTrackFormAjax('contact',paramsPost); } //event.preventDefault(); } function vubTrackFormAjax(type, paramsPost) { var jsonData; $.ajax({ url: 'https://app.vub.sk/vubtrack/?type='+type, method: 'POST', data: paramsPost }).done(function (response) { jsonData = JSON.parse(response); //$.cookie(cookieTrackName, jsonData.detail, { expires: 90, path: '/', domain: 'vub.sk' }); //$.cookie(cookieTrackName, jsonData.detail, { expires: 90, path: '/' }); }); } }); // ######## modul 'convertAtoCTA' verzia 04.10.2024 11.48.22 //premeň A element na otvaranie CTA $(document).ready(function() { $('a.leadFormVubCallMe').each(function() { console.log("## => konvert A na CTA"); $(this).attr("onclick","$('[data-bs-target=\"#cmbModal\"]').click(); return false;"); }); }); // ######## modul 'convertBannerBTN' verzia 30.05.2024 10.48.01 //premeň button v Banner komponente (ak CTA=#leadform#) $(document).ready(function() { $("div.com11__buttonCover a[data-scrollto='#leadform#']").each(function() { console.log("## => konvert banner button"); $(this).parent().attr("onclick","$('[data-target=\"#cmbModal\"]').click(); return false;"); }); }); // ######## modul 'convertHeroBTN' verzia 30.08.2024 23.04.26 //premeň hero button (ak CTA=#leadForm#) $(document).ready(function() { //$("div.js-hero-btn").each(function() { $('xxdiv.js-hero-btn:not(:has("a.js-loan-hero-btn"))').each(function() { console.log("## => konvert hero button"); $(this).attr("onclick","$('[data-target=\"#cmbModal\"]').click(); return false;"); var scrollToValue = $(this).find('a').attr("data-scrollto"); var lastChar = scrollToValue.charAt(scrollToValue.length - 1); if (scrollToValue === '#leadForm#') { //fix $(this).find('a').attr("data-scrollto","#leadForm"); } }); $('div.js-hero-btn a[data-scrollto*="leadForm"]').each(function() { console.log("## => konvert hero button2"); $(this).parent().attr("onclick","$('[data-bs-target=\"#cmbModal\"]').click(); return false;"); if ($(this).attr("data-scrollto") === '#leadForm#') { //fix $(this).attr("data-scrollto","#leadForm"); console.log("## => konvert hero button FIX"); } }); $('div.com11__buttonCover a[data-scrollto*="leadform"]').each(function() { console.log("## => konvert hero button3"); $(this).parent().attr("onclick","$('[data-target=\"#cmbModal\"]').click(); return false;"); }); $('div.js-hero-btn form[action*="leadForm"] a.heroBtnDesktop').each(function() { console.log("## => konvert hero button (loan)"); $(this).attr("onclick","$('[data-bs-target=\"#cmbModal\"]').click(); return false;"); }); }); //end...