1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-26 08:01:49 +00:00

standardize code

This commit is contained in:
Rokt33r
2015-06-10 03:14:44 +09:00
parent 58729b4d56
commit 29430b540b
15 changed files with 146 additions and 146 deletions

View File

@@ -1,5 +1,3 @@
/* global angular */
angular.module('codexen')
.controller('AppController', function ($scope) {
})
.controller('AppController', function ($scope) {})

View File

@@ -1,6 +1,6 @@
/* global angular */
angular.module('codexen')
.controller('NewSnippetModalController', function ($modalInstance, aceModes, $log, Snippet, $rootScope, Tag){
.controller('NewSnippetModalController', function ($modalInstance, aceModes, $log, Snippet, $rootScope, Tag) {
var vm = this
vm.aceModes = aceModes

View File

@@ -7,14 +7,14 @@ angular.module('codexen')
return true
}
vm.signup = function () {
$auth.signup({
email: vm.email,
password: vm.password,
name: vm.name,
profileName: vm.profileName
}).then(function (data) {
$rootScope.$broadcast('userSignIn')
$state.go('home')
})
$auth.signup({
email: vm.email,
password: vm.password,
name: vm.name,
profileName: vm.profileName
}).then(function (data) {
$rootScope.$broadcast('userSignIn')
$state.go('home')
})
}
})

View File

@@ -7,7 +7,7 @@ angular.module('codexen')
$auth.login({
email: vm.email,
password: vm.password
}).then(function(data){
}).then(function (data) {
console.log(data)
$rootScope.$broadcast('userSignIn')
})

View File

@@ -1,5 +1,3 @@
/* global angular */
angular.module('codexen')
.controller('HomeController', function ($auth, Snippet, $scope) {
})
.controller('HomeController', function ($auth, Snippet, $scope) {})

View File

@@ -10,18 +10,18 @@ angular.module('codexen')
Snippet.show(snippetId, {
'include': ['Tag']
})
.success(function (data) {
vm.snippet = data
vm.isLoaded = true
})
.success(function (data) {
vm.snippet = data
vm.isLoaded = true
})
// TODO: When deletion occurs, switch the next snippet
// TODO: Add deletion confirmation modal
vm.delete = function () {
Snippet.delete(vm.snippet.id)
.success(function () {
$rootScope.$broadcast('snippetDeleted')
})
.success(function () {
$rootScope.$broadcast('snippetDeleted')
})
}
$scope.$on('snippetUpdated', function (e, snippet) {

View File

@@ -16,7 +16,7 @@ angular.module('codexen')
vm.snippets = data
vm.isGuest = false
})
}else {
} else {
vm.isLoaded = true
vm.isGuest = true
vm.snippets = void 0
@@ -45,8 +45,8 @@ angular.module('codexen')
if (vm.snippets[i]._id === currentSnippetId) {
var targetSnippet = null
if (i === 0) targetSnippet = vm.snippets[i+1]
else targetSnippet = vm.snippets[i-1]
if (i === 0) targetSnippet = vm.snippets[i + 1]
else targetSnippet = vm.snippets[i - 1]
console.log('target', targetSnippet)
$state.go('snippets.detail', {id: targetSnippet._id})