merge with master
This commit is contained in:
commit
b41f0624b8
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 9a7aa3261f2ad97ebd436c8b1e86d168cf93023d
|
35
js/app.js
35
js/app.js
|
@ -1,24 +1,19 @@
|
||||||
var app = angular.module('launchpad', ['oauth3.org', 'ui.router', 'LocalStorageModule']);
|
var app = angular.module('launchpad', ['oauth3.org', 'ui.router', 'LocalStorageModule']);
|
||||||
|
var redirected = false;
|
||||||
var redirectedURL;
|
var redirectedURL;
|
||||||
|
var urlArray = [];
|
||||||
app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider', function($stateProvider, $urlRouterProvider, localStorageServiceProvider){
|
app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider', function($stateProvider, $urlRouterProvider, localStorageServiceProvider){
|
||||||
localStorageServiceProvider.setPrefix('launchpad').setStorageType('sessionStorage');
|
localStorageServiceProvider.setPrefix('launchpad').setStorageType('sessionStorage');
|
||||||
|
|
||||||
$urlRouterProvider.otherwise('/splash-page');
|
$urlRouterProvider.otherwise('/splash-page');
|
||||||
|
|
||||||
$stateProvider
|
$stateProvider
|
||||||
.state('splash-page', {
|
.state('splash-page', {
|
||||||
data: { 'requiresLogin': false },
|
data: { requiresLogin: false },
|
||||||
params: {
|
|
||||||
// 'toState': 'home',
|
|
||||||
'toParams': {
|
|
||||||
}
|
|
||||||
},
|
|
||||||
url: '/splash-page',
|
url: '/splash-page',
|
||||||
templateUrl: '/templates/splash-page.html',
|
templateUrl: '/templates/splash-page.html',
|
||||||
})
|
})
|
||||||
.state('app',{
|
.state('app',{
|
||||||
data: { 'requiresLogin': true },
|
data: { requiresLogin: true },
|
||||||
url: '/',
|
url: '/',
|
||||||
views: {
|
views: {
|
||||||
'header': {
|
'header': {
|
||||||
|
@ -126,27 +121,19 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider
|
||||||
app.run(['$rootScope', '$state', 'Auth', function($rootScope, $state, Auth) {
|
app.run(['$rootScope', '$state', 'Auth', function($rootScope, $state, Auth) {
|
||||||
|
|
||||||
$rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams) {
|
$rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams) {
|
||||||
// console.log('toState', toState);
|
|
||||||
// console.log('toParams', toParams);
|
|
||||||
// console.log('fromState', fromState);
|
|
||||||
// console.log('fromParams', fromParams);
|
|
||||||
|
|
||||||
var requiresLogin = toState.data.requiresLogin;
|
var requiresLogin = toState.data.requiresLogin;
|
||||||
|
if (!Auth.isLoggedIn()) { redirected = true; }
|
||||||
|
// set url
|
||||||
redirectedURL = toState.url;
|
redirectedURL = toState.url;
|
||||||
|
urlArray.push(redirectedURL);
|
||||||
// console.log("%c" + redirectedURL, "color: yellow; font-size: 72px;");
|
if (urlArray.length > 1) {
|
||||||
|
redirectedURL = urlArray[0];
|
||||||
if (Auth.isLoggedIn()) {
|
urlArray = [];
|
||||||
console.log('logged in');
|
|
||||||
} else {
|
|
||||||
console.log('logged out');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (requiresLogin && !Auth.isLoggedIn()) {
|
if (requiresLogin && !Auth.isLoggedIn()) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
$state.go('splash-page');
|
$state.go('splash-page', { 'toState': toState.name });
|
||||||
// $state.go('splash-page', { 'toState': toState.name, 'toParams': toParams });
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}]);
|
}]);
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
app.factory('Auth', ['localStorageService', '$location', function(localStorageService, $location) {
|
app.factory('Auth', ['localStorageService', '$location', '$rootScope', function(localStorageService, $location, $rootScope) {
|
||||||
var user;
|
var user;
|
||||||
|
|
||||||
return{
|
return{
|
||||||
setUser: function(currentUser){
|
setUser: function(currentUser){
|
||||||
user = currentUser;
|
user = currentUser;
|
||||||
|
|
||||||
// console.log("%c" + redirectedURL, "color: red; font-size: 72px;");
|
|
||||||
|
|
||||||
if (redirectedURL === '/splash-page') {
|
if (redirectedURL === '/splash-page') {
|
||||||
$location.path('/home');
|
$location.path('/home');
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -27,7 +27,7 @@ app.factory('ContactsService', [function(){
|
||||||
find: function(id){
|
find: function(id){
|
||||||
return _.find(contacts,function(contact){
|
return _.find(contacts,function(contact){
|
||||||
return contact.id == id;
|
return contact.id == id;
|
||||||
})
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
}]);
|
}]);
|
||||||
|
|
|
@ -1 +1,73 @@
|
||||||
<h1>website</h1>
|
<style>
|
||||||
|
.panel{
|
||||||
|
box-shadow: none;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div class="home-container">
|
||||||
|
|
||||||
|
<div class="white-well">
|
||||||
|
<h1>Create a new Website</h1>
|
||||||
|
<h3>Select a Domain</h3>
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="text" class="form-control" placeholder="www" />
|
||||||
|
<span class="input-group-addon">.</span>
|
||||||
|
|
||||||
|
<input type="text" class="form-control" placeholder="Select a domain" aria-label="Domain Name">
|
||||||
|
<div class="input-group-btn">
|
||||||
|
<!-- Single button -->
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="caret"></span>
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li><a href="#">blog.jane.smith.net</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-body">
|
||||||
|
Choose or create a public shared folder <button class="btn btn-default">Select Daplie Folder</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-body">
|
||||||
|
Who can edit and upload to this site? <input placeholder="Type contact name or email address" type="text" class="form-control">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="form-group">
|
||||||
|
<div class="pull-right"> -->
|
||||||
|
<button ng-click="vm.unlock('webpreneur')" type="button" name="button" class="btn btn-default">Create Website</button>
|
||||||
|
<!-- </div>
|
||||||
|
</div> -->
|
||||||
|
</div>
|
||||||
|
<div class="white-well">
|
||||||
|
<h1>Your Websites</h1>
|
||||||
|
<table class="table">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><a href="new.html" target="_blank">blog.jane.smith.net</a></td>
|
||||||
|
<td>Sites > blogs > blog.jane.smith.net</td>
|
||||||
|
<td>jane@smith.net, jack@smith.net, friend@gmail.com</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="new.html" target="_blank">jane.smith.com</a></td>
|
||||||
|
<td>Sites > business > jane test site</td>
|
||||||
|
<td>jane@smith.net</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="new.html" target="_blank">jane.smith.edu</a></td>
|
||||||
|
<td>Documents > 2017 semester > econ class site</td>
|
||||||
|
<td>jane@smith.net, teacher@college.edu</td>
|
||||||
|
</tr>
|
||||||
|
<!-- <tr>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr> -->
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue