Permalink
Browse files

Integrate firebase login/signup

  • Loading branch information...
1 parent 2eb2550 commit 46d881445ca269b679f3d289f1950fc4f8dd1e8f Penn Su committed Jun 29, 2014
Showing with 17,314 additions and 944 deletions.
  1. +4 −0 bower.json
  2. +1 −1 platforms/android/CordovaLib/ant-build/build.prop
  3. BIN platforms/android/ant-build/HelloCordova-debug-unaligned.apk
  4. BIN platforms/android/ant-build/HelloCordova-debug.apk
  5. BIN platforms/android/ant-build/HelloCordova.ap_
  6. +1 −1 platforms/android/ant-build/build.prop
  7. +1 −1 platforms/android/assets/www/index.html
  8. +2 −1 platforms/android/assets/www/templates/login.html
  9. +3 −1 www/index.html
  10. +10 −0 www/js/app.js
  11. +57 −13 www/js/controllers.js
  12. +18 −0 www/lib/angular-animate/.bower.json
  13. +54 −0 www/lib/angular-animate/README.md
  14. +2 −2 www/lib/{ionic/js/angular → angular-animate}/angular-animate.js
  15. +1 −1 www/lib/{ionic/js/angular → angular-animate}/angular-animate.min.js
  16. +8 −0 www/lib/angular-animate/angular-animate.min.js.map
  17. +8 −0 www/lib/angular-animate/bower.json
  18. +18 −0 www/lib/angular-sanitize/.bower.json
  19. +54 −0 www/lib/angular-sanitize/README.md
  20. +1 −1 www/lib/{ionic/js/angular → angular-sanitize}/angular-sanitize.js
  21. +1 −1 www/lib/{ionic/js/angular → angular-sanitize}/angular-sanitize.min.js
  22. +8 −0 www/lib/angular-sanitize/angular-sanitize.min.js.map
  23. +8 −0 www/lib/angular-sanitize/bower.json
  24. +33 −0 www/lib/angular-ui-router/.bower.json
  25. +23 −0 www/lib/angular-ui-router/CHANGELOG.md
  26. +21 −0 www/lib/angular-ui-router/LICENSE
  27. +280 −0 www/lib/angular-ui-router/README.md
  28. +23 −0 www/lib/angular-ui-router/bower.json
  29. 0 www/lib/{ionic/js/angular-ui → angular-ui-router/release}/angular-ui-router.js
  30. 0 www/lib/{ionic/js/angular-ui → angular-ui-router/release}/angular-ui-router.min.js
  31. +246 −0 www/lib/angular-ui-router/src/common.js
  32. +146 −0 www/lib/angular-ui-router/src/compat.js
  33. +242 −0 www/lib/angular-ui-router/src/resolve.js
  34. +1,204 −0 www/lib/angular-ui-router/src/state.js
  35. +226 −0 www/lib/angular-ui-router/src/stateDirectives.js
  36. +35 −0 www/lib/angular-ui-router/src/stateFilters.js
  37. +110 −0 www/lib/angular-ui-router/src/templateFactory.js
  38. +325 −0 www/lib/angular-ui-router/src/urlMatcherFactory.js
  39. +273 −0 www/lib/angular-ui-router/src/urlRouter.js
  40. +71 −0 www/lib/angular-ui-router/src/view.js
  41. +290 −0 www/lib/angular-ui-router/src/viewDirective.js
  42. +52 −0 www/lib/angular-ui-router/src/viewScroll.js
  43. +16 −0 www/lib/angular/.bower.json
  44. +48 −0 www/lib/angular/README.md
  45. +24 −0 www/lib/angular/angular-csp.css
  46. +119 −75 www/lib/{ionic/js → }/angular/angular.js
  47. +213 −0 www/lib/angular/angular.min.js
  48. BIN www/lib/angular/angular.min.js.gzip
  49. +8 −0 www/lib/angular/angular.min.js.map
  50. +7 −0 www/lib/angular/bower.json
  51. +42 −0 www/lib/firebase-simple-login/.bower.json
  52. +93 −0 www/lib/firebase-simple-login/CHANGELOG.md
  53. +67 −0 www/lib/firebase-simple-login/CONTRIBUTING.md
  54. +127 −0 www/lib/firebase-simple-login/Gruntfile.js
  55. +21 −0 www/lib/firebase-simple-login/LICENSE
  56. +117 −0 www/lib/firebase-simple-login/README.md
  57. +32 −0 www/lib/firebase-simple-login/bower.json
  58. +3,047 −0 www/lib/firebase-simple-login/firebase-simple-login-debug.js
  59. +147 −0 www/lib/firebase-simple-login/firebase-simple-login.js
  60. +39 −0 www/lib/firebase-simple-login/package.json
  61. +89 −0 www/lib/firebase-simple-login/release.sh
  62. +35 −0 www/lib/firebase/.bower.json
  63. +19 −0 www/lib/firebase/LICENSE
  64. +4 −0 www/lib/firebase/README.md
  65. +25 −0 www/lib/firebase/bower.json
  66. +8,857 −0 www/lib/firebase/firebase-debug.js
  67. +154 −0 www/lib/firebase/firebase.js
  68. +46 −0 www/lib/ionic/.bower.json
  69. +15 −0 www/lib/ionic/README.md
  70. +37 −0 www/lib/ionic/bower.json
  71. +0 −610 www/lib/ionic/js/angular/angular-resource.js
  72. +0 −13 www/lib/ionic/js/angular/angular-resource.min.js
  73. +0 −212 www/lib/ionic/js/angular/angular.min.js
  74. 0 www/lib/ionic/scss/_reset.scss
  75. 0 www/lib/ionic/scss/ionicons/_ionicons-animation.scss
  76. 0 www/lib/ionic/scss/ionicons/_ionicons-font.scss
  77. 0 www/lib/ionic/scss/ionicons/_ionicons-icons.scss
  78. 0 www/lib/ionic/scss/ionicons/_ionicons-variables.scss
  79. 0 www/lib/ionic/scss/ionicons/ionicons.scss
  80. +0 −6 www/lib/ionic/version.json
  81. +6 −5 www/templates/login.html
View
@@ -3,5 +3,9 @@
"private": "true",
"devDependencies": {
"ionic": "driftyco/ionic-bower#1.0.0-beta.8"
+ },
+ "dependencies": {
+ "firebase": "~1.0.17",
+ "firebase-simple-login": "~1.6.1"
}
}
@@ -1,5 +1,5 @@
#Last build type
-#Sat, 28 Jun 2014 05:23:56 -0700
+#Sun, 29 Jun 2014 12:47:46 -0700
build.last.target=debug
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,5 @@
#Last build type
-#Sat, 28 Jun 2014 05:24:03 -0700
+#Sun, 29 Jun 2014 12:47:53 -0700
build.last.target=debug
@@ -5,10 +5,10 @@
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
+ <!--<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.2.0/css/bootstrap.css">-->
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link rel="stylesheet" href="css/main.css" />
- <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.2.0/css/bootstrap.css">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
@@ -17,7 +17,8 @@ <h1 class="title">Login</h1>
<input type="password" ng-model="loginData.password">
</label>
<label class="item">
- <button class="button button-block button-positive" type="submit">Log in</button>
+ <button class="button button-positive" type="submit">Log in</button>
+ <button class="button button-balanced" type="submit">Sign up</button>
</label>
</div>
</form>
View
@@ -5,17 +5,19 @@
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
+ <!--<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.2.0/css/bootstrap.css">-->
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link rel="stylesheet" href="css/main.css" />
- <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.2.0/css/bootstrap.css">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
+ <script src="lib/firebase/firebase.js"></script>
+ <script src="lib/firebase-simple-login/firebase-simple-login.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
View
@@ -39,6 +39,16 @@ angular.module('starter', ['ionic', 'starter.controllers'])
}
})
+ .state('app.chat', {
+ url: "/chats/:chatId",
+ views: {
+ 'menuContent' :{
+ templateUrl: "templates/playlist.html",
+ controller: 'ChatCtrl'
+ }
+ }
+ })
+
.state('app.browse', {
url: "/browse",
views: {
View
@@ -1,16 +1,39 @@
angular.module('starter.controllers', [])
-.controller('AppCtrl', function($scope, $ionicModal, $timeout) {
+.constant('spiceRef', new Firebase('https://spicewords.firebaseio.com/'))
+
+.controller('AppCtrl', function($scope, $ionicModal, $timeout, spiceRef) {
// Form data for the login modal
$scope.loginData = {};
+ $scope.loginStatus = {
+ status: 'logout'
+ };
- $scope.favorites = [
- 'Yuri S.',
- 'Penn S.',
- 'Venkytesh B.',
- 'Golly A.',
- 'Jessica V.'
- ]
+ var auth = new FirebaseSimpleLogin(spiceRef, function (error, user) {
+ if (error) {
+ console.log(error);
+ alert(error);
+ $scope.loginStatus.error = error;
+ $scope.loginStatus.status = 'error'
+ /*
+ switch(error.code) {
+ case 'INVALID_EMAIL':
+ case 'INVALID_PASSWORD':
+ default:
+ }
+ */
+ } else if (user) {
+ console.log(user.uid);
+ $scope.loginStatus.user = user;
+ $scope.loginStatus.status = 'login';
+ $location.path('/app/message');
+ } else {
+ // user is logged out
+ $scope.loginStatus.user = null;
+ $scope.loginStatus.status = 'logout';
+ $scope.login();
+ }
+ });
// Create the login modal that we will use later
$ionicModal.fromTemplateUrl('templates/login.html', {
@@ -33,11 +56,18 @@ angular.module('starter.controllers', [])
$scope.doLogin = function() {
console.log('Doing login', $scope.loginData);
- // Simulate a login delay. Remove this and replace with your login
- // code if using a login system
- $timeout(function() {
- $scope.closeLogin();
- }, 1000);
+ if ($scope.loginStatus.status == 'logout') {
+ auth.login('password', $scope.loginData);
+ }
+ };
+
+ $scope.doSignup = function () {
+ auth.createUser($scope.loginData.email, $scope.loginData.password, function (error, user) {
+ if (!error) {
+ console.log('User Id: ' + user.uid + ', Email: ' + user.email);
+ auth.login('password', $scope.loginData);
+ }
+ });
};
})
@@ -54,3 +84,17 @@ angular.module('starter.controllers', [])
.controller('PlaylistCtrl', function($scope, $stateParams) {
})
+
+.controller('MessageCtrl', function($scope, $stateParams) {
+ $scope.favorites = [
+ 'Yuri S.',
+ 'Penn S.',
+ 'Venkytesh B.',
+ 'Golly A.',
+ 'Jessica V.'
+ ]
+
+})
+
+.controller('ChatCtrl', function($scope, $stateParams) {
+})
@@ -0,0 +1,18 @@
+{
+ "name": "angular-animate",
+ "version": "1.2.18",
+ "main": "./angular-animate.js",
+ "dependencies": {
+ "angular": "1.2.18"
+ },
+ "homepage": "https://github.com/angular/bower-angular-animate",
+ "_release": "1.2.18",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.2.18",
+ "commit": "cd5a97b990643e831802256cbfd3c39f0372fd3b"
+ },
+ "_source": "git://github.com/angular/bower-angular-animate.git",
+ "_target": "~1.2.17",
+ "_originalSource": "angular-animate"
+}
@@ -0,0 +1,54 @@
+# bower-angular-animate
+
+This repo is for distribution on `bower`. The source for this module is in the
+[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngAnimate).
+Please file issues and pull requests against that repo.
+
+## Install
+
+Install with `bower`:
+
+```shell
+bower install angular-animate
+```
+
+Add a `<script>` to your `index.html`:
+
+```html
+<script src="/bower_components/angular-animate/angular-animate.js"></script>
+```
+
+And add `ngAnimate` as a dependency for your app:
+
+```javascript
+angular.module('myApp', ['ngAnimate']);
+```
+
+## Documentation
+
+Documentation is available on the
+[AngularJS docs site](http://docs.angularjs.org/api/ngAnimate).
+
+## License
+
+The MIT License
+
+Copyright (c) 2010-2012 Google, Inc. http://angularjs.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
@@ -1,5 +1,5 @@
/**
- * @license AngularJS v1.2.17
+ * @license AngularJS v1.2.18
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
@@ -750,7 +750,7 @@ angular.module('ngAnimate', ['ng'])
* @kind function
*
* @param {boolean=} value If provided then set the animation on or off.
- * @param {DOMElement} element If provided then the element will be used to represent the enable/disable operation
+ * @param {DOMElement=} element If provided then the element will be used to represent the enable/disable operation
* @return {boolean} Current animation state.
*
* @description
@@ -1,5 +1,5 @@
/*
- AngularJS v1.2.17
+ AngularJS v1.2.18
(c) 2010-2014 Google, Inc. http://angularjs.org
License: MIT
*/
Oops, something went wrong.
@@ -0,0 +1,8 @@
+{
+ "name": "angular-animate",
+ "version": "1.2.18",
+ "main": "./angular-animate.js",
+ "dependencies": {
+ "angular": "1.2.18"
+ }
+}
@@ -0,0 +1,18 @@
+{
+ "name": "angular-sanitize",
+ "version": "1.2.18",
+ "main": "./angular-sanitize.js",
+ "dependencies": {
+ "angular": "1.2.18"
+ },
+ "homepage": "https://github.com/angular/bower-angular-sanitize",
+ "_release": "1.2.18",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.2.18",
+ "commit": "8b012cfe691a5e7bc95de08e764595f7dc7ee223"
+ },
+ "_source": "git://github.com/angular/bower-angular-sanitize.git",
+ "_target": "~1.2.17",
+ "_originalSource": "angular-sanitize"
+}
@@ -0,0 +1,54 @@
+# bower-angular-sanitize
+
+This repo is for distribution on `bower`. The source for this module is in the
+[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngSanitize).
+Please file issues and pull requests against that repo.
+
+## Install
+
+Install with `bower`:
+
+```shell
+bower install angular-sanitize
+```
+
+Add a `<script>` to your `index.html`:
+
+```html
+<script src="/bower_components/angular-sanitize/angular-sanitize.js"></script>
+```
+
+And add `ngSanitize` as a dependency for your app:
+
+```javascript
+angular.module('myApp', ['ngSanitize']);
+```
+
+## Documentation
+
+Documentation is available on the
+[AngularJS docs site](http://docs.angularjs.org/api/ngSanitize).
+
+## License
+
+The MIT License
+
+Copyright (c) 2010-2012 Google, Inc. http://angularjs.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
@@ -1,5 +1,5 @@
/**
- * @license AngularJS v1.2.17
+ * @license AngularJS v1.2.18
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
@@ -1,5 +1,5 @@
/*
- AngularJS v1.2.17
+ AngularJS v1.2.18
(c) 2010-2014 Google, Inc. http://angularjs.org
License: MIT
*/
Oops, something went wrong.

0 comments on commit 46d8814

Please sign in to comment.