-
Notifications
You must be signed in to change notification settings - Fork 2
AJAXParent.js
Parent Kind for all AJAX Kinds. Most child Kinds simply define the REST API, some override the processResponse() and processError(), as necessary.
- LoginPage.js: mvcApp.waterfall('onLogin', {username: owner.$.username.value, password: owner.$.password.value});
- PublicController.js: login: function(inSender, inEvent) { var ajaxLogin = new AJAX.Login({owner:this, fireEvent:'onLoginResult'}); ajaxLogin.makeRequest({username:inEvent.username , password:inEvent.password}); } PublicController.js: loginResult: function(inSender, inEvent) { if (inEvent.authenticated) { mvcApp.data.user = inEvent.userdata; mvcApp.username = mvcApp.data.username; mvcApp.data.username = ''; mvcApp.data.password = ''; // display the authenticated home page mvcApp.setAuthView(); } else { mvcApp.showWarningMessage("Login failed", inEvent.message); }; }
#../
\enyo-mvc-web-app
|
+---index html
+---mvcApp html
+---mvcAppDebug html
+---package json
+---node-server js
+---mvcApp html
+---assets
+---enyo
+---lib
+---node_modules
+---public
+---scripts
|
\---source
|
+---apps
+---controllers
| |
| +---auth
| \---public
|
+---css
+---ext
+---models
| |
| +---ajax
| \---socket
|
\---views
|
+---auth
| |
| \---body
|
\---public
|
\---body
Add a Contact Page for Authorized users
Why is the project structured this way?
Why are some things implemented this way?