{"version":3,"sources":["src/javascripts/mobile/screen.js"],"names":["$","on","trigger","length","hasClass","buildList","list","tempString","each","externalLink","this","isExternal","icon","iconName","route","title","buildHTML","data","htmlString","navigation","user","image","name","lastLogin","favoriteWidgets","moreWidgets","fi","bankName","footerInfo","document","getElementById","mobileMenu","hasAttribute","innerHTML","$mobileNav","removeAttr","mmenu","find","append","get","locales","localesList","$mobileNavLanguage","i","IsCurrent","CultureCode","Id","Language","html","localeId","close","window","setTimeout","alkBottomPanel","addClass","post","done","location","reload","saveLocaleChosen","createLocalesList","e","focus","preventDefault","open","scrollTop","createNav","ajax","url","attr","dataType","async","success","click","cookie","parser","UAParser","getResult","preventMove","wrapScroller","id","wrap","iScroll","os","toLowerCase","modalId","a","load","addEventListener","removeEventListener","val","ua","today","Date","browsername","browser","osname","version","major","substring","getMonth","getDate","getFullYear","toString","getDeviceName","bindCurrencyFields","$infoPanel","$infoPanelFooter","$pageFooterInfo","focusableElements","firstFocusableElement","lastFocusableElement","key","shiftKey","activeElement","options","active","menuItem","menu","parent","menuNext","menuPrevious","menuGoNumber","number","that","newLeft","scrolled","scrollLeft","removeClass","width","position","left","animate","index","menuLength"],"mappings":";AAEIA,GAAE,WAUE,GALAA,EAAE,QAAQC,GAAG,QAAS,2BAA2B,WAC7CD,EAAE,eAAeE,QAAQ,gBAIzBF,EAAE,eAAeG,QAAUH,EAAE,eAAeG,SAAWH,EAAE,QAAQI,SAAS,eAAgB,CAE1F,SAASC,EAAUC,GACf,IAAIC,EAAa,GAajB,OAZAP,EAAEQ,KAAKF,GAAM,WACT,IAAIG,EAAeC,KAAKC,WAAa,mBAAqB,GACtDC,EAAO,KAAOF,KAAKE,KAEnBF,KAAKG,WACPD,EAAO,aAAeF,KAAKG,UAG7BN,GAAc,8BAAgCK,EAAhC,cACIF,KAAKI,MAAQ,IAAML,EAAe,IAAMC,KAAKK,MADjD,eAIXR,EAIX,SAASS,EAAUC,GACf,IAAIC,EAAa,GAEjBA,GACI,uCACeD,EAAK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/ happy place...\r\n $(function () {\r\n\r\n // mm-panel-blocker for #mm_bottom_panels overlays mm-blocker\r\n // this prevents its default close panel click event\r\n // therefore we force it\r\n $('body').on('click', '.mm-partial-panel-close', function () {\r\n $('#mm-blocker').trigger('mousedown');\r\n });\r\n\r\n // Populate Nav menu if: nav button exists, nav div exists, is not a native app\r\n if ($('#nav_button').length && $('#mobile_nav').length && !$('body').hasClass('native-menu')) {\r\n // builds list of widgets during html string generation\r\n function buildList(list) {\r\n var tempString = '';\r\n $.each(list, function () {\r\n var externalLink = this.isExternal ? ' target=\"_blank\"' : '';\r\n var icon = 'i-' + this.icon;\r\n\r\n if (this.iconName) {\r\n icon = 'font-icon-' + this.iconName;\r\n }\r\n\r\n tempString += '
  • ' +\r\n '' + this.title + '' +\r\n '
  • ';\r\n });\r\n return tempString;\r\n }\r\n\r\n // generates html string from requested data\r\n function buildHTML(data) {\r\n var htmlString = '';\r\n // User\r\n htmlString +=\r\n '
    ' +\r\n '\"Profile' +\r\n '
    ' +\r\n '

    ' + data.navigation.user.name + '

    ' +\r\n '

    Last Login ' + data.navigation.user.lastLogin + '

    ' +\r\n '
    ' +\r\n '
    ';\r\n\r\n // Favorites\r\n if (data.navigation.favoriteWidgets.length > 0) {\r\n htmlString +=\r\n '
    ' +\r\n '

    Favorites

    ' +\r\n '' +\r\n '
    ';\r\n }\r\n\r\n // More widgets\r\n if (data.navigation.moreWidgets.length > 0) {\r\n htmlString +=\r\n '
    ' +\r\n '

    More Widgets

    ' +\r\n '' +\r\n '
    ';\r\n }\r\n\r\n // FI\r\n if (data.navigation.fi.length > 0) {\r\n htmlString +=\r\n '
    ' +\r\n '

    ' + data.navigation.bankName + '

    ' +\r\n '' +\r\n '
    ';\r\n }\r\n\r\n // Footer\r\n // @todo - techDebt --- once we rewrite the mobile nav we can git rid of this\r\n // this was added per DEV-69642\r\n // This will take the footer from the bottom of each page and place it in\r\n // the bottom of the mobile_nav. If the Fi does not want this option then you\r\n // will need to go to that fi's views/footer.mobile and in the mobile_nav div\r\n // remove the data-menufooter=\"true\" and this will not show in the nav menu\r\n // also will need to go to the fi/theme/stylesheets/mobilePartials/_footer and\r\n // remove the code on lines 12 -14 that hide the footer throughout the application.\r\n var footerInfo = document.getElementById('mobile_footer');\r\n var mobileMenu = document.getElementById('mobile_nav');\r\n\r\n if (mobileMenu && mobileMenu.hasAttribute(\"data-menuFooter\") && footerInfo) {\r\n htmlString += '
    ' + footerInfo.innerHTML + '
    '\r\n };\r\n\r\n // Localization\r\n htmlString += '
    '\r\n\r\n // Create the nav with our constructed string.\r\n createNav(htmlString);\r\n }\r\n\r\n function getLocales() {\r\n // normally we would want to store the locales\r\n // to avoid a get every page load\r\n // but we need to clear the storage on logout\r\n // or some other event\r\n /*\r\n var locales = JSON.parse(localStorage.getItem('alkami.locales'));\r\n\r\n if (!locales) {\r\n $.get('/API/Locales', function (data) {\r\n createLocalesList(data);\r\n }, 'json');\r\n } else {\r\n createLocalesList(locales);\r\n }\r\n */\r\n\r\n $.get('/API/Locales', function (data) {\r\n createLocalesList(data);\r\n }, 'json');\r\n }\r\n\r\n function createLocalesList(locales) {\r\n var localeid;\r\n var $mobileNavLanguage = $('#mobile_nav_language');\r\n var localesList;\r\n\r\n if (locales.length > 1) {\r\n localesList = '';\r\n\r\n $mobileNavLanguage.html(localesList);\r\n $mobileNavLanguage.find('li').on('click', function () {\r\n localeId = $(this).data('id');\r\n $('#mobile_nav').data('mmenu').close();\r\n // delay to give nav menu time to close first\r\n window.setTimeout(function () {\r\n alkBottomPanel('#locale_confirmation');\r\n }, 400);\r\n });\r\n\r\n $('#confirm_locale').on('click', function() {\r\n $('#locale_confirmation').addClass('confirmed');\r\n saveLocaleChosen(locales, localeId)\r\n });\r\n\r\n $('#cancel_locale, #locale_confirmation .alk-bottom-panel-close').on('click', function () {\r\n alkBottomPanel('#locale_confirmation');\r\n })\r\n }\r\n }\r\n\r\n function saveLocaleChosen(locales, localeId) {\r\n // normally we would want to store the locales\r\n // to avoid a get every page load\r\n // but we need to clear the storage on logout\r\n // or some other event\r\n /*\r\n for (var i = 0; i < locales.length; i++) {\r\n locales[i].IsCurrent = false;\r\n if (locales[i].Id === localeId) {\r\n locales[i].IsCurrent = true;\r\n }\r\n }\r\n\r\n localStorage.setItem('alkami.locales', JSON.stringify(locales));\r\n */\r\n\r\n $.post('/API/Locales/SetLocale', { localeId: localeId })\r\n .done(function (data) {\r\n location.reload();\r\n });\r\n }\r\n\r\n // creates nav based off generated html\r\n function createNav(htmlString) {\r\n // mobile nav is hidden by default to prevent flash of content\r\n // remove style attr instead of changing display to block to not override display property in CSS\r\n var $mobileNav = $('#mobile_nav');\r\n $mobileNav.removeAttr('style').mmenu().find('.mobile-nav-container').append('
    ' + htmlString + '
    ');\r\n\r\n getLocales();\r\n\r\n $('#nav_button').on('click', function (e) {\r\n if($mobileNav.hasClass('mm-opened')) {\r\n $('#mm-blocker').trigger('mousedown');\r\n $('#nav_button').focus();\r\n\r\n return false;\r\n }\r\n e.preventDefault();\r\n $mobileNav.data('mmenu').open();\r\n $('#mobile_nav_container').scrollTop(0).focus();\r\n\r\n return false;\r\n });\r\n\r\n $mobileNav.trigger('navMenuBuilt');\r\n }\r\n\r\n // request menu data\r\n $.ajax({\r\n url: $(location).attr('protocol') + '//' + $(location).attr('host') + '/MobileClient/NavigationV2',\r\n dataType: 'json',\r\n async: true,\r\n success: function (data) {\r\n buildHTML(data);\r\n }\r\n });\r\n }\r\n\r\n $('#full-site').click(function () {\r\n document.cookie = \"ViewFullSite=1;path=/\";\r\n return true;\r\n });\r\n\r\n var parser = new UAParser().getResult();\r\n $('body').addClass(parser.os.name.toLowerCase());\r\n\r\n function preventMove(e) {\r\n e.preventDefault();\r\n }\r\n\r\n function wrapScroller(id) {\r\n if (id == null || id === '')\r\n return;\r\n\r\n $('#' + id + ' .modal-content').wrap('
    ').wrap('
    ');\r\n var scroller = new iScroll('wrap');\r\n }\r\n\r\n function getDeviceName(ua) {\r\n var parser = new UAParser(ua).getResult();\r\n var today = new Date();\r\n var browsername = (parser.browser && parser.browser.name) || 'unknown';\r\n var osname = (parser.os && parser.os.name) || 'unknown';\r\n var version = (parser.browser && parser.browser.major) || '0';\r\n\r\n var deviceName = browsername.substring(0, 4) + ' ' + version.substring(0, 2) + ' ' + osname.substring(0, 3) + ' ' + (today.getMonth() + 1) + '/' + today.getDate() + '/' + today.getFullYear().toString().substring(2);\r\n return deviceName;\r\n }\r\n\r\n // Legacy Modals\r\n // WARNING: this technically only works for a single modal on a page - we're not unwrapping/unbinding scroll when user closes modal yet\r\n $('.modal').each(function () {\r\n var modalId = this.id,\r\n a = $('a[href=\"#' + modalId + '\"]');\r\n\r\n if (!modalId) {\r\n return;\r\n }\r\n\r\n a.click(function () {\r\n if (!$('#wrap').length) {\r\n if (modalId == 'transfer_policy') {\r\n $('#transfer_policy .modal-content').load('/Content/Disclosures/Show?name=DisclosureTransfer', function () {\r\n wrapScroller(modalId);\r\n });\r\n } else {\r\n wrapScroller(modalId);\r\n }\r\n\r\n $('#' + modalId).trigger(\"modalOpened\");\r\n }\r\n setTimeout(function () {\r\n document.addEventListener('touchmove', preventMove, false);\r\n }, 500);\r\n });\r\n });\r\n\r\n $('a[href=\"#close\"]').click(function () {\r\n document.removeEventListener('touchmove', preventMove);\r\n });\r\n\r\n /* Remember Device */\r\n $('#DeviceName').val(getDeviceName());\r\n });\r\n\r\n bindCurrencyFields();\r\n})();\r\n\r\n// Some backwards compatible black magic that needs cleaning up.\r\n(function () {\r\n var $infoPanel = $('#mm_panel_info');\r\n var $infoPanelFooter = $('#mm_panel_info .footer');\r\n var $pageFooterInfo = $('#mobile_info_panel');\r\n\r\n if ($infoPanel.length > 0 && $infoPanelFooter.length > 0 && $pageFooterInfo.length > 0) {\r\n $infoPanel.attr('tabindex', -1);\r\n $infoPanelFooter.html($pageFooterInfo.html());\r\n\r\n // Find all focusable elements in the info panel. \r\n var focusableElements = $infoPanel.find('a[href]:not([disabled]), button:not([disabled])');\r\n var firstFocusableElement = focusableElements[0];\r\n var lastFocusableElement = focusableElements[focusableElements.length - 1];\r\n\r\n // Listen for tab or shift tab keypress and apply logic if the first or last element had focus\r\n $infoPanel.on('keydown', function(e) {\r\n var isTabPressed = e.key === 'Tab';\r\n\r\n if (!isTabPressed) { \r\n return; \r\n }\r\n\r\n if ( e.shiftKey ) {\r\n if (document.activeElement === firstFocusableElement) {\r\n lastFocusableElement.focus();\r\n e.preventDefault();\r\n }\r\n } else {\r\n if (document.activeElement === lastFocusableElement) {\r\n firstFocusableElement.focus();\r\n e.preventDefault();\r\n }\r\n }\r\n });\r\n }\r\n})();\r\n\r\n\r\n//New Mobile Menu -- Horizontal Scroller w/ snap to grid for active item 10.7.16\r\n$(function () {\r\n var options = {\r\n class: {\r\n active: 'active'\r\n },\r\n dom: {\r\n menuItem: 'a.tab',\r\n menu: '.tab-wrapper',\r\n parent: '.tab-nav',\r\n menuNext: '#tab-next',\r\n menuPrevious: '#tab-previous'\r\n }\r\n };\r\n\r\n // main function for switching active menu item\r\n function menuGoNumber(number) {\r\n var that = $(options.dom.menu).find(options.dom.menuItem + ':nth-child(' + number + ')');\r\n var newLeft = 0;\r\n var parent = $(options.dom.parent);\r\n var scrolled = $(options.dom.parent).scrollLeft();\r\n if (that.length > 0) {\r\n // highlight active element\r\n $('.' + options.class.active).removeClass(options.class.active);\r\n that.addClass(options.class.active);\r\n // scroll cycle menu to active element\r\n newLeft = (parent.width() * 0.5) - that.position().left - (that.width() * 0.5) + scrolled - 10;\r\n $(options.dom.menu).animate({ left: newLeft }, 500, 'swing');\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n // helper function for previouse item\r\n function menuGoPrevious() {\r\n // find active\r\n var that = $(options.dom.menu).find(options.dom.menuItem + '.' + options.class.active);\r\n if (that.index() > 0) {\r\n menuGoNumber(that.index() + 1 - 1);\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n // helper function for next item\r\n function menuGoNext() {\r\n // find active\r\n var that = $(options.dom.menu).find(options.dom.menuItem + '.' + options.class.active);\r\n var menuLength = $(options.dom.menu).find(options.dom.menuItem).length;\r\n if (that.index() < menuLength - 1) {\r\n menuGoNumber(that.index() + 1 + 1);\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n // helper function to refresh view\r\n function menuGoRefresh() {\r\n // find active\r\n var that = $(options.dom.menu).find(options.dom.menuItem + '.' + options.class.active);\r\n menuGoNumber(that.index() + 1);\r\n }\r\n\r\n\r\n // --------------------------------------------------\r\n // do stuff\r\n // --------------------------------------------------\r\n\r\n // bind resize\r\n $(window).on('resize', function () {\r\n menuGoRefresh();\r\n });\r\n\r\n // bind click on menu items\r\n $(options.dom.menuItem).on('click', function () {\r\n var that = $(this);\r\n menuGoNumber(that.index() + 1);\r\n });\r\n\r\n // bind click on next and previous button\r\n $(options.dom.menuNext).on('click', menuGoNext);\r\n $(options.dom.menuPrevious).on('click', menuGoPrevious);\r\n\r\n // start with first menu item\r\n menuGoNumber(1);\r\n\r\n});\r\n"]}