mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 02:06:29 +00:00
add How-to & Signout modal
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/* global angular */
|
/* global angular */
|
||||||
angular.module('codexen')
|
angular.module('codexen')
|
||||||
.controller('SideNavController', function ($auth, User, $rootScope, $scope) {
|
.controller('SideNavController', function ($auth, User, $rootScope, $scope, Modal) {
|
||||||
var vm = this
|
var vm = this
|
||||||
|
|
||||||
vm.isAuthenticated = $auth.isAuthenticated()
|
vm.isAuthenticated = $auth.isAuthenticated()
|
||||||
@@ -16,11 +16,7 @@ angular.module('codexen')
|
|||||||
reloadUser()
|
reloadUser()
|
||||||
|
|
||||||
vm.signOut = function () {
|
vm.signOut = function () {
|
||||||
$auth.logout()
|
Modal.signOut()
|
||||||
.then(function () {
|
|
||||||
console.log('Sign Out')
|
|
||||||
$rootScope.$broadcast('userSignOut')
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.$on('userSignIn', function () {
|
$scope.$on('userSignIn', function () {
|
||||||
|
|||||||
@@ -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')
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -3,13 +3,19 @@ angular.module('codexen')
|
|||||||
.controller('AuthSignInController', function ($auth, $rootScope) {
|
.controller('AuthSignInController', function ($auth, $rootScope) {
|
||||||
var vm = this
|
var vm = this
|
||||||
|
|
||||||
|
vm.authFailed = false
|
||||||
|
|
||||||
vm.signIn = function () {
|
vm.signIn = function () {
|
||||||
|
vm.authFailed = false
|
||||||
$auth.login({
|
$auth.login({
|
||||||
email: vm.email,
|
email: vm.email,
|
||||||
password: vm.password
|
password: vm.password
|
||||||
}).then(function (data) {
|
}).then(function (data) {
|
||||||
console.log(data)
|
console.log(data)
|
||||||
$rootScope.$broadcast('userSignIn')
|
$rootScope.$broadcast('userSignIn')
|
||||||
|
}, function (err) {
|
||||||
|
console.log(err)
|
||||||
|
vm.authFailed = true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
<script src="../vendor/angular-md5.js"></script>
|
<script src="../vendor/angular-md5.js"></script>
|
||||||
<script src="../vendor/moment.js"></script>
|
<script src="../vendor/moment.js"></script>
|
||||||
<script src="../vendor/marked.js"></script>
|
<script src="../vendor/marked.js"></script>
|
||||||
|
<script src="../vendor/hotkeys.js" charset="utf-8"></script>
|
||||||
|
|
||||||
<!-- inject:js -->
|
<!-- inject:js -->
|
||||||
<script src="app.js"></script>
|
<script src="app.js"></script>
|
||||||
@@ -76,6 +77,7 @@
|
|||||||
<script src="controllers/modals/NewRecipeModalController.js"></script>
|
<script src="controllers/modals/NewRecipeModalController.js"></script>
|
||||||
<script src="controllers/modals/NewSnippetModalController.js"></script>
|
<script src="controllers/modals/NewSnippetModalController.js"></script>
|
||||||
<script src="controllers/modals/SelectSnippetModalController.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/shared.js"></script>
|
||||||
<script src="../shared/config/ace.js"></script>
|
<script src="../shared/config/ace.js"></script>
|
||||||
<script src="../shared/config/env.js"></script>
|
<script src="../shared/config/env.js"></script>
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
<script src="../vendor/angular-md5.js"></script>
|
<script src="../vendor/angular-md5.js"></script>
|
||||||
<script src="../vendor/moment.js"></script>
|
<script src="../vendor/moment.js"></script>
|
||||||
<script src="../vendor/marked.js"></script>
|
<script src="../vendor/marked.js"></script>
|
||||||
|
<script src="../vendor/hotkeys.js" charset="utf-8"></script>
|
||||||
|
|
||||||
<!-- inject:js -->
|
<!-- inject:js -->
|
||||||
<!-- endinject -->
|
<!-- endinject -->
|
||||||
|
|||||||
@@ -1,6 +1,19 @@
|
|||||||
/* global angular */
|
/* global angular */
|
||||||
angular.module('codexen')
|
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 */
|
/* Recipe */
|
||||||
var newRecipe = function () {
|
var newRecipe = function () {
|
||||||
return $modal.open({
|
return $modal.open({
|
||||||
@@ -98,6 +111,7 @@ angular.module('codexen')
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
signOut: signOut,
|
||||||
newRecipe: newRecipe,
|
newRecipe: newRecipe,
|
||||||
editRecipe: editRecipe,
|
editRecipe: editRecipe,
|
||||||
deleteRecipe: deleteRecipe,
|
deleteRecipe: deleteRecipe,
|
||||||
|
|||||||
@@ -274,6 +274,15 @@ body > .ui-select-bootstrap.open {
|
|||||||
.home-state {
|
.home-state {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
.home-state p {
|
||||||
|
margin: 5px auto 15px;
|
||||||
|
}
|
||||||
|
.home-state ol {
|
||||||
|
margin: 35px auto;
|
||||||
|
}
|
||||||
|
.home-state li {
|
||||||
|
margin-bottom: 25px;
|
||||||
|
}
|
||||||
.settings-state .panel {
|
.settings-state .panel {
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,8 @@
|
|||||||
.home-state
|
.home-state
|
||||||
padding 10px
|
padding 10px
|
||||||
|
p
|
||||||
|
margin 5px auto 15px
|
||||||
|
ol
|
||||||
|
margin 35px auto
|
||||||
|
li
|
||||||
|
margin-bottom 25px
|
||||||
|
|||||||
16
src/browser/main/tpls/modals/sign-out-modal.html
Normal file
16
src/browser/main/tpls/modals/sign-out-modal.html
Normal 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>
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
<form ng-submit="vm.signIn()">
|
<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">
|
<div class="form-group">
|
||||||
<label for="email">E-mail</label>
|
<label for="email">E-mail</label>
|
||||||
<input ng-model="vm.email" type="text" id="email" name="name" class="form-control" placeholder="E-mail">
|
<input ng-model="vm.email" type="text" id="email" name="name" class="form-control" placeholder="E-mail">
|
||||||
|
|||||||
@@ -1,9 +1,47 @@
|
|||||||
<div class="home-state">
|
<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>
|
<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>
|
</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>
|
<p>
|
||||||
© 2015 MAISIN&CO.,Inc.
|
© 2015 MAISIN&CO.,Inc.
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -50,7 +50,6 @@
|
|||||||
<script src="../vendor/ace.js"></script>
|
<script src="../vendor/ace.js"></script>
|
||||||
<script src="../vendor/angular.js" charset="utf-8"></script>
|
<script src="../vendor/angular.js" charset="utf-8"></script>
|
||||||
<script src="../vendor/satellizer.js"></script>
|
<script src="../vendor/satellizer.js"></script>
|
||||||
<script src="../vendor/hotkeys.js" charset="utf-8"></script>
|
|
||||||
|
|
||||||
<!-- inject:js -->
|
<!-- inject:js -->
|
||||||
<!-- endinject -->
|
<!-- endinject -->
|
||||||
|
|||||||
Reference in New Issue
Block a user