2015-06-09 17:16:29 +00:00
|
|
|
var DEBUG = true;
|
2015-05-09 19:00:14 +00:00
|
|
|
|
|
|
|
var welcome = angular.module('welcome', ['ngMaterial', 'seHub.services', 'ngRoute' , 'ngCookies']);
|
|
|
|
|
|
|
|
var app = angular.module('SeHub', ['ngMaterial', 'ngRoute', 'seHub.services', 'ngCookies']);
|
|
|
|
|
|
|
|
|
|
|
|
welcome.config(function($mdThemingProvider) {
|
|
|
|
$mdThemingProvider.theme('default')
|
|
|
|
.primaryPalette('teal');
|
|
|
|
});
|
|
|
|
|
|
|
|
welcome.controller('welcomeController', ['$scope', 'apiService', '$cookies', '$window', function($scope, apiService, $cookies, $window) {
|
|
|
|
console.log("Welcome Controller");
|
|
|
|
|
|
|
|
var uid = $cookies['com.sehub.www'];
|
2015-06-15 15:41:44 +00:00
|
|
|
if(uid){
|
|
|
|
console.info("Session in Place");
|
2015-05-09 19:00:14 +00:00
|
|
|
$window.location.href = DEBUG ? 'http://localhost:8080/home' : 'http://se-hub.appspot.com/home';
|
2015-06-15 15:41:44 +00:00
|
|
|
}
|
2015-05-09 19:00:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
|
|
app.config(['$routeProvider', '$locationProvider',
|
|
|
|
function($routeProvider, $locationProvider) {
|
|
|
|
$routeProvider
|
|
|
|
.when('/', {
|
2015-06-15 15:41:44 +00:00
|
|
|
templateUrl: 'templates/views/home.html'
|
2015-05-09 19:00:14 +00:00
|
|
|
})
|
|
|
|
.when('/register', {
|
|
|
|
templateUrl: 'templates/views/register.html',
|
|
|
|
controller: 'registerController'
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
]);
|
|
|
|
|