1 line
47 KiB
JavaScript
1 line
47 KiB
JavaScript
|
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["wizard-BaseWizardController"],{9312:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"BaseWizardController\": () => (/* binding */ BaseWizardController)\n/* harmony export */ });\n/* harmony import */ var _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6739);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n/* provided dependency */ var jQuery = __webpack_require__(9755);\n\n\nclass BaseWizardController extends _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__.TTBackboneView {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\t// _required_files: null,\n\t\t\tsteps: 0,\n\t\t\ttitle: 'Wizard',\n\t\t\tcurrent_step: 1,\n\n\t\t\tcontent_div: null,\n\n\t\t\tnext_btn: null,\n\t\t\tback_btn: null,\n\t\t\tdone_btn: null,\n\t\t\tcancel_btn: null,\n\t\t\tprogress: null,\n\t\t\tprogress_label: null,\n\n\t\t\tstepsWidgetDic: null,\n\t\t\tstepsDataDic: null,\n\n\t\t\tdefault_data: null,\n\n\t\t\tcall_back: null,\n\n\t\t\tsaved_user_generic_data: null,\n\n\t\t\tscript_name: null,\n\n\t\t\tuser_generic_data_api: null,\n\n\t\t\twizard_id: null,\n\n\t\t\tedit_view_ui_dic: {},\n\n\t\t\tedit_view_form_item_dic: {},\n\n\t\t\tevents: {\n\t\t\t\t'click .close-btn': 'onCloseClick',\n\t\t\t\t'click .close-icon': 'onCloseClick',\n\t\t\t\t'click .wizard-overlay.onclick-close': 'onCloseClick',\n\t\t\t\t'click .forward-btn': 'onNextClick',\n\t\t\t\t'click .back-btn': 'onBackClick',\n\t\t\t\t'click .done-btn': 'onDoneClick'\n\t\t\t}\n\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\t/**\n\t * When changing this function, you need to look for all occurences of this function because it was needed in several bases\n\t * BaseViewController, HomeViewController, BaseWizardController, QuickPunchBaseViewControler\n\t *\n\t * @returns {Array}\n\t */\n\t// filterRequiredFiles() {\n\t// \tvar retval = [];\n\t//\n\t// \tif ( this._required_files && this._required_files[0] ) {\n\t// \t\tretval = this._required_files;\n\t// \t} else {\n\t// \t\tfor ( var edition_id in this._required_files ) {\n\t// \t\t\tif ( Global.getProductEdition() >= edition_id ) {\n\t// \t\t\t\tretval = retval.concat( this._required_files[edition_id] );\n\t// \t\t\t}\n\t// \t\t}\n\t// \t}\n\t//\n\t// \tDebug.Arr( retval, 'RETVAL', 'BaseWizardController.js', 'BaseWizardController', 'filterRequiredFiles', 10 );\n\t// \treturn retval;\n\t// }\n\n\tinitialize( options ) {\n\t\tsuper.initialize( options );\n\n\t\tthis.content_div = $( this.el ).find( '.content' );\n\t\tthis.stepsWidgetDic = {};\n\t\tthis.stepsDataDic = {};\n\n\t\tthis.default_data = BaseWizardController.default_data;\n\t\tthis.call_back = BaseWizardController.call_back;\n\n\t\tBaseWizardController.default_data = null;\n\t\tBaseWizardController.call_back = null;\n\n\t\tthis.user_generic_data_api = TTAPI.APIUserGenericData;\n\n\t\tif ( this.wizard_id === null ) {\n this.wizard_id = this.constructor.name;\n }\n\n\t\tLocalCacheData.current_open_wizard_controllers.push( this );\n\n\t\tif ( typeof this.init == 'function' ) {\n\t\t\t//FIXME: pull this out when all wizards are refactored to the new way #1187\n\t\t\tif ( typeof this.setDefaultDataToSteps == 'function' ) {\n\t\t\t\tthis.setDefaultDataToSteps();\n\t\t\t}\n\t\t\tthis.init( options );\n\t\t\tTTPromise.resolve( 'BaseViewController', 'initialize' );\n\t\t}\n\t}\n\n\tsetDefaultDataToSteps() {\n\t}\n\n\tgetDefaultData( key ) {\n\n\t\tif ( !this.default_data ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this.default_data[key];\n\t}\n\n\trender() {\n\t\tvar title = $( this.el ).find( '.title' );\n\t\tvar title_1 = $( this.el ).find( '.title-1' );\n\t\tthis.progress = $( this.el ).find( '.progress' );\n\t\tthis.progress_label = $( this.el ).find( '.steps' );\n\n\t\tthis.progress.attr( 'max', 10 );\n\t\tthis.progress
|