1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

add How-to & Signout modal

This commit is contained in:
Rokt33r
2015-06-25 20:31:38 +09:00
parent c72b5449bd
commit 549ce7f299
12 changed files with 113 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
/* global angular */
angular.module('codexen')
.controller('SideNavController', function ($auth, User, $rootScope, $scope) {
.controller('SideNavController', function ($auth, User, $rootScope, $scope, Modal) {
var vm = this
vm.isAuthenticated = $auth.isAuthenticated()
@@ -16,11 +16,7 @@ angular.module('codexen')
reloadUser()
vm.signOut = function () {
$auth.logout()
.then(function () {
console.log('Sign Out')
$rootScope.$broadcast('userSignOut')
})
Modal.signOut()
}
$scope.$on('userSignIn', function () {

View File

@@ -0,0 +1,13 @@
/* global angular */
angular.module('codexen')
.controller('SignOutModalController', function ($modalInstance) {
var vm = this
vm.submit = function () {
$modalInstance.close()
}
vm.cancel = function () {
$modalInstance.dismiss('cancel')
}
})

View File

@@ -3,13 +3,19 @@ angular.module('codexen')
.controller('AuthSignInController', function ($auth, $rootScope) {
var vm = this
vm.authFailed = false
vm.signIn = function () {
vm.authFailed = false
$auth.login({
email: vm.email,
password: vm.password
}).then(function (data) {
console.log(data)
$rootScope.$broadcast('userSignIn')
}, function (err) {
console.log(err)
vm.authFailed = true
})
}
})

View File

@@ -34,6 +34,7 @@
<script src="../vendor/angular-md5.js"></script>
<script src="../vendor/moment.js"></script>
<script src="../vendor/marked.js"></script>
<script src="../vendor/hotkeys.js" charset="utf-8"></script>
<!-- inject:js -->
<script src="app.js"></script>
@@ -76,6 +77,7 @@
<script src="controllers/modals/NewRecipeModalController.js"></script>
<script src="controllers/modals/NewSnippetModalController.js"></script>
<script src="controllers/modals/SelectSnippetModalController.js"></script>
<script src="controllers/modals/SignOutModalController.js"></script>
<script src="../shared/shared.js"></script>
<script src="../shared/config/ace.js"></script>
<script src="../shared/config/env.js"></script>

View File

@@ -32,6 +32,7 @@
<script src="../vendor/angular-md5.js"></script>
<script src="../vendor/moment.js"></script>
<script src="../vendor/marked.js"></script>
<script src="../vendor/hotkeys.js" charset="utf-8"></script>
<!-- inject:js -->
<!-- endinject -->

View File

@@ -1,6 +1,19 @@
/* global angular */
angular.module('codexen')
.factory('Modal', function ($modal, $rootScope) {
.factory('Modal', function ($modal, $rootScope, $auth) {
var signOut = function () {
return $modal.open({
templateUrl: 'tpls/modals/sign-out-modal.html',
controller: 'SignOutModalController as vm'
}).result.then(function () {
$auth.logout()
.then(function () {
console.log('Sign Out')
$rootScope.$broadcast('userSignOut')
})
})
}
/* Recipe */
var newRecipe = function () {
return $modal.open({
@@ -98,6 +111,7 @@ angular.module('codexen')
}
return {
signOut: signOut,
newRecipe: newRecipe,
editRecipe: editRecipe,
deleteRecipe: deleteRecipe,

View File

@@ -274,6 +274,15 @@ body > .ui-select-bootstrap.open {
.home-state {
padding: 10px;
}
.home-state p {
margin: 5px auto 15px;
}
.home-state ol {
margin: 35px auto;
}
.home-state li {
margin-bottom: 25px;
}
.settings-state .panel {
margin-top: 15px;
}

View File

@@ -1,2 +1,8 @@
.home-state
padding 10px
p
margin 5px auto 15px
ol
margin 35px auto
li
margin-bottom 25px

View File

@@ -0,0 +1,16 @@
<div class="new-snippet-modal">
<div class="modal-header">
<h4>Sign Out</h4>
</div>
<div class="modal-body">
<p>
Are you sure to sign out?
</p>
</div>
<div class="modal-footer">
<button ng-click="vm.submit()" type="button" name="button" class="btn btn-danger">Sign Out</button>
<button ng-click="vm.cancel()" type="button" name="button" class="btn btn-default">Cancel</button>
</div>
</div>

View File

@@ -1,4 +1,7 @@
<form ng-submit="vm.signIn()">
<p ng-if="vm.authFailed" class="alert alert-danger">
Incorrect email or password entered. Please try again.
</p>
<div class="form-group">
<label for="email">E-mail</label>
<input ng-model="vm.email" type="text" id="email" name="name" class="form-control" placeholder="E-mail">

View File

@@ -1,9 +1,47 @@
<div class="home-state">
<h1 class="jumbotron">Codexen App <small>v0.2</small></h1>
<h1 class="jumbotron">Codexen App <small>v0.1.1</small></h1>
<h2>About CodeXen</h2>
<p>
App for Code snippets<br>
CodeXen is short code storage tool make coding more stressless. If you use CodeXen, then you will be disentangled from troublesome organizing a large number of snippets and googling same code many times.
</p>
<ol>
<li>
<h4>
Post your code
</h4>
<p>
Post your commonly used code with description,category,and tags.
</p>
</li>
<li>
<h4>
Save on cloud
</h4>
<p>
From short snippet to long complex code,CodeXen saves any code simply.
</p>
</li>
<li>
<h4>
Use code like a magic
</h4>
<p>
CodeXen call code you posted whereever you are.Type [shift+control+tab] simultaneously.
</p>
</li>
<li>
<h4>
Code Elegantly
</h4>
<p>
That's all!
You must be loved with CodeXen. Enjoy coding;)
</p>
</li>
</ol>
<p>
© 2015 MAISIN&CO.,Inc.
</p>

View File

@@ -50,7 +50,6 @@
<script src="../vendor/ace.js"></script>
<script src="../vendor/angular.js" charset="utf-8"></script>
<script src="../vendor/satellizer.js"></script>
<script src="../vendor/hotkeys.js" charset="utf-8"></script>
<!-- inject:js -->
<!-- endinject -->