TimeTrex/interface/html5/dist/quick_punch-punch-QuickPunchViewController.bundle.js

1 line
156 KiB
JavaScript
Raw Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["quick_punch-punch-QuickPunchViewController","quick_punch-QuickPunchBaseViewController","quick_punch-header-HeaderViewController"],{7194:(__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_quick_punch_header_HeaderViewController__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5196);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\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\tloadView( view_id ) {\n\t\tGlobal.loadViewSource( view_id, view_id + 'View.html', function( result ) {\n\t\t\tvar template = _.template( result );\n\t\t\tGlobal.contentContainer().html( template );\n\n\t\t\tLocalCacheData.current_open_view_id = view_id;\n\n\t\t\tGlobal.trackView( view_id );\n\t\t} );\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' ) { //Was ES5: window[view_id + 'ViewController'] &&\n\t\t\tthis.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=QuickPunchLogin' );\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\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 && viewName.indexOf( 'QuickPunch' ) >= 0 ) {\n\t\t\tview_id = Global.sanitizeViewId( args.m );\n\t\t} else {\n\t\t\tview_id = 'QuickPunchLogin';\n\t\t\tGlobal.setURLToBrowser( Global.getBaseURL() + '#!m=QuickPunchLogin' );\n\t\t}\n\n\t\tLocalCacheData.fullUrlParameterStr = viewName;\n\n\t\tLocalCacheData.setAllURLArgs( args );\n\t\tvar reg = new RegExp( '^[0-9]*$' );\n\t\tvar timeout_count;\n\t\ttimeout_count = 0;\n\t\t// $('link[title=\"application css\"]').prop('disabled', true);\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\t\t\t$( 'body' ).removeClass( 'login-bg' );\n\t\t\t// Global.loadStyleSheet( '../theme/default/css/quickPunch.css' + '?v=' + APIGlobal.pre_login_data.application_build ); // #2844 quickpunch css will now be loaded at start.\n\t\t\tif ( !$this.headerView ) {\n\t\t\t\t$this.headerView = new _views_quick_punch_header_HeaderViewController__WEBPACK_IMPORTED_MODULE_0__.HeaderViewController();\n\t\t\t\t$( '#topContainer' ).html( $this.headerView.el );\n\t\t\t}\n\t\t\tloadViewController();\n\t\t}\n\n\t\tfunction loadViewController() {\n\t\t\tGlobal.loadViewSource( view_id, view_id + 'ViewController.js', function() {\n\t\t\t\t/* jshint ignore:start */\n\t\t\t\tvar view_controller = eval( 'new ' + view_id + 'ViewController(); ' );\n\t\t\t\tGlobal.trackView( view_i