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

1 line
160 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
"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.curr