TimeTrex/interface/html5/dist/wizard-formula_builder_wizard-FormulaBuilderWizardController.bundle.js

1 line
20 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["wizard-formula_builder_wizard-FormulaBuilderWizardController"],{3313:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"FormulaBuilderWizardController\": () => (/* binding */ FormulaBuilderWizardController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass FormulaBuilderWizardController extends BaseWizardController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '.wizard-bg',\n\n\t\t\tformula_selection_pos: 0\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit( options ) {\n\t\t//this._super('initialize', options );\n\n\t\tthis.title = $.i18n._( 'Formula Builder' );\n\t\tthis.steps = 1;\n\t\tthis.current_step = 1;\n\n\t\tthis.render();\n\t}\n\n\trender() {\n\t\tsuper.render();\n\n\t\t$( this.el ).find( '.progress-bar' ).hide();\n\t\tthis.next_btn.hide();\n\t\tthis.back_btn.hide();\n\t\t$( this.el ).css( 'max-height', 500 );\n\t\tthis.content_div.css( 'top', 20 );\n\n\t\tthis.initCurrentStep();\n\t}\n\n\t//Create each page UI\n\tbuildCurrentStepUI() {\n\t\tvar $this = this;\n\t\tthis.content_div.empty();\n\n\t\tthis.stepsWidgetDic[this.current_step] = {};\n\t\tswitch ( this.current_step ) {\n\t\t\tcase 1:\n\t\t\t\tvar label = this.getLabel();\n\t\t\t\tlabel.text( '' );\n\n\t\t\t\tthis.content_div.append( label );\n\n\t\t\t\tvar form_item = $( Global.loadWidget( 'global/widgets/wizard_form_item/WizardFormItem.html' ) );\n\t\t\t\tvar form_item_label = form_item.find( '.form-item-label' );\n\t\t\t\tvar form_item_input_div = form_item.find( '.form-item-input-div' );\n\n\t\t\t\tform_item.css( 'margin-left', 0 );\n\n\t\t\t\tvar combobox = this.getAComboBox( null, null, 'global_option_column', 'custom_variables', false );\n\n\t\t\t\tform_item_label.text( $.i18n._( 'Custom Variables' ) );\n\t\t\t\tform_item_input_div.append( combobox );\n\n\t\t\t\tcombobox.setSourceData( this.default_data.variables );\n\n\t\t\t\tcombobox.unbind( 'mousedown' ).bind( 'mousedown', function() {\n\t\t\t\t\t$this.formula_selection_pos = formula[0].selectionStart;\n\t\t\t\t} );\n\n\t\t\t\tcombobox.unbind( 'formItemChange' ).bind( 'formItemChange', onOptionSelect );\n\n\t\t\t\tthis.content_div.append( form_item );\n\n\t\t\t\tif ( !this.default_data.do_not_show_functions ) {\n\t\t\t\t\tform_item = $( Global.loadWidget( 'global/widgets/wizard_form_item/WizardFormItem.html' ) );\n\t\t\t\t\tform_item_label = form_item.find( '.form-item-label' );\n\t\t\t\t\tform_item_input_div = form_item.find( '.form-item-input-div' );\n\n\t\t\t\t\tform_item.css( 'margin-left', 0 );\n\n\t\t\t\t\tvar formula_func = this.getComboBox( 'formula_function', true );\n\n\t\t\t\t\tform_item_label.text( $.i18n._( 'Formula Functions' ) );\n\t\t\t\t\tform_item_input_div.append( formula_func );\n\n\t\t\t\t\tformula_func.setSourceData( this.default_data.functions );\n\n\t\t\t\t\tformula_func.unbind( 'mousedown' ).bind( 'mousedown', function() {\n\t\t\t\t\t\t$this.formula_selection_pos = formula[0].selectionStart;\n\t\t\t\t\t} );\n\n\t\t\t\t\tformula_func.unbind( 'formItemChange' ).bind( 'formItemChange', onOptionSelect );\n\n\t\t\t\t\tthis.content_div.append( form_item );\n\t\t\t\t}\n\n\t\t\t\tform_item = $( Global.loadWidget( 'global/widgets/wizard_form_item/WizardFormItem.html' ) );\n\t\t\t\tform_item_label = form_item.find( '.form-item-label' );\n\t\t\t\tform_item_input_div = form_item.find( '.form-item-input-div' );\n\n\t\t\t\tform_item.css( 'margin-left', 0 );\n\n\t\t\t\tvar formula = this.getTextArea( 'formula', 730 );\n\n\t\t\t\tform_item_label.text( $.i18n._( 'Formula' ) );\n\t\t\t\tform_item_input_div.append( formula );\n\n\t\t\t\tthis.content_div.append( form_item );\n\n\t\t\t\tthis.stepsWidgetDic[this.current_step][combobox.getField()] = combobox;\n\t\t\t\tif ( !this.default_data.do_not_show_functions ) {\n\t\t\t\