diff --git a/.gitignore b/.gitignore index 27b1935..4914910 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -*.DS_Store +.DS_Store lib/node_modules/ lib/bower_components/ -*javascripts/AppConstants.js -npm-debug.log +javascripts/AppConstants.js + diff --git a/css/main.css b/css/main.css index 0727f69..75a51db 100644 --- a/css/main.css +++ b/css/main.css @@ -1,4 +1,4 @@ -body { +/*body { background-image: url("img/cork.jpg"); font-family: 'Yanone Kaffeesatz', sans-serif; font-size: 2em; @@ -8,3 +8,4 @@ h1 { font-family: 'Anton', sans-serif; font-size: 1.5em; } +*/ \ No newline at end of file diff --git a/javascripts/AppConfig.js b/javascripts/AppConfig.js index dded909..9d4e57a 100644 --- a/javascripts/AppConfig.js +++ b/javascripts/AppConfig.js @@ -6,14 +6,14 @@ let isAuth = (AuthFactory) => new Promise((resolve, reject) => { } else { reject(); } -}); +}) app.run(function($rootScope, $location, FIREBASE_CONFIG, AuthFactory){ firebase.initializeApp(FIREBASE_CONFIG); $rootScope.$on('$routeChangeStart', function(event, currRoute, prevRoute){ + let logged = AuthFactory.isAuthenticated(); - let appTo; if(currRoute.originalPath){ @@ -33,7 +33,7 @@ app.config(function($routeProvider){ $routeProvider .when('/auth', { templateUrl: 'partials/auth.html', - controller:'AuthCtrl' + controller:'AuthCtrl', }) .when('/boards/list', { templateUrl: 'partials/general-view.html', @@ -61,4 +61,6 @@ app.config(function($routeProvider){ resolve: {isAuth} }) .otherwise('/auth'); -}); \ No newline at end of file +}); + +console.log("AppConfig loaded"); \ No newline at end of file diff --git a/javascripts/AppConstants.js b/javascripts/AppConstants.js index 9d17b21..2863415 100644 --- a/javascripts/AppConstants.js +++ b/javascripts/AppConstants.js @@ -6,4 +6,6 @@ app.constant("FIREBASE_CONFIG", { databaseURL: "https://pinthis-fe275.firebaseio.com", storageBucket: "pinthis-fe275.appspot.com", messagingSenderId: "918121387819" -}); \ No newline at end of file +}); + +console.log("AppConstantsCompleted"); \ No newline at end of file diff --git a/javascripts/app.js b/javascripts/app.js index 3c73363..01ef943 100644 --- a/javascripts/app.js +++ b/javascripts/app.js @@ -2,3 +2,4 @@ var app = angular.module("PinThisApp", ["ngRoute"]); + diff --git a/javascripts/controllers/AuthCtrl.js b/javascripts/controllers/AuthCtrl.js index 770d0bf..5329435 100644 --- a/javascripts/controllers/AuthCtrl.js +++ b/javascripts/controllers/AuthCtrl.js @@ -5,7 +5,7 @@ app.controller("AuthCtrl", function($scope, $rootScope, AuthFactory, UserFactory $scope.setRegisterContainer = false; - if($location.path() == "/logout"){ + if($location.path() === "/logout"){ AuthFactory.logout(); $rootScope.user ={}; $location.url("/auth"); @@ -23,11 +23,6 @@ app.controller("AuthCtrl", function($scope, $rootScope, AuthFactory, UserFactory }); }; - $scope.setLoginContainer = function(){ - $scope.loginContainer = true; - $scope.registerContainer = false; - - }; $scope.setRegisterContainer = function(){ $scope.loginContainer = false; @@ -35,6 +30,12 @@ app.controller("AuthCtrl", function($scope, $rootScope, AuthFactory, UserFactory }; + $scope.setLoginContainer = function(){ + $scope.loginContainer = true; + $scope.registerContainer = false; + + }; + $scope.registerUser = function(registerNewUser){ AuthFactory.registerWithEmail(registerNewUser).then(function(didRegister){ registerNewUser.uid = didRegister.uid; diff --git a/javascripts/factories/AuthFactory.js b/javascripts/factories/AuthFactory.js index ed3b5f3..681965f 100644 --- a/javascripts/factories/AuthFactory.js +++ b/javascripts/factories/AuthFactory.js @@ -59,4 +59,6 @@ app.factory("AuthFactory", function($q, $http, $rootScope, FIREBASE_CONFIG) { }; return {isAuthenticated:isAuthenticated, getUser:getUser, logout:logout, registerWithEmail:registerWithEmail, authenticate:authenticate, authenticateGoogle: authenticateGoogle}; -}); \ No newline at end of file +}); + +console.log("AuthFactory loaded"); \ No newline at end of file diff --git a/partials/auth.html b/partials/auth.html index f537e90..201661d 100644 --- a/partials/auth.html +++ b/partials/auth.html @@ -1,55 +1,41 @@ -