TimeTrex/interface/html5/dist/portal-PortalBaseViewController.bundle.js

1 line
160 KiB
JavaScript

"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["portal-PortalBaseViewController","portal-header-HeaderUploadResumeWidget","portal-hr-recruitment-PortalJobVacancyRowController","portal-sign_in-PortalForgotPasswordController","portal-sign_in-PortalResetForgotPasswordController"],{1748:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"g\": () => (/* binding */ IndexViewController)\n/* harmony export */ });\n/* unused harmony export ApplicationRouter */\n/* harmony import */ var _views_portal_header_HeaderViewController__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3246);\n/* harmony import */ var _views_portal_PortalBaseViewController__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97);\n/* harmony import */ var _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7526);\n/* harmony import */ var _global_TAlertManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9239);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\n\n\n\nclass ApplicationRouter extends Backbone.Router {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tcontroller: null,\n\t\t\theaderView: null,\n\t\t\troutes: {\n\t\t\t\t'': 'onViewChange',\n\t\t\t\t'!:viewName': 'onViewChange',\n\t\t\t\t'*notFound': 'notFound'\n\t\t\t}\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\treloadView( view_id ) {\n\t\t//error: Uncaught ReferenceError: XXXXViewController is not defined ininterface/html5/#!m=TimeSheet line 3\n\t\t// Happens when quickly click on context menu and network is slow.\n\t\tif ( eval( 'typeof '+ view_id + 'ViewController' ) === 'function' ) {\n\t\t\t_views_portal_PortalBaseViewController__WEBPACK_IMPORTED_MODULE_1__.PortalBaseViewController.loadView( view_id );\n\t\t}\n\t}\n\n\tnotFound( url ) {\n\t\tvar new_url = Global.getBaseURL();\n\n\t\tGlobal.setURLToBrowser( new_url + '#!m=PortalJobVacancy' );\n\t}\n\n\t/* jshint ignore:start */\n\tonViewChange( viewName ) {\n\t\tvar $this = this;\n\t\tvar args = {};\n\t\tvar view_id;\n\t\tvar edit_id;\n\t\tvar action;\n\n\t\tif ( Global.needReloadBrowser ) {\n\t\t\tGlobal.needReloadBrowser = false;\n\t\t\twindow.location.reload();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( viewName ) {\n\t\t\targs = Global.buildArgDic( viewName.split( '&' ) );\n\t\t}\n\t\tif ( viewName && viewName.indexOf( 'm=' ) >= 0 ) {\n\t\t\tview_id = Global.sanitizeViewId( args.m );\n\t\t} else {\n\t\t\tview_id = 'PortalJobVacancy';\n\t\t}\n\n\t\tLocalCacheData.fullUrlParameterStr = viewName;\n\n\t\tLocalCacheData.setAllURLArgs( args );\n\n\t\tif ( LocalCacheData.getAllURLArgs() ) {\n\t\t\tif ( !LocalCacheData.getAllURLArgs().hasOwnProperty( 'company_id' ) ) {\n\t\t\t\tTTPromise.add( 'IndexController', 'onViewChange' );\n\t\t\t\tTTPromise.wait( null, null, function() {\n\t\t\t\t\tif ( IndexViewController && IndexViewController.instance && IndexViewController.instance.router ) {\n\t\t\t\t\t\tIndexViewController.instance.router.showTipModal( $.i18n._( 'Invalid Company' ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t_global_TAlertManager__WEBPACK_IMPORTED_MODULE_3__/* .TAlertManager.showAlert */ .K.showAlert( $.i18n._( 'Invalid Company' ) );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t//Ensure that the error is shown in a relatively timely fashion AFTER the framework needed to render properly is loaded.\n\t\t\t\t\tTTPromise.resolve( 'IndexController', 'onViewChange' );\n\t\t\t\t}, 4000 );\n\t\t\t}\n\t\t}\n\n\t\tedit_id = args.id;\n\n\t\taction = args.a;\n\n\t\tif ( LocalCacheData.current_open_view_id === view_id ) {\n\n\t\t\tif ( LocalCacheData.current_open_primary_controller ) {\n\n\t\t\t\tif ( action ) {\n\t\t\t\t\tswitch ( action ) {\n\t\t\t\t\t\tcase 'edit':\n\n\t\t\t\t\t\t\t//Error: Unable to get property 'id' of undefined or null reference in /interface/html5/IndexController.js?v=8.0.0-20141230-125406 line 87\n\t\t\t\t\t\t\tif ( !LocalCacheData.current_open_primary_controller.edit_view ||\n\t\t\t\t\t\t\t\t( LocalCacheData.current_open_primary_controller.current_edit_record &&\n\t\t\t\t\t\t\t\t\tLocalCacheData.current_open_primary_controller.current_edit_record.id != edit_id ) ) {\n\n\t\t\t\t\t\t\t\t//Makes ure when doing copy_as_new, don't open this\n\t\t\t\t\t\t\t\tif ( LocalCacheData.current_doing_context_action === 'edit' ) {\n\t\t\t\t\t\t\t\t\topenEditView( edit_id );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'new':\n\t\t\t\t\t\t\tif ( !LocalCacheData.current_open_primary_controller.edit_view ) {\n\t\t\t\t\t\t\t\topenEditView();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'view':\n\n\t\t\t\t\t\t\tswitch ( view_id ) {\n\t\t\t\t\t\t\t\tcase 'MessageControl':\n\t\t\t\t\t\t\t\t\tif ( args.t === 'message' ) {\n\t\t\t\t\t\t\t\t\t\tif ( !LocalCacheData.current_open_primary_controller.edit_view ||\n\t\t\t\t\t\t\t\t\t\t\t( !checkIds() ) ) {\n\t\t\t\t\t\t\t\t\t\t\topenEditView( edit_id, true );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else if ( args.t === 'request' ) {\n\t\t\t\t\t\t\t\t\t\tif ( !LocalCacheData.current_open_primary_controller.edit_view ||\n\t\t\t\t\t\t\t\t\t\t\t( LocalCacheData.current_open_primary_controller.current_select_message_control_data.id != edit_id ) ) {\n\t\t\t\t\t\t\t\t\t\t\topenEditView( edit_id, true );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tif ( !LocalCacheData.current_open_primary_controller.edit_view ||\n\t\t\t\t\t\t\t\t\t\t( LocalCacheData.current_open_primary_controller.current_edit_record.id != edit_id ) ) {\n\t\t\t\t\t\t\t\t\t\topenEditView( edit_id, true );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tif ( LocalCacheData.current_open_primary_controller.edit_view &&\n\t\t\t\t\t\tLocalCacheData.current_open_primary_controller.current_edit_record ) {\n\n\t\t\t\t\t\tif ( LocalCacheData.current_open_primary_controller.viewId === 'TimeSheet' ) {\n\t\t\t\t\t\t\tif ( LocalCacheData.current_open_primary_controller.is_mass_editing ) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tLocalCacheData.current_open_primary_controller.buildContextMenu( true );\n\t\t\t\t\t\tLocalCacheData.current_open_primary_controller.removeEditView();\n\t\t\t\t\t\tthis.cleanAnySubViewUI();\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\treturn;\n\n\t\t} else {\n\t\t\tLocalCacheData.edit_id_for_next_open_view = edit_id;\n\n\t\t\tif ( action ) {\n\t\t\t\tLocalCacheData.current_doing_context_action = action;\n\t\t\t}\n\n\t\t\tswitch ( view_id ) {\n\t\t\t\tcase 'TimeSheet':\n\t\t\t\tcase 'Schedule':\n\t\t\t\t\tif ( args.date ) {\n\t\t\t\t\t\tLocalCacheData.current_select_date = args.date;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tvar timeout_count;\n\t\ttimeout_count = 0;\n\t\tif ( LocalCacheData.loadViewRequiredJSReady ) {\n\t\t\tshowRibbonMenuAndLoadView();\n\t\t} else {\n\t\t\tvar auto_login_timer = setInterval( function() {\n\t\t\t\tif ( timeout_count == 100 ) {\n\t\t\t\t\tclearInterval( auto_login_timer );\n\t\t\t\t}\n\t\t\t\ttimeout_count = timeout_count + 1;\n\t\t\t\tif ( LocalCacheData.loadViewRequiredJSReady ) {\n\t\t\t\t\tshowRibbonMenuAndLoadView();\n\t\t\t\t\tclearInterval( auto_login_timer );\n\t\t\t\t}\n\t\t\t}, 600 );\n\t\t}\n\n\t\tfunction showRibbonMenuAndLoadView() {\n\n\t\t\tIndexViewController.autoLogin( function() {\n\t\t\t\t$( 'body' ).removeClass( 'login-bg' );\n\t\t\t\t// Global.loadStyleSheet( '../../theme/default/portal/css/portal.css' + '?v=' + APIGlobal.pre_login_data.application_build ); // Trialling the loading of this stylesheet earlier, in portal-styles.js to aid with loading screen styling.\n\t\t\t\tGlobal.loadStyleSheet( '../../framework/bootstrap-select/css/bootstrap-select.min.css' + '?v=' + APIGlobal.pre_login_data.application_build );\n\t\t\t\t// $( 'link[title=\"application css\"]' ).prop( 'disabled', true ); // no longer needed as application.css not loaded now. See the lines above on portal.css. Or for context see #2833 and 65ae7d9c1bf7f9e6102e1faf43a989060416fa99\n\t\t\t\tif ( !$this.headerView ) {\n\t\t\t\t\t$this.headerView = new _views_portal_header_HeaderViewController__WEBPACK_IMPORTED_MODULE_0__.HeaderViewController();\n\t\t\t\t\t$( '#topContainer' ).html( $this.headerView.el );\n\t\t\t\t\tloadViewController();\n\t\t\t\t} else {\n\t\t\t\t\tif ( $this.headerView.profileView && $this.headerView.profileView.is_changed ) {\n\t\t\t\t\t\t$this.showConfirmModal( $.i18n._( 'You have modified data without saving, are you sure you want to continue and lose your changes' ), {\n\t\t\t\t\t\t\ttitle: '',\n\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: \"No\", isClose: true, callBack: function( e ) {\n\t\t\t\t\t\t\t\t\t\t$this.navigate( '#!m=MyProfile&company_id=' + LocalCacheData.getAllURLArgs().company_id, {\n\t\t\t\t\t\t\t\t\t\t\ttrigger: false,\n\t\t\t\t\t\t\t\t\t\t\treplace: true\n\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: 'Yes', callBack: function( e ) {\n\t\t\t\t\t\t\t\t\t\t$this.hideConfirmModal();\n\t\t\t\t\t\t\t\t\t\theaderRender();\n\t\t\t\t\t\t\t\t\t\tloadViewController();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t} );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\t\t\t\t\t\theaderRender();\n\t\t\t\t\t\tloadViewController();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\tfunction headerRender() {\n\t\t\t$this.headerView.jobVacancyViewController = null;\n\t\t\t$this.headerView.profileView = null;\n\t\t\t$this.headerView.render();\n\t\t}\n\n\t\tfunction loadViewController() {\n\t\t\tsetTimeout( function() {\n\t\t\t\tGlobal.topContainer().css( 'display', 'block' );\n\t\t\t\tGlobal.bottomContainer().css( 'display', 'block' );\n\n\t\t\t\tGlobal.showPoweredBy();\n\t\t\t}.bind(this), 50 );\n\n\t\t\tGlobal.loadViewSource( view_id, view_id + 'ViewController.js', function() {\n\t\t\t\t_views_portal_PortalBaseViewController__WEBPACK_IMPORTED_MODULE_1__.PortalBaseViewController.loadView( view_id );\n\t\t\t} );\n\t\t}\n\n\t\tfunction checkIds() {\n\n\t\t\tif ( Global.isArray( LocalCacheData.current_open_primary_controller.current_edit_record ) ) {\n\t\t\t\tfor ( var i = 0; i < LocalCacheData.current_open_primary_controller.current_edit_record.length; i++ ) {\n\t\t\t\t\tvar item = LocalCacheData.current_open_primary_controller.current_edit_record[i];\n\n\t\t\t\t\tif ( item.id === edit_id ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\titem = LocalCacheData.current_open_primary_controller.current_edit_record;\n\t\t\t\tif ( item.id === edit_id ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tfunction openEditView( edit_id, view_mode ) {\n\t\t\tvar type;\n\t\t\tswitch ( view_id ) {\n\t\t\t\tcase 'MessageControl':\n\t\t\t\t\ttype = args.t;\n\t\t\t\t\tvar item = {};\n\t\t\t\t\tif ( type === 'message' ) {\n\t\t\t\t\t\titem.id = edit_id;\n\t\t\t\t\t} else {\n\t\t\t\t\t\titem.object_id = edit_id;\n\t\t\t\t\t\titem.object_type_id = 50;\n\t\t\t\t\t}\n\t\t\t\t\tLocalCacheData.current_open_primary_controller.onViewClick( item );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'TimeSheet':\n\t\t\t\t\ttype = args.t;\n\n\t\t\t\t\tif ( !view_mode ) {\n\t\t\t\t\t\tif ( edit_id ) {\n\t\t\t\t\t\t\tLocalCacheData.current_open_primary_controller.onEditClick( edit_id, type );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tLocalCacheData.current_open_primary_controller.onAddClick();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( edit_id ) {\n\t\t\t\t\t\t\tLocalCacheData.current_open_primary_controller.onViewClick( edit_id, type );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\n\t\t\t\t\tif ( !view_mode ) {\n\t\t\t\t\t\tif ( edit_id ) {\n\t\t\t\t\t\t\tLocalCacheData.current_open_primary_controller.onEditClick( edit_id );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tLocalCacheData.current_open_primary_controller.onAddClick();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( edit_id ) {\n\t\t\t\t\t\t\tLocalCacheData.current_open_primary_controller.onViewClick( edit_id );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t}\n\n\t/* jshint ignore:end */\n\n\tcleanAnySubViewUI() {\n\t\tvar children = Global.contentContainer().children();\n\n\t\tif ( children.length > 1 ) {\n\t\t\tfor ( var i = 1; i < children.length; i++ ) {\n\t\t\t\t// Object doesn't support property or method 'remove', Not sure why, add try catch to ingore this error since this should no harm\n\t\t\t\ttry {\n\n\t\t\t\t\tif ( $( children[i] ).attr( 'id' ) === LocalCacheData.current_open_primary_controller.ui_id ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchildren[i].remove();\n\t\t\t\t\t}\n\n\t\t\t\t} catch ( e ) {\n\t\t\t\t\t//Do nothing\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}\n\n\tsetContentDivHeight() {\n\t\tGlobal.contentContainer().removeClass( 'content-container' );\n\t\tGlobal.contentContainer().addClass( 'content-container-after-login' );\n\t\tGlobal.topContainer().addClass( 'top-container-after-login' );\n\n\t}\n\n\taddTopMenu() {\n\t\tGlobal.loadScript( 'global/widgets/top_menu/TopMenuController.js' );\n\t\tif ( TopMenuController ) {\n\t\t\tTopMenuController.loadView();\n\t\t}\n\n\t}\n\n\tshowFormModal( element, options ) {\n\t\tvar $this = this;\n\t\tif ( $( '#formModal' ).is( ':visible' ) ) {\n\t\t\tthis.hideFormModal();\n\t\t\tsetTimeout( function() {\n\t\t\t\tdoNext();\n\t\t\t}, 500 );\n\t\t} else {\n\t\t\tdoNext();\n\t\t}\n\n\t\tfunction doNext() {\n\t\t\t!options && ( options = { title: '...', actions: [] } );\n\t\t\tif ( $( '#formModal' ).length > 0 ) {\n\t\t\t\t$( '#formModal' ).modal( {\n\t\t\t\t\tbackdrop: 'static',\n\t\t\t\t\tshow: true\n\t\t\t\t} );\n\t\t\t}\n\t\t\t$( '#formModalLabel' ).text( options.title );\n\t\t\t$( '#formModalBody' ).html( element );\n\t\t\tif ( options.actions.length > 0 ) {\n\t\t\t\t$( '#formModalFooter' ).empty();\n\t\t\t\t_.each( options.actions, function( item ) {\n\t\t\t\t\tvar button = $( '<button type=\"button\" class=\"btn\"></button>' );\n\t\t\t\t\titem.isClose && button.attr( 'data-dismiss', 'modal' );\n\t\t\t\t\tbutton.text( item.label );\n\t\t\t\t\titem.class && ( button.addClass( item.class ) );\n\t\t\t\t\t!item.class && button.addClass( 'btn-primary' );\n\t\t\t\t\tif ( item.callBack ) {\n\t\t\t\t\t\tif ( item.isClose ) {\n\t\t\t\t\t\t\t$( '#formModal' ).find( 'button.close' ).unbind( 'click' ).bind( 'click', item.callBack.bind( self ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbutton.unbind( 'click' ).bind( 'click', item.callBack.bind( self ) );\n\t\t\t\t\t}\n\t\t\t\t\t$( '#formModalFooter' ).append( button );\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t}\n\n\tshowTipModal( element, options ) {\n\t\tvar $this = this;\n\t\tif ( $( '#tipModal' ).is( ':visible' ) ) {\n\t\t\tthis.hideTipModal();\n\t\t\tsetTimeout( function() {\n\t\t\t\tdoNext();\n\t\t\t}, 500 );\n\t\t} else {\n\t\t\tdoNext();\n\t\t}\n\n\t\tfunction doNext() {\n\t\t\t!options && ( options = { title: '...', actions: [], style: {} } );\n\t\t\t$( '#tipModal' ).find( '.modal-content' ).css( options.style );\n\t\t\tif ( $( '#tipModal' ).length > 0 ) {\n\t\t\t\t$( '#tipModal' ).modal( 'show' );\n\t\t\t}\n\t\t\t$( '#tipModalBody' ).html( element );\n\t\t\t$this.autoHideTipModal();\n\t\t}\n\t}\n\n\tshowConfirmModal( element, options ) {\n\t\tvar $this = this;\n\t\tif ( $( '#confirmModal' ).is( ':visible' ) ) {\n\t\t\tthis.hideConfirmModal();\n\t\t\tsetTimeout( function() {\n\t\t\t\tdoNext();\n\t\t\t}, 500 );\n\t\t} else {\n\t\t\tdoNext();\n\t\t}\n\n\t\tfunction doNext() {\n\t\t\t!options && ( options = { title: '...', actions: [] } );\n\t\t\tif ( $( '#confirmModal' ).length > 0 ) {\n\t\t\t\t$( '#confirmModal' ).modal( {\n\t\t\t\t\tbackdrop: 'static',\n\t\t\t\t\tshow: true\n\t\t\t\t} );\n\t\t\t}\n\t\t\t$( '#confirmModalLabel' ).text( options.title );\n\t\t\t$( '#confirmModalBody' ).html( element );\n\t\t\tif ( options.actions.length > 0 ) {\n\t\t\t\t$( '#confirmModalFooter' ).empty();\n\t\t\t\t_.each( options.actions, function( item ) {\n\t\t\t\t\tvar button = $( '<button type=\"button\" class=\"btn\"></button>' );\n\t\t\t\t\titem.isClose && button.attr( 'data-dismiss', 'modal' );\n\t\t\t\t\tbutton.text( item.label );\n\t\t\t\t\titem.class && ( button.addClass( item.class ) );\n\t\t\t\t\t!item.class && button.addClass( 'btn-primary' );\n\t\t\t\t\tif ( item.callBack ) {\n\t\t\t\t\t\tbutton.unbind( 'click' ).bind( 'click', item.callBack.bind( self ) );\n\t\t\t\t\t}\n\t\t\t\t\t$( '#confirmModalFooter' ).append( button );\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t}\n\n\tshowSignInModal( element, options ) {\n\t\tvar $this = this;\n\t\tif ( $( '#signinModal' ).is( ':visible' ) ) {\n\t\t\tthis.hideSignInModal();\n\t\t\tsetTimeout( function() {\n\t\t\t\tdoNext();\n\t\t\t}, 500 );\n\t\t} else {\n\t\t\tdoNext();\n\t\t}\n\n\t\tfunction doNext() {\n\t\t\t!options && ( options = { title: '...', actions: [] } );\n\t\t\tif ( $( '#signinModal' ).length > 0 ) {\n\t\t\t\t$( '#signinModal' ).modal( {\n\t\t\t\t\tbackdrop: 'static',\n\t\t\t\t\tshow: true\n\t\t\t\t} );\n\t\t\t}\n\t\t\t$( '#signinModalLabel' ).text( options.title );\n\t\t\t$( '#signinModalBody' ).html( element );\n\t\t\tif ( options.actions.length > 0 ) {\n\t\t\t\t$( '#signinModalFooter' ).empty();\n\t\t\t\t_.each( options.actions, function( item ) {\n\t\t\t\t\tvar button = $( '<button type=\"button\" class=\"btn\"></button>' );\n\t\t\t\t\titem.isClose && button.attr( 'data-dismiss', 'modal' );\n\t\t\t\t\tbutton.text( item.label );\n\t\t\t\t\titem.class && ( button.addClass( item.class ) );\n\t\t\t\t\t!item.class && button.addClass( 'btn-primary' );\n\t\t\t\t\tif ( item.callBack ) {\n\t\t\t\t\t\tif ( item.isClose ) {\n\t\t\t\t\t\t\t$( '#signinModal' ).find( 'button.close' ).unbind( 'click' ).bind( 'click', item.callBack.bind( self ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbutton.unbind( 'click' ).bind( 'click', item.callBack.bind( self ) );\n\t\t\t\t\t}\n\t\t\t\t\t$( '#signinModalFooter' ).append( button );\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t}\n\n\tautoHideTipModal() {\n\t\tvar $this = this;\n\t\tsetTimeout( function() {\n\t\t\t$this.hideTipModal();\n\t\t}, 5000 );\n\t}\n\n\thideTipModal() {\n\t\t$( '#tipModal' ).modal( 'hide' );\n\t}\n\n\thideFormModal() {\n\t\t$( '#formModal' ).modal( 'hide' );\n\t}\n\n\thideSignInModal() {\n\t\t$( '#signinModal' ).modal( 'hide' );\n\t}\n\n\thideConfirmModal() {\n\t\t$( '#confirmModal' ).modal( 'hide' );\n\t}\n\n\tremoveCurrentView( callBack ) {\n\t\tif ( LocalCacheData.current_open_edit_only_controller ) {\n\t\t\tclean( LocalCacheData.current_open_edit_only_controller );\n\t\t\tLocalCacheData.current_open_edit_only_controller = null;\n\t\t}\n\n\t\tif ( LocalCacheData.current_open_primary_controller ) {\n\t\t\tif ( LocalCacheData.current_open_primary_controller.edit_view ) {\n\t\t\t\tclean( LocalCacheData.current_open_primary_controller );\n\t\t\t}\n\t\t\tGlobal.contentContainer().empty();\n\t\t\tLocalCacheData.current_open_primary_controller.cleanWhenUnloadView( callBack );\n\t\t} else {\n\n\t\t\tif ( Global.isSet( callBack ) ) {\n\t\t\t\tcallBack();\n\t\t\t}\n\t\t}\n\n\t\tfunction clean( viewController ) {\n\t\t\tviewController.clearErrorTips();\n\t\t\t// Cannot read property 'remove' of null in interface/html5/IndexController.js?v=9.0.0-20151016-153057 line 439\n\t\t\tif ( viewController.edit_view ) {\n\t\t\t\tviewController.edit_view.remove();\n\t\t\t}\n\t\t\tviewController.sub_log_view_controller = null;\n\t\t\tviewController.edit_view_ui_dic = {};\n\t\t\tviewController.edit_view_ui_validation_field_dic = {};\n\t\t\tviewController.edit_view_form_item_dic = {};\n\t\t\tviewController.edit_view_error_ui_dic = {};\n\t\t\tLocalCacheData.current_doing_context_action = '';\n\t\t}\n\t}\n\n}\n\nclass IndexViewController extends Backbone.View {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: 'body', //So we can add event listener for all elements\n\t\t\trouter: null,\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinitialize( options ) {\n\t\tthis.router = new ApplicationRouter();\n\n\t\t//Set title in index.php instead.\n\t\t//$( 'title' ).html( '' );\n\n\t\tthis.router.controller = this;\n\t\t//Error: Backbone.history has already been started in interface/html5/framework/backbone/backbone-min.js?v=9.0.1-20151022-162110 line 28\n\t\tif ( !Backbone.History.started ) {\n\t\t\tBackbone.history.start();\n\t\t}\n\n\t\tIndexViewController.instance = this;\n\n\t}\n\n}\n\nIndexViewController.autoLogin = function( callback ) {\n\tvar session_cookie = getCookie( Global.getSessionIDKey() );\n\tvar login_data = LocalCacheData.getLoginData();\n\tif ( session_cookie && session_cookie.length >= 40 && login_data && login_data.is_logged_in == true ) {\n\t\t//Setup user data when browser is refreshed and they are already logged in.\n\t\tIndexViewController.setPortalLoginUserData( session_cookie, callback );\n\t} else {\n\t\tcallback();\n\t}\n};\n\nIndexViewController.setPortalLoginUserData = function( session_id, callback ) {\n\t//Setup Job Appicant data upon login.\n\tif ( LocalCacheData.getPortalLoginUser() === null ) {\n\t\tvar $this = this;\n\n\t\tLocalCacheData.setSessionID( session_id );\n\t\tsetCookie( Global.getSessionIDKey(), session_id );\n\n\t\tthis.doing_login = true;\n\n\t\tthis.jobapplicant_api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_2__/* .TTAPI.APIJobApplicantPortal */ .y.APIJobApplicantPortal;\n\t\tthis.jobapplicant_api.getJobApplicant( {\n\t\t\tonResult: function( result ) {\n\t\t\t\tif ( result.isValid() ) {\n\t\t\t\t\tLocalCacheData.setPortalLoginUser( result.getResult()[0] );\n\t\t\t\t}\n\n\t\t\t\t$this.doing_login = false;\n\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t} else {\n\t\tcallback();\n\t}\n};\n\nIndexViewController.goToView = function( view_name, filter ) {\n\n\t$( '#' + view_name ).addClass( 'selected-menu' );\n\tLocalCacheData.default_filter_for_next_open_view = filter;\n\n\t// TopMenuManager.goToView( view_name, true );\n\tMenuManager.goToView( view_name, true );\n\n};\n\nIndexViewController.goToViewByViewLabel = function( view_label ) {\n\tvar view_name;\n\tswitch ( view_label ) {\n\t\tcase 'Exceptions':\n\t\t\tview_name = 'Exception';\n\t\t\tbreak;\n\t\tcase 'Messages':\n\t\t\tview_name = 'MessageControl';\n\t\t\tbreak;\n\t\tcase 'Requests':\n\t\t\tview_name = 'Request';\n\t\t\tbreak;\n\t\tcase 'Contact Information':\n\t\t\tIndexViewController.openEditView( LocalCacheData.current_open_primary_controller, 'LoginUserContact' );\n\t\t\treturn;\n\t\tdefault:\n\t\t\tvar reg = /\\s/g;\n\t\t\tview_name = view_label.replace( reg, '' );\n\t\t\tbreak;\n\t}\n\n\tMenuManager.goToView( view_name, true );\n\n};\n\nIndexViewController.openWizard = function( wizardName, defaultData, callBack ) {\n\tBaseWizardController.default_data = defaultData;\n\tBaseWizardController.call_back = callBack;\n\tswitch ( wizardName ) {\n\t\tdefault:\n\t\t\t// track edit view only view\n\t\t\tGlobal.trackView( wizardName );\n\t\t\tGlobal.loadViewSource( wizardName, wizardName + 'Controller.js', function() {\n\t\t\t\tBaseWizardController.openWizard( wizardName, wizardName + '.html' );\n\t\t\t} );\n\t\t\tbreak;\n\t}\n\n};\n\nIndexViewController.openReport = function( parent_view_controller, view_name, id ) {\n\tvar view_controller = null;\n\n\tif ( LocalCacheData.current_open_report_controller ) {\n\t\tLocalCacheData.current_open_report_controller.removeEditView();\n\t}\n\n\tProgressBar.showOverlay();\n\n\tswitch ( view_name ) {\n\t\tdefault:\n\t\t\tGlobal.loadViewSource( view_name, view_name + 'ViewController.js', function() {\n\t\t\t\t/* jshint ignore:start */\n\t\t\t\tview_controller = eval( 'new ' + view_name + 'ViewController( {edit_only_mode: true} ); ' );\n\t\t\t\t/* jshint ignore:end */\n\t\t\t\tview_controller.parent_view_controller = parent_view_controller;\n\t\t\t\tview_controller.openEditView();\n\n\t\t\t\tvar current_url = window.location.href;\n\t\t\t\tif ( current_url.indexOf( '&sm' ) > 0 ) {\n\t\t\t\t\tcurrent_url = current_url.substring( 0, current_url.indexOf( '&sm' ) );\n\t\t\t\t}\n\t\t\t\tcurrent_url = current_url + '&sm=' + view_name;\n\n\t\t\t\tif ( LocalCacheData.default_edit_id_for_next_open_edit_view ) {\n\t\t\t\t\tcurrent_url = current_url + '&sid=' + LocalCacheData.default_edit_id_for_next_open_edit_view;\n\t\t\t\t}\n\t\t\t\tGlobal.setURLToBrowser( current_url );\n\n\t\t\t} );\n\t\t\tbreak;\n\t}\n\n};\n\n//Open edit view\nIndexViewController.openEditView = function( parent_view_controller, view_name, id ) {\n\tvar view_controller = null;\n\n\tif ( !PermissionManager.checkTopLevelPermission( view_name ) && view_name !== 'map' ) {\n\t\t_global_TAlertManager__WEBPACK_IMPORTED_MODULE_3__/* .TAlertManager.showAlert */ .K.showAlert( 'Permission denied' );\n\t\treturn;\n\t}\n\n\t//Merge conflict from RecruitmentPortal. This seemed to have removed the permission check, but that would break the application UI?\n\t//if ( LocalCacheData.current_open_edit_only_controller ) {\n\t//\tLocalCacheData.current_open_edit_only_controller.onCancelClick();\n\t//}\n\n\t// track edit view only view\n\tGlobal.trackView( view_name );\n\n\tswitch ( view_name ) {\n\n\t\tdefault:\n\t\t\tGlobal.loadViewSource( view_name, view_name + 'ViewController.js', function() {\n\t\t\t\t/* jshint ignore:start */\n\t\t\t\tview_controller = eval( 'new ' + view_name + 'ViewController( {edit_only_mode: true} ); ' );\n\t\t\t\t/* jshint ignore:end */\n\t\t\t\tview_controller.parent_view_controller = parent_view_controller;\n\t\t\t\tview_controller.openEditView( id );\n\n\t\t\t\tvar current_url = window.location.href;\n\t\t\t\tif ( current_url.indexOf( '&sm' ) > 0 ) {\n\t\t\t\t\tcurrent_url = current_url.substring( 0, current_url.indexOf( '&sm' ) );\n\t\t\t\t}\n\t\t\t\tif ( id ) {\n\t\t\t\t\tcurrent_url = current_url + '&sm=' + view_name + '&sid=' + id;\n\t\t\t\t} else {\n\t\t\t\t\tcurrent_url = current_url + '&sm=' + view_name;\n\t\t\t\t}\n\n\t\t\t\tGlobal.setURLToBrowser( current_url );\n\n\t\t\t\tLocalCacheData.current_open_edit_only_controller = view_controller;\n\n\t\t\t} );\n\t\t\tbreak;\n\n\t}\n\n};\n\nIndexViewController.instance = null;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTc0OC5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQWtGO0FBQ0M7QUFDOUI7QUFDRTs7QUFFaEQ7QUFDUCwyQkFBMkI7QUFDM0IsRUFBR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ubG9jYXRpb24uaHJlZjtcblx0XHRcdFx0aWYgKCBjdXJyZW50X3VybC5pbmRleE9mKCAnJnNtJyApID4gMCApIHtcblx0XHRcdFx0XHRjdXJyZW50X3VybCA9IGN1cnJlbnRfdXJsLnN1YnN0cmluZyggMCwgY3VycmVudF91cmwuaW5kZXhPZiggJyZzbScgKSApO1xuXHRcdFx0XHR9XG5cdFx0XHRcdGlmICggaWQgKSB7XG5cdFx0XHRcdFx0Y3VycmVudF91cmwgPSBjdXJyZW50X3VybCArICcmc209JyArIHZpZXdfbmFtZSArICcmc2lkPScgKyBpZDtcblx0XHRcdFx0fSBlbHNlIHtcblx0XHRcdFx0XHRjdXJyZW50X3VybCA9IGN1cnJlbnRfdXJsICsgJyZzbT0nICsgdmlld19uYW1lO1xuXHRcdFx0XHR9XG5cblx0XHRcdFx0R2xvYmFsLnNldFVSTFRvQnJvd3NlciggY3VycmVudF91cmwgKTtcblxuXHRcdFx0XHRMb2NhbENhY2hlRGF0YS5jdXJyZW50X29wZW5fZWRpdF9vbmx5X2NvbnRyb2xsZXIgPSB2aWV3X2NvbnRyb2xsZXI7XG5cblx0XHRcdH0gKTtcblx0XHRcdGJyZWFrO1xuXG5cdH1cblxufTtcblxuSW5kZXhWaWV3Q29udHJvbGxlci5pbnN0YW5jZSA9IG51bGw7Il0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///1748\n")},97:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"PortalBaseViewController\": () => (/* binding */ PortalBaseViewController)\n/* harmony export */ });\n/* harmony import */ var bootstrap_select__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(300);\n/* harmony import */ var bootstrap_select__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(bootstrap_select__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6739);\n/* harmony import */ var _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7526);\n/* harmony import */ var _portal_recruitment_IndexController__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1748);\n/* harmony import */ var _views_portal_hr_recruitment_PortalJobVacancyRowController__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1730);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\n\n // For the reference in the html file PortalJobVacancyView.html loaded from this file.\n\n\nclass PortalBaseViewController extends _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_1__.TTBackboneView {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tcan_cache_controller: true, //if allow to cache current controller\n\t\t\tpager_data: null,\n\t\t\t// required_files: [],\n\n\t\t\tevents: {\n\t\t\t\t'click .search-btn': 'onSearchClick',\n\t\t\t\t'change select[id=\"country\"]': 'onCountryChange',\n\t\t\t\t// 'click .more': 'loadMore'\n\t\t\t\t// 'click .styled-select .glyphicon': 'onSelectClick',\n\t\t\t\t'keydown input[id=\"name\"]': 'autoSearch',\n\t\t\t\t// 'change select[id=\"province\"]': 'onSearchClick',\n\t\t\t\t'keydown input[id=\"city\"]': 'autoSearch'\n\t\t\t}\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinitialize( options ) {\n\t\tsuper.initialize( options );\n\n\t\tthis.preInit( options );\n\n\t\t// __non_webpack_require__( this.getRequiredFiles(), function() {\n\t\tthis.company_api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_2__/* .TTAPI.APICompanyPortal */ .y.APICompanyPortal;\n\t\tLocalCacheData.current_open_primary_controller = this;\n\t\tthis.init();\n\t\tthis.postInit( options );\n\t\t// } );\n\t}\n\n\t// getRequiredFiles() {\n\t// \t//override in child class\n\t// \treturn this.required_files.concat( this._required_files );\n\t// }\n\n\tpreInit() {\n\t\t//Override in child class.\n\t\treturn;\n\t}\n\n\tinit() {\n\t\t//Override in child class.\n\t\treturn;\n\t}\n\n\tpostInit() {\n\t\t//Override in child class.\n\t\treturn;\n\t}\n\n\trender() {\n\t\tvar $this = this;\n\t\tProgressBar.showOverlay();\n\t\tthis.initOptions( function() {\n\t\t\t$this.search();\n\t\t} );\n\n\t\t$( window ).off( 'scroll' ).on( 'scroll', Global.debounce( function() {\n\t\t\tif ( $this.isOnScreen( '.more.container' ) ) {\n\t\t\t\t$this.loadMore();\n\t\t\t}\n\t\t}, 200 ) );\n\t}\n\n\tisOnScreen( element_id ) {\n\t\tlet element = $( element_id );\n\n\t\tif ( element.length === 0 || !element.is( ':visible' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tlet bounding = element[0].getBoundingClientRect();\n\n\t\tif ( bounding.top >= 0 && bounding.left >= 0 && bounding.right <= ( window.innerWidth || document.documentElement.clientWidth ) && bounding.bottom <= ( window.innerHeight || document.documentElement.clientHeight ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tautoSearch( e ) {\n\t\tif ( e.keyCode === 13 ) {\n\t\t\tthis.onSearchClick();\n\t\t}\n\t}\n\n\tinitOptions( callback ) {\n\t\tthis.initCountryOptions( callback );\n\t}\n\n\tinitCountryOptions( callback ) {\n\t\tvar $this = this;\n\t\tthis.company_api.getOptions( 'country', {\n\t\t\tonResult: function( result ) {\n\t\t\t\tvar result = result.getResult();\n\t\t\t\t$this.$( '#country' ).append( $( '<option></option>' ).prop( 'value', '' ).attr( 'selected', 'selected' ).text( $.i18n._( 'All Countries' ) ) );\n\t\t\t\t$.each( result, function( value, label ) {\n\t\t\t\t\t$this.$( '#country' ).append( $( '<option></option>' ).prop( 'value', value ).text( $.i18n._( label ) ) );\n\t\t\t\t} );\n\t\t\t\t$this.$( '#country' ).selectpicker();\n\t\t\t\t$this.$( '#province' ).selectpicker();\n\t\t\t\tcallback();\n\t\t\t}\n\t\t} );\n\t}\n\n\tonCountryChange() {\n\t\tthis.eSetProvince( this.$( 'select[id=\"country\"]' ).val() );\n\t}\n\n\teSetProvince( val ) {\n\t\tvar $this = this;\n\t\t$this.$( '#province' ).selectpicker( 'destroy' );\n\t\tif ( !val ) {\n\t\t\t$this.$( '#province' ).html( $( '<option></option>' ).prop( 'value', '' ).attr( 'selected', 'selected' ).text( $.i18n._( 'All Province/States' ) ) );\n\t\t\t$this.$( '#province' ).selectpicker();\n\t\t\treturn;\n\t\t}\n\t\tthis.company_api.getOptions( 'province', val, {\n\t\t\tonResult: function( result ) {\n\t\t\t\tresult = result.getResult();\n\t\t\t\tif ( !result ) {\n\t\t\t\t\tresult = [];\n\t\t\t\t}\n\t\t\t\t$this.$( '#province' ).html( $( '<option></option>' ).prop( 'value', '' ).attr( 'selected', 'selected' ).text( $.i18n._( 'All Province/States' ) ) );\n\t\t\t\t$.each( result, function( value, label ) {\n\t\t\t\t\t$this.$( '#province' ).append( $( '<option></option>' ).prop( 'value', value ).text( $.i18n._( label ) ) );\n\t\t\t\t} );\n\t\t\t\t$this.$( '#province' ).selectpicker();\n\t\t\t}\n\t\t} );\n\t}\n\n\tloadMore() {\n\t\tthis.onSearchClick( {\n\t\t\tpage_action: 'next'\n\t\t} );\n\t}\n\n\taddSearchResultPanel() {\n\t}\n\n\tonSearchClick( options ) {\n\t\tvar $this = this;\n\t\tvar filter = {};\n\t\tthis.addSearchResultPanel();\n\t\t// first load\n\t\tif ( typeof options == 'undefined' ) {\n\t\t\toptions = {};\n\t\t}\n\t\tif ( typeof options.page_action == 'undefined' ) {\n\t\t\tthis.$( '.search-result .content' ).empty();\n\t\t}\n\t\tthis.vacancy_list_panel = this.$( '.search-result .content' );\n\t\tthis.more_btn = this.$( '.search-result .more' );\n\t\tthis.more_btn.unbind( 'click' ).bind( 'click', function() {\n\t\t\t$this.loadMore();\n\t\t} );\n\t\tfilter.filter_data = {};\n\t\tfilter.filter_sort = {};\n\t\tfilter.filter_items_per_page = 0; // Default to 0 to load user preference defined\n\t\t// if ( this.$('#job_title_id').val() && parseInt( this.$('#job_title_id').val() ) > 0 ) {\n\t\t// \tfilter.filter_data['title_id'] = this.$('#job_title_id').val();\n\t\t// }\n\t\tif ( this.$( '#name' ).val() && this.$( '#name' ).val() != '' ) {\n\t\t\tfilter.filter_data['name'] = this.$( '#name' ).val();\n\t\t}\n\t\tif ( this.$( '#country' ).val() && this.$( '#country' ).val() != '' ) {\n\t\t\tfilter.filter_data['country'] = this.$( '#country' ).val();\n\t\t}\n\t\tif ( this.$( '#province' ).val() && this.$( '#province' ).val() != '' ) {\n\t\t\tfilter.filter_data['province'] = this.$( '#province' ).val();\n\t\t}\n\t\tif ( this.$( '#city' ).val() && this.$( '#city' ).val() != '' ) {\n\t\t\tfilter.filter_data['city'] = this.$( '#city' ).val();\n\t\t}\n\t\tif ( this.pager_data ) {\n\t\t\tif ( options.page_action === 'next' ) {\n\t\t\t\tfilter.filter_page = this.pager_data.next_page;\n\t\t\t} else {\n\t\t\t\tfilter.filter_page = 1;\n\t\t\t}\n\t\t} else {\n\t\t\tfilter.filter_page = 1;\n\t\t}\n\t\tthis.api['get' + this.api.key_name]( filter, false, { // paging or none\n\t\t\tonResult: function( result ) {\n\t\t\t\t$this.pager_data = result.getPagerData();\n\t\t\t\tvar result_data = result.getResult();\n\t\t\t\tvar no_result_panel = $this.vacancy_list_panel.find( '.vacancy-list-no-result' );\n\t\t\t\tif ( no_result_panel[0] || ( $this.pager_data && $this.pager_data.is_first_page ) ) {\n\t\t\t\t\t$this.vacancy_list_panel.empty();\n\t\t\t\t}\n\t\t\t\tif ( !Global.isArray( result_data ) ) {\n\t\t\t\t\tvar no_result_span = $( '<div class=\"vacancy-list-no-result\">' + $.i18n._( 'No Results Found' ) + '</div>' );\n\t\t\t\t\t$this.vacancy_list_panel.html( no_result_span );\n\t\t\t\t} else {\n\t\t\t\t\tfor ( var i = 0; i < result_data.length; i++ ) {\n\t\t\t\t\t\tvar row = result_data[i];\n\t\t\t\t\t\tvar vacancy_model = new Backbone.Model( row );\n\t\t\t\t\t\tvar vacancy_row = new _views_portal_hr_recruitment_PortalJobVacancyRowController__WEBPACK_IMPORTED_MODULE_4__.PortalJobVacancyRowController( { model: vacancy_model } );\n\t\t\t\t\t\t$this.vacancy_list_panel.append( vacancy_row.el );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( !$this.pager_data || $this.pager_data.is_last_page || result_data === true ) {\n\t\t\t\t\t$this.more_btn.hide();\n\t\t\t\t} else {\n\t\t\t\t\t$this.more_btn.show();\n\t\t\t\t}\n\t\t\t\tif ( typeof options.callback != 'undefined' ) {\n\t\t\t\t\toptions.callback();\n\t\t\t\t}\n\t\t\t},\n\t\t\tonError: function () {\n\t\t\t\t//Issue #3083 - This search call is being aborted which will result in a blank page if the user quickly goes to \"My Profile\" and logs out immediately.\n\t\t\t\t//In addition, the async calls are being aborted, so we cannot call search again as all future calls are also aborted.\n\t\t\t\t//This is a rare enough scenario that we have opted to do a reload in this specific case.\n\t\t\t\twindow.location.reload();\n\t\t\t}\n\t\t} );\n\t}\n\n\tonSelectClick( e ) {\n\t\tvar elem = $( e.currentTarget ).parent().find( 'select' );\n\t\tif ( document.createEvent ) {\n\t\t\tvar e = document.createEvent( 'MouseEvents' );\n\t\t\te.initMouseEvent( 'mousedown', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null );\n\t\t\telem[0].dispatchEvent( e );\n\t\t} else if ( element.fireEvent ) {\n\t\t\telem[0].fireEvent( 'onmousedown' );\n\t\t}\n\t}\n}\n\nPortalBaseViewController.loadView = function( view_id ) {\n\tGlobal.loadViewSource( view_id, view_id + 'View.html', function( result ) {\n\t\tvar template = _.template( result )();\n\t\twindow.IndexViewController = _portal_recruitment_IndexController__WEBPACK_IMPORTED_MODULE_3__/* .IndexViewController */ .g; // // For the reference in the html file PortalJobVacancyView.html loaded from this file.\n\t\tGlobal.contentContainer().html( template );\n\n\t\tLocalCacheData.current_open_view_id = view_id;\n\n\t\t$( 'div.tooltip' ).remove(); //Issue #2676 - Removing tooltips on page load to prevent validation errors from lingering on screen.\n\n\t\tGlobal.trackView( view_id, LocalCacheData.current_doing_context_action );\n\t} );\n\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTcuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBQTBCO0FBQzhCO0FBQ0g7QUFDcUIsQ0FBQztBQUNpQzs7QUFFckcsdUNBQXVDLGlFQUFjO0FBQzVELDJCQUEyQjtBQUMzQixFQUFFLENBQUM7QUFDSDtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsSUFBSTs7QUFFSjtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQSxxQkFBcUIseUdBQXNCO0FBQzNDO0FBQ0E7QUFDQTtBQUNBLE9BQU87QUFDUDs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsSUFBSTs7QUFFSixFQUFFLENBQUM7QUFDSDtBQUNBO0FBQ0E7QUFDQSxHQUFHO0FBQ0g7O0FBRUE7QUFDQSxnQkFBZ0IsQ0FBQzs7QUFFakI7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQSxJQUFJO0FBQ0o7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxrQ0FBa0MsQ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mdfY29udGV4dF9hY3Rpb24gKTtcblx0fSApO1xuXG59O1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///97\n")},3295:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"HeaderUploadResumeWidget\": () => (/* binding */ HeaderUploadResumeWidget)\n/* harmony export */ });\n/* harmony import */ var _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6739);\n/* harmony import */ var _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7526);\n/* harmony import */ var _global_TTUUID__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4936);\n/* harmony import */ var _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\n\n\n\nclass HeaderUploadResumeWidget extends _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__.TTBackboneView {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {} );\n\n\t\tsuper( options );\n\t}\n\n\tinitialize( options ) {\n\t\tsuper.initialize( options );\n\t\tvar tpl = Global.loadWidget( 'views/portal/header/HeaderUploadResumeWidget.html' );\n\t\tthis.setElement( _.template( tpl )() );\n\t\tthis.document_id = null;\n\t\tthis.profileView = null;\n\t\tif ( options.profileView ) {\n\t\t\tthis.profileView = options.profileView;\n\t\t}\n\t\t// this.render();\n\t}\n\n\trender() {\n\t\tvar $this = this;\n\t\tif ( !this.uploader ) {\n\t\t\tthis.uploader = this.$( '.register-resume' ).TImageBrowser( {\n\t\t\t\tfield: 'file',\n\t\t\t\tname: 'filedata',\n\t\t\t\taccept_filter: '*',\n\t\t\t\tchangeHandler: function( a ) {\n\t\t\t\t\tvar file_name = $( this ).find( '.browser' )[0].files[0].name;\n\t\t\t\t\t$this.$( '#fileName' ).val( file_name );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\tIndexViewController.instance.router.showFormModal( this.$el, {\n\t\t\ttitle: $.i18n._( 'Upload Resume' ),\n\t\t\tactions: [\n\t\t\t\t{ label: 'Close', isClose: true },\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Upload Resume' ), callBack: function( e ) {\n\t\t\t\t\t\t$this.uploadResume();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t} );\n\t}\n\n\tuploadResume() {\n\t\tvar $this = this;\n\t\tif ( !this.uploader ) {\n\t\t\treturn false;\n\t\t}\n\t\tvar uploader = this.uploader;\n\t\tvar name = uploader.attr( 'file_name' );\n\t\tvar file = uploader.getValue();\n\t\tif ( file ) {\n\t\t\tthis.document_api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__/* .TTAPI.APIDocumentPortal */ .y.APIDocumentPortal;\n\t\t\tvar document_name = 'Resume' + ' - ' + LocalCacheData.getPortalLoginUser().first_name + ' ' + LocalCacheData.getPortalLoginUser().last_name;\n\t\t\tvar result = this.document_api.addAttachment( document_name, '', { async: false } ).getResult();\n\t\t\tthis.document_id = result['document_id'];\n\t\t\tthis.uploadFile( file, result['document_revision_id'] );\n\t\t}\n\t}\n\n\tuploadFile( file_data, document_revision_id ) {\n\t\tvar $this = this;\n\t\tvar url = _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_3__/* .ServiceCaller.getAPIURL */ .n.getAPIURL( 'Class=' + this.document_api.className + '&Method=uploadAttachment' + '&v=2' );\n\t\tif ( LocalCacheData.getAllURLArgs() ) {\n\t\t\tif ( LocalCacheData.getAllURLArgs().hasOwnProperty( 'company_id' ) ) {\n\t\t\t\turl = url + '&company_id=' + LocalCacheData.getAllURLArgs().company_id;\n\t\t\t}\n\t\t}\n\t\turl = url + '&object_id=' + document_revision_id;\n\t\tvar message_id = _global_TTUUID__WEBPACK_IMPORTED_MODULE_2__/* .TTUUID.generateUUID */ .d.generateUUID();\n\t\tProgressBar.showProgressBar( message_id );\n\t\tProgressBar.changeProgressBarMessage( $.i18n._( 'File Uploading' ) + '...' );\n\t\t$.ajax( {\n\t\t\turl: url, //Server script to process data\n\t\t\theaders: {\n\t\t\t\t//Handle CSRF tokens and related headers here.\n\t\t\t\t'X-Client-ID': 'Browser-TimeTrex',\n\t\t\t\t'X-CSRF-Token': getCookie( 'CSRF-Token' ),\n\t\t\t},\n\t\t\ttype: 'POST',\n\t\t\tdata: file_data,\n\t\t\tsuccess: function( res ) {\n\t\t\t\tProgressBar.removeProgressBar();\n\t\t\t\t$this.uploaded();\n\t\t\t\tif ( res.error ) {\n\t\t\t\t\t$this.showUploadedMessage( res.error );\n\t\t\t\t} else {\n\t\t\t\t\t$this.showUploadedMessage( $.i18n._( 'Upload Successful!' ) );\n\t\t\t\t\t$this.refreshSubDocument();\n\t\t\t\t}\n\t\t\t},\n\t\t\tcache: false,\n\t\t\tcontentType: false,\n\t\t\tprocessData: false\n\t\t} );\n\t}\n\n\trefreshSubDocument() {\n\t\tif ( this.profileView ) {\n\t\t\tthis.profileView.addDocumentRow( this.document_id );\n\t\t}\n\t}\n\n\tuploaded() {\n\t\tthis.uploader = null;\n\t\tIndexViewController.instance.router.hideFormModal();\n\t}\n\n\tshowUploadedMessage( message ) {\n\t\tIndexViewController.instance.router.showTipModal( message );\n\t}\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzI5NS5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQXdEO0FBQ0g7QUFDWjtBQUNnQjs7QUFFbEQsdUNBQXVDLGlFQUFjO0FBQzVELDJCQUEyQjtBQUMzQixFQUFFLENBQUMsdUJBQXVCOztBQUUxQjtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBLG1CQUFtQixDQUFDO0FBQ3BCO0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G5cdFx0XHRcdCR0aGlzLnVwbG9hZGVkKCk7XG5cdFx0XHRcdGlmICggcmVzLmVycm9yICkge1xuXHRcdFx0XHRcdCR0aGlzLnNob3dVcGxvYWRlZE1lc3NhZ2UoIHJlcy5lcnJvciApO1xuXHRcdFx0XHR9IGVsc2Uge1xuXHRcdFx0XHRcdCR0aGlzLnNob3dVcGxvYWRlZE1lc3NhZ2UoICQuaTE4bi5fKCAnVXBsb2FkIFN1Y2Nlc3NmdWwhJyApICk7XG5cdFx0XHRcdFx0JHRoaXMucmVmcmVzaFN1YkRvY3VtZW50KCk7XG5cdFx0XHRcdH1cblx0XHRcdH0sXG5cdFx0XHRjYWNoZTogZmFsc2UsXG5cdFx0XHRjb250ZW50VHlwZTogZmFsc2UsXG5cdFx0XHRwcm9jZXNzRGF0YTogZmFsc2Vcblx0XHR9ICk7XG5cdH1cblxuXHRyZWZyZXNoU3ViRG9jdW1lbnQoKSB7XG5cdFx0aWYgKCB0aGlzLnByb2ZpbGVWaWV3ICkge1xuXHRcdFx0dGhpcy5wcm9maWxlVmlldy5hZGREb2N1bWVudFJvdyggdGhpcy5kb2N1bWVudF9pZCApO1xuXHRcdH1cblx0fVxuXG5cdHVwbG9hZGVkKCkge1xuXHRcdHRoaXMudXBsb2FkZXIgPSBudWxsO1xuXHRcdEluZGV4Vmlld0NvbnRyb2xsZXIuaW5zdGFuY2Uucm91dGVyLmhpZGVGb3JtTW9kYWwoKTtcblx0fVxuXG5cdHNob3dVcGxvYWRlZE1lc3NhZ2UoIG1lc3NhZ2UgKSB7XG5cdFx0SW5kZXhWaWV3Q29udHJvbGxlci5pbnN0YW5jZS5yb3V0ZXIuc2hvd1RpcE1vZGFsKCBtZXNzYWdlICk7XG5cdH1cbn0iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///3295\n")},3246:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"HeaderViewController\": () => (/* binding */ HeaderViewController)\n/* harmony export */ });\n/* harmony import */ var _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6739);\n/* harmony import */ var _views_portal_sign_in_SignInController__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9903);\n/* harmony import */ var _views_portal_header_HeaderUploadResumeWidget__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3295);\n/* harmony import */ var _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12);\n/* harmony import */ var _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7526);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\n\n\n\n\nclass HeaderViewController extends _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__.TTBackboneView {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tevents: {\n\t\t\t\t'click .navbar-signin .login': 'goPortalLogin',\n\t\t\t\t'click .navbar-signin .logout': 'doLogout',\n\t\t\t\t'click .navbar-signin .profile': 'goProfile'\n\t\t\t\t// 'click .navbar-upload-resume > a': 'uploadResume'\n\t\t\t}\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinitialize( options ) {\n\t\tsuper.initialize( options );\n\t\tvar url;\n\t\tvar options = {};\n\t\tif ( LocalCacheData.getAllURLArgs().company_id ) {\n\t\t\turl = _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_3__/* .ServiceCaller.getAPIURL */ .n.getAPIURL( 'Class=APIDocumentPortal&Method=getCompanyLogo' + '&v=2' ) + '&company_id=' + LocalCacheData.getAllURLArgs().company_id;\n\t\t} else {\n\t\t\turl = '../../theme/default/portal/images/t_icon_logo.png';\n\t\t}\n\t\tvar tpl = Global.loadWidget( 'views/portal/header/HeaderView.html' );\n\t\tlet portal_vacancy_url = Global.getBaseURL() + '#!m=PortalJobVacancy&company_id=' + LocalCacheData.getAllURLArgs().company_id;\n\t\tthis.setElement( _.template( tpl )( { company_logo: url, portal_vacancy_link: portal_vacancy_url } ) );\n\t\tthis.uploadResumeWidget = null;\n\t\tthis.profileView = null;\n\t\tthis.jobVacancyDetailController = null;\n\t\tthis.jobVacancyViewController = null;\n\t\tthis.render();\n\t}\n\n\trender() {\n\t\tvar $this = this;\n\t\tif ( !LocalCacheData.getPortalLoginUser() ) {\n\t\t\tvar sign_in_container = $( '<a class=\"login\"></a>' );\n\t\t\tsign_in_container.attr( 'href', 'javascript:;' );\n\t\t\tsign_in_container.append( $( '<img>' ).attr( 'src', '../../theme/default/portal/images/t_icon_head.png' ) );\n\t\t\tsign_in_container.append( $( '<span>' ).text( $.i18n._( 'Login' ) ) );\n\t\t\tthis.$( '.navbar-signin' ).html( sign_in_container );\n\t\t} else {\n\t\t\tvar my_profile_container = $( '<div class=\"dropdown\">' );\n\t\t\tmy_profile_container.append( '<a href=\"javascript:;\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">' + LocalCacheData.getPortalLoginUser().first_name + ' ' + LocalCacheData.getPortalLoginUser().last_name + ' <span class=\"caret\"></span></a>' );\n\t\t\tvar dropdown_menus = $( '<ul class=\"dropdown-menu\">' );\n\t\t\tdropdown_menus.append( '<li><a class=\"profile\" href=\"javascript:;\">My Profile</a></li>' );\n\t\t\tdropdown_menus.append( '<li><a class=\"logout\" href=\"javascript:;\">Logout</a></li>' );\n\t\t\tmy_profile_container.append( dropdown_menus );\n\t\t\tthis.$( '.navbar-signin' ).html( my_profile_container );\n\t\t}\n\t}\n\n\tgoPortalLogin() {\n\t\tvar sign_controller = new _views_portal_sign_in_SignInController__WEBPACK_IMPORTED_MODULE_1__.SignInController( {\n\t\t\t_delegate: this.jobVacancyDetailController\n\t\t} );\n\t\t// $('#signinModal').modal({\n\t\t// \tbackdrop: 'static',\n\t\t// \tshow: true\n\t\t// });\n\t}\n\n\tdoLogout() {\n\t\tthis.clearErrorTips();\n\t\tvar $this = this;\n\t\tvar current_user_api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_4__/* .TTAPI.APIRecruitmentAuthentication */ .y.APIRecruitmentAuthentication;\n\t\tcurrent_user_api.Logout( {\n\t\t\tonResult: function( result ) {\n\t\t\t\tdeleteCookie( Global.getSessionIDKey() );\n\t\t\t\tLocalCacheData.setPortalLoginUser( false );\n\t\t\t\tLocalCacheData.current_open_view_id = ''; //#1528 - Logout icon not working.\n\t\t\t\t// $this.goPortalLogin();\n\t\t\t\t// $this.render();\n\t\t\t\t// if ( $this.jobVacancyDetailController ) {\n\t\t\t\t// \t$this.jobVacancyDetailController.render();\n\t\t\t\t// }\n\n\t\t\t\tif ( $this.jobVacancyViewController ) {\n\t\t\t\t\t$this.render();\n\t\t\t\t} else {\n\t\t\t\t\tIndexViewController.instance.router.navigate( '#!m=PortalJobVacancy&company_id=' + LocalCacheData.getAllURLArgs().company_id, {\n\t\t\t\t\t\ttrigger: true,\n\t\t\t\t\t\treplace: true\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t//needed for logout.\n\tclearErrorTips() {\n\t\t//harder here because we can't access the active controller's data from here.\n\t\tvar tips = $( '.error-tip' );\n\t\tfor ( var i = 0; i < tips.length; i++ ) {\n\t\t\t$( tips[i] ).removeClass( 'error-tip' );\n\t\t\t$( tips[i] ).tooltip().tooltip( 'dispose' );\n\t\t}\n\t}\n\n\tgoProfile() {\n\t\tvar location = Global.getBaseURL() + '#!m=MyProfile&company_id=' + LocalCacheData.getAllURLArgs()['company_id'];\n\t\twindow.location = location;\n\t}\n\n\tuploadResume() {\n\t\tvar $this = this;\n\t\tif ( !LocalCacheData.getPortalLoginUser() ) {\n\t\t\t// IndexViewController.instance.router.showTipModal('Please login first!')\n\t\t\t// setTimeout(function( ) {\n\t\t\t// \t$this.goPortalLogin();\n\t\t\t// }, 100)\n\t\t\tthis.goPortalLogin();\n\t\t} else {\n\t\t\tif ( !this.uploadResumeWidget ) {\n\t\t\t\tthis.uploadResumeWidget = new _views_portal_header_HeaderUploadResumeWidget__WEBPACK_IMPORTED_MODULE_2__.HeaderUploadResumeWidget( {\n\t\t\t\t\tprofileView: $this.profileView\n\t\t\t\t} );\n\t\t\t}\n\t\t\tthis.uploadResumeWidget.render();\n\t\t}\n\t}\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzI0Ni5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7OztBQUF3RDtBQUNtQjtBQUNlO0FBQ2pDO0FBQ0o7O0FBRTlDLG1DQUFtQyxpRUFBYztBQUN4RCwyQkFBMkI7QUFDM0IsRUFBRSxDQUFDO0FBQ0g7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsSUFBSTs7QUFFSjtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxTQUFTLCtGQUF1QjtBQUNoQyxJQUFJO0FBQ0o7QUFDQTtBQUNBO0FBQ0E7QUFDQSxtQkFBbUIsQ0FBQyxvQkFBb0IsNkRBQTZEO0FBQ3JHO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQSwyQkFBMkIsQ0FBQztBQUM1QixnREFBZ0Q7QUFDaEQsNkJBQTZCLENBQUM7QUFDOUIsNkJBQTZCLENBQUMsbUJBQW1CLENBQUM7QUFDbEQ7QUFDQSxJQUFJO0FBQ0osOEJBQThCLENBQUM7QUFDL0Isc0RBQXNEO0FBQ3RELHdCQUF3QixDQUFDO0FBQ3pCLG9FQUFvRTtBQUNwRSxtRUFBbUU7QUFDbkU7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQSw0QkFBNEIsb0ZBQWdCO0FBQzVDO0F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udXBsb2FkUmVzdW1lV2lkZ2V0LnJlbmRlcigpO1xuXHRcdH1cblx0fVxufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///3246\n")},1730:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"PortalJobVacancyRowController\": () => (/* binding */ PortalJobVacancyRowController)\n/* harmony export */ });\n/* harmony import */ var _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6739);\n/* provided dependency */ var _ = __webpack_require__(9050);\n\n\nclass PortalJobVacancyRowController extends _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__.TTBackboneView {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {} );\n\n\t\tsuper( options );\n\t}\n\n\tinitialize( options ) {\n\t\tsuper.initialize( options );\n\t\tvar $this = this;\n\t\tvar row = Global.loadWidget( 'views/portal/hr/recruitment/PortalJobVacancyRow.html' );\n\t\tfor ( var key in this.model.attributes ) {\n\t\t\tif ( this.model.get( key ) == false ) {\n\t\t\t\tthis.model.set( key, '' );\n\t\t\t}\n\t\t}\n\t\tthis.setElement( _.template( row )( this.model.toJSON() ) );\n\t\tthis.$el.on( 'click', function( e ) {\n\t\t\tvar url = Global.getBaseURL() + '#!m=PortalJobVacancyDetail&id=' + $this.model.id + '&company_id=' + LocalCacheData.getAllURLArgs().company_id;\n\t\t\twindow.location = url;\n\t\t} );\n\t}\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTczMC5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7QUFBd0Q7O0FBRWpELDRDQUE0QyxpRUFBYztBQUNqRSwyQkFBMkI7QUFDM0IsRUFBRSxDQUFDLHVCQUF1Qjs7QUFFMUI7QUFDQTs7QUFFQTt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KCByb3cgKSggdGhpcy5tb2RlbC50b0pTT04oKSApICk7XG5cdFx0dGhpcy4kZWwub24oICdjbGljaycsIGZ1bmN0aW9uKCBlICkge1xuXHRcdFx0dmFyIHVybCA9IEdsb2JhbC5nZXRCYXNlVVJMKCkgKyAnIyFtPVBvcnRhbEpvYlZhY2FuY3lEZXRhaWwmaWQ9JyArICR0aGlzLm1vZGVsLmlkICsgJyZjb21wYW55X2lkPScgKyBMb2NhbENhY2hlRGF0YS5nZXRBbGxVUkxBcmdzKCkuY29tcGFueV9pZDtcblx0XHRcdHdpbmRvdy5sb2NhdGlvbiA9IHVybDtcblx0XHR9ICk7XG5cdH1cbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///1730\n")},76:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"PortalForgotPasswordController\": () => (/* binding */ PortalForgotPasswordController)\n/* harmony export */ });\n/* harmony import */ var _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6739);\n/* harmony import */ var _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7526);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\n\nclass PortalForgotPasswordController extends _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__.TTBackboneView {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tevents: {\n\t\t\t\t'click .send-reset-email': 'sendResetEmail'\n\t\t\t}\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinitialize( options ) {\n\t\tsuper.initialize( options );\n\t\tthis.api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__/* .TTAPI.APIRecruitmentAuthentication */ .y.APIRecruitmentAuthentication;\n\t\tvar el = Global.loadWidget( 'views/portal/sign_in/PortalForgotPassword.html' );\n\t\tthis.setElement( _.template( el )() );\n\t\tthis.emailInput = this.$( '#email' );\n\t\tthis.render();\n\t}\n\n\trender() {\n\t\tvar $this = this;\n\t\tthis.emailInput.focus();\n\t\tthis.emailInput.unbind( 'keydown' ).bind( 'keydown', function( e ) {\n\t\t\tif ( e.keyCode === 13 ) {\n\t\t\t\t$this.sendResetEmail();\n\t\t\t}\n\t\t} );\n\t\t$( 'body' ).append( this.$el );\n\t\tthis.$el.modal( {\n\t\t\t'show': true,\n\t\t\t'backdrop': 'static'\n\t\t} );\n\t\tthis.$el.on( 'hidden.bs.modal', function() {\n\t\t\t$this.$el.remove();\n\t\t} );\n\t}\n\n\tsendResetEmail() {\n\t\tvar $this = this;\n\t\tvar email = this.emailInput.val();\n\t\tthis.api.resetPassword( email, {\n\t\t\tonResult: function( result ) {\n\t\t\t\tif ( !result.isValid() ) {\n\t\t\t\t\t$this.showErrorAlert( result );\n\t\t\t\t} else {\n\t\t\t\t\tvar response = result.getResult();\n\t\t\t\t\tif ( response.hasOwnProperty( 'email_sent' ) ) { // make sure email if is sent successfully\n\t\t\t\t\t\t$this.$el.modal( 'hide' );\n\t\t\t\t\t\tIndexViewController.instance.router.showTipModal( $.i18n._( 'An email has been sent to you with instructions on how to change your password.' ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\tshowErrorAlert( result ) {\n\t\tvar details = result.getDetails();\n\t\t// if ( details.hasOwnProperty( 'error' ) ) {\n\t\t//\n\t\t// }\n\t\tif ( !details ) {\n\t\t\tdetails = result.getDescription(); // If the details is empty, try to get description to show.\n\t\t}\n\t\tvar error_string = '';\n\n\t\tif ( Global.isArray( details ) || typeof details === 'object' ) {\n\n\t\t\t$.each( details, function( index, val ) {\n\n\t\t\t\tif ( val.hasOwnProperty( 'error' ) ) {\n\t\t\t\t\tval = val.error;\n\t\t\t\t}\n\t\t\t\tvar i = 0;\n\t\t\t\tfor ( var key in val ) {\n\t\t\t\t\terror_string = error_string + val[key];\n\t\t\t\t\tif ( i > 0 ) {\n\t\t\t\t\t\terror_string += '<br>';\n\t\t\t\t\t}\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\terror_string = details;\n\t\t}\n\t\tthis.emailInput.css( 'border', '1px solid red' );\n\t\tthis.emailInput.tooltip( {\n\t\t\ttitle: error_string\n\t\t} );\n\t\tthis.emailInput.tooltip( 'show' );\n\t}\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzYuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7QUFBd0Q7QUFDSDs7QUFFOUMsNkNBQTZDLGlFQUFjO0FBQ2xFLDJCQUEyQjtBQUMzQixFQUFFLENBQUM7QUFDSDtBQUNBO0FBQ0E7QUFDQSxJQUFJOztBQUVKO0FBQ0E7O0FBRUE7QUFDQTtBQUNBLGFBQWEsaUlBQWtDO0FBQy9DO0FBQ0EsbUJBQW1CLENBQUM7QUFDcEI7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsSUFBSTtBQUNKLEVBQUUsQ0FBQztBQUNIO0FBQ0E7QUFDQTtBQUNBLElBQUk7QUFDSjtBQUNBO0FBQ0EsSUFBSTtBQUNKOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsTUFBTTtBQUNOO0FBQ0Esc0RBQXNEO0FBQ3REO0FBQ0Esd0RBQXdELENBQUM7QUFDekQ7QUFDQTtBQUNBO0FBQ0EsSUFBSTtBQUNKOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLHNDQUFzQztBQUN0QztBQUNBOztBQUVBOztBQUVBLEdBQUcsQ0FBQzs7QUFFSjtBQUNBO0FBQ0E7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LCB2YWwgKSB7XG5cblx0XHRcdFx0aWYgKCB2YWwuaGFzT3duUHJvcGVydHkoICdlcnJvcicgKSApIHtcblx0XHRcdFx0XHR2YWwgPSB2YWwuZXJyb3I7XG5cdFx0XHRcdH1cblx0XHRcdFx0dmFyIGkgPSAwO1xuXHRcdFx0XHRmb3IgKCB2YXIga2V5IGluIHZhbCApIHtcblx0XHRcdFx0XHRlcnJvcl9zdHJpbmcgPSBlcnJvcl9zdHJpbmcgKyB2YWxba2V5XTtcblx0XHRcdFx0XHRpZiAoIGkgPiAwICkge1xuXHRcdFx0XHRcdFx0ZXJyb3Jfc3RyaW5nICs9ICc8YnI+Jztcblx0XHRcdFx0XHR9XG5cdFx0XHRcdFx0aSsrO1xuXHRcdFx0XHR9XG5cdFx0XHR9ICk7XG5cdFx0fSBlbHNlIHtcblx0XHRcdGVycm9yX3N0cmluZyA9IGRldGFpbHM7XG5cdFx0fVxuXHRcdHRoaXMuZW1haWxJbnB1dC5jc3MoICdib3JkZXInLCAnMXB4IHNvbGlkIHJlZCcgKTtcblx0XHR0aGlzLmVtYWlsSW5wdXQudG9vbHRpcCgge1xuXHRcdFx0dGl0bGU6IGVycm9yX3N0cmluZ1xuXHRcdH0gKTtcblx0XHR0aGlzLmVtYWlsSW5wdXQudG9vbHRpcCggJ3Nob3cnICk7XG5cdH1cblxufSJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///76\n")},5866:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"PortalResetForgotPasswordController\": () => (/* binding */ PortalResetForgotPasswordController)\n/* harmony export */ });\n/* harmony import */ var _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6739);\n/* harmony import */ var _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7526);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\n\nclass PortalResetForgotPasswordController extends _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__.TTBackboneView {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tevents: {\n\t\t\t\t'click .portal-reset-forgot-password': 'resetForgotPassword'\n\t\t\t}\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinitialize( options ) {\n\t\tsuper.initialize( options );\n\t\tif ( options.callback ) {\n\t\t\tthis.callback = options.callback;\n\t\t}\n\t\t// var $this = this;\n\t\t// __non_webpack_require__( this._required_files, function() {\n\t\tthis.api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__/* .TTAPI.APIRecruitmentAuthentication */ .y.APIRecruitmentAuthentication;\n\t\tvar el = Global.loadWidget( 'views/portal/sign_in/PortalResetForgotPassword.html' );\n\t\tthis.setElement( _.template( el )() );\n\t\tthis.render();\n\t\t// } );\n\t}\n\n\trender() {\n\t\tvar $this = this;\n\t\tthis.$( '#new_password' ).focus();\n\t\tthis.$( '#confirm_password' ).unbind( 'keydown' ).bind( 'keydown', function( e ) {\n\t\t\tif ( e.keyCode === 13 ) {\n\t\t\t\t$this.resetForgotPassword();\n\t\t\t}\n\t\t} );\n\t\t$( 'body' ).append( this.$el );\n\t\tthis.$el.modal( {\n\t\t\t'show': true,\n\t\t\t'backdrop': 'static'\n\t\t} );\n\t\tthis.$el.on( 'hidden.bs.modal', function() {\n\t\t\t$this.removeView();\n\t\t} );\n\t}\n\n\tremoveView() {\n\t\tthis.$el.remove();\n\t\tLocalCacheData.setAllURLArgs( _.omit( LocalCacheData.getAllURLArgs(), 'sm' ) );\n\t\tLocalCacheData.setAllURLArgs( _.omit( LocalCacheData.getAllURLArgs(), 'key' ) );\n\t\tIndexViewController.instance.router.navigate( '#!m=PortalJobVacancy&company_id=' + LocalCacheData.getAllURLArgs().company_id, {\n\t\t\ttrigger: false,\n\t\t\treplace: true\n\t\t} );\n\t}\n\n\tresetForgotPassword() {\n\t\tvar $this = this;\n\t\tif ( this.getPassword() ) {\n\t\t\tvar password = this.getPassword();\n\t\t\tthis.api.passwordReset( LocalCacheData.getAllURLArgs().key,\n\t\t\t\tpassword.new_password,\n\t\t\t\tpassword.confirm_password\n\t\t\t\t, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\tif ( !result.isValid() ) {\n\t\t\t\t\t\t\tvar details = result.getDetails();\n\t\t\t\t\t\t\tif ( !details ) {\n\t\t\t\t\t\t\t\tdetails = result.getDescription(); // If the details is empty, try to get description to show.\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar error_string = '';\n\t\t\t\t\t\t\tif ( Global.isArray( details ) || typeof details === 'object' ) {\n\t\t\t\t\t\t\t\t$.each( details, function( index, val ) {\n\t\t\t\t\t\t\t\t\tif ( val.hasOwnProperty( 'error' ) ) {\n\t\t\t\t\t\t\t\t\t\tval = val.error;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tvar i = 0;\n\t\t\t\t\t\t\t\t\tfor ( var key in val ) {\n\t\t\t\t\t\t\t\t\t\terror_string = error_string + val[key];\n\t\t\t\t\t\t\t\t\t\tif ( i > 0 ) {\n\t\t\t\t\t\t\t\t\t\t\terror_string += '<br>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\terror_string = details;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$this.setError( $this.$( '#new_password' ), error_string );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this.$el.modal( 'hide' );\n\t\t\t\t\t\t\tif ( $this.callback ) {\n\t\t\t\t\t\t\t\t$this.callback();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t}\n\t}\n\n\tgetPassword() {\n\t\tvar new_password = this.$( '#new_password' );\n\t\tvar confirm_password = this.$( '#confirm_password' );\n\t\tif ( !new_password.val() ) {\n\t\t\tthis.setError( new_password, $.i18n._( 'New password can\\'t be empty' ) );\n\t\t\treturn false;\n\t\t} else {\n\t\t\tthis.clearError( new_password );\n\t\t}\n\t\tif ( new_password.val() !== confirm_password.val() ) {\n\t\t\tthis.setError( confirm_password, $.i18n._( 'New password does not match' ) );\n\t\t\treturn false;\n\t\t} else {\n\t\t\tthis.clearError( confirm_password );\n\t\t}\n\n\t\treturn {\n\t\t\tnew_password: new_password.val(),\n\t\t\tconfirm_password: confirm_password.val()\n\t\t};\n\t}\n\n\tsetError( widget, message ) {\n\t\twidget.css( 'border', '1px solid red' );\n\t\twidget.tooltip( {\n\t\t\ttitle: message\n\t\t} );\n\t\twidget.tooltip( 'show' );\n\t}\n\n\tclearError( widget ) {\n\t\twidget.css( 'border', '1px solid #ccc' );\n\t\twidget.tooltip( 'dispose' );\n\t}\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTg2Ni5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7OztBQUF3RDtBQUNIOztBQUU5QyxrREFBa0QsaUVBQWM7QUFDdkUsMkJBQTJCO0FBQzNCLEVBQUUsQ0FBQztBQUNIO0FBQ0E7QUFDQTtBQUNBLElBQUk7O0FBRUo7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGFBQWEsaUlBQWtDO0FBQy9DO0FBQ0EsbUJBQW1CLENBQUM7QUFDcEI7QUFDQSxPQUFPO0FBQ1A7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxJQUFJO0FBQ0osRUFBRSxDQUFDO0FBQ0g7QUFDQTtBQUNBO0FBQ0EsS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c2FnZVxuXHRcdH0gKTtcblx0XHR3aWRnZXQudG9vbHRpcCggJ3Nob3cnICk7XG5cdH1cblxuXHRjbGVhckVycm9yKCB3aWRnZXQgKSB7XG5cdFx0d2lkZ2V0LmNzcyggJ2JvcmRlcicsICcxcHggc29saWQgI2NjYycgKTtcblx0XHR3aWRnZXQudG9vbHRpcCggJ2Rpc3Bvc2UnICk7XG5cdH1cblxufSJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///5866\n")},9903:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"SignInController\": () => (/* binding */ SignInController)\n/* harmony export */ });\n/* harmony import */ var _views_portal_PortalBaseViewController__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(97);\n/* harmony import */ var _views_portal_sign_in_PortalResetForgotPasswordController__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5866);\n/* harmony import */ var _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7526);\n/* harmony import */ var _portal_recruitment_IndexController__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1748);\n/* harmony import */ var _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12);\n/* harmony import */ var _views_portal_sign_in_PortalForgotPasswordController__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(76);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\n\n\n\n\n\nclass SignInController extends _views_portal_PortalBaseViewController__WEBPACK_IMPORTED_MODULE_0__.PortalBaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tdoing_login: false,\n\t\t\tedit_view_error_ui_dic: {},\n\n\t\t\t_delegate: null,\n\t\t\tevents: {\n\t\t\t\t'click #forgot_password': 'forgotPasswordClick'\n\t\t\t}\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit( options ) {\n\t\tvar $this = this;\n\t\t$this.recruitment_api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_2__/* .TTAPI.APIRecruitmentAuthentication */ .y.APIRecruitmentAuthentication;\n\t\t$this.jobapplicant_api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_2__/* .TTAPI.APIJobApplicantPortal */ .y.APIJobApplicantPortal;\n\t\t$this.authentication_api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_2__/* .TTAPI.APIAuthentication */ .y.APIAuthentication;\n\t\t// var login_data = LocalCacheData.getLoginData();\n\t\tvar el = Global.loadWidget( 'views/portal/sign_in/SignIn.html' );\n\t\t$this.setElement( _.template( el )() );\n\t\t$this.user_name = $this.$( '#user_name' );\n\t\t$this.password = $this.$( '#password' );\n\t\tif ( Global.isSet( options ) && Global.isSet( options._delegate ) ) {\n\t\t\t$this._delegate = options._delegate;\n\t\t}\n\t\tif ( LocalCacheData.getAllURLArgs().sm === 'ResetPassword' && LocalCacheData.getAllURLArgs().key && LocalCacheData.getAllURLArgs().company_id ) {\n\t\t\tvar forgotResetPasswordIntance = new _views_portal_sign_in_PortalResetForgotPasswordController__WEBPACK_IMPORTED_MODULE_1__.PortalResetForgotPasswordController( {\n\t\t\t\tcallback: function() {\n\t\t\t\t\tLocalCacheData.setAllURLArgs( _.omit( LocalCacheData.getAllURLArgs(), 'sm' ) );\n\t\t\t\t\tLocalCacheData.setAllURLArgs( _.omit( LocalCacheData.getAllURLArgs(), 'key' ) );\n\t\t\t\t\t_portal_recruitment_IndexController__WEBPACK_IMPORTED_MODULE_3__/* .IndexViewController.instance.router.navigate */ .g.instance.router.navigate( '#!m=PortalJobVacancy&company_id=' + LocalCacheData.getAllURLArgs().company_id, {\n\t\t\t\t\t\ttrigger: false,\n\t\t\t\t\t\treplace: true\n\t\t\t\t\t} );\n\t\t\t\t\t$this.setLoginTips( $.i18n._( 'Password has been changed successfully, you may now login' ) );\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\t// $( this.el ).visible();\n\t\t\t$this.render();\n\t\t}\n\t\t// this.render();\n\t}\n\n\trender() {\n\t\tvar $this = this;\n\t\tLocalCacheData.setSessionID( '' );\n\t\tthis.user_name.focus();\n\t\tthis.password.unbind( 'keydown' ).bind( 'keydown', function( e ) {\n\t\t\tif ( e.keyCode === 13 ) {\n\t\t\t\t$this.onLoginBtnClick();\n\t\t\t}\n\t\t} );\n\t\tif ( LocalCacheData.getAllURLArgs().user_name ) {\n\t\t\tthis.user_name.val( LocalCacheData.getAllURLArgs().user_name );\n\t\t}\n\t\tif ( LocalCacheData.getAllURLArgs().password ) {\n\t\t\tthis.password.val( LocalCacheData.getAllURLArgs().password );\n\t\t}\n\t\tthis.showSignInModal();\n\t}\n\n\tshowSignInModal() {\n\t\tvar $this = this;\n\t\t_portal_recruitment_IndexController__WEBPACK_IMPORTED_MODULE_3__/* .IndexViewController.instance.router.showSignInModal */ .g.instance.router.showSignInModal( this.$el, {\n\t\t\ttitle: $.i18n._( 'Login' ),\n\t\t\tactions: [\n\t\t\t\t{ label: $.i18n._( 'Cancel' ), isClose: true },\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Login' ), callBack: function( e ) {\n\t\t\t\t\t\t$this.onLoginBtnClick();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t} );\n\t}\n\n\thideSignInModal( callback ) {\n\t\tif ( callback ) {\n\t\t\t$( '#signinModal' ).unbind( 'hidden.bs.modal' ).bind( 'hidden.bs.modal', function( e ) {\n\t\t\t\tcallback();\n\t\t\t} );\n\t\t}\n\t\t_portal_recruitment_IndexController__WEBPACK_IMPORTED_MODULE_3__/* .IndexViewController.instance.router.hideSignInModal */ .g.instance.router.hideSignInModal();\n\t}\n\n\tforgotPasswordClick() {\n\t\tvar $this = this;\n\t\tthis.hideSignInModal( function() {\n\t\t\tvar forgotPasswordIntance = new _views_portal_sign_in_PortalForgotPasswordController__WEBPACK_IMPORTED_MODULE_5__.PortalForgotPasswordController();\n\t\t\t$( '#signinModal' ).unbind( 'hidden.bs.modal' );\n\t\t} );\n\t}\n\n\tonLoginBtnClick() {\n\t\tvar user_name = this.user_name.val();\n\t\tvar password = this.password.val();\n\t\tvar $this = this;\n\t\tif ( !this.doing_login ) {\n\t\t\tthis.doing_login = true;\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t\t//Async call\n\t\tthis.recruitment_api.Login( user_name, password, {\n\t\t\tonResult: function( e ) {\n\t\t\t\t$this.onLoginSuccess( e );\n\t\t\t\t$this.setLocalCacheCompany();\n\t\t\t}, delegate: this\n\t\t} );\n\t}\n\n\tsetLocalCacheCompany() {\n\t\t// set local cache company information this will be used when sending an error report.\n\t\tthis.authentication_api.getCurrentCompany( {\n\t\t\tonResult: function( current_company_result ) {\n\t\t\t\tvar com_result = current_company_result.getResult();\n\t\t\t\tLocalCacheData.setCurrentCompany( com_result );\n\t\t\t}\n\t\t} );\n\t}\n\n\tonLoginSuccess( e, session_id ) {\n\t\tvar result;\n\t\tvar $this = this;\n\t\tif ( !session_id ) {\n\t\t\tresult = e.getResult();\n\t\t} else {\n\t\t\tresult = session_id;\n\t\t}\n\t\t//Clean user preference, since if login to normal UI and than to portal, it's not null.\n\t\tLocalCacheData.setLoginUserPreference( null );\n\n\t\tif ( e && !e.isValid() ) {\n\t\t\tLocalCacheData.setSessionID( '' );\n\t\t\tdeleteCookie( Global.getSessionIDKey() );\n\n\t\t\tif ( e.getDetails()[0].hasOwnProperty( 'password' ) ) {\n\t\t\t\t$this.hideSignInModal();\n\t\t\t\t$this.password.val( '' );\n\t\t\t\t_portal_recruitment_IndexController__WEBPACK_IMPORTED_MODULE_3__/* .IndexViewController.openWizard */ .g.openWizard( 'ResetPasswordWizard', {\n\t\t\t\t\tuser_name: $this.user_name.val(),\n\t\t\t\t\tapi_class: _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_2__/* .TTAPI.APIRecruitmentAuthentication */ .y.APIRecruitmentAuthentication,\n\t\t\t\t\tmessage: e.getDetailsAsString()\n\t\t\t\t}, function() {\n\t\t\t\t\t$this.setLoginTips( $.i18n._( 'Password has been changed successfully, you may now login' ) );\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\t// TAlertManager.showAlert( e.getDetailsAsString(), 'Error', function() {\n\t\t\t\t// password.focus();\n\t\t\t\t// } );\n\t\t\t\tthis.setErrorTips( e );\n\t\t\t}\n\n\t\t\t$this.doing_login = false;\n\t\t} else {\n\t\t\tthis.clearErrorTips();\n\t\t\t_services_ServiceCaller__WEBPACK_IMPORTED_MODULE_4__/* .ServiceCaller.cancel_all_error */ .n.cancel_all_error = false;\n\n\t\t\t_portal_recruitment_IndexController__WEBPACK_IMPORTED_MODULE_3__/* .IndexViewController.setPortalLoginUserData */ .g.setPortalLoginUserData( result, function() {\n\t\t\t\t_portal_recruitment_IndexController__WEBPACK_IMPORTED_MODULE_3__/* .IndexViewController.instance.router.headerView.render */ .g.instance.router.headerView.render();\n\t\t\t\tif ( $this._delegate ) {\n\t\t\t\t\t$this._delegate.render();\n\t\t\t\t}\n\t\t\t\t$this.hideSignInModal();\n\n\t\t\t\t$this.doing_login = false;\n\t\t\t} );\n\t\t}\n\t}\n\n\tsetLoginTips( message ) {\n\t\tif ( typeof this.$( '.alert' )[0] !== 'undefined' ) {\n\t\t\tthis.$( '.alert' ).remove();\n\t\t}\n\t\tvar row = Global.loadWidget( 'views/portal/alert/alert.html' );\n\t\tthis.$( '.signIn-form' ).before( row );\n\t\tthis.$( '.alert' ).append( '<p>' + message + '</p>' );\n\t\tthis.showSignInModal();\n\t}\n\n\tsetErrorTips( e ) {\n\t\tvar error_list = e.getDetails() ? e.getDetails()[0] : {};\n\t\tif ( error_list && error_list.hasOwnProperty( 'error' ) ) {\n\t\t\terror_list = error_list.error;\n\t\t}\n\t\tfor ( var key in error_list ) {\n\t\t\tif ( !error_list.hasOwnProperty( key ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvar field_obj;\n\t\t\tif ( this.$( 'input[id=\"' + key + '\"]' )[0] ) {\n\t\t\t\tfield_obj = this.$( 'input[id=\"' + key + '\"]' );\n\t\t\t}\n\t\t\tif ( field_obj ) {\n\t\t\t\tfield_obj.addClass( 'error-tip' );\n\t\t\t\tvar error_string;\n\t\t\t\tif ( _.isArray( error_list[key] ) ) {\n\t\t\t\t\terror_string = error_list[key][0];\n\t\t\t\t} else {\n\t\t\t\t\terror_string = error_list[key];\n\t\t\t\t}\n\t\t\t\tfield_obj.tooltip( {\n\t\t\t\t\t'title': error_string\n\t\t\t\t} );\n\t\t\t\tfield_obj.tooltip( 'show' );\n\t\t\t\tthis.edit_view_error_ui_dic[key] = field_obj;\n\t\t\t\t// sort_array.push( field_obj.attr('data-sort') );\n\t\t\t}\n\t\t}\n\t}\n\n\tclearErrorTips() {\n\t\tfor ( var key in this.edit_view_error_ui_dic ) {\n\t\t\tthis.edit_view_error_ui_dic[key].removeClass( 'error-tip' );\n\t\t\tthis.edit_view_error_ui_dic[key].tooltip( 'dispose' );\n\t\t}\n\t\tthis.edit_view_error_ui_dic = {};\n\t}\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTkwMy5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7QUFBbUY7QUFDOEI7QUFDNUQ7QUFDc0I7QUFDbEI7QUFDOEM7O0FBRWhHLCtCQUErQiw0RkFBd0I7QUFDOUQsMkJBQTJCO0FBQzNCLEVBQUUsQ0FBQztBQUNIO0FBQ0EsNkJBQTZCOztBQUU3QjtBQUNBO0FBQ0E7QUFDQTtBQUNBLElBQUk7O0FBRUo7QUFDQTs7QUFFQTtBQUNBO0FBQ0EsMEJBQTBCLGlJQUFrQztBQUM1RCwyQkFBMkIsbUhBQTJCO0FBQ3RELDZCQUE2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