mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-29 17:41:46 +00:00
Merge branch 'dev'
* dev: (79 commits) version 0.2.1 修正 - Member list, Team listのデザイン修正 実装 - Team pageとPlanet pageにMember List表示 実装 - PlanetHeaderにPrivate鍵表示 Noteから外部Linkを開くときにBrowserを使う LogoutModal実装 Contact Modal追加 on Refactor... #4 on Refactor... #3 on Refactor... #2 on Refactoring... test 0.2.0 Fix: Personal Settingボターンを右にする。写真からまっすぐProfile pageに入れるようにする Add: Refresh button Fix: Design changed Fix: Disable pinch to zoom Fix: Preview button修正 Fix: PlanetNavigatorのHome削除 & SnippetsとBlueprintsはToggleができるように Fix: minor features 設定ボタンアイコンの変更 削除Modalでcmd+enterの使用 検索バーデザイン Add: Log in / Sign upの時にエラーが出たらAlertを表示する Debug: Tray Icon, PopUpWindow, Menuがいつの間にか消える ... Conflicts: src/browser/main/controllers/AppController.js src/browser/main/controllers/directives/SideNavController.js src/browser/main/controllers/states/AuthRegisterController.js src/browser/main/index.html src/browser/main/services/Modal.js src/browser/main/styles/app.css src/browser/main/styles/app.styl src/browser/main/styles/directives/side-nav.styl src/browser/main/tpls/directives/side-nav.tpl.html src/browser/main/tpls/states/home.tpl.html
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen', [
|
||||
'codexen.shared',
|
||||
'ngSanitize',
|
||||
'ui.select',
|
||||
'ui.ace',
|
||||
'ui.router',
|
||||
'ui.bootstrap',
|
||||
'satellizer',
|
||||
'angular-md5',
|
||||
'templates'])
|
||||
.constant('appName', 'main')
|
||||
angular.module('templates', [])
|
||||
@@ -1,111 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.config(function ($stateProvider, $urlRouterProvider, $httpProvider) {
|
||||
$httpProvider.interceptors.push(function ($q, $injector) {
|
||||
return {
|
||||
responseError: function (res) {
|
||||
switch (res.status) {
|
||||
case 401:
|
||||
var $state = $injector.get('$state')
|
||||
$state.go('auth.signin')
|
||||
break
|
||||
}
|
||||
|
||||
return $q.reject(res)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
$urlRouterProvider
|
||||
.when('/auth', '/auth/register')
|
||||
.when('/auth/', '/auth/register')
|
||||
.otherwise('/')
|
||||
|
||||
$stateProvider
|
||||
/* Auth */
|
||||
.state('auth', {
|
||||
url: '/auth',
|
||||
views: {
|
||||
'main-view': {
|
||||
templateUrl: 'tpls/states/auth.tpl.html'
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('auth.register', {
|
||||
url: '/register',
|
||||
templateUrl: 'tpls/states/auth.register.tpl.html',
|
||||
controller: 'AuthRegisterController as vm'
|
||||
})
|
||||
.state('auth.signin', {
|
||||
url: '/signin',
|
||||
templateUrl: 'tpls/states/auth.signin.tpl.html',
|
||||
controller: 'AuthSignInController as vm'
|
||||
})
|
||||
|
||||
.state('settings', {
|
||||
url: '/settings',
|
||||
views: {
|
||||
'main-view': {
|
||||
templateUrl: 'tpls/states/settings.tpl.html',
|
||||
controller: 'SettingsController as vm'
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
/* Snippets */
|
||||
.state('snippets', {
|
||||
url: '/snippets',
|
||||
views: {
|
||||
'main-view': {
|
||||
templateUrl: 'tpls/states/snippets.list.tpl.html',
|
||||
controller: 'SnippetsListController as vm'
|
||||
}
|
||||
},
|
||||
resolve: {
|
||||
mySnippets: function (Snippet) {
|
||||
return Snippet.findMine().then(function (res) {
|
||||
return res.data
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('snippets.detail', {
|
||||
url: '/:id',
|
||||
templateUrl: 'tpls/states/snippets.detail.tpl.html',
|
||||
controller: 'SnippetsDetailController as vm'
|
||||
})
|
||||
|
||||
/* Home */
|
||||
.state('home', {
|
||||
url: '/',
|
||||
views: {
|
||||
'main-view': {
|
||||
templateUrl: 'tpls/states/home.tpl.html',
|
||||
controller: 'HomeController as vm'
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
/* Recipes */
|
||||
.state('recipes', {
|
||||
url: '/recipes',
|
||||
views: {
|
||||
'main-view': {
|
||||
templateUrl: 'tpls/states/recipes.list.tpl.html',
|
||||
controller: 'RecipesListController as vm'
|
||||
}
|
||||
},
|
||||
resolve: {
|
||||
myRecipes: function (Recipe) {
|
||||
return Recipe.findMine().then(function (res) {
|
||||
return res.data
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('recipes.detail', {
|
||||
url: '/:id',
|
||||
templateUrl: 'tpls/states/recipes.detail.html',
|
||||
controller: 'RecipesDetailController as vm'
|
||||
})
|
||||
})
|
||||
@@ -1,16 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.controller('DeleteRecipeModalController', function ($modalInstance, Recipe, recipe) {
|
||||
var vm = this
|
||||
|
||||
vm.submit = function () {
|
||||
Recipe.delete(recipe.id)
|
||||
.success(function (recipe) {
|
||||
$modalInstance.close(recipe)
|
||||
})
|
||||
}
|
||||
|
||||
vm.cancel = function () {
|
||||
$modalInstance.dismiss()
|
||||
}
|
||||
})
|
||||
@@ -1,16 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.controller('DeleteSnippetModalController', function ($modalInstance, Snippet, snippet) {
|
||||
var vm = this
|
||||
|
||||
vm.submit = function () {
|
||||
Snippet.delete(snippet.id)
|
||||
.success(function (snippet) {
|
||||
$modalInstance.close(snippet)
|
||||
})
|
||||
}
|
||||
|
||||
vm.cancel = function () {
|
||||
$modalInstance.dismiss()
|
||||
}
|
||||
})
|
||||
@@ -1,42 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.controller('EditRecipeModalController', function (Recipe, Tag, $modalInstance, recipe) {
|
||||
var vm = this
|
||||
|
||||
vm.recipe = recipe
|
||||
|
||||
vm.submit = function () {
|
||||
var params = {
|
||||
title: vm.recipe.title,
|
||||
content: vm.recipe.content,
|
||||
Tags: angular.isArray(vm.recipe.Tags) ? vm.recipe.Tags.map(function (tag) { return tag.name }) : []
|
||||
}
|
||||
|
||||
Recipe.update(vm.recipe.id, params)
|
||||
.success(function (data) {
|
||||
$modalInstance.close(data)
|
||||
})
|
||||
}
|
||||
|
||||
// vm.tags = []
|
||||
vm.tagCandidates = []
|
||||
vm.refreshTagCandidates = function (tagName) {
|
||||
if (tagName == null || tagName === '') return null
|
||||
return Tag.findByName(tagName)
|
||||
.success(function (data) {
|
||||
console.log('tags fetched!!', data)
|
||||
vm.tagCandidates = data
|
||||
})
|
||||
}
|
||||
vm.transform = function (tagName) {
|
||||
return {
|
||||
id: 0,
|
||||
name: tagName
|
||||
}
|
||||
}
|
||||
|
||||
vm.cancel = function () {
|
||||
$modalInstance.dismiss()
|
||||
}
|
||||
|
||||
})
|
||||
@@ -1,45 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.controller('EditSnippetModalController', function ($modalInstance, aceModes, $log, Snippet, $rootScope, Tag, snippet) {
|
||||
var vm = this
|
||||
|
||||
vm.aceModes = aceModes
|
||||
vm.snippet = snippet
|
||||
|
||||
vm.submit = function () {
|
||||
var params = {
|
||||
description: vm.snippet.description,
|
||||
callSign: vm.snippet.callSign,
|
||||
mode: vm.snippet.mode == null ? null : vm.snippet.mode.toLowerCase(),
|
||||
content: vm.snippet.content,
|
||||
Tags: angular.isArray(vm.snippet.Tags) ? vm.snippet.Tags.map(function (tag) { return tag.name }) : []
|
||||
}
|
||||
Snippet.update(vm.snippet.id, params)
|
||||
.success(function (data) {
|
||||
console.log('updated res :', data)
|
||||
$rootScope.$broadcast('snippetUpdated', snippet)
|
||||
$modalInstance.close(data)
|
||||
})
|
||||
}
|
||||
|
||||
// vm.tags = []
|
||||
vm.tagCandidates = []
|
||||
vm.refreshTagCandidates = function (tagName) {
|
||||
if (tagName == null || tagName === '') return null
|
||||
return Tag.findByName(tagName)
|
||||
.success(function (data) {
|
||||
console.log('tags fetched!!', data)
|
||||
vm.tagCandidates = data
|
||||
})
|
||||
}
|
||||
vm.transform = function (tagName) {
|
||||
return {
|
||||
id: 0,
|
||||
name: tagName
|
||||
}
|
||||
}
|
||||
|
||||
vm.cancel = function () {
|
||||
$modalInstance.dismiss()
|
||||
}
|
||||
})
|
||||
@@ -1,23 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.controller('ExpandRecipeModalController', function (recipe, $modalInstance, $scope, Modal) {
|
||||
var vm = this
|
||||
console.log(recipe)
|
||||
|
||||
vm.recipe = recipe
|
||||
|
||||
vm.cancel = function () {
|
||||
$modalInstance.dismiss('cancel')
|
||||
}
|
||||
|
||||
vm.insert = function (type) {
|
||||
$scope.$broadcast('insertRequested', type)
|
||||
}
|
||||
|
||||
vm.insertSnippet = function () {
|
||||
Modal.selectSnippet()
|
||||
.then(function (snippet) {
|
||||
$scope.$broadcast('insertSnippetRequested', snippet)
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -1,42 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.controller('NewRecipeModalController', function (Recipe, Tag, $modalInstance) {
|
||||
var vm = this
|
||||
|
||||
vm.recipe = {}
|
||||
|
||||
vm.submit = function () {
|
||||
var params = {
|
||||
title: vm.recipe.title,
|
||||
content: vm.recipe.content,
|
||||
Tags: angular.isArray(vm.recipe.Tags) ? vm.recipe.Tags.map(function (tag) { return tag.name }) : []
|
||||
}
|
||||
|
||||
Recipe.create(params)
|
||||
.success(function (data) {
|
||||
$modalInstance.close(data)
|
||||
})
|
||||
}
|
||||
|
||||
// vm.tags = []
|
||||
vm.tagCandidates = []
|
||||
vm.refreshTagCandidates = function (tagName) {
|
||||
if (tagName == null || tagName === '') return null
|
||||
return Tag.findByName(tagName)
|
||||
.success(function (data) {
|
||||
console.log('tags fetched!!', data)
|
||||
vm.tagCandidates = data
|
||||
})
|
||||
}
|
||||
vm.transform = function (tagName) {
|
||||
return {
|
||||
id: 0,
|
||||
name: tagName
|
||||
}
|
||||
}
|
||||
|
||||
vm.cancel = function () {
|
||||
$modalInstance.dismiss()
|
||||
}
|
||||
|
||||
})
|
||||
@@ -1,43 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.controller('NewSnippetModalController', function ($modalInstance, aceModes, $log, Snippet, Tag) {
|
||||
var vm = this
|
||||
|
||||
vm.aceModes = aceModes
|
||||
|
||||
vm.submit = function () {
|
||||
var params = {
|
||||
description: vm.description,
|
||||
callSign: vm.callSign,
|
||||
mode: vm.mode == null ? null : vm.mode.toLowerCase(),
|
||||
content: vm.content,
|
||||
Tags: angular.isArray(vm.Tags) ? vm.Tags.map(function (tag) { return tag.name }) : []
|
||||
}
|
||||
|
||||
Snippet.create(params)
|
||||
.success(function (data) {
|
||||
$modalInstance.close(data)
|
||||
})
|
||||
}
|
||||
|
||||
// vm.tags = []
|
||||
vm.tagCandidates = []
|
||||
vm.refreshTagCandidates = function (tagName) {
|
||||
if (tagName == null || tagName === '') return null
|
||||
return Tag.findByName(tagName)
|
||||
.success(function (data) {
|
||||
console.log('tags fetched!!', data)
|
||||
vm.tagCandidates = data
|
||||
})
|
||||
}
|
||||
vm.transform = function (tagName) {
|
||||
return {
|
||||
id: 0,
|
||||
name: tagName
|
||||
}
|
||||
}
|
||||
|
||||
vm.cancel = function () {
|
||||
$modalInstance.dismiss()
|
||||
}
|
||||
})
|
||||
@@ -1,18 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.controller('SelectSnippetModalController', function (Snippet, $modalInstance) {
|
||||
var vm = this
|
||||
|
||||
vm.select = function (snippet) {
|
||||
$modalInstance.close(snippet)
|
||||
}
|
||||
|
||||
vm.cancel = function () {
|
||||
$modalInstance.dismiss('cancel')
|
||||
}
|
||||
|
||||
Snippet.findMine()
|
||||
.success(function (snippets) {
|
||||
vm.snippets = snippets
|
||||
})
|
||||
})
|
||||
@@ -1,13 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.controller('SignOutModalController', function ($modalInstance) {
|
||||
var vm = this
|
||||
|
||||
vm.submit = function () {
|
||||
$modalInstance.close()
|
||||
}
|
||||
|
||||
vm.cancel = function () {
|
||||
$modalInstance.dismiss('cancel')
|
||||
}
|
||||
})
|
||||
@@ -1,21 +0,0 @@
|
||||
/* global angular */
|
||||
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
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -1,3 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.controller('HomeController', function ($auth, Snippet, $scope) {})
|
||||
@@ -1,32 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.controller('RecipesDetailController', function (Recipe, $state, $rootScope, $scope, Modal) {
|
||||
var vm = this
|
||||
|
||||
vm.isLoaded = false
|
||||
|
||||
var recipeId = $state.params.id
|
||||
|
||||
Recipe.show(recipeId)
|
||||
.success(function (data) {
|
||||
vm.recipe = data
|
||||
vm.isLoaded = true
|
||||
})
|
||||
|
||||
$scope.$on('taggingRequested', function (e) {
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
Modal.editRecipe(angular.copy(vm.recipe))
|
||||
.then(function (recipe) {
|
||||
console.log('edited', recipe)
|
||||
}, function () {
|
||||
console.log('edit recipe modal dismissed')
|
||||
})
|
||||
})
|
||||
|
||||
$scope.$on('recipeUpdated', function (e, recipe) {
|
||||
console.log('event received', recipe)
|
||||
if (recipe.id === vm.recipe.id) vm.recipe = recipe
|
||||
})
|
||||
|
||||
})
|
||||
@@ -1,98 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.controller('RecipesListController', function (Recipe, $state, $scope, $filter, myRecipes, User, $auth) {
|
||||
var vm = this
|
||||
|
||||
|
||||
vm.recipes = myRecipes
|
||||
|
||||
vm.searchRecipes = searchRecipes
|
||||
vm.searchRecipes()
|
||||
|
||||
vm.isAuthenticated = $auth.isAuthenticated()
|
||||
var reloadUser = function () {
|
||||
if (vm.isAuthenticated) {
|
||||
User.me().success(function (data) {
|
||||
vm.currentUser = data
|
||||
})
|
||||
}
|
||||
}
|
||||
reloadUser()
|
||||
|
||||
$scope.$on('$stateChangeSuccess', function (e, toState, toParams) {
|
||||
if (!toState.name.match(/recipes/)) return null
|
||||
|
||||
vm.recipeId = parseInt(toParams.id, 10)
|
||||
|
||||
if (!vm.recipeId && vm.filtered && vm.filtered[0]) {
|
||||
$state.go('recipes.detail', {id: vm.filtered[0].id})
|
||||
}
|
||||
})
|
||||
|
||||
$scope.$on('recipeUpdated', function (e, recipe) {
|
||||
if (!myRecipes.some(function (_recipe, index) {
|
||||
if (_recipe.id === recipe.id) {
|
||||
myRecipes[index] = recipe
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})) myRecipes.unshift(recipe)
|
||||
|
||||
searchRecipes()
|
||||
vm.recipeId = recipe.id
|
||||
$state.go('recipes.detail', {id: recipe.id})
|
||||
})
|
||||
|
||||
$scope.$on('recipeDeleted', function () {
|
||||
if ($state.is('recipes.detail')) {
|
||||
var currentRecipeId = parseInt($state.params.id, 10)
|
||||
// Delete recipe from recipe list
|
||||
for (var i = 0; i < vm.recipes.length; i++) {
|
||||
if (vm.recipes[i].id === currentRecipeId) {
|
||||
vm.recipes.splice(i, 1)
|
||||
break
|
||||
}
|
||||
}
|
||||
// Delete recipe from `filtered list`
|
||||
// And redirect `next filtered recipe`
|
||||
for (i = 0; i < vm.filtered.length; i++) {
|
||||
if (vm.filtered[i].id === currentRecipeId) {
|
||||
if (vm.filtered[i + 1] != null) $state.go('recipes.detail', {id: vm.filtered[i + 1].id})
|
||||
else if (vm.filtered[i - 1] != null) $state.go('recipes.detail', {id: vm.filtered[i - 1].id})
|
||||
else $state.go('recipes')
|
||||
|
||||
vm.filtered.splice(i, 1)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
$scope.$on('tagSelected', function (e, tag) {
|
||||
e.stopPropagation()
|
||||
$scope.$apply(function () {
|
||||
vm.search = '#' + tag.name
|
||||
searchRecipes()
|
||||
})
|
||||
})
|
||||
|
||||
function loadRecipes () {
|
||||
if ($auth.isAuthenticated) {
|
||||
Recipe.findMine()
|
||||
.success(function (data) {
|
||||
vm.recipes = data
|
||||
})
|
||||
} else {
|
||||
vm.recipes = void 0
|
||||
}
|
||||
}
|
||||
|
||||
function searchRecipes () {
|
||||
vm.filtered = $filter('searchSnippets')(myRecipes, vm.search)
|
||||
if (vm.search && vm.filtered && vm.filtered[0] && (!vm.recipeId || vm.recipeId !== vm.filtered[0].id)) {
|
||||
$state.go('recipes.detail', {id: vm.filtered[0].id})
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
@@ -1,33 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.controller('SettingsController', function (Settings) {
|
||||
var vm = this
|
||||
|
||||
vm.changePassword = changePassword
|
||||
vm.isSuccess = false
|
||||
vm.isError = false
|
||||
|
||||
function changePassword () {
|
||||
var params = {
|
||||
password: vm.password,
|
||||
newPassword: vm.newPassword
|
||||
}
|
||||
|
||||
Settings.changePassword(params)
|
||||
.success(function (data) {
|
||||
resetInput()
|
||||
vm.isSuccess = true
|
||||
vm.isError = false
|
||||
})
|
||||
.error(function () {
|
||||
resetInput()
|
||||
vm.isError = true
|
||||
vm.isSuccess = false
|
||||
})
|
||||
}
|
||||
|
||||
function resetInput () {
|
||||
vm.password = ''
|
||||
vm.newPassword = ''
|
||||
}
|
||||
})
|
||||
@@ -1,31 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.controller('SnippetsDetailController', function (Snippet, $state, $rootScope, $scope, Modal) {
|
||||
var vm = this
|
||||
|
||||
vm.isLoaded = false
|
||||
|
||||
var snippetId = $state.params.id
|
||||
|
||||
Snippet.show(snippetId)
|
||||
.success(function (data) {
|
||||
vm.snippet = data
|
||||
vm.isLoaded = true
|
||||
})
|
||||
|
||||
$scope.$on('taggingRequested', function (e) {
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
Modal.editSnippet(angular.copy(vm.snippet))
|
||||
.then(function (snippet) {
|
||||
console.log('edited', snippet)
|
||||
}, function () {
|
||||
console.log('edit snippet modal dismissed')
|
||||
})
|
||||
})
|
||||
|
||||
$scope.$on('snippetUpdated', function (e, snippet) {
|
||||
console.log('event received', snippet)
|
||||
if (snippet.id === vm.snippet.id) vm.snippet = snippet
|
||||
})
|
||||
})
|
||||
@@ -1,107 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.controller('SnippetsListController', function ($auth, Snippet, $scope, $state, $filter, mySnippets, User) {
|
||||
var vm = this
|
||||
|
||||
vm.snippetId = parseInt($state.params.id)
|
||||
|
||||
vm.snippets = mySnippets
|
||||
|
||||
vm.searchSnippets = searchSnippets
|
||||
vm.searchSnippets()
|
||||
|
||||
vm.isAuthenticated = $auth.isAuthenticated()
|
||||
var reloadUser = function () {
|
||||
if (vm.isAuthenticated) {
|
||||
User.me().success(function (data) {
|
||||
vm.currentUser = data
|
||||
})
|
||||
}
|
||||
}
|
||||
reloadUser()
|
||||
|
||||
// TODO: add Navigation methods
|
||||
// vm.nextSnippet()
|
||||
// vm.priorSnippet()
|
||||
// vm.firstSnippet()
|
||||
// vm.lastSnippet()
|
||||
|
||||
// TODO: keyboard navigating UX
|
||||
|
||||
$scope.$on('$stateChangeSuccess', function (e, toState, toParams) {
|
||||
if (!toState.name.match(/snippets/)) return null
|
||||
|
||||
vm.snippetId = parseInt(toParams.id, 10)
|
||||
|
||||
if (!vm.snippetId && vm.filtered[0]) {
|
||||
$state.go('snippets.detail', {id: vm.filtered[0].id})
|
||||
}
|
||||
})
|
||||
|
||||
$scope.$on('snippetUpdated', function (e, snippet) {
|
||||
if (!mySnippets.some(function (_snippet, index) {
|
||||
if (_snippet.id === snippet.id) {
|
||||
mySnippets[index] = snippet
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})) mySnippets.unshift(snippet)
|
||||
|
||||
searchSnippets()
|
||||
vm.snippetId = snippet.id
|
||||
$state.go('snippets.detail', {id: snippet.id})
|
||||
})
|
||||
|
||||
$scope.$on('snippetDeleted', function () {
|
||||
if ($state.is('snippets.detail')) {
|
||||
var currentSnippetId = parseInt($state.params.id, 10)
|
||||
// Delete snippet from snippet list
|
||||
for (var i = 0; i < vm.snippets.length; i++) {
|
||||
if (vm.snippets[i].id === currentSnippetId) {
|
||||
vm.snippets.splice(i, 1)
|
||||
break
|
||||
}
|
||||
}
|
||||
// Delete snippet from `filtered list`
|
||||
// And redirect `next filtered snippet`
|
||||
for (i = 0; i < vm.filtered.length; i++) {
|
||||
if (vm.filtered[i].id === currentSnippetId) {
|
||||
if (vm.filtered[i + 1] != null) $state.go('snippets.detail', {id: vm.filtered[i + 1].id})
|
||||
else if (vm.filtered[i - 1] != null) $state.go('snippets.detail', {id: vm.filtered[i - 1].id})
|
||||
else $state.go('snippets')
|
||||
|
||||
vm.filtered.splice(i, 1)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
$scope.$on('tagSelected', function (e, tag) {
|
||||
e.stopPropagation()
|
||||
$scope.$apply(function () {
|
||||
vm.search = '#' + tag.name
|
||||
searchSnippets()
|
||||
})
|
||||
})
|
||||
|
||||
function loadSnippets() {
|
||||
if ($auth.isAuthenticated) {
|
||||
Snippet.findMine()
|
||||
.success(function (data) {
|
||||
vm.snippets = data
|
||||
})
|
||||
} else {
|
||||
vm.snippets = void 0
|
||||
}
|
||||
}
|
||||
|
||||
function searchSnippets () {
|
||||
vm.filtered = $filter('searchSnippets')(mySnippets, vm.search)
|
||||
if (vm.search && vm.filtered[0] && (!vm.snippetId || vm.snippetId !== vm.filtered[0].id)) {
|
||||
$state.go('snippets.detail', {id: vm.filtered[0].id})
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
@@ -1,19 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.directive('btnDeleteRecipe', function (Modal, $rootScope) {
|
||||
return {
|
||||
scope: {
|
||||
recipe: '=btnDeleteRecipe'
|
||||
},
|
||||
link: function (scope, el) {
|
||||
el.on('click', function () {
|
||||
Modal.deleteRecipe(scope.recipe)
|
||||
.then(function (recipe) {
|
||||
console.log('deleted', recipe)
|
||||
}, function () {
|
||||
console.log('delete snippet modal dismissed')
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,19 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.directive('btnDeleteSnippet', function (Modal, $rootScope) {
|
||||
return {
|
||||
scope: {
|
||||
snippet: '=btnDeleteSnippet'
|
||||
},
|
||||
link: function (scope, el) {
|
||||
el.on('click', function () {
|
||||
Modal.deleteSnippet(scope.snippet)
|
||||
.then(function (snippet) {
|
||||
console.log('deleted', snippet)
|
||||
}, function () {
|
||||
console.log('delete snippet modal dismissed')
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,14 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.directive('btnEditRecipe', function (Modal) {
|
||||
return {
|
||||
scope: {
|
||||
recipe: '=btnEditRecipe'
|
||||
},
|
||||
link: function (scope, el) {
|
||||
el.on('click', function () {
|
||||
Modal.editRecipe(angular.copy(scope.recipe))
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,14 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.directive('btnEditSnippet', function (Modal) {
|
||||
return {
|
||||
scope: {
|
||||
snippet: '=btnEditSnippet'
|
||||
},
|
||||
link: function (scope, el) {
|
||||
el.on('click', function () {
|
||||
Modal.editSnippet(angular.copy(scope.snippet))
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,15 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.directive('btnExpandRecipe', function (Modal) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
scope: {
|
||||
recipe: '=btnExpandRecipe'
|
||||
},
|
||||
link: function (scope, el) {
|
||||
el.on('click', function () {
|
||||
Modal.expandRecipe(scope.recipe)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,12 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.directive('btnNewRecipe', function (Modal) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: function (scope, el) {
|
||||
el.on('click', function () {
|
||||
Modal.newRecipe()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,11 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.directive('btnNewSnippet', function (Modal, $rootScope) {
|
||||
return {
|
||||
link: function (scope, el) {
|
||||
el.on('click', function () {
|
||||
Modal.newSnippet()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,19 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.directive('recipeItem', function (Modal, $rootScope) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
transclude: true,
|
||||
template: '<div ng-transclude></div>',
|
||||
scope: {
|
||||
recipe: '=recipeItem'
|
||||
},
|
||||
link: function (scope, elem) {
|
||||
scope.$on('taggingRequested', function (e) {
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
Modal.editRecipe(angular.copy(scope.recipe))
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,8 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.directive('sideNav', function () {
|
||||
return {
|
||||
templateUrl: 'tpls/directives/side-nav.tpl.html',
|
||||
controller: 'SideNavController as vm'
|
||||
}
|
||||
})
|
||||
@@ -1,19 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.directive('snippetItem', function (Modal, $rootScope) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
transclude: true,
|
||||
template: '<div ng-transclude></div>',
|
||||
scope: {
|
||||
snippet: '=snippetItem'
|
||||
},
|
||||
link: function (scope, elem) {
|
||||
scope.$on('taggingRequested', function (e) {
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
Modal.editSnippet(angular.copy(scope.snippet))
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,16 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.directive('tagItem', function () {
|
||||
return {
|
||||
restrict: 'A',
|
||||
template: '#<span ng-bind="tag.name"></span>',
|
||||
scope: {
|
||||
tag: '=tagItem'
|
||||
},
|
||||
link: function (scope, el) {
|
||||
el.on('click', function () {
|
||||
scope.$emit('tagSelected', scope.tag)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,28 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.directive('tagList', function () {
|
||||
return {
|
||||
restrict: 'A',
|
||||
template: '<p class="tags">' +
|
||||
'<i class="fa fa-tags"></i> ' +
|
||||
'<a tag-item="tag" ng-repeat="tag in tags" href></a>' +
|
||||
'<a ng-if="!tags.length" ng-click="requestTagging($event)" href> Not tagged yet</a>' +
|
||||
'</p>',
|
||||
scope: {
|
||||
tags: '=tagList'
|
||||
},
|
||||
link: function (scope, el) {
|
||||
el.ready(function () {
|
||||
el.find('a').on('click', function (e) {
|
||||
e.stopPropagation()
|
||||
})
|
||||
})
|
||||
|
||||
scope.requestTagging = function (e) {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
scope.$emit('taggingRequested')
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,7 +0,0 @@
|
||||
/* global angular moment */
|
||||
angular.module('codexen')
|
||||
.filter('fromNow', function () {
|
||||
return function (input) {
|
||||
return moment(input).fromNow()
|
||||
}
|
||||
})
|
||||
@@ -1,19 +0,0 @@
|
||||
/* global angular marked*/
|
||||
angular.module('codexen')
|
||||
.filter('marked', function () {
|
||||
marked.setOptions({
|
||||
renderer: new marked.Renderer(),
|
||||
gfm: true,
|
||||
tables: true,
|
||||
breaks: false,
|
||||
pedantic: false,
|
||||
sanitize: true,
|
||||
smartLists: true,
|
||||
smartypants: false
|
||||
})
|
||||
|
||||
return function (input) {
|
||||
if (!angular.isString(input)) input = ''
|
||||
return marked(input)
|
||||
}
|
||||
})
|
||||
@@ -1,17 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.filter('searchSnippets', function ($filter) {
|
||||
return function (input, needle) {
|
||||
if (!angular.isString(needle) || !angular.isArray(input)) return angular.copy(input)
|
||||
if (needle.match(/#(.+)|tag:(.+)/)) {
|
||||
var name = needle.match(/#(.+)/) ? needle.match(/#(.+)/)[1] : needle.match(/tag:(.+)/)[1]
|
||||
|
||||
return input.filter(function (snippet) {
|
||||
return snippet.Tags.some(function (tag) {
|
||||
return tag.name.match(new RegExp('^'+name))
|
||||
})
|
||||
})
|
||||
}
|
||||
else return $filter('filter')(input, needle)
|
||||
}
|
||||
})
|
||||
@@ -1,41 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html ng-app="codexen">
|
||||
<head>
|
||||
<title>
|
||||
CodeXen App
|
||||
</title>
|
||||
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
|
||||
<meta name="description" content="CodeXen - Short code storage service">
|
||||
|
||||
<title>Codexen!</title>
|
||||
|
||||
<link rel="stylesheet" href="../vendor/css/font-awesome.css" media="screen" title="no title" charset="utf-8">
|
||||
|
||||
<!-- inject:css -->
|
||||
<!-- endinject -->
|
||||
|
||||
</head>
|
||||
<body ng-controller="AppController as app">
|
||||
<div side-nav id="side-view"></div>
|
||||
<div ui-view name="main-view" id="main-view"></div>
|
||||
|
||||
<script src="../vendor/ace.js"></script>
|
||||
<script src="../vendor/angular.js"></script>
|
||||
<script src="../vendor/angular-sanitize.js"></script>
|
||||
<script src="../vendor/angular-ui-router.js"></script>
|
||||
<script src="../vendor/ui-bootstrap-tpls.js"></script>
|
||||
<script src="../vendor/select.js"></script>
|
||||
<script src="../vendor/satellizer.js"></script>
|
||||
<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 -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,52 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.factory('Recipe', function ($http, $auth, apiUrl) {
|
||||
var findByUser = function (user) {
|
||||
var url = apiUrl + 'blueprints/search'
|
||||
|
||||
return $http.get(url, {
|
||||
params: {
|
||||
user: user
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
var findMine = function (params) {
|
||||
var url = apiUrl + 'blueprints/my'
|
||||
|
||||
return $http.get(url, {params: params})
|
||||
}
|
||||
|
||||
var create = function (params) {
|
||||
var url = apiUrl + 'blueprints/create'
|
||||
|
||||
return $http.post(url, params)
|
||||
}
|
||||
|
||||
var show = function (id, params) {
|
||||
var url = apiUrl + 'blueprints/id/' + id
|
||||
|
||||
return $http.get(url, {params: params})
|
||||
}
|
||||
|
||||
var update = function (id, params) {
|
||||
var url = apiUrl + 'blueprints/id/' + id
|
||||
|
||||
return $http.put(url, params)
|
||||
}
|
||||
|
||||
var destroy = function (id) {
|
||||
var url = apiUrl + 'blueprints/id/' + id
|
||||
|
||||
return $http.delete(url)
|
||||
}
|
||||
|
||||
return {
|
||||
findByUser: findByUser,
|
||||
findMine: findMine,
|
||||
create: create,
|
||||
show: show,
|
||||
delete: destroy,
|
||||
update: update
|
||||
}
|
||||
})
|
||||
@@ -1,13 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.factory('Settings', function ($http, apiUrl) {
|
||||
var changePassword = function (params) {
|
||||
var url = apiUrl + 'settings/change_password'
|
||||
|
||||
return $http.post(url, params)
|
||||
}
|
||||
|
||||
return {
|
||||
changePassword: changePassword
|
||||
}
|
||||
})
|
||||
@@ -1,17 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.factory('Tag', function ($http, apiUrl) {
|
||||
var findByName = function (tagName) {
|
||||
var url = apiUrl + 'tags/search'
|
||||
|
||||
return $http.get(url, {
|
||||
params: {
|
||||
name: tagName
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
findByName: findByName
|
||||
}
|
||||
})
|
||||
@@ -1,16 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.factory('User', function ($http, apiUrl, $rootScope, $state) {
|
||||
$rootScope.$on('userSignOut', function () {
|
||||
$state.go('auth.signin')
|
||||
})
|
||||
|
||||
var me = function () {
|
||||
var url = apiUrl + 'auth/user'
|
||||
return $http.get(url)
|
||||
}
|
||||
|
||||
return {
|
||||
me: me
|
||||
}
|
||||
})
|
||||
@@ -1,232 +0,0 @@
|
||||
/*!
|
||||
* ui-select
|
||||
* http://github.com/angular-ui/ui-select
|
||||
* Version: 0.11.2 - 2015-03-17T04:08:46.478Z
|
||||
* License: MIT
|
||||
*/
|
||||
|
||||
|
||||
/* Style when highlighting a search. */
|
||||
.ui-select-highlight
|
||||
font-weight: bold
|
||||
|
||||
|
||||
.ui-select-offscreen
|
||||
clip: rect(0 0 0 0) !important
|
||||
width: 1px !important
|
||||
height: 1px !important
|
||||
border: 0 !important
|
||||
margin: 0 !important
|
||||
padding: 0 !important
|
||||
overflow: hidden !important
|
||||
position: absolute !important
|
||||
outline: 0 !important
|
||||
left: 0px !important
|
||||
top: 0px !important
|
||||
|
||||
|
||||
/* Select2 theme */
|
||||
|
||||
/* Mark invalid Select2 */
|
||||
.ng-dirty.ng-invalid > a.select2-choice
|
||||
border-color: #D44950
|
||||
|
||||
|
||||
.select2-result-single
|
||||
padding-left: 0
|
||||
|
||||
|
||||
.select2-locked > .select2-search-choice-close
|
||||
display:none
|
||||
|
||||
|
||||
.select-locked > .ui-select-match-close
|
||||
display:none
|
||||
|
||||
|
||||
body > .select2-container.open
|
||||
z-index: 9999 /* The z-index Select2 applies to the select2-drop */
|
||||
|
||||
|
||||
/* Selectize theme */
|
||||
|
||||
/* Helper class to show styles when focus */
|
||||
.selectize-input.selectize-focus
|
||||
border-color: #007FBB !important
|
||||
|
||||
|
||||
/* Fix input width for Selectize theme */
|
||||
.selectize-control > .selectize-input > input
|
||||
width: 100%
|
||||
|
||||
|
||||
/* Fix dropdown width for Selectize theme */
|
||||
.selectize-control > .selectize-dropdown
|
||||
width: 100%
|
||||
|
||||
|
||||
/* Mark invalid Selectize */
|
||||
.ng-dirty.ng-invalid > div.selectize-input
|
||||
border-color: #D44950
|
||||
|
||||
|
||||
|
||||
/* Bootstrap theme */
|
||||
|
||||
/* Helper class to show styles when focus */
|
||||
.btn-default-focus
|
||||
color: #333
|
||||
background-color: #EBEBEB
|
||||
border-color: #ADADAD
|
||||
text-decoration: none
|
||||
outline: 5px auto -webkit-focus-ring-color
|
||||
outline-offset: -2px
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6)
|
||||
|
||||
|
||||
.ui-select-bootstrap .ui-select-toggle
|
||||
position: relative
|
||||
border-radius $input-border-radius
|
||||
.ui-select-placeholder
|
||||
color $textColor
|
||||
|
||||
|
||||
.ui-select-bootstrap .ui-select-toggle > .caret
|
||||
position: absolute
|
||||
height: 10px
|
||||
top: 50%
|
||||
right: 10px
|
||||
margin-top: -2px
|
||||
|
||||
|
||||
/* Fix Bootstrap dropdown position when inside a input-group */
|
||||
.input-group > .ui-select-bootstrap.dropdown
|
||||
/* Instead of relative */
|
||||
position: static
|
||||
|
||||
|
||||
.input-group > .ui-select-bootstrap > input.ui-select-search.form-control
|
||||
border-radius: $input-border-radius
|
||||
border-top-right-radius: 0
|
||||
border-bottom-right-radius: 0
|
||||
|
||||
|
||||
.ui-select-bootstrap > .ui-select-match > .btn
|
||||
/* Instead of center because of .btn */
|
||||
text-align: left !important
|
||||
padding-right: 25px
|
||||
border-radius $input-border-radius
|
||||
border solid 1px $input-border
|
||||
|
||||
|
||||
.ui-select-bootstrap > .ui-select-match > .caret
|
||||
position: absolute
|
||||
top: 45%
|
||||
right: 15px
|
||||
|
||||
|
||||
/* See Scrollable Menu with Bootstrap 3 http://stackoverflow.com/questions/19227496 */
|
||||
.ui-select-bootstrap > .ui-select-choices
|
||||
width: 100%
|
||||
height: auto
|
||||
max-height: 200px
|
||||
overflow-x: hidden
|
||||
margin-top: -1px
|
||||
|
||||
|
||||
body > .ui-select-bootstrap.open
|
||||
z-index: 1000 /* Standard Bootstrap dropdown z-index */
|
||||
|
||||
|
||||
.ui-select-multiple.ui-select-bootstrap
|
||||
height: auto
|
||||
padding: 3px 3px 0 10px
|
||||
|
||||
|
||||
.ui-select-multiple.ui-select-bootstrap.open
|
||||
border-color $input-border-focus
|
||||
outline 0
|
||||
box-shadow inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(red($input-border-focus), green($input-border-focus), blue($input-border-focus), .6)
|
||||
|
||||
|
||||
.ui-select-multiple.ui-select-bootstrap input.ui-select-search
|
||||
background-color: transparent !important /* To prevent double background when disabled */
|
||||
border: none
|
||||
outline: none
|
||||
height: 1.666666em
|
||||
margin-bottom: 3px
|
||||
|
||||
|
||||
.ui-select-multiple.ui-select-bootstrap .ui-select-match .close
|
||||
font-size: 1.6em
|
||||
line-height: 0.75
|
||||
|
||||
|
||||
.ui-select-multiple.ui-select-bootstrap .ui-select-match-item
|
||||
outline: 0
|
||||
margin: 0 3px 3px 0
|
||||
|
||||
|
||||
.ui-select-multiple .ui-select-match-item
|
||||
position: relative
|
||||
|
||||
|
||||
.ui-select-multiple .ui-select-match-item.dropping-before:before
|
||||
content: ""
|
||||
position: absolute
|
||||
top: 0
|
||||
right: 100%
|
||||
height: 100%
|
||||
margin-right: 2px
|
||||
border-left: 1px solid #428bca
|
||||
|
||||
|
||||
.ui-select-multiple .ui-select-match-item.dropping-after:after
|
||||
content: ""
|
||||
position: absolute
|
||||
top: 0
|
||||
left: 100%
|
||||
height: 100%
|
||||
margin-left: 2px
|
||||
border-right: 1px solid #428bca
|
||||
|
||||
|
||||
.ui-select-bootstrap .ui-select-choices-row>a
|
||||
display: block
|
||||
padding: 3px 20px
|
||||
clear: both
|
||||
font-weight: 400
|
||||
line-height: 1.42857143
|
||||
color: $dropdown-link-color
|
||||
white-space: nowrap
|
||||
|
||||
|
||||
.ui-select-bootstrap .ui-select-choices-row>a:hover, .ui-select-bootstrap .ui-select-choices-row>a:focus
|
||||
text-decoration: none
|
||||
color: $dropdown-link-hover-color
|
||||
background-color: $dropdown-link-hover-bg
|
||||
|
||||
|
||||
.ui-select-bootstrap .ui-select-choices-row.active>a
|
||||
color: $dropdown-link-hover-color
|
||||
text-decoration: none
|
||||
outline: 0
|
||||
background-color: $dropdown-link-hover-bg
|
||||
|
||||
|
||||
.ui-select-bootstrap .ui-select-choices-row.disabled>a,
|
||||
.ui-select-bootstrap .ui-select-choices-row.active.disabled>a
|
||||
color: #777
|
||||
cursor: not-allowed
|
||||
background-color: #fff
|
||||
|
||||
|
||||
/* fix hide/show angular animation */
|
||||
.ui-select-match.ng-hide-add,
|
||||
.ui-select-search.ng-hide-add
|
||||
display: none !important
|
||||
|
||||
|
||||
/* Mark invalid Bootstrap */
|
||||
.ui-select-bootstrap.ng-dirty.ng-invalid > button.btn.ui-select-match
|
||||
border-color: #D44950
|
||||
@@ -1,9 +0,0 @@
|
||||
.expand-recipe-modal
|
||||
.expand-editor
|
||||
.editor-pane
|
||||
height 500px
|
||||
.ace_editor
|
||||
height 500px
|
||||
.preview-pane
|
||||
height 500px
|
||||
overflow-y auto
|
||||
@@ -1,4 +0,0 @@
|
||||
.new-snippet-modal
|
||||
|
||||
.ace_editor
|
||||
height: 200px
|
||||
@@ -1,17 +0,0 @@
|
||||
.select-snippet-modal
|
||||
.snippet-list
|
||||
list-style none
|
||||
padding 0
|
||||
li
|
||||
padding 10px
|
||||
border solid 1px $baseBorderColor
|
||||
background-color $backgroundColorHighlight
|
||||
border-radius 5px
|
||||
margin-bottom 5px
|
||||
cursor pointer
|
||||
&:hover
|
||||
background-color $backgroundColorSelected
|
||||
.ace_editor
|
||||
height 150px
|
||||
.call-sign
|
||||
color $textColorHighlight
|
||||
@@ -1,7 +0,0 @@
|
||||
.auth-state
|
||||
.panel
|
||||
margin-top 50px
|
||||
h1
|
||||
margin 15px 0
|
||||
.auth-control
|
||||
margin 10px 0
|
||||
@@ -1,8 +0,0 @@
|
||||
.home-state
|
||||
padding 10px
|
||||
p
|
||||
margin 5px auto 15px
|
||||
ol
|
||||
margin 35px auto
|
||||
li
|
||||
margin-bottom 25px
|
||||
@@ -1,8 +0,0 @@
|
||||
.settings-state
|
||||
.panel
|
||||
margin-top 15px
|
||||
h1
|
||||
margin 30px 0
|
||||
.section
|
||||
h4
|
||||
margin-bottom 15px
|
||||
@@ -1,132 +0,0 @@
|
||||
$left-pane-width= 275px
|
||||
|
||||
|
||||
$pane-border-color= $border-color
|
||||
$snippet-list-border-color= $border-color
|
||||
$snippet-list-item-hover-bg= #EEE
|
||||
$snippet-list-active-color= white
|
||||
$snippet-list-active-bg= $brand-primary
|
||||
|
||||
.snippets-list-state
|
||||
position: absolute
|
||||
top:0
|
||||
left:0
|
||||
right:0
|
||||
bottom:0
|
||||
.left-pane
|
||||
border-right 1px solid $baseBorderColor
|
||||
position: absolute
|
||||
top: 0
|
||||
bottom: 0
|
||||
left: 0
|
||||
width: $left-pane-width
|
||||
overflow:hidden
|
||||
.snippet-search
|
||||
position: absolute
|
||||
top: 0
|
||||
height: 50px
|
||||
left: 0
|
||||
right: 0
|
||||
border-right 1px solid $baseBorderColor
|
||||
padding: 7px 5px
|
||||
|
||||
.snippet-list
|
||||
position: absolute
|
||||
top: 50px
|
||||
bottom: 0
|
||||
left: 0
|
||||
right: 0
|
||||
overflow-x: hidden
|
||||
overflow-y: auto
|
||||
list-style: none
|
||||
padding: 0
|
||||
li
|
||||
cursor: pointer
|
||||
padding: 5px
|
||||
border-right 1px solid $baseBorderColor
|
||||
border-bottom 1px solid $baseBorderColor
|
||||
&:nth-child(even)
|
||||
background-color $baseBackgroundColor
|
||||
&:nth-child(odd)
|
||||
background-color lighten($baseBackgroundColor, 2%)
|
||||
h4
|
||||
margin: 0
|
||||
|
||||
&:hover
|
||||
background-color: $backgroundColorSelected
|
||||
|
||||
p
|
||||
margin:0
|
||||
|
||||
p.call-sign
|
||||
font-size:0.8em
|
||||
|
||||
p.created-at
|
||||
font-size:0.8em
|
||||
opacity: 0.8
|
||||
|
||||
&.active
|
||||
color: $snippet-list-active-color
|
||||
background-color: $snippet-list-active-bg
|
||||
a
|
||||
color: white
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.right-pane
|
||||
position: absolute
|
||||
top: 0
|
||||
bottom: 0
|
||||
left: $left-pane-width
|
||||
right: 0
|
||||
overflow-x: hidden
|
||||
overflow-y: auto
|
||||
background-color lighten($baseBackgroundColor, 2%)
|
||||
|
||||
|
||||
|
||||
.snippets-detail-state
|
||||
position absolute
|
||||
top 0
|
||||
width 100%
|
||||
bottom 0
|
||||
overflow hidden
|
||||
.detail-header
|
||||
position absolute
|
||||
top 0
|
||||
width 100%
|
||||
background-color lighten($baseBackgroundColor, 5%)
|
||||
padding 5px 10px
|
||||
height 50px
|
||||
border-bottom solid 1px $baseBorderColor
|
||||
.detail-header-title
|
||||
color $textColorHighlight
|
||||
line-height 40px
|
||||
font-size 1.2em
|
||||
small
|
||||
font-size: 0.6em
|
||||
color $textColor
|
||||
|
||||
|
||||
.detail-header-control
|
||||
padding 3px
|
||||
|
||||
.detail-body
|
||||
position absolute
|
||||
top 50px
|
||||
width 100%
|
||||
bottom 0
|
||||
padding 5px 10px
|
||||
overflow-y auto
|
||||
.ace_editor
|
||||
min-height 300px
|
||||
border solid 1px $border-color
|
||||
border-radius 5px
|
||||
margin-bottom 5px
|
||||
|
||||
.tags
|
||||
word-break: break-all
|
||||
a
|
||||
margin: 0 2px
|
||||
@@ -1,14 +0,0 @@
|
||||
<div
|
||||
ui-ace="{
|
||||
showGutter: false,
|
||||
useWrapMode : true,
|
||||
mode:snippet.mode.toLowerCase(),
|
||||
maxLines: -1,
|
||||
theme:'solarized_dark',
|
||||
rendererOptions: {
|
||||
maxLinks: Infinity
|
||||
}
|
||||
}"
|
||||
readonly
|
||||
ng-model="snippet.content"
|
||||
></div>
|
||||
@@ -1,19 +0,0 @@
|
||||
<div class="new-snippet-modal">
|
||||
<div class="modal-header">
|
||||
<h4>Delete Recipe</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
Are you sure to delete it?
|
||||
</p>
|
||||
<blockquote>
|
||||
Snippets of this recipe will not be removed.
|
||||
</blockquote>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button ng-click="vm.submit()" type="button" name="button" class="btn btn-danger">Delete It</button>
|
||||
<button ng-click="vm.cancel()" type="button" name="button" class="btn btn-default">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,16 +0,0 @@
|
||||
<div class="new-snippet-modal">
|
||||
<div class="modal-header">
|
||||
<h4>Delete Snippet</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
Are you sure to delete it?
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button ng-click="vm.submit()" type="button" name="button" class="btn btn-danger">Delete It</button>
|
||||
<button ng-click="vm.cancel()" type="button" name="button" class="btn btn-default">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,60 +0,0 @@
|
||||
<div class="new-snippet-modal">
|
||||
<div class="modal-header">
|
||||
<h4>New Recipe</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<input ng-model="vm.recipe.title" type="text" class="form-control" placeholder="Title">
|
||||
</div>
|
||||
|
||||
<tabset>
|
||||
<tab>
|
||||
<tab-heading>
|
||||
<i class="glyphicon glyphicon-bell"></i> Markdown
|
||||
</tab-heading>
|
||||
|
||||
<div class="form-group">
|
||||
<div
|
||||
ui-ace="{
|
||||
mode: 'Markdown',
|
||||
theme: 'solarized_dark',
|
||||
useWrapMode: true
|
||||
}"
|
||||
ng-model="vm.recipe.content"
|
||||
></div>
|
||||
</div>
|
||||
</tab>
|
||||
<tab>
|
||||
<tab-heading>
|
||||
<i class=""></i> Preview
|
||||
</tab-heading>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div ng-bind-html="vm.recipe.content | marked" class="marked"></div>
|
||||
</div>
|
||||
</div>
|
||||
</tab>
|
||||
</tabset>
|
||||
|
||||
<div class="form-group">
|
||||
<button btn-expand-recipe="vm.recipe" class="btn btn-default">Expand Editor</button>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<ui-select multiple tagging="vm.transform" tagging-tokens="SPACE|,|/" ng-model="vm.recipe.Tags" theme="bootstrap">
|
||||
<ui-select-match placeholder="Tags...">{{$item.name}}</ui-select-match>
|
||||
<ui-select-choices repeat="tag in vm.tagCandidates" refresh="vm.refreshTagCandidates($select.search)"
|
||||
refresh-delay="100">
|
||||
<div><span ng-bind-html="tag.name | highlight: $select.search"></span><span ng-if="tag.isTag">(new)</span></div>
|
||||
</ui-select-choices>
|
||||
</ui-select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button ng-click="vm.submit()" type="button" name="button" class="btn btn-primary">Submit</button>
|
||||
<button ng-click="vm.cancel()" type="button" name="button" class="btn btn-default">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,49 +0,0 @@
|
||||
<div class="new-snippet-modal">
|
||||
<div class="modal-header">
|
||||
<h4>Edit Snippet</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<textarea ng-model="vm.snippet.description" name="description" class="form-control" placeholder="Description..."></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input ng-model="vm.snippet.callSign" type="text" name="callSign" class="inline-form-control" placeholder="Callsign">
|
||||
|
||||
<ui-select ng-model="vm.snippet.mode" style="display: inline-block;" theme="bootstrap">
|
||||
<ui-select-match placeholder="Select Type">{{$select.selected}}</ui-select-match>
|
||||
<ui-select-choices repeat="mode in vm.aceModes | filter:$select.search">
|
||||
<div ng-bind-html="mode | highlight: $select.search"></div>
|
||||
</ui-select-choices>
|
||||
</ui-select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div
|
||||
ui-ace="{
|
||||
mode: vm.snippet.mode.toLowerCase(),
|
||||
theme:'solarized_dark',
|
||||
useWrapMode : true
|
||||
|
||||
}"
|
||||
ng-model="vm.snippet.content"
|
||||
></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<ui-select multiple tagging="vm.transform" tagging-tokens="SPACE|,|/" ng-model="vm.snippet.Tags" theme="bootstrap">
|
||||
<ui-select-match placeholder="Tags...">{{$item.name}}</ui-select-match>
|
||||
<ui-select-choices repeat="tag in vm.tagCandidates" refresh="vm.refreshTagCandidates($select.search)"
|
||||
refresh-delay="200">
|
||||
<div><span ng-bind-html="tag.name | highlight: $select.search"></span><span ng-if="tag.isTag">(new)</span></div>
|
||||
</ui-select-choices>
|
||||
</ui-select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button ng-click="vm.submit()" type="button" name="button" class="btn btn-primary">Submit</button>
|
||||
<button ng-click="vm.cancel()" type="button" name="button" class="btn btn-default">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,37 +0,0 @@
|
||||
<div class="expand-recipe-modal">
|
||||
<div class="modal-header">
|
||||
<button ng-click="vm.insert('h1')" class="btn btn-default"><i class="fa fa-header fa-fw"></i></button>
|
||||
<button ng-click="vm.insert('ul')" class="btn btn-default"><i class="fa fa-list-ul fa-fw"></i></button>
|
||||
<button ng-click="vm.insert('ol')" class="btn btn-default"><i class="fa fa-list-ol fa-fw"></i></button>
|
||||
<button ng-click="vm.insert('a')" class="btn btn-default"><i class="fa fa-link fa-fw"></i></button>
|
||||
<button ng-click="vm.insert('table')" class="btn btn-default"><i class="fa fa-table fa-fw"></i></button>
|
||||
<button ng-click="vm.insertSnippet()" class="btn btn-default">Insert Snippet</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="container-fluid expand-editor">
|
||||
<div class="row">
|
||||
<div class="col-xs-6 editor-pane">
|
||||
<div
|
||||
ui-ace="{
|
||||
mode: 'Markdown',
|
||||
theme: 'solarized_dark',
|
||||
useWrapMode: true
|
||||
}"
|
||||
ng-model="vm.recipe.content"
|
||||
></div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6">
|
||||
<div class="panel panel-default preview-pane">
|
||||
<div class="panel-body">
|
||||
<div ng-bind-html="vm.recipe.content | marked" class="marked"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-default" ng-click="vm.cancel()">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,60 +0,0 @@
|
||||
<div class="new-snippet-modal">
|
||||
<div class="modal-header">
|
||||
<h4>New Recipe</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<input ng-model="vm.recipe.title" type="text" class="form-control" placeholder="Title">
|
||||
</div>
|
||||
|
||||
<tabset>
|
||||
<tab>
|
||||
<tab-heading>
|
||||
<i class="glyphicon glyphicon-bell"></i> Markdown
|
||||
</tab-heading>
|
||||
|
||||
<div class="form-group">
|
||||
<div
|
||||
ui-ace="{
|
||||
mode: 'Markdown',
|
||||
theme: 'solarized_dark',
|
||||
useWrapMode: true
|
||||
}"
|
||||
ng-model="vm.recipe.content"
|
||||
></div>
|
||||
</div>
|
||||
</tab>
|
||||
<tab>
|
||||
<tab-heading>
|
||||
<i class=""></i> Preview
|
||||
</tab-heading>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div ng-bind-html="vm.recipe.content | marked" class="marked"></div>
|
||||
</div>
|
||||
</div>
|
||||
</tab>
|
||||
</tabset>
|
||||
|
||||
<div class="form-group">
|
||||
<button btn-expand-recipe="vm.recipe" class="btn btn-default">Expand Editor</button>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<ui-select multiple tagging="vm.transform" tagging-tokens="SPACE|,|/" ng-model="vm.recipe.Tags" theme="bootstrap">
|
||||
<ui-select-match placeholder="Tags...">{{$item.name}}</ui-select-match>
|
||||
<ui-select-choices repeat="tag in vm.tagCandidates" refresh="vm.refreshTagCandidates($select.search)"
|
||||
refresh-delay="100">
|
||||
<div><span ng-bind-html="tag.name | highlight: $select.search"></span><span ng-if="tag.isTag">(new)</span></div>
|
||||
</ui-select-choices>
|
||||
</ui-select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button ng-click="vm.submit()" type="button" name="button" class="btn btn-primary">Submit</button>
|
||||
<button ng-click="vm.cancel()" type="button" name="button" class="btn btn-default">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,49 +0,0 @@
|
||||
<div class="new-snippet-modal">
|
||||
<div class="modal-header">
|
||||
<h4>New Snippet</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<textarea ng-model="vm.description" name="description" class="form-control" placeholder="Description..."></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input ng-model="vm.callSign" type="text" name="callSign" class="inline-form-control" placeholder="Callsign">
|
||||
|
||||
<ui-select ng-model="vm.mode" style="display: inline-block;" on-select="vm.log(vm.mode.name.toLowerCase())" theme="bootstrap">
|
||||
<ui-select-match placeholder="Select Type">{{$select.selected}}</ui-select-match>
|
||||
<ui-select-choices repeat="mode in vm.aceModes | filter: $select.search">
|
||||
<div ng-bind="::mode"></div>
|
||||
</ui-select-choices>
|
||||
</ui-select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div
|
||||
ui-ace="{
|
||||
mode: vm.mode.toLowerCase(),
|
||||
theme:'solarized_dark',
|
||||
useWrapMode : true
|
||||
|
||||
}"
|
||||
ng-model="vm.content"
|
||||
></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<ui-select multiple tagging="vm.transform" tagging-tokens="SPACE|,|/" ng-model="vm.Tags" theme="bootstrap">
|
||||
<ui-select-match placeholder="Tags...">{{$item.name}}</ui-select-match>
|
||||
<ui-select-choices repeat="tag in vm.tagCandidates" refresh="vm.refreshTagCandidates($select.search)"
|
||||
refresh-delay="100">
|
||||
<div><span ng-bind-html="tag.name | highlight: $select.search"></span><span ng-if="tag.isTag">(new)</span></div>
|
||||
</ui-select-choices>
|
||||
</ui-select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button ng-click="vm.submit()" type="button" name="button" class="btn btn-primary">Submit</button>
|
||||
<button ng-click="vm.cancel()" type="button" name="button" class="btn btn-default">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,25 +0,0 @@
|
||||
<div class="select-snippet-modal">
|
||||
<div class="modal-header">
|
||||
Select a snippet
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<ul class="snippet-list">
|
||||
<li ng-repeat="snippet in vm.snippets" ng-click="vm.select(snippet)">
|
||||
<p><small>callsign</small> <span ng-bind="snippet.callSign"></span> <small ng-bind="snippet.updatedAt|fromNow" class="call-sign"></small></p>
|
||||
<p ng-bind="snippet.description"></p>
|
||||
|
||||
<div ui-ace="{
|
||||
showGutter: true,
|
||||
useWrapMode : true,
|
||||
mode:snippet.mode.toLowerCase(),
|
||||
theme:'solarized_dark'
|
||||
}"
|
||||
readonly
|
||||
ng-model="snippet.content"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button ng-click="vm.cancel()" class="btn btn-default">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,16 +0,0 @@
|
||||
<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,54 +0,0 @@
|
||||
|
||||
<form novalidate name="registerForm" ng-submit="registerForm.$valid?vm.signup():null">
|
||||
|
||||
<!-- Email -->
|
||||
<div class="form-group">
|
||||
<label for="email">E-mail</label>
|
||||
<input ng-model="vm.email" type="email" id="email" name="email" class="form-control" placeholder="E-mail" required>
|
||||
|
||||
<div class="alert alert-danger" ng-if="registerForm.$submitted && !vm.isEmpty(registerForm.email.$error)">
|
||||
<div ng-show="registerForm.email.$error.required">No E-mail given.</div>
|
||||
<div ng-show="registerForm.email.$error.email">Invalid Address.</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Password -->
|
||||
<div class="form-group">
|
||||
<label for="password">Password</label>
|
||||
<input ng-model="vm.password" type="password" id="password" name="password" class="form-control" placeholder="Password" required>
|
||||
|
||||
<div class="alert alert-danger" ng-if="registerForm.$submitted && !vm.isEmpty(registerForm.password.$error)">
|
||||
<div ng-show="registerForm.password.$error.required">No password given.</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<!-- Username -->
|
||||
<div class="form-group">
|
||||
<label for="name">Username</label>
|
||||
<input ng-model="vm.name" ng-pattern="'^[A-Za-z0-9\-\_]+$'" type="text" id="name" name="name" class="form-control" required>
|
||||
<div class="alert alert-danger" ng-if="registerForm.$submitted && !vm.isEmpty(registerForm.name.$error)">
|
||||
<div ng-show="registerForm.name.$error.required">No Username given.</div>
|
||||
<div ng-show="registerForm.name.$error.pattern">Username should be ^[A-Za-z0-9\-\_]+$ (only alphanumeric, hyphen, underscore characters)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Profile name -->
|
||||
<div class="form-group">
|
||||
<label for="profileName">Profile name</label>
|
||||
<input ng-model="vm.profileName" type="text" name="profileName" class="form-control" required>
|
||||
|
||||
<div class="alert alert-danger" ng-if="registerForm.$submitted && !vm.isEmpty(registerForm.profileName.$error)">
|
||||
<div ng-show="registerForm.profileName.$error.required">No Profile name given.</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<button ng-class="{'btn-danger':registerForm.$invalid, 'btn-primary':registerForm.$valid}" type="submit" class="btn form-control">Register</button>
|
||||
</div>
|
||||
</form>
|
||||
@@ -1,18 +0,0 @@
|
||||
<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">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="password">Password</label>
|
||||
<input ng-model="vm.password" type="password" id="password" name="name" class="form-control" placeholder="Password">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary form-control">Sign In</button>
|
||||
</div>
|
||||
</form>
|
||||
@@ -1,19 +0,0 @@
|
||||
<div class="auth-state container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-xs-10 col-xs-offset-1 col-sm-8 col-sm-offset-2 col-lg-6 col-lg-offset-3 panel panel-default">
|
||||
|
||||
<div class="text-center">
|
||||
|
||||
<h1>Authentication</h1>
|
||||
|
||||
<div class="auth-control">
|
||||
<a class="btn btn-default" ui-sref-active="active" ui-sref="auth.register"><i class="fa fa-user-plus fa-fw"></i> Register</a> or <a class="btn btn-default" ui-sref-active="active" ui-sref="auth.signin"><i class="fa fa-sign-in fa-fw"></i> Sign In</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<ui-view></ui-view>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,33 +0,0 @@
|
||||
<div class="snippets-detail-state">
|
||||
|
||||
<div class="detail-header">
|
||||
<span class="detail-header-title">
|
||||
<small>callsign</small>
|
||||
<span ng-bind="vm.recipe.title"></span>
|
||||
<small><span ng-bind="vm.recipe.updatedAt|fromNow"></span> <i class="fa fa-clock-o"></i></small>
|
||||
</span>
|
||||
<span class="detail-header-control pull-right">
|
||||
<!-- <button type="button" name="button" class="btn btn-default"><i class="fa fa-share"></i></button> -->
|
||||
<button btn-edit-recipe="vm.recipe" type="button" name="button" class="btn btn-default"><i class="fa fa-edit"></i></button>
|
||||
<button btn-delete-recipe="vm.recipe" type="button" name="button" class="btn btn-danger"><i class="fa fa-trash"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="detail-body">
|
||||
|
||||
<div ng-if="!vm.isLoaded" class="">
|
||||
Loadding
|
||||
</div>
|
||||
|
||||
<div ng-if="vm.isLoaded" class="">
|
||||
|
||||
<div tag-list="vm.recipe.Tags"></div>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div ng-bind-html="vm.recipe.content | marked" class="marked"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,62 +0,0 @@
|
||||
<div class="snippets-list-state">
|
||||
|
||||
<div class="left-pane">
|
||||
<div class="snippet-search">
|
||||
|
||||
<div class="input-group">
|
||||
<input ng-model="vm.search" ng-change="vm.searchRecipes()" type="text" name="name" class="form-control" placeholder="Search ..." autocomplete="off">
|
||||
<span class="input-group-btn">
|
||||
<button btn-new-recipe class="btn btn-default" type="button">
|
||||
<i class="fa fa-plus-square-o"></i>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="snippet-list">
|
||||
|
||||
<li ng-if="vm.isLoading" class="message-item">
|
||||
<h4>
|
||||
Loading
|
||||
</h4>
|
||||
</li>
|
||||
|
||||
<li ng-if="!vm.isLoading && vm.snippets==0 && !vm.isGuest" class="message-item">
|
||||
<h4>
|
||||
Empty List
|
||||
</h4>
|
||||
<button btn-new-snippet class="btn btn-default"><i class="fa fa-plus-square-o"></i> New Snippet</button>
|
||||
</li>
|
||||
|
||||
<li ng-if="!vm.isLoading && vm.isGuest" class="message-item">
|
||||
<h4>
|
||||
Sign In to access
|
||||
</h4>
|
||||
<a ui-sref="auth.signin" class="btn btn-default"><i class="fa fa-signin"></i> Sign In</a>
|
||||
</li>
|
||||
|
||||
<li recipe-item="recipe" ng-repeat="recipe in vm.filtered" ui-sref="recipes.detail({id:recipe.id})" ng-class="{active:vm.recipeId===recipe.id}">
|
||||
<div class="media">
|
||||
<div class="media-left">
|
||||
<img width="25" height="25" class="img-circle" ng-src="http://www.gravatar.com/avatar/{{ vm.currentUser.email | gravatar }}" alt="" />
|
||||
</div>
|
||||
<div class="media-body">
|
||||
<p ng-bind="recipe.title"></p>
|
||||
<p class="created-at">
|
||||
<span ng-bind="recipe.updatedAt|fromNow"></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div tag-list="recipe.Tags"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="right-pane">
|
||||
<div ng-if="'recipes'|isState">
|
||||
No snippet selected.
|
||||
</div>
|
||||
<div ui-view></div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
@@ -1,33 +0,0 @@
|
||||
<div class="settings-state container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-xs-10 col-xs-offset-1 col-sm-8 col-sm-offset-2 col-lg-6 col-lg-offset-3 panel panel-default">
|
||||
<h1><i class="fa fa-gears"></i> Settings</h1>
|
||||
<p>
|
||||
Some settings...
|
||||
</p>
|
||||
<hr>
|
||||
<div class="section">
|
||||
<h4>Change Password</h4>
|
||||
<form ng-submit="vm.changePassword()">
|
||||
<alert type="success" ng-show="vm.isSuccess" close="vm.isSuccess=false">
|
||||
Successfully changed!!
|
||||
</alert>
|
||||
<alert type="danger" ng-show="vm.isError" close="vm.isError=false">
|
||||
Request failed!!
|
||||
</alert>
|
||||
<div class="form-group">
|
||||
<label for="password">Current Password</label>
|
||||
<input ng-model="vm.password" class="form-control" type="password" name="password" placeholder="Current Password">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="newPassword"> New Password</label>
|
||||
<input ng-model="vm.newPassword" class="form-control" type="password" name="newPassword" placeholder="New Password">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary form-control">Change Password</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,41 +0,0 @@
|
||||
<div class="snippets-detail-state">
|
||||
|
||||
<div class="detail-header">
|
||||
<span class="detail-header-title">
|
||||
<small>callsign</small>
|
||||
<span ng-bind="vm.snippet.callSign"></span>
|
||||
<small><span ng-bind="vm.snippet.updatedAt|fromNow"></span> <i class="fa fa-clock-o"></i></small>
|
||||
</span>
|
||||
<span class="detail-header-control pull-right">
|
||||
<!-- <button type="button" name="button" class="btn btn-default"><i class="fa fa-share"></i></button> -->
|
||||
<button btn-edit-snippet="vm.snippet" type="button" name="button" class="btn btn-default"><i class="fa fa-edit"></i></button>
|
||||
<button btn-delete-snippet="vm.snippet" type="button" name="button" class="btn btn-danger"><i class="fa fa-trash"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="detail-body">
|
||||
|
||||
<div ng-if="!vm.isLoaded" class="">
|
||||
Loadding
|
||||
</div>
|
||||
|
||||
<div ng-if="vm.isLoaded" class="">
|
||||
<p ng-bind="vm.snippet.description"></p>
|
||||
|
||||
<div tag-list="vm.snippet.Tags"></div>
|
||||
|
||||
<div ui-ace="{
|
||||
showGutter: false,
|
||||
useWrapMode : true,
|
||||
mode:vm.snippet.mode.toLowerCase(),
|
||||
maxLines: -1,
|
||||
theme:'solarized_dark',
|
||||
rendererOptions: {
|
||||
maxLinks: Infinity
|
||||
}
|
||||
}"
|
||||
readonly
|
||||
ng-model="vm.snippet.content"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,64 +0,0 @@
|
||||
<div class="snippets-list-state">
|
||||
|
||||
<div class="left-pane">
|
||||
<div class="snippet-search">
|
||||
<div class="input-group">
|
||||
<input ng-model="vm.search" ng-change="vm.searchSnippets()" type="text" name="name" class="form-control" placeholder="Search ..." autocomplete="off">
|
||||
<span class="input-group-btn">
|
||||
<button btn-new-snippet class="btn btn-default" type="button">
|
||||
<i class="fa fa-plus-square-o"></i>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="snippet-list">
|
||||
|
||||
<li ng-if="vm.isLoading" class="message-item">
|
||||
<h4>
|
||||
Loading
|
||||
</h4>
|
||||
</li>
|
||||
|
||||
<li ng-if="!vm.isLoading && vm.snippets==0 && !vm.isGuest" class="message-item">
|
||||
<h4>
|
||||
Empty List
|
||||
</h4>
|
||||
<button btn-new-snippet class="btn btn-default"><i class="fa fa-plus-square-o"></i> New Snippet</button>
|
||||
</li>
|
||||
|
||||
<li ng-if="!vm.isLoading && vm.isGuest" class="message-item">
|
||||
<h4>
|
||||
Sign In to access
|
||||
</h4>
|
||||
<a ui-sref="auth.signin" class="btn btn-default"><i class="fa fa-signin"></i> Sign In</a>
|
||||
</li>
|
||||
|
||||
<li snippet-item="snippet" ng-repeat="snippet in vm.filtered" ui-sref="snippets.detail({id:snippet.id})" ng-class="{active:vm.snippetId===snippet.id}">
|
||||
<div class="media">
|
||||
<div class="media-left">
|
||||
<img width="25" height="25" class="img-circle" ng-src="http://www.gravatar.com/avatar/{{ vm.currentUser.email | gravatar }}" alt="" />
|
||||
</div>
|
||||
<div class="media-body">
|
||||
<p ng-bind="snippet.callSign" class="call-sign">
|
||||
</p>
|
||||
<p ng-bind="snippet.description">
|
||||
</p>
|
||||
<p class="created-at">
|
||||
<span ng-bind="snippet.updatedAt|fromNow"></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div tag-list="snippet.Tags"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="right-pane">
|
||||
<div ng-if="'snippets'|isState">
|
||||
No snippet selected.
|
||||
</div>
|
||||
<div ui-view></div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user