// ######## modul 'chatVUBnew' verzia 26.08.2024 14.22.21 //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-toggle") .removeAttr("data-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 '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...