mirror of
				https://github.com/aclindsa/moneygo.git
				synced 2025-10-29 17:13:26 -04:00 
			
		
		
		
	Move models.js to browserify/require() format
This commit is contained in:
		| @@ -23,6 +23,16 @@ var Glyphicon = ReactBootstrap.Glyphicon; | ||||
| var DateTimePicker = require('react-widgets').DateTimePicker; | ||||
| var Combobox = require('react-widgets').Combobox; | ||||
|  | ||||
| var models = require('./models.js'); | ||||
| var Security = models.Security; | ||||
| var Account = models.Account; | ||||
| var Split = models.Split; | ||||
| var Transaction = models.Transaction; | ||||
| var TransactionStatus = models.TransactionStatus; | ||||
| var TransactionStatusList = models.TransactionStatusList; | ||||
| var TransactionStatusMap = models.TransactionStatusMap; | ||||
| var Error = models.Error; | ||||
|  | ||||
| var AccountCombobox = require('./AccountCombobox.js'); | ||||
|  | ||||
| const TransactionRow = React.createClass({ | ||||
|   | ||||
| @@ -1,9 +1,14 @@ | ||||
| var React = require('react'); | ||||
|  | ||||
| var Modal = require('react-bootstrap').Modal; | ||||
| var Button = require('react-bootstrap').Button; | ||||
| var ButtonGroup = require('react-bootstrap').ButtonGroup; | ||||
| var Input = require('react-bootstrap').Input; | ||||
| var ReactBootstrap = require('react-bootstrap'); | ||||
| var Modal = ReactBootstrap.Modal; | ||||
| var Button = ReactBootstrap.Button; | ||||
| var ButtonGroup = ReactBootstrap.ButtonGroup; | ||||
| var Input = ReactBootstrap.Input; | ||||
|  | ||||
| var models = require('./models.js'); | ||||
| var User = models.User; | ||||
| var Error = models.Error; | ||||
|  | ||||
| module.exports = React.createClass({ | ||||
| 	displayName: "AccountSettingsModal", | ||||
| @@ -12,10 +17,10 @@ module.exports = React.createClass({ | ||||
| 			name: props.user.Name, | ||||
| 			username: props.user.Username, | ||||
| 			email: props.user.Email, | ||||
| 			password: BogusPassword, | ||||
| 			confirm_password: BogusPassword, | ||||
| 			password: models.BogusPassword, | ||||
| 			confirm_password: models.BogusPassword, | ||||
| 			passwordChanged: false, | ||||
| 			initial_password: BogusPassword}; | ||||
| 			initial_password: models.BogusPassword}; | ||||
| 	}, | ||||
| 	getInitialState: function() { | ||||
| 		 return this._getInitialState(this.props); | ||||
| @@ -74,7 +79,7 @@ module.exports = React.createClass({ | ||||
| 				return; | ||||
| 			} | ||||
| 		} else { | ||||
| 			u.Password = BogusPassword; | ||||
| 			u.Password = models.BogusPassword; | ||||
| 		} | ||||
|  | ||||
| 		this.handleSaveSettings(u); | ||||
|   | ||||
| @@ -18,6 +18,11 @@ var Collapse = ReactBootstrap.Collapse; | ||||
|  | ||||
| var Combobox = require('react-widgets').Combobox; | ||||
|  | ||||
| var models = require('./models.js'); | ||||
| var Security = models.Security; | ||||
| var Account = models.Account; | ||||
| var AccountTypeList = models.AccountTypeList; | ||||
|  | ||||
| var AccountCombobox = require('./AccountCombobox.js'); | ||||
| var AccountRegister = require('./AccountRegister.js'); | ||||
|  | ||||
|   | ||||
| @@ -6,6 +6,13 @@ var Tabs = ReactBootstrap.Tabs; | ||||
| var Tab = ReactBootstrap.Tab; | ||||
| var Modal = ReactBootstrap.Modal; | ||||
|  | ||||
| var models = require('./models.js'); | ||||
| var User = models.User; | ||||
| var Session = models.Session; | ||||
| var Security = models.Security; | ||||
| var Account = models.Account; | ||||
| var Error = models.Error; | ||||
|  | ||||
| var TopBar = require('./TopBar.js'); | ||||
| var NewUserForm = require('./NewUserForm.js'); | ||||
| var AccountSettingsModal = require('./AccountSettingsModal.js'); | ||||
|   | ||||
| @@ -5,6 +5,10 @@ var Input = require('react-bootstrap').Input; | ||||
| var Button = require('react-bootstrap').Button; | ||||
| var ButtonGroup = require('react-bootstrap').ButtonGroup; | ||||
|  | ||||
| var models = require('./models.js'); | ||||
| var User = models.User; | ||||
| var Error = models.Error; | ||||
|  | ||||
| module.exports = React.createClass({ | ||||
| 	getInitialState: function() { | ||||
| 		return {error: "", | ||||
|   | ||||
| @@ -9,6 +9,8 @@ var MenuItem = ReactBootstrap.MenuItem; | ||||
| var Row = ReactBootstrap.Row; | ||||
| var Col = ReactBootstrap.Col; | ||||
|  | ||||
| var User = require('./models.js').User; | ||||
|  | ||||
| const LoginBar = React.createClass({ | ||||
| 	getInitialState: function() { | ||||
| 		return {username: '', password: ''}; | ||||
|   | ||||
| @@ -12,7 +12,6 @@ | ||||
| <script src="static/external/classnames/index.js"></script> | ||||
|  | ||||
| <script type="text/javascript" src="static/utils.js"></script> | ||||
| <script type="text/javascript" src="static/models.js"></script> | ||||
| <script type="text/javascript" src="static/bundle.js"></script> | ||||
|  | ||||
| </head> | ||||
|   | ||||
| @@ -16,8 +16,6 @@ function User() { | ||||
| 	this.Email = ""; | ||||
| } | ||||
|  | ||||
| const BogusPassword = "password"; | ||||
|  | ||||
| User.prototype.toJSON = function() { | ||||
| 	var json_obj = {}; | ||||
| 	json_obj.UserId = this.UserId; | ||||
| @@ -385,3 +383,27 @@ Error.prototype.isError = function() { | ||||
| 	return this.ErrorId != empty_error.ErrorId || | ||||
| 		this.ErrorString != empty_error.ErrorString; | ||||
| } | ||||
|  | ||||
| module.exports = models = { | ||||
|  | ||||
| 	// Classes | ||||
| 	User: User, | ||||
| 	Session: Session, | ||||
| 	Security: Security, | ||||
| 	Account: Account, | ||||
| 	Split: Split, | ||||
| 	Transaction: Transaction, | ||||
| 	Error: Error, | ||||
|  | ||||
| 	// Enums, Lists | ||||
| 	AccountType: AccountType, | ||||
| 	AccountTypeList: AccountTypeList, | ||||
| 	SecurityType: SecurityType, | ||||
| 	SecurityTypeList: SecurityTypeList, | ||||
| 	TransactionStatus: TransactionStatus, | ||||
| 	TransactionStatusList: TransactionStatusList, | ||||
| 	TransactionStatusMap: TransactionStatusMap, | ||||
|  | ||||
| 	// Constants | ||||
| 	BogusPassword: "password" | ||||
| }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user