mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
apply electron & cleanup old app files
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
var React = require('react/addons')
|
||||
|
||||
var ace = require('ace')
|
||||
var ace = window.ace
|
||||
var CodeEditor = React.createClass({
|
||||
propTypes: {
|
||||
code: React.PropTypes.string,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
var React = require('react/addons')
|
||||
|
||||
var ace = require('ace')
|
||||
var ace = window.ace
|
||||
var CodeViewer = React.createClass({
|
||||
propTypes: {
|
||||
code: React.PropTypes.string,
|
||||
|
||||
@@ -13,6 +13,10 @@ module.exports = React.createClass({
|
||||
this.unsubscribe()
|
||||
},
|
||||
onListen: function (res) {
|
||||
if (res == null || res.status == null) {
|
||||
return
|
||||
}
|
||||
|
||||
if (res.status === 'loggedIn' || res.status === 'registered') {
|
||||
var user = res.data
|
||||
var planet = user.Planets.length > 0 ? user.Planets[0] : null
|
||||
|
||||
@@ -4,12 +4,48 @@
|
||||
<title>CodeXen</title>
|
||||
|
||||
<link rel="stylesheet" href="../vendor/fontawesome/css/font-awesome.min.css" media="screen" title="no title" charset="utf-8">
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<script>
|
||||
if (!Object.assign) {
|
||||
Object.defineProperty(Object, 'assign', {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: function(target) {
|
||||
'use strict';
|
||||
if (target === undefined || target === null) {
|
||||
throw new TypeError('Cannot convert first argument to object');
|
||||
}
|
||||
|
||||
var to = Object(target);
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var nextSource = arguments[i];
|
||||
if (nextSource === undefined || nextSource === null) {
|
||||
continue;
|
||||
}
|
||||
nextSource = Object(nextSource);
|
||||
|
||||
var keysArray = Object.keys(Object(nextSource));
|
||||
for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
|
||||
var nextKey = keysArray[nextIndex];
|
||||
var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
|
||||
if (desc !== undefined && desc.enumerable) {
|
||||
to[nextKey] = nextSource[nextKey];
|
||||
}
|
||||
}
|
||||
}
|
||||
return to;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="content"></div>
|
||||
<script src="../ace/src-min/ace.js"></script>
|
||||
<script>
|
||||
require('node-jsx').install({ harmony: true, extension: '.jsx' });
|
||||
require('node-jsx').install({ harmony: true, extension: '.jsx' })
|
||||
require('./index.jsx')
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@@ -51,5 +51,6 @@
|
||||
<div id="content"></div>
|
||||
<script src="http://localhost:8090/webpack-dev-server.js"></script>
|
||||
<script type="text/javascript" src="http://localhost:8090/assets/main.js"></script>
|
||||
<script type="text/javascript" src="http://localhost:8090/assets/main-style.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
require('../styles/main/index.styl')
|
||||
require('react-select/dist/default.css')
|
||||
|
||||
var React = require('react/addons')
|
||||
|
||||
var ReactRouter = require('react-router')
|
||||
|
||||
2
browser/main/style.js
Normal file
2
browser/main/style.js
Normal file
@@ -0,0 +1,2 @@
|
||||
require('../styles/main/index.styl')
|
||||
require('react-select/dist/default.css')
|
||||
260
browser/styles/main/components/Select.styl
Normal file
260
browser/styles/main/components/Select.styl
Normal file
@@ -0,0 +1,260 @@
|
||||
/**
|
||||
* React Select
|
||||
* ============
|
||||
* Created by Jed Watson and Joss Mackison for KeystoneJS, http://www.keystonejs.com/
|
||||
* https://twitter.com/jedwatson https://twitter.com/jossmackison https://twitter.com/keystonejs
|
||||
* MIT License: https://github.com/keystonejs/react-select
|
||||
*/
|
||||
.Select {
|
||||
position: relative;
|
||||
}
|
||||
.Select-control {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #cccccc;
|
||||
border-color: #d9d9d9 #cccccc #b3b3b3;
|
||||
border-radius: 4px;
|
||||
box-sizing: border-box;
|
||||
color: #333333;
|
||||
cursor: default;
|
||||
outline: none;
|
||||
padding: 8px 52px 8px 10px;
|
||||
transition: all 200ms ease;
|
||||
}
|
||||
.Select-control:hover {
|
||||
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
.is-searchable.is-open > .Select-control {
|
||||
cursor: text;
|
||||
}
|
||||
.is-open > .Select-control {
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
background: #ffffff;
|
||||
border-color: #b3b3b3 #cccccc #d9d9d9;
|
||||
}
|
||||
.is-open > .Select-control > .Select-arrow {
|
||||
border-color: transparent transparent #999999;
|
||||
border-width: 0 5px 5px;
|
||||
}
|
||||
.is-searchable.is-focused:not(.is-open) > .Select-control {
|
||||
cursor: text;
|
||||
}
|
||||
.is-focused:not(.is-open) > .Select-control {
|
||||
border-color: #0088cc #0099e6 #0099e6;
|
||||
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 5px -1px rgba(0, 136, 204, 0.5);
|
||||
}
|
||||
.Select-placeholder {
|
||||
color: #aaaaaa;
|
||||
padding: 8px 52px 8px 10px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: -15px;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.has-value > .Select-control > .Select-placeholder {
|
||||
color: #333333;
|
||||
}
|
||||
.Select-input > input {
|
||||
cursor: default;
|
||||
background: none transparent;
|
||||
box-shadow: none;
|
||||
height: auto;
|
||||
border: 0 none;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
outline: none;
|
||||
display: inline-block;
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
.is-focused .Select-input > input {
|
||||
cursor: text;
|
||||
}
|
||||
.Select-control:not(.is-searchable) > .Select-input {
|
||||
outline: none;
|
||||
}
|
||||
.Select-loading {
|
||||
-webkit-animation: Select-animation-spin 400ms infinite linear;
|
||||
-o-animation: Select-animation-spin 400ms infinite linear;
|
||||
animation: Select-animation-spin 400ms infinite linear;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
box-sizing: border-box;
|
||||
border-radius: 50%;
|
||||
border: 2px solid #cccccc;
|
||||
border-right-color: #333333;
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
margin-top: -8px;
|
||||
position: absolute;
|
||||
right: 30px;
|
||||
top: 50%;
|
||||
}
|
||||
.has-value > .Select-control > .Select-loading {
|
||||
right: 46px;
|
||||
}
|
||||
.Select-clear {
|
||||
color: #999999;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
padding: 6px 10px;
|
||||
position: absolute;
|
||||
right: 17px;
|
||||
top: 0;
|
||||
}
|
||||
.Select-clear:hover {
|
||||
color: #c0392b;
|
||||
}
|
||||
.Select-clear > span {
|
||||
font-size: 1.1em;
|
||||
}
|
||||
.Select-arrow-zone {
|
||||
content: " ";
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 30px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.Select-arrow {
|
||||
border-color: #999999 transparent transparent;
|
||||
border-style: solid;
|
||||
border-width: 5px 5px 0;
|
||||
content: " ";
|
||||
display: block;
|
||||
height: 0;
|
||||
margin-top: -ceil(2.5px);
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 14px;
|
||||
width: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
.Select-menu-outer {
|
||||
border-bottom-right-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #cccccc;
|
||||
border-top-color: #e6e6e6;
|
||||
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
|
||||
box-sizing: border-box;
|
||||
margin-top: -1px;
|
||||
max-height: 200px;
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
width: 100%;
|
||||
z-index: 1000;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.Select-menu {
|
||||
max-height: 198px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.Select-option {
|
||||
box-sizing: border-box;
|
||||
color: #666666;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
padding: 8px 10px;
|
||||
}
|
||||
.Select-option:last-child {
|
||||
border-bottom-right-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
}
|
||||
.Select-option.is-focused {
|
||||
background-color: #f2f9fc;
|
||||
color: #333333;
|
||||
}
|
||||
.Select-option.is-disabled {
|
||||
color: #cccccc;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.Select-noresults {
|
||||
box-sizing: border-box;
|
||||
color: #999999;
|
||||
cursor: default;
|
||||
display: block;
|
||||
padding: 8px 10px;
|
||||
}
|
||||
.Select.is-multi .Select-control {
|
||||
padding: 2px 52px 2px 3px;
|
||||
}
|
||||
.Select.is-multi .Select-input {
|
||||
vertical-align: middle;
|
||||
border: 1px solid transparent;
|
||||
margin: 2px;
|
||||
padding: 3px 0;
|
||||
}
|
||||
.Select-item {
|
||||
background-color: #f2f9fc;
|
||||
border-radius: 2px;
|
||||
border: 1px solid #c9e6f2;
|
||||
color: #0088cc;
|
||||
display: inline-block;
|
||||
font-size: 1em;
|
||||
margin: 2px;
|
||||
}
|
||||
.Select-item-icon,
|
||||
.Select-item-label {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.Select-item-label {
|
||||
cursor: default;
|
||||
border-bottom-right-radius: 2px;
|
||||
border-top-right-radius: 2px;
|
||||
padding: 3px 5px;
|
||||
}
|
||||
.Select-item-label .Select-item-label__a {
|
||||
color: #0088cc;
|
||||
cursor: pointer;
|
||||
}
|
||||
.Select-item-icon {
|
||||
cursor: pointer;
|
||||
border-bottom-left-radius: 2px;
|
||||
border-top-left-radius: 2px;
|
||||
border-right: 1px solid #c9e6f2;
|
||||
padding: 2px 5px 4px;
|
||||
}
|
||||
.Select-item-icon:hover,
|
||||
.Select-item-icon:focus {
|
||||
background-color: #ddeff7;
|
||||
color: #0077b3;
|
||||
}
|
||||
.Select-item-icon:active {
|
||||
background-color: #c9e6f2;
|
||||
}
|
||||
.Select.is-multi.is-disabled .Select-item {
|
||||
background-color: #f2f2f2;
|
||||
border: 1px solid #d9d9d9;
|
||||
color: #888888;
|
||||
}
|
||||
.Select.is-multi.is-disabled .Select-item-icon {
|
||||
cursor: not-allowed;
|
||||
border-right: 1px solid #d9d9d9;
|
||||
}
|
||||
.Select.is-multi.is-disabled .Select-item-icon:hover,
|
||||
.Select.is-multi.is-disabled .Select-item-icon:focus,
|
||||
.Select.is-multi.is-disabled .Select-item-icon:active {
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
@keyframes Select-animation-spin {
|
||||
to {
|
||||
transform: rotate(1turn);
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes Select-animation-spin {
|
||||
to {
|
||||
-webkit-transform: rotate(1turn);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
marked()
|
||||
line-height 1.2em
|
||||
hr
|
||||
border-top none
|
||||
border-bottom solid 1px borderColor
|
||||
@@ -24,6 +23,9 @@ marked()
|
||||
margin 2.33em auto
|
||||
h1, h2, h3, h4, h5, h6
|
||||
font-weight bold
|
||||
line-height 1.2em
|
||||
p
|
||||
line-height 1.2em
|
||||
img
|
||||
max-width 100%
|
||||
strong
|
||||
@@ -63,6 +65,7 @@ marked()
|
||||
border solid 1px borderColor
|
||||
border-radius 5px
|
||||
margin 0.5em 0
|
||||
overflow-x auto
|
||||
&>code
|
||||
padding 0
|
||||
border none
|
||||
|
||||
BIN
src/app-logo.png
BIN
src/app-logo.png
Binary file not shown.
|
Before Width: | Height: | Size: 42 KiB |
@@ -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,3 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.controller('AppController', function ($scope) {})
|
||||
@@ -1,31 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.controller('SideNavController', function ($auth, User, $rootScope, $scope, Modal) {
|
||||
var vm = this
|
||||
|
||||
vm.isAuthenticated = $auth.isAuthenticated()
|
||||
|
||||
var reloadUser = function () {
|
||||
if (vm.isAuthenticated) {
|
||||
User.me().success(function (data) {
|
||||
console.log('currentUser', data)
|
||||
vm.currentUser = data
|
||||
})
|
||||
}
|
||||
}
|
||||
reloadUser()
|
||||
|
||||
vm.signOut = function () {
|
||||
Modal.signOut()
|
||||
}
|
||||
|
||||
$scope.$on('userSignIn', function () {
|
||||
vm.isAuthenticated = true
|
||||
reloadUser()
|
||||
})
|
||||
|
||||
$scope.$on('userSignOut', function () {
|
||||
vm.isAuthenticated = false
|
||||
vm.currentUser = null
|
||||
})
|
||||
})
|
||||
@@ -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,20 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.controller('AuthRegisterController', function ($auth, $log, $state, $rootScope) {
|
||||
var vm = this
|
||||
vm.isEmpty = function (obj) {
|
||||
for (var i in obj) if (obj.hasOwnProperty(i)) return false
|
||||
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')
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -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,90 +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 -->
|
||||
<link rel="stylesheet" href="styles/app.css">
|
||||
<link rel="stylesheet" href="../shared/styles/bootstrap.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 -->
|
||||
<script src="app.js"></script>
|
||||
<script src="config/states.js"></script>
|
||||
<script src="controllers/AppController.js"></script>
|
||||
<script src="directives/btn-delete-recipe.js"></script>
|
||||
<script src="directives/btn-delete-snippet.js"></script>
|
||||
<script src="directives/btn-edit-recipe.js"></script>
|
||||
<script src="directives/btn-edit-snippet.js"></script>
|
||||
<script src="directives/btn-expand-recipe.js"></script>
|
||||
<script src="directives/btn-new-recipe.js"></script>
|
||||
<script src="directives/btn-new-snippet.js"></script>
|
||||
<script src="directives/recipe-item.js"></script>
|
||||
<script src="directives/side-nav.js"></script>
|
||||
<script src="directives/snippet-item.js"></script>
|
||||
<script src="directives/tag-item.js"></script>
|
||||
<script src="directives/tag-list.js"></script>
|
||||
<script src="filters/from-now.js"></script>
|
||||
<script src="filters/marked.js"></script>
|
||||
<script src="filters/search-snippets.js"></script>
|
||||
<script src="services/Modal.js"></script>
|
||||
<script src="services/Recipe.js"></script>
|
||||
<script src="services/Settings.js"></script>
|
||||
<script src="services/Tag.js"></script>
|
||||
<script src="services/User.js"></script>
|
||||
<script src="controllers/directives/SideNavController.js"></script>
|
||||
<script src="controllers/states/AuthRegisterController.js"></script>
|
||||
<script src="controllers/states/AuthSignInController.js"></script>
|
||||
<script src="controllers/states/HomeController.js"></script>
|
||||
<script src="controllers/states/RecipesDetailController.js"></script>
|
||||
<script src="controllers/states/RecipesListController.js"></script>
|
||||
<script src="controllers/states/SettingsController.js"></script>
|
||||
<script src="controllers/states/SnippetsDetailController.js"></script>
|
||||
<script src="controllers/states/SnippetsListController.js"></script>
|
||||
<script src="controllers/modals/DeleteRecipeModalController.js"></script>
|
||||
<script src="controllers/modals/DeleteSnippetModalController.js"></script>
|
||||
<script src="controllers/modals/EditRecipeModalController.js"></script>
|
||||
<script src="controllers/modals/EditSnippetModalController.js"></script>
|
||||
<script src="controllers/modals/ExpandRecipeModalController.js"></script>
|
||||
<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>
|
||||
<script src="../shared/config/satellizer.js"></script>
|
||||
<script src="../shared/directives/ui-ace.js"></script>
|
||||
<script src="../shared/services/Snippet.js"></script>
|
||||
<!-- endinject -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -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,124 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.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({
|
||||
templateUrl: 'tpls/modals/new-recipe-modal.html',
|
||||
controller: 'NewRecipeModalController as vm'
|
||||
}).result.then(function (recipe) {
|
||||
$rootScope.$broadcast('recipeUpdated', recipe)
|
||||
})
|
||||
}
|
||||
|
||||
var editRecipe = function (recipe) {
|
||||
return $modal.open({
|
||||
resolve: {
|
||||
recipe: function () {
|
||||
return recipe
|
||||
}
|
||||
},
|
||||
templateUrl: 'tpls/modals/edit-recipe-modal.html',
|
||||
controller: 'EditRecipeModalController as vm'
|
||||
}).result.then(function (recipe) {
|
||||
$rootScope.$broadcast('recipeUpdated', recipe)
|
||||
})
|
||||
}
|
||||
|
||||
var expandRecipe = function (recipe) {
|
||||
return $modal.open({
|
||||
size: 'lg',
|
||||
resolve: {
|
||||
recipe: function () {
|
||||
return recipe
|
||||
}
|
||||
},
|
||||
templateUrl: 'tpls/modals/expand-recipe-modal.html',
|
||||
controller: 'ExpandRecipeModalController as vm'
|
||||
})
|
||||
}
|
||||
|
||||
var deleteRecipe = function (recipe) {
|
||||
return $modal.open({
|
||||
resolve: {
|
||||
recipe: function () {
|
||||
return recipe
|
||||
}
|
||||
},
|
||||
templateUrl: 'tpls/modals/delete-recipe-modal.html',
|
||||
controller: 'DeleteRecipeModalController as vm'
|
||||
}).result.then(function (recipe) {
|
||||
$rootScope.$broadcast('recipeDeleted', recipe)
|
||||
})
|
||||
}
|
||||
|
||||
/* Snippet */
|
||||
var newSnippet = function () {
|
||||
return $modal.open({
|
||||
templateUrl: 'tpls/modals/new-snippet-modal.tpl.html',
|
||||
controller: 'NewSnippetModalController as vm'
|
||||
}).result.then(function (snippet) {
|
||||
$rootScope.$broadcast('snippetUpdated', snippet)
|
||||
})
|
||||
}
|
||||
|
||||
var editSnippet = function (snippet) {
|
||||
return $modal.open({
|
||||
resolve: {
|
||||
snippet: function () {
|
||||
return snippet
|
||||
}
|
||||
},
|
||||
templateUrl: 'tpls/modals/edit-snippet-modal.tpl.html',
|
||||
controller: 'EditSnippetModalController as vm'
|
||||
}).result.then(function (snippet) {
|
||||
$rootScope.$broadcast('snippetUpdated', snippet)
|
||||
})
|
||||
}
|
||||
|
||||
var deleteSnippet = function (snippet) {
|
||||
return $modal.open({
|
||||
resolve: {
|
||||
snippet: function () {
|
||||
return snippet
|
||||
}
|
||||
},
|
||||
templateUrl: 'tpls/modals/delete-snippet-modal.tpl.html',
|
||||
controller: 'DeleteSnippetModalController as vm'
|
||||
}).result.then(function (snippet) {
|
||||
$rootScope.$broadcast('snippetDeleted', snippet)
|
||||
})
|
||||
}
|
||||
|
||||
var selectSnippet = function (snippet) {
|
||||
return $modal.open({
|
||||
templateUrl: 'tpls/modals/select-snippet-modal.html',
|
||||
controller: 'SelectSnippetModalController as vm'
|
||||
}).result
|
||||
}
|
||||
|
||||
return {
|
||||
signOut: signOut,
|
||||
newRecipe: newRecipe,
|
||||
editRecipe: editRecipe,
|
||||
deleteRecipe: deleteRecipe,
|
||||
expandRecipe: expandRecipe,
|
||||
newSnippet: newSnippet,
|
||||
editSnippet: editSnippet,
|
||||
deleteSnippet: deleteSnippet,
|
||||
selectSnippet: selectSnippet
|
||||
}
|
||||
})
|
||||
@@ -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,543 +0,0 @@
|
||||
.expand-recipe-modal .expand-editor .editor-pane {
|
||||
height: 500px;
|
||||
}
|
||||
.expand-recipe-modal .expand-editor .editor-pane .ace_editor {
|
||||
height: 500px;
|
||||
}
|
||||
.expand-recipe-modal .expand-editor .preview-pane {
|
||||
height: 500px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.new-snippet-modal .ace_editor {
|
||||
height: 200px;
|
||||
}
|
||||
.select-snippet-modal .snippet-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
.select-snippet-modal .snippet-list li {
|
||||
padding: 10px;
|
||||
border: solid 1px #001a20;
|
||||
background-color: #003b4a;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.select-snippet-modal .snippet-list li:hover {
|
||||
background-color: #004b5f;
|
||||
}
|
||||
.select-snippet-modal .snippet-list li .ace_editor {
|
||||
height: 150px;
|
||||
}
|
||||
.select-snippet-modal .snippet-list li .call-sign {
|
||||
color: #d5dfe2;
|
||||
}
|
||||
#side-view .nav-control-group {
|
||||
margin: auto 10px;
|
||||
}
|
||||
#side-view .new-block {
|
||||
margin: 20px auto;
|
||||
}
|
||||
#side-view .new-block button {
|
||||
padding: 10px inherit;
|
||||
}
|
||||
#side-view .new-block button:nth-child(1) {
|
||||
width: 147px;
|
||||
padding-left: 15px;
|
||||
text-align: left;
|
||||
}
|
||||
#side-view .new-block button:nth-child(2) {
|
||||
width: 33px;
|
||||
}
|
||||
#side-view .new-block .success-menu {
|
||||
background-color: #167b59;
|
||||
}
|
||||
#side-view .new-block .success-menu a {
|
||||
padding: 5px 15px;
|
||||
color: #fff;
|
||||
}
|
||||
#side-view .new-block .success-menu a.hover,
|
||||
#side-view .new-block .success-menu a:hover {
|
||||
background-color: #22bd89;
|
||||
}
|
||||
#side-view .new-block .success-menu a.focus,
|
||||
#side-view .new-block .success-menu a:focus {
|
||||
background-color: #20b482;
|
||||
}
|
||||
#side-view ul.nav.nav-pills {
|
||||
margin-top: 10px;
|
||||
}
|
||||
#side-view ul.nav.nav-pills li a {
|
||||
padding: 12px 15px;
|
||||
margin-bottom: 7px;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
-webkit-transition: 0.2s;
|
||||
transition: 0.2s;
|
||||
}
|
||||
#side-view ul.nav.nav-pills li.active > a,
|
||||
#side-view ul.nav.nav-pills .nav-pills > li.active > a:hover,
|
||||
#side-view ul.nav.nav-pills .nav-pills > li.active > a:focus {
|
||||
background-color: #004b5f;
|
||||
}
|
||||
/*
|
||||
* ui-select
|
||||
* http://github.com/angular-ui/ui-select
|
||||
* Version: 0.11.2 - 2015-03-17T04:08:46.478Z
|
||||
* License: MIT
|
||||
*/
|
||||
.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;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.selectize-input.selectize-focus {
|
||||
border-color: #007fbb !important;
|
||||
}
|
||||
.selectize-control > .selectize-input > input {
|
||||
width: 100%;
|
||||
}
|
||||
.selectize-control > .selectize-dropdown {
|
||||
width: 100%;
|
||||
}
|
||||
.ng-dirty.ng-invalid > div.selectize-input {
|
||||
border-color: #d44950;
|
||||
}
|
||||
.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-bootstrap .ui-select-toggle .ui-select-placeholder {
|
||||
color: #99b2b8;
|
||||
}
|
||||
.ui-select-bootstrap .ui-select-toggle > .caret {
|
||||
position: absolute;
|
||||
height: 10px;
|
||||
top: 50%;
|
||||
right: 10px;
|
||||
margin-top: -2px;
|
||||
}
|
||||
.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 #001a20;
|
||||
}
|
||||
.ui-select-bootstrap > .ui-select-match > .caret {
|
||||
position: absolute;
|
||||
top: 45%;
|
||||
right: 15px;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.ui-select-multiple.ui-select-bootstrap {
|
||||
height: auto;
|
||||
padding: 3px 3px 0 10px;
|
||||
}
|
||||
.ui-select-multiple.ui-select-bootstrap.open {
|
||||
border-color: #52dcff;
|
||||
outline: 0;
|
||||
box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 8px rgba(82,220,255,0.6);
|
||||
}
|
||||
.ui-select-multiple.ui-select-bootstrap input.ui-select-search {
|
||||
background-color: transparent !important;
|
||||
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: #99b2b8;
|
||||
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: #fff;
|
||||
background-color: #004b5f;
|
||||
}
|
||||
.ui-select-bootstrap .ui-select-choices-row.active>a {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
outline: 0;
|
||||
background-color: #004b5f;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.ui-select-match.ng-hide-add,
|
||||
.ui-select-search.ng-hide-add {
|
||||
display: none !important;
|
||||
}
|
||||
.ui-select-bootstrap.ng-dirty.ng-invalid > button.btn.ui-select-match {
|
||||
border-color: #d44950;
|
||||
}
|
||||
.auth-state .panel {
|
||||
margin-top: 50px;
|
||||
}
|
||||
.auth-state h1 {
|
||||
margin: 15px 0;
|
||||
}
|
||||
.auth-state .auth-control {
|
||||
margin: 10px 0;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.settings-state h1 {
|
||||
margin: 30px 0;
|
||||
}
|
||||
.settings-state .section h4 {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.snippets-list-state {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
.snippets-list-state .left-pane {
|
||||
border-right: 1px solid #001a20;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 275px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.snippets-list-state .left-pane .snippet-search {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
height: 50px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
border-right: 1px solid #001a20;
|
||||
padding: 7px 5px;
|
||||
}
|
||||
.snippets-list-state .left-pane .snippet-list {
|
||||
position: absolute;
|
||||
top: 50px;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
.snippets-list-state .left-pane .snippet-list li {
|
||||
cursor: pointer;
|
||||
padding: 5px;
|
||||
border-right: 1px solid #001a20;
|
||||
border-bottom: 1px solid #001a20;
|
||||
}
|
||||
.snippets-list-state .left-pane .snippet-list li:nth-child(even) {
|
||||
background-color: #002b36;
|
||||
}
|
||||
.snippets-list-state .left-pane .snippet-list li:nth-child(odd) {
|
||||
background-color: #00323f;
|
||||
}
|
||||
.snippets-list-state .left-pane .snippet-list li h4 {
|
||||
margin: 0;
|
||||
}
|
||||
.snippets-list-state .left-pane .snippet-list li:hover {
|
||||
background-color: #004b5f;
|
||||
}
|
||||
.snippets-list-state .left-pane .snippet-list li p {
|
||||
margin: 0;
|
||||
}
|
||||
.snippets-list-state .left-pane .snippet-list li p.call-sign {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
.snippets-list-state .left-pane .snippet-list li p.created-at {
|
||||
font-size: 0.8em;
|
||||
opacity: 0.8;
|
||||
}
|
||||
.snippets-list-state .left-pane .snippet-list li.active {
|
||||
color: #fff;
|
||||
background-color: #088cff;
|
||||
}
|
||||
.snippets-list-state .left-pane .snippet-list li.active a {
|
||||
color: #fff;
|
||||
}
|
||||
.snippets-list-state .right-pane {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 275px;
|
||||
right: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
background-color: #00323f;
|
||||
}
|
||||
.snippets-detail-state {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
bottom: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.snippets-detail-state .detail-header {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
background-color: #003d4d;
|
||||
padding: 5px 10px;
|
||||
height: 50px;
|
||||
border-bottom: solid 1px #001a20;
|
||||
}
|
||||
.snippets-detail-state .detail-header .detail-header-title {
|
||||
color: #d5dfe2;
|
||||
line-height: 40px;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
.snippets-detail-state .detail-header .detail-header-title small {
|
||||
font-size: 0.6em;
|
||||
color: #99b2b8;
|
||||
}
|
||||
.snippets-detail-state .detail-header .detail-header-control {
|
||||
padding: 3px;
|
||||
}
|
||||
.snippets-detail-state .detail-body {
|
||||
position: absolute;
|
||||
top: 50px;
|
||||
width: 100%;
|
||||
bottom: 0;
|
||||
padding: 5px 10px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.snippets-detail-state .detail-body .ace_editor {
|
||||
min-height: 300px;
|
||||
border: solid 1px $border-color;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.tags {
|
||||
word-break: break-all;
|
||||
}
|
||||
.tags a {
|
||||
margin: 0 2px;
|
||||
}
|
||||
#side-view {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 200px;
|
||||
background-color: #002b36;
|
||||
border-right: solid 2px #004b5f;
|
||||
box-sizing: border-box;
|
||||
padding: 10px 0 10px 10px;
|
||||
}
|
||||
#main-view {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 200px;
|
||||
right: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
background-color: $bgDarker;
|
||||
}
|
||||
.marked h1,
|
||||
.marked h2,
|
||||
.marked h3,
|
||||
.marked h4,
|
||||
.marked h5 {
|
||||
margin: 0.75em 0;
|
||||
}
|
||||
.marked h1:nth-child(1),
|
||||
.marked h2:nth-child(1),
|
||||
.marked h3:nth-child(1),
|
||||
.marked h4:nth-child(1),
|
||||
.marked h5:nth-child(1) {
|
||||
margin-top: 0;
|
||||
}
|
||||
.marked code {
|
||||
background-color: #003644;
|
||||
color: #fff;
|
||||
border: 1px solid #001a20;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 1px 1px rgba(0,0,0,0.05);
|
||||
padding: 5px;
|
||||
line-height: 200%;
|
||||
}
|
||||
.marked pre {
|
||||
margin-bottom: 10px;
|
||||
background-color: #003644;
|
||||
color: #fff;
|
||||
border: 1px solid #001a20;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 1px 1px rgba(0,0,0,0.05);
|
||||
padding: 5px;
|
||||
}
|
||||
.marked pre >code {
|
||||
background-color: transparent;
|
||||
color: inherit;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
padding: 0;
|
||||
line-height: inherit;
|
||||
}
|
||||
.marked blockquote {
|
||||
font-size: 1em;
|
||||
border-left: 5px solid #6494ed;
|
||||
}
|
||||
.marked a {
|
||||
text-decoration: underline;
|
||||
color: #6494ed;
|
||||
}
|
||||
.marked table {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
margin-bottom: $line-height-computed;
|
||||
border: 1px solid #001a20;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.marked table > thead > tr > th,
|
||||
.marked table > tbody > tr > th,
|
||||
.marked table > tfoot > tr > th,
|
||||
.marked table > thead > tr > td,
|
||||
.marked table > tbody > tr > td,
|
||||
.marked table > tfoot > tr > td {
|
||||
padding: 10px;
|
||||
line-height: $line-height-base;
|
||||
vertical-align: top;
|
||||
border-top: 1px solid #001a20;
|
||||
border-right: 1px solid #001a20;
|
||||
}
|
||||
.marked table > thead > tr > th:nth-last-child(1),
|
||||
.marked table > tbody > tr > th:nth-last-child(1),
|
||||
.marked table > tfoot > tr > th:nth-last-child(1),
|
||||
.marked table > thead > tr > td:nth-last-child(1),
|
||||
.marked table > tbody > tr > td:nth-last-child(1),
|
||||
.marked table > tfoot > tr > td:nth-last-child(1) {
|
||||
border-right: none;
|
||||
}
|
||||
.marked table > thead > tr > th {
|
||||
vertical-align: bottom;
|
||||
border-bottom: 2px solid #001a20;
|
||||
}
|
||||
.marked table > caption + thead,
|
||||
.marked table > colgroup + thead,
|
||||
.marked table > thead:first-child {
|
||||
background-color: #004b5f;
|
||||
}
|
||||
.marked table > caption + thead > tr:first-child > th,
|
||||
.marked table > colgroup + thead > tr:first-child > th,
|
||||
.marked table > thead:first-child > tr:first-child > th,
|
||||
.marked table > caption + thead > tr:first-child > td,
|
||||
.marked table > colgroup + thead > tr:first-child > td,
|
||||
.marked table > thead:first-child > tr:first-child > td {
|
||||
border-top: 0;
|
||||
}
|
||||
.marked table > tbody >tr:nth-child(odd) {
|
||||
background-color: #002b36;
|
||||
}
|
||||
.marked table > tbody >tr:nth-child(even) {
|
||||
background-color: #003644;
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
@import '../../shared/styles/_vars'
|
||||
@import '../../shared/styles/mixins/*'
|
||||
|
||||
@import 'modals/*'
|
||||
@import 'directives/*'
|
||||
@import 'states/*'
|
||||
|
||||
#side-view
|
||||
position:absolute
|
||||
top: 0
|
||||
bottom: 0
|
||||
left: 0
|
||||
width: 200px
|
||||
background-color: $baseBackgroundColor
|
||||
border-right solid 2px $backgroundColorSelected
|
||||
box-sizing: border-box
|
||||
padding: 10px 0 10px 10px
|
||||
|
||||
#main-view
|
||||
position:absolute
|
||||
top: 0
|
||||
bottom: 0
|
||||
left: 200px
|
||||
right: 0
|
||||
overflow-x: hidden
|
||||
overflow-y: auto
|
||||
background-color $bgDarker
|
||||
|
||||
.marked
|
||||
h1, h2, h3, h4, h5
|
||||
margin 0.75em 0
|
||||
&:nth-child(1)
|
||||
margin-top 0
|
||||
code
|
||||
background-color lighten($baseBackgroundColor, 3%)
|
||||
color $textColorSelected
|
||||
border 1px solid $baseBorderColor
|
||||
border-radius 5px
|
||||
box-shadow 0 1px 1px rgba(0, 0, 0, .05)
|
||||
padding 5px
|
||||
line-height 200%
|
||||
pre
|
||||
margin-bottom 10px
|
||||
background-color lighten($baseBackgroundColor, 3%)
|
||||
color $textColorSelected
|
||||
border 1px solid $baseBorderColor
|
||||
border-radius 5px
|
||||
box-shadow 0 1px 1px rgba(0, 0, 0, .05)
|
||||
padding 5px
|
||||
>code
|
||||
background-color transparent
|
||||
color inherit
|
||||
border none
|
||||
border-radius 0
|
||||
box-shadow none
|
||||
padding 0
|
||||
line-height inherit
|
||||
blockquote
|
||||
font-size 1em
|
||||
border-left 5px solid $textColorInfo
|
||||
a
|
||||
text-decoration underline
|
||||
color $textColorInfo
|
||||
table
|
||||
width 100%
|
||||
max-width 100%
|
||||
margin-bottom $line-height-computed
|
||||
border 1px solid $table-border-color
|
||||
margin-bottom 10px
|
||||
|
||||
// Cells
|
||||
> thead,
|
||||
> tbody,
|
||||
> tfoot
|
||||
> tr
|
||||
> th,
|
||||
> td
|
||||
padding 10px
|
||||
line-height $line-height-base
|
||||
vertical-align top
|
||||
border-top 1px solid $table-border-color
|
||||
border-right 1px solid $table-border-color
|
||||
&:nth-last-child(1)
|
||||
border-right none
|
||||
> thead > tr > th
|
||||
vertical-align bottom
|
||||
border-bottom 2px solid $table-border-color
|
||||
> caption + thead,
|
||||
> colgroup + thead,
|
||||
> thead:first-child
|
||||
background-color $backgroundColorSelected
|
||||
> tr:first-child
|
||||
> th,
|
||||
> td
|
||||
border-top 0
|
||||
> tbody
|
||||
>tr
|
||||
&:nth-child(odd)
|
||||
background-color $baseBackgroundColor
|
||||
&:nth-child(even)
|
||||
background-color lighten($baseBackgroundColor, 3%)
|
||||
@@ -1,34 +0,0 @@
|
||||
#side-view
|
||||
.nav-control-group
|
||||
margin auto 10px
|
||||
.new-block
|
||||
margin 20px auto
|
||||
button
|
||||
padding 10px inherit
|
||||
button:nth-child(1)
|
||||
width 147px
|
||||
padding-left 15px
|
||||
text-align left
|
||||
button:nth-child(2)
|
||||
width 33px
|
||||
.success-menu
|
||||
background-color darken($brand-success, 35%)
|
||||
a
|
||||
padding 5px 15px
|
||||
color $textColorSelected
|
||||
&.hover, &:hover
|
||||
background-color $brand-success
|
||||
&.focus, &:focus
|
||||
background-color darken($brand-success, 5%)
|
||||
|
||||
ul.nav.nav-pills
|
||||
margin-top 10px
|
||||
li a
|
||||
padding 12px 15px
|
||||
margin-bottom 7px
|
||||
border-top-right-radius 0
|
||||
border-bottom-right-radius 0
|
||||
transition 0.2s
|
||||
li.active > a, .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus{
|
||||
background-color: $backgroundColorSelected
|
||||
}
|
||||
@@ -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,45 +0,0 @@
|
||||
<div class="current-user">
|
||||
<div ng-if="vm.currentUser">
|
||||
<img width="30" class="img-circle" ng-src="http://www.gravatar.com/avatar/{{ vm.currentUser.email | gravatar }}">
|
||||
<a href ng-bind="vm.currentUser.name"></a>
|
||||
<span class="nav-control-group pull-right">
|
||||
<a ui-sref="settings" class="btn btn-sm btn-default" ui-sref-active="active"><i class="fa fa-gears fa-fw"></i></a>
|
||||
<a href class="btn btn-sm btn-default" ng-click="vm.signOut()"><i class="fa fa-sign-out fa-fw"></i></a>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<div ng-if="!vm.currentUser">
|
||||
<span>Guest</span>
|
||||
|
||||
<span class="nav-control-group pull-right">
|
||||
<a class="btn btn-sm btn-default" ui-sref="auth.register"><i class="fa fa-user-plus fa-fw"></i></a>
|
||||
<a class="btn btn-sm btn-default" ui-sref="auth.signin"><i class="fa fa-sign-in fa-fw"></i></a>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="new-block">
|
||||
<div class="btn-group" dropdown>
|
||||
<button ng-disabled="!vm.isAuthenticated" btn-new-snippet type="button" class="btn btn-success"><i class="fa fa-plus-square-o fa-fw"></i> New Snippet</button>
|
||||
<button ng-disabled="!vm.isAuthenticated" type="button" class="btn btn-success dropdown-toggle" dropdown-toggle>
|
||||
<span class="caret"></span>
|
||||
<span class="sr-only">Split button!</span>
|
||||
</button>
|
||||
<ul class="dropdown-menu success-menu" role="menu">
|
||||
<li><a href btn-new-recipe><i class="fa fa-bookmark-o fa-fw"></i> New Recipe</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li ui-sref-active="active">
|
||||
<a ui-sref="home"><i class="fa fa-home fa-fw"></i> Home</a>
|
||||
</li>
|
||||
<li ui-sref-active="active">
|
||||
<a ui-sref="snippets"><i class="fa fa-code fa-fw"></i> Snippets</a>
|
||||
</li>
|
||||
<li ui-sref-active="active">
|
||||
<a ui-sref="recipes"><i class="fa fa-bookmark-o fa-fw"></i> Recipes</a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -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,48 +0,0 @@
|
||||
<div class="home-state">
|
||||
<h1 class="jumbotron">Codexen App <small>v0.1.1</small></h1>
|
||||
|
||||
<h2>About CodeXen</h2>
|
||||
|
||||
<p>
|
||||
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>
|
||||
</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>
|
||||
@@ -1,66 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html ng-app="codexen.popup">
|
||||
<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">
|
||||
|
||||
<link rel="stylesheet" href="../vendor/css/font-awesome.css" media="screen" title="no title" charset="utf-8">
|
||||
|
||||
<!-- inject:css -->
|
||||
<link rel="stylesheet" href="styles/app.css">
|
||||
<link rel="stylesheet" href="../shared/styles/bootstrap.css">
|
||||
<!-- endinject -->
|
||||
|
||||
</head>
|
||||
<body class="popup-body" ng-controller="PopUpController">
|
||||
|
||||
<div class="search-block">
|
||||
<input ng-change="filterList(searchNeedle)" search-input id="search-input" type="text" class="form-control" ng-model="searchNeedle" ng-change="refreshResult">
|
||||
</div>
|
||||
|
||||
<div class="result-block row-fluid">
|
||||
<ul id="result-list" class="result-list left-pane">
|
||||
<li ng-click="selectSnippet($index)" ng-repeat="snippet in filteredSnippets" ng-class="{active:$index == selectIndex}"><a href="#"> <small ng-bind="snippet.callSign"></small> / <span ng-bind="snippet.description"></span></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="right-pane">
|
||||
<div class="result-detail-control">
|
||||
<button ng-click="writeCode(selectedItem.content)" id="btnClipboard" type="button" name="button" class="btn btn-default"><i class="fa fa-clipboard"></i></button>
|
||||
</div>
|
||||
<div id="aceView" class="result-detail-content"
|
||||
ui-ace="{
|
||||
showGutter: false,
|
||||
useWrapMode: true,
|
||||
mode:selectedItem.mode.toLowerCase(),
|
||||
onLoad: aceLoaded,
|
||||
theme: 'solarized_dark'
|
||||
}"
|
||||
|
||||
readonly
|
||||
ng-model="selectedItem.content"
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
<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 -->
|
||||
<script src="popup.js"></script>
|
||||
<script src="services/snippet.js"></script>
|
||||
<script src="../shared/shared.js"></script>
|
||||
<script src="../shared/directives/ui-ace.js"></script>
|
||||
<script src="../shared/config/ace.js"></script>
|
||||
<script src="../shared/config/env.js"></script>
|
||||
<script src="../shared/config/satellizer.js"></script>
|
||||
<script src="../shared/services/Snippet.js"></script>
|
||||
<!-- endinject -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,56 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html ng-app="codexen.popup">
|
||||
<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">
|
||||
|
||||
<link rel="stylesheet" href="../vendor/css/font-awesome.css" media="screen" title="no title" charset="utf-8">
|
||||
|
||||
<!-- inject:css -->
|
||||
<!-- endinject -->
|
||||
|
||||
</head>
|
||||
<body class="popup-body" ng-controller="PopUpController">
|
||||
|
||||
<div class="search-block">
|
||||
<input ng-change="filterList(searchNeedle)" search-input id="search-input" type="text" class="form-control" ng-model="searchNeedle" ng-change="refreshResult">
|
||||
</div>
|
||||
|
||||
<div class="result-block row-fluid">
|
||||
<ul id="result-list" class="result-list left-pane">
|
||||
<li ng-click="selectSnippet($index)" ng-repeat="snippet in filteredSnippets" ng-class="{active:$index == selectIndex}"><a href="#"> <small ng-bind="snippet.callSign"></small> / <span ng-bind="snippet.description"></span></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="right-pane">
|
||||
<div class="result-detail-control">
|
||||
<button ng-click="writeCode(selectedItem.content)" id="btnClipboard" type="button" name="button" class="btn btn-default"><i class="fa fa-clipboard"></i></button>
|
||||
</div>
|
||||
<div id="aceView" class="result-detail-content"
|
||||
ui-ace="{
|
||||
showGutter: false,
|
||||
useWrapMode: true,
|
||||
mode:selectedItem.mode.toLowerCase(),
|
||||
onLoad: aceLoaded,
|
||||
theme: 'solarized_dark'
|
||||
}"
|
||||
|
||||
readonly
|
||||
ng-model="selectedItem.content"
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
<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 -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,192 +0,0 @@
|
||||
/* global angular */
|
||||
|
||||
var remote = require('remote')
|
||||
var ipc = require('ipc')
|
||||
|
||||
var resultList = document.getElementById('result-list')
|
||||
|
||||
angular.module('codexen.popup', [
|
||||
'codexen.shared',
|
||||
'ui.ace',
|
||||
'satellizer',
|
||||
'cfp.hotkeys'
|
||||
])
|
||||
.constant('appName', 'popup')
|
||||
.controller('PopUpController', function ($scope, Snippet, $auth, $window, hotkeys, $document, $filter) {
|
||||
// Setup Events
|
||||
remote.getCurrentWindow().on('focus', function () {
|
||||
if (!$auth.isAuthenticated()) return hidePopUp()
|
||||
$scope.$apply(focusSearchInput)
|
||||
loadSnippets()
|
||||
})
|
||||
|
||||
hotkeys.bindTo($scope)
|
||||
.add('down', function (e) {
|
||||
nextSnippet()
|
||||
e.preventDefault()
|
||||
})
|
||||
.add('up', function (e) {
|
||||
priorSnippet()
|
||||
e.preventDefault()
|
||||
})
|
||||
.add('right', function (e) {
|
||||
e.preventDefault()
|
||||
})
|
||||
.add('left', function (e) {
|
||||
e.preventDefault()
|
||||
})
|
||||
.add('esc', function (e) {
|
||||
hidePopUp()
|
||||
})
|
||||
.add('shift+tab', function (e) {
|
||||
e.preventDefault()
|
||||
})
|
||||
.add('tab', function (e) {
|
||||
e.preventDefault()
|
||||
})
|
||||
.add('enter', function (e) {
|
||||
writeCode($scope.selectedItem.content)
|
||||
e.preventDefault()
|
||||
})
|
||||
|
||||
$scope.aceLoaded = function (editor) {
|
||||
editor.commands.addCommand({
|
||||
name: 'escape',
|
||||
bindKey: {win: 'esc', mac: 'esc'},
|
||||
exec: function (editor) {
|
||||
editor.blur()
|
||||
$scope.$apply()
|
||||
},
|
||||
readOnly: true
|
||||
})
|
||||
}
|
||||
|
||||
$scope.$on('nextSnippetRequested', function (e) {
|
||||
e.stopPropagation()
|
||||
nextSnippet()
|
||||
})
|
||||
|
||||
$scope.$on('priorSnippetRequested', function (e) {
|
||||
e.stopPropagation()
|
||||
priorSnippet()
|
||||
})
|
||||
|
||||
$scope.$on('snippetSubmitted', function (e) {
|
||||
if ($scope.filteredSnippets.length > 0) ipc.send('writeCode', $scope.selectedItem.content)
|
||||
else console.log('\x07')
|
||||
e.stopPropagation()
|
||||
})
|
||||
|
||||
// Init Data
|
||||
$scope.snippets = []
|
||||
|
||||
Snippet.findMine()
|
||||
.success(function (data) {
|
||||
$scope.snippets = data
|
||||
filterList()
|
||||
})
|
||||
|
||||
// Result Item control
|
||||
$scope.selectIndex = 0
|
||||
|
||||
$scope.selectSnippet = selectSnippet
|
||||
$scope.filterList = filterList
|
||||
$scope.writeCode = writeCode
|
||||
$scope.focusSearchInput = focusSearchInput
|
||||
|
||||
// Search Filter
|
||||
function loadSnippets () {
|
||||
Snippet.findMine()
|
||||
.success(function (data) {
|
||||
$scope.snippets = data
|
||||
filterList()
|
||||
})
|
||||
}
|
||||
|
||||
function filterList (needle) {
|
||||
$scope.filteredSnippets = $filter('filter')($scope.snippets, needle)
|
||||
firstSnippet()
|
||||
}
|
||||
|
||||
function selectSnippet (index) {
|
||||
if (index !== undefined) $scope.selectIndex = index
|
||||
$scope.selectedItem = $scope.filteredSnippets[$scope.selectIndex]
|
||||
}
|
||||
|
||||
function firstSnippet () {
|
||||
$scope.selectIndex = 0
|
||||
selectSnippet($scope.selectIndex)
|
||||
}
|
||||
|
||||
function priorSnippet () {
|
||||
if ($scope.selectIndex > 0) $scope.selectIndex -= 1
|
||||
|
||||
if (resultList.children[$scope.selectIndex].offsetTop < resultList.scrollTop) {
|
||||
resultList.scrollTop -= 33
|
||||
}
|
||||
|
||||
selectSnippet()
|
||||
}
|
||||
|
||||
function nextSnippet () {
|
||||
if ($scope.selectIndex < $scope.filteredSnippets.length - 1) {
|
||||
$scope.selectIndex += 1
|
||||
}
|
||||
|
||||
if (resultList.clientHeight - 33 < resultList.children[$scope.selectIndex].offsetTop - resultList.scrollTop) {
|
||||
resultList.scrollTop += 33
|
||||
}
|
||||
|
||||
selectSnippet()
|
||||
}
|
||||
|
||||
function writeCode (code) {
|
||||
ipc.send('writeCode', code)
|
||||
}
|
||||
|
||||
// Focusing Search Input
|
||||
function focusSearchInput () {
|
||||
document.getElementById('search-input').focus()
|
||||
}
|
||||
|
||||
function hidePopUp () {
|
||||
ipc.send('hidePopUp')
|
||||
}
|
||||
|
||||
})
|
||||
.directive('searchInput', function () {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: function (scope, el, attr) {
|
||||
el.on('keydown', function (e) {
|
||||
// Down key => Focus on Result list
|
||||
if (e.keyCode === 40) {
|
||||
scope.$emit('nextSnippetRequested')
|
||||
// e.preventDefault()
|
||||
}
|
||||
|
||||
// Up key => Focus on Result list
|
||||
if (e.keyCode === 38) {
|
||||
scope.$emit('priorSnippetRequested')
|
||||
// e.preventDefault()
|
||||
}
|
||||
|
||||
// Up key => Focus on Result list
|
||||
if (e.keyCode === 13) {
|
||||
scope.$emit('snippetSubmitted')
|
||||
}
|
||||
|
||||
// Esc key => Dismiss popup
|
||||
if (e.keyCode === 27) {
|
||||
ipc.send('hidePopUp')
|
||||
e.preventDefault()
|
||||
}
|
||||
|
||||
// TODO: Tab key => Auto complete
|
||||
if (e.keyCode === 9) {
|
||||
e.preventDefault()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,62 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen.popup')
|
||||
.constant('apiUrl', 'http://codexen-server-dev.elasticbeanstalk.com/')
|
||||
.config(function ($authProvider, $httpProvider, apiUrl) {
|
||||
$authProvider.baseUrl = apiUrl
|
||||
|
||||
$httpProvider.defaults.useXDomain = true
|
||||
delete $httpProvider.defaults.headers.common['X-Requested-With']
|
||||
})
|
||||
|
||||
|
||||
angular.module('codexen.popup')
|
||||
.factory('Snippet', function ($http, $auth, apiUrl) {
|
||||
var findByUser = function (user) {
|
||||
var url = apiUrl + 'snippets/search'
|
||||
|
||||
return $http.get(url, {
|
||||
params: {
|
||||
user: user
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
var findMine = function (params) {
|
||||
var url = apiUrl + 'snippets/my'
|
||||
|
||||
return $http.get(url, {params: params})
|
||||
}
|
||||
|
||||
var create = function (params) {
|
||||
var url = apiUrl + 'snippets/create'
|
||||
|
||||
return $http.post(url, params)
|
||||
}
|
||||
|
||||
var show = function (id, params) {
|
||||
var url = apiUrl + 'snippets/id/' + id
|
||||
|
||||
return $http.get(url, {params: params})
|
||||
}
|
||||
|
||||
var update = function (id, params) {
|
||||
var url = apiUrl + 'snippets/id/' + id
|
||||
|
||||
return $http.put(url, params)
|
||||
}
|
||||
|
||||
var destroy = function (id) {
|
||||
var url = apiUrl + 'snippets/id/' + id
|
||||
|
||||
return $http.delete(url)
|
||||
}
|
||||
|
||||
return {
|
||||
findByUser: findByUser,
|
||||
findMine: findMine,
|
||||
create: create,
|
||||
show: show,
|
||||
delete: destroy,
|
||||
update: update
|
||||
}
|
||||
})
|
||||
@@ -1,60 +0,0 @@
|
||||
.popup-body
|
||||
.search-block
|
||||
padding: 5px
|
||||
height:44px
|
||||
position:absolute
|
||||
top: 0
|
||||
width: 100%
|
||||
|
||||
.result-block
|
||||
position:absolute
|
||||
top: 44px
|
||||
bottom: 0
|
||||
width: 100%
|
||||
overflow: hidden
|
||||
.left-pane
|
||||
margin: 0
|
||||
position: absolute
|
||||
left: 0
|
||||
top: 0
|
||||
bottom: 0
|
||||
width: 40%
|
||||
overflow-y: auto
|
||||
overflow-x: hidden
|
||||
.result-list
|
||||
list-style:none
|
||||
padding: 0
|
||||
border-right: 1px solid $baseBorderColor
|
||||
li
|
||||
white-space nowrap
|
||||
&:nth-child(even)
|
||||
background-color $baseBackgroundColor
|
||||
&:nth-child(odd)
|
||||
background-color lighten($baseBackgroundColor, 2%)
|
||||
&.active
|
||||
color: $textColorSelected
|
||||
background-color: $btnPrimary
|
||||
a
|
||||
display:block
|
||||
padding: 5px 10px
|
||||
border-bottom 1px solid $baseBorderColor
|
||||
|
||||
.right-pane
|
||||
position: absolute
|
||||
left: 40%
|
||||
top: 0
|
||||
bottom: 0
|
||||
width: 60%
|
||||
overflow-y: auto
|
||||
overflow-x: hidden
|
||||
.result-detail-control
|
||||
position: absolute
|
||||
top: 0
|
||||
width: 100%
|
||||
height: 34px
|
||||
|
||||
.result-detail-content
|
||||
position: absolute
|
||||
top: 34px
|
||||
bottom: 0
|
||||
width: 100%
|
||||
@@ -1,68 +0,0 @@
|
||||
.popup-body .search-block {
|
||||
padding: 5px;
|
||||
height: 44px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.popup-body .result-block {
|
||||
position: absolute;
|
||||
top: 44px;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.popup-body .result-block .left-pane {
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 40%;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.popup-body .result-block .result-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
border-right: 1px solid #001a20;
|
||||
}
|
||||
.popup-body .result-block .result-list li {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.popup-body .result-block .result-list li:nth-child(even) {
|
||||
background-color: #002b36;
|
||||
}
|
||||
.popup-body .result-block .result-list li:nth-child(odd) {
|
||||
background-color: #00323f;
|
||||
}
|
||||
.popup-body .result-block .result-list li.active {
|
||||
color: #fff;
|
||||
background-color: #088cff;
|
||||
}
|
||||
.popup-body .result-block .result-list li a {
|
||||
display: block;
|
||||
padding: 5px 10px;
|
||||
border-bottom: 1px solid #001a20;
|
||||
}
|
||||
.popup-body .result-block .right-pane {
|
||||
position: absolute;
|
||||
left: 40%;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 60%;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.popup-body .result-block .result-detail-control {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 34px;
|
||||
}
|
||||
.popup-body .result-block .result-detail-content {
|
||||
position: absolute;
|
||||
top: 34px;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
@import '../../shared/styles/_vars'
|
||||
@import '../../shared/styles/mixins/*'
|
||||
|
||||
@import '_popup'
|
||||
@@ -1,3 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen.shared')
|
||||
.constant('aceModes', ['ABAP', 'ABC', 'ActionScript', 'ADA', 'Apache_Conf', 'AsciiDoc', 'Assembly_x86', 'AutoHotKey', 'BatchFile', 'C9Search', 'C_Cpp', 'Cirru', 'Clojure', 'Cobol', 'coffee', 'ColdFusion', 'CSharp', 'CSS', 'Curly', 'D', 'Dart', 'Diff', 'Dockerfile', 'Dot', 'Dummy', 'DummySyntax', 'Eiffel', 'EJS', 'Elixir', 'Elm', 'Erlang', 'Forth', 'FTL', 'Gcode', 'Gherkin', 'Gitignore', 'Glsl', 'golang', 'Groovy', 'HAML', 'Handlebars', 'Haskell', 'haXe', 'HTML', 'HTML_Ruby', 'INI', 'Io', 'Jack', 'Jade', 'Java', 'JavaScript', 'JSON', 'JSONiq', 'JSP', 'JSX', 'Julia', 'LaTeX', 'Lean', 'LESS', 'Liquid', 'Lisp', 'LiveScript', 'LogiQL', 'LSL', 'Lua', 'LuaPage', 'Lucene', 'Makefile', 'Markdown', 'Mask', 'MATLAB', 'MEL', 'MUSHCode', 'MySQL', 'Nix', 'ObjectiveC', 'OCaml', 'Pascal', 'Perl', 'pgSQL', 'PHP', 'Powershell', 'Praat', 'Prolog', 'Properties', 'Protobuf', 'Python', 'R', 'RDoc', 'RHTML', 'Ruby', 'Rust', 'SASS', 'SCAD', 'Scala', 'Scheme', 'SCSS', 'SH', 'SJS', 'Smarty', 'snippets', 'Soy_Template', 'Space', 'SQL', 'SQLServer', 'Stylus', 'SVG', 'Tcl', 'Tex', 'Text', 'Textile', 'Toml', 'Twig', 'Typescript', 'Vala', 'VBScript', 'Velocity', 'Verilog', 'VHDL', 'XML', 'XQuery', 'YAML', 'Django'])
|
||||
@@ -1,4 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen.shared')
|
||||
// .constant('apiUrl', 'http://localhost:8000/')
|
||||
.constant('apiUrl', 'http://codexen-server-dev.elasticbeanstalk.com/')
|
||||
@@ -1,8 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen.shared')
|
||||
.config(function ($authProvider, $httpProvider, apiUrl) {
|
||||
$authProvider.baseUrl = apiUrl
|
||||
|
||||
$httpProvider.defaults.useXDomain = true
|
||||
delete $httpProvider.defaults.headers.common['X-Requested-With']
|
||||
})
|
||||
@@ -1,386 +0,0 @@
|
||||
/* global angular */
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Binds a ACE Editor widget
|
||||
*/
|
||||
angular.module('ui.ace', [])
|
||||
.constant('uiAceConfig', {})
|
||||
.directive('uiAce', ['uiAceConfig', function (uiAceConfig) {
|
||||
if (angular.isUndefined(window.ace)) {
|
||||
throw new Error('ui-ace need ace to work... (o rly?)')
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets editor options such as the wrapping mode or the syntax checker.
|
||||
*
|
||||
* The supported options are:
|
||||
*
|
||||
* <ul>
|
||||
* <li>showGutter</li>
|
||||
* <li>useWrapMode</li>
|
||||
* <li>onLoad</li>
|
||||
* <li>theme</li>
|
||||
* <li>mode</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param acee
|
||||
* @param session ACE editor session
|
||||
* @param {object} opts Options to be set
|
||||
*/
|
||||
var setOptions = function (acee, session, opts) {
|
||||
// sets the ace worker path, if running from concatenated
|
||||
// or minified source
|
||||
if (angular.isDefined(opts.workerPath)) {
|
||||
var config = window.ace.require('ace/config')
|
||||
config.set('workerPath', opts.workerPath)
|
||||
}
|
||||
// ace requires loading
|
||||
if (angular.isDefined(opts.require)) {
|
||||
opts.require.forEach(function (n) {
|
||||
window.ace.require(n)
|
||||
})
|
||||
}
|
||||
// Boolean options
|
||||
if (angular.isDefined(opts.showGutter)) {
|
||||
acee.renderer.setShowGutter(opts.showGutter)
|
||||
}
|
||||
if (angular.isDefined(opts.useWrapMode)) {
|
||||
session.setUseWrapMode(opts.useWrapMode)
|
||||
}
|
||||
if (angular.isDefined(opts.showInvisibles)) {
|
||||
acee.renderer.setShowInvisibles(opts.showInvisibles)
|
||||
}
|
||||
if (angular.isDefined(opts.showIndentGuides)) {
|
||||
acee.renderer.setDisplayIndentGuides(opts.showIndentGuides)
|
||||
}
|
||||
if (angular.isDefined(opts.useSoftTabs)) {
|
||||
session.setUseSoftTabs(opts.useSoftTabs)
|
||||
}
|
||||
if (angular.isDefined(opts.showPrintMargin)) {
|
||||
acee.setShowPrintMargin(opts.showPrintMargin)
|
||||
}
|
||||
if (angular.isDefined(opts.maxLines)) {
|
||||
if (opts.maxLines < 0) opts.maxLines = Infinity
|
||||
acee.setOptions({
|
||||
maxLines: opts.maxLines
|
||||
})
|
||||
}
|
||||
|
||||
// commands
|
||||
if (angular.isDefined(opts.disableSearch) && opts.disableSearch) {
|
||||
acee.commands.addCommands([
|
||||
{
|
||||
name: 'unfind',
|
||||
bindKey: {
|
||||
win: 'Ctrl-F',
|
||||
mac: 'Command-F'
|
||||
},
|
||||
exec: function () {
|
||||
return false
|
||||
},
|
||||
readOnly: true
|
||||
}
|
||||
])
|
||||
}
|
||||
|
||||
// Basic options
|
||||
if (angular.isString(opts.theme)) {
|
||||
acee.setTheme('ace/theme/' + opts.theme)
|
||||
}
|
||||
if (angular.isString(opts.mode)) {
|
||||
session.setMode('ace/mode/' + opts.mode)
|
||||
}
|
||||
// Advanced options
|
||||
if (angular.isDefined(opts.firstLineNumber)) {
|
||||
if (angular.isNumber(opts.firstLineNumber)) {
|
||||
session.setOption('firstLineNumber', opts.firstLineNumber)
|
||||
} else if (angular.isFunction(opts.firstLineNumber)) {
|
||||
session.setOption('firstLineNumber', opts.firstLineNumber())
|
||||
}
|
||||
}
|
||||
|
||||
// advanced options
|
||||
var key, obj
|
||||
if (angular.isDefined(opts.advanced)) {
|
||||
for (key in opts.advanced) {
|
||||
// create a javascript object with the key and value
|
||||
obj = { name: key, value: opts.advanced[key] }
|
||||
// try to assign the option to the ace editor
|
||||
acee.setOption(obj.name, obj.value)
|
||||
}
|
||||
}
|
||||
|
||||
// advanced options for the renderer
|
||||
if (angular.isDefined(opts.rendererOptions)) {
|
||||
for (key in opts.rendererOptions) {
|
||||
// create a javascript object with the key and value
|
||||
obj = { name: key, value: opts.rendererOptions[key] }
|
||||
// try to assign the option to the ace editor
|
||||
acee.renderer.setOption(obj.name, obj.value)
|
||||
}
|
||||
}
|
||||
|
||||
// onLoad callbacks
|
||||
angular.forEach(opts.callbacks, function (cb) {
|
||||
if (angular.isFunction(cb)) {
|
||||
cb(acee)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
restrict: 'EA',
|
||||
require: '?ngModel',
|
||||
link: function (scope, elm, attrs, ngModel) {
|
||||
/**
|
||||
* Corresponds the uiAceConfig ACE configuration.
|
||||
* @type object
|
||||
*/
|
||||
var options = uiAceConfig.ace || {}
|
||||
|
||||
/**
|
||||
* uiAceConfig merged with user options via json in attribute or data binding
|
||||
* @type object
|
||||
*/
|
||||
var opts = angular.extend({}, options, scope.$eval(attrs.uiAce))
|
||||
|
||||
/**
|
||||
* ACE editor
|
||||
* @type object
|
||||
*/
|
||||
var acee = window.ace.edit(elm[0])
|
||||
acee.$blockScrolling = Infinity
|
||||
|
||||
/**
|
||||
* ACE editor session.
|
||||
* @type object
|
||||
* @see [EditSession]{@link http://ace.c9.io/#nav=api&api=edit_session}
|
||||
*/
|
||||
var session = acee.getSession()
|
||||
|
||||
/**
|
||||
* Reference to a change listener created by the listener factory.
|
||||
* @function
|
||||
* @see listenerFactory.onChange
|
||||
*/
|
||||
var onChangeListener
|
||||
|
||||
/**
|
||||
* Reference to a blur listener created by the listener factory.
|
||||
* @function
|
||||
* @see listenerFactory.onBlur
|
||||
*/
|
||||
var onBlurListener
|
||||
|
||||
/**
|
||||
* Calls a callback by checking its existing. The argument list
|
||||
* is variable and thus this function is relying on the arguments
|
||||
* object.
|
||||
* @throws {Error} If the callback isn't a function
|
||||
*/
|
||||
var executeUserCallback = function () {
|
||||
/**
|
||||
* The callback function grabbed from the array-like arguments
|
||||
* object. The first argument should always be the callback.
|
||||
*
|
||||
* @see [arguments]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/arguments}
|
||||
* @type {*}
|
||||
*/
|
||||
var callback = arguments[0]
|
||||
|
||||
/**
|
||||
* Arguments to be passed to the callback. These are taken
|
||||
* from the array-like arguments object. The first argument
|
||||
* is stripped because that should be the callback function.
|
||||
*
|
||||
* @see [arguments]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/arguments}
|
||||
* @type {Array}
|
||||
*/
|
||||
var args = Array.prototype.slice.call(arguments, 1)
|
||||
|
||||
if (angular.isDefined(callback)) {
|
||||
scope.$evalAsync(function () {
|
||||
if (angular.isFunction(callback)) {
|
||||
callback(args)
|
||||
} else {
|
||||
throw new Error('ui-ace use a function as callback.')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Listener factory. Until now only change listeners can be created.
|
||||
* @type object
|
||||
*/
|
||||
var listenerFactory = {
|
||||
/**
|
||||
* Creates a change listener which propagates the change event
|
||||
* and the editor session to the callback from the user option
|
||||
* onChange. It might be exchanged during runtime, if this
|
||||
* happens the old listener will be unbound.
|
||||
*
|
||||
* @param callback callback function defined in the user options
|
||||
* @see onChangeListener
|
||||
*/
|
||||
onChange: function (callback) {
|
||||
return function (e) {
|
||||
var newValue = session.getValue()
|
||||
|
||||
if (ngModel && newValue !== ngModel.$viewValue &&
|
||||
// HACK make sure to only trigger the apply outside of the
|
||||
// digest loop 'cause ACE is actually using this callback
|
||||
// for any text transformation !
|
||||
!scope.$$phase && !scope.$root.$$phase) {
|
||||
scope.$evalAsync(function () {
|
||||
ngModel.$setViewValue(newValue)
|
||||
})
|
||||
}
|
||||
|
||||
executeUserCallback(callback, e, acee)
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Creates a blur listener which propagates the editor session
|
||||
* to the callback from the user option onBlur. It might be
|
||||
* exchanged during runtime, if this happens the old listener
|
||||
* will be unbound.
|
||||
*
|
||||
* @param callback callback function defined in the user options
|
||||
* @see onBlurListener
|
||||
*/
|
||||
onBlur: function (callback) {
|
||||
return function () {
|
||||
executeUserCallback(callback, acee)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
attrs.$observe('readonly', function (value) {
|
||||
acee.setReadOnly(!!value || value === '')
|
||||
})
|
||||
|
||||
// Value Blind
|
||||
if (ngModel) {
|
||||
ngModel.$formatters.push(function (value) {
|
||||
if (angular.isUndefined(value) || value === null) {
|
||||
return ''
|
||||
} else if (angular.isObject(value) || angular.isArray(value)) {
|
||||
throw new Error('ui-ace cannot use an object or an array as a model')
|
||||
}
|
||||
return value
|
||||
})
|
||||
|
||||
ngModel.$render = function () {
|
||||
session.setValue(ngModel.$viewValue)
|
||||
}
|
||||
}
|
||||
|
||||
// Listen for option updates
|
||||
var updateOptions = function (current, previous) {
|
||||
if (current === previous) return
|
||||
opts = angular.extend({}, options, scope.$eval(attrs.uiAce))
|
||||
|
||||
opts.callbacks = [ opts.onLoad ]
|
||||
if (opts.onLoad !== options.onLoad) {
|
||||
// also call the global onLoad handler
|
||||
opts.callbacks.unshift(options.onLoad)
|
||||
}
|
||||
|
||||
// EVENTS
|
||||
|
||||
// unbind old change listener
|
||||
session.removeListener('change', onChangeListener)
|
||||
|
||||
// bind new change listener
|
||||
onChangeListener = listenerFactory.onChange(opts.onChange)
|
||||
session.on('change', onChangeListener)
|
||||
|
||||
// unbind old blur listener
|
||||
// session.removeListener('blur', onBlurListener)
|
||||
acee.removeListener('blur', onBlurListener)
|
||||
|
||||
// bind new blur listener
|
||||
onBlurListener = listenerFactory.onBlur(opts.onBlur)
|
||||
acee.on('blur', onBlurListener)
|
||||
|
||||
setOptions(acee, session, opts)
|
||||
}
|
||||
|
||||
scope.$watch(attrs.uiAce, updateOptions, /* deep watch */ true)
|
||||
|
||||
// set the options here, even if we try to watch later, if this
|
||||
// line is missing things go wrong (and the tests will also fail)
|
||||
updateOptions(options)
|
||||
|
||||
elm.on('$destroy', function () {
|
||||
acee.session.$stopWorker()
|
||||
acee.destroy()
|
||||
})
|
||||
|
||||
scope.$watch(function () {
|
||||
return [elm[0].offsetWidth, elm[0].offsetHeight]
|
||||
}, function () {
|
||||
acee.resize()
|
||||
acee.renderer.updateFull()
|
||||
}, true)
|
||||
|
||||
scope.Infinity = -1
|
||||
|
||||
scope.focus = function () {
|
||||
acee.focus()
|
||||
}
|
||||
|
||||
scope.addCommand = acee.commands.addCommand
|
||||
|
||||
elm.on('click', function () {
|
||||
acee.focus()
|
||||
})
|
||||
|
||||
scope.$on('insertRequested', function (e, req) {
|
||||
var cursor = acee.selection.getCursor()
|
||||
var str = ''
|
||||
if (cursor.column > 0) str += '\n\n'
|
||||
|
||||
switch (req) {
|
||||
case 'h1':
|
||||
acee.insert(str + '# some heading\n\n')
|
||||
break
|
||||
case 'ul':
|
||||
acee.insert(str + '- item1\n- item2\n- item3')
|
||||
break
|
||||
case 'ol':
|
||||
acee.insert(str + '1. item1\n2. item2\n3. item3')
|
||||
break
|
||||
case 'a':
|
||||
acee.insert(str + '[example.com](http://example.com)')
|
||||
break
|
||||
case 'table':
|
||||
acee.insert(str +
|
||||
'First Header | Second Header\n' +
|
||||
'------------- | -------------\n' +
|
||||
'Content Cell | Content Cell\n' +
|
||||
'Content Cell | Content Cell\n')
|
||||
}
|
||||
|
||||
scope.$evalAsync(function () {
|
||||
ngModel.$setViewValue(session.getValue())
|
||||
})
|
||||
})
|
||||
|
||||
scope.$on('insertSnippetRequested', function (e, snippet) {
|
||||
var cursor = acee.selection.getCursor()
|
||||
var str = ''
|
||||
if (cursor.column > 0) str += '\n\n'
|
||||
|
||||
acee.insert(str + '```\n' + snippet.content + '\n```\n> [snippet#' + snippet.id + '](#/snippets/' + snippet.id + ')\n\n')
|
||||
|
||||
scope.$evalAsync(function () {
|
||||
ngModel.$setViewValue(session.getValue())
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}])
|
||||
@@ -1,52 +0,0 @@
|
||||
/* global angular */
|
||||
angular.module('codexen.shared')
|
||||
.factory('Snippet', function ($http, $auth, apiUrl) {
|
||||
var findByUser = function (user) {
|
||||
var url = apiUrl + 'snippets/search'
|
||||
|
||||
return $http.get(url, {
|
||||
params: {
|
||||
user: user
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
var findMine = function (params) {
|
||||
var url = apiUrl + 'snippets/my'
|
||||
|
||||
return $http.get(url, {params: params})
|
||||
}
|
||||
|
||||
var create = function (params) {
|
||||
var url = apiUrl + 'snippets/create'
|
||||
|
||||
return $http.post(url, params)
|
||||
}
|
||||
|
||||
var show = function (id, params) {
|
||||
var url = apiUrl + 'snippets/id/' + id
|
||||
|
||||
return $http.get(url, {params: params})
|
||||
}
|
||||
|
||||
var update = function (id, params) {
|
||||
var url = apiUrl + 'snippets/id/' + id
|
||||
|
||||
return $http.put(url, params)
|
||||
}
|
||||
|
||||
var destroy = function (id) {
|
||||
var url = apiUrl + 'snippets/id/' + id
|
||||
|
||||
return $http.delete(url)
|
||||
}
|
||||
|
||||
return {
|
||||
findByUser: findByUser,
|
||||
findMine: findMine,
|
||||
create: create,
|
||||
show: show,
|
||||
delete: destroy,
|
||||
update: update
|
||||
}
|
||||
})
|
||||
@@ -1,3 +0,0 @@
|
||||
angular.module('codexen.shared', [
|
||||
'satellizer'
|
||||
])
|
||||
@@ -1,24 +0,0 @@
|
||||
html
|
||||
overflow: hidden
|
||||
height: 100%
|
||||
|
||||
body
|
||||
height: 100%
|
||||
overflow: auto
|
||||
font-family: "Lato", sans-serif
|
||||
color $textColor
|
||||
background-color: $appBackgroundColor
|
||||
|
||||
label
|
||||
font-family: "Lato", sans-serif
|
||||
color $textColor
|
||||
|
||||
h1, h2, h3, h4, h5
|
||||
color $textColorHighlight
|
||||
margin 0
|
||||
|
||||
textarea
|
||||
resize: vertical
|
||||
|
||||
hr
|
||||
border-color $baseBorderColor
|
||||
@@ -1,50 +0,0 @@
|
||||
.alert
|
||||
margin: 5px 0
|
||||
|
||||
input.form-control, textarea.form-control, input.inline-form-control
|
||||
&::-webkit-input-placeholder
|
||||
color $textColor
|
||||
&:-moz-placeholder /* Firefox 18- */
|
||||
color $textColor
|
||||
&::-moz-placeholder /* Firefox 19+ */
|
||||
color $textColor
|
||||
&:-ms-input-placeholder
|
||||
color $textColor
|
||||
|
||||
|
||||
.inline-form-control
|
||||
@extend .form-control
|
||||
width: auto
|
||||
display: inline-block
|
||||
|
||||
.btn.btn-default
|
||||
border-style solid
|
||||
border-width 1px
|
||||
btn-color($btn-default-color, $btn-default-bg, $btn-default-border)
|
||||
.btn.btn-primary
|
||||
btn-color($btn-primary-color, $btn-primary-bg, $btn-primary-border)
|
||||
.btn.btn-info
|
||||
btn-color($btn-info-color, $btn-info-bg, $btn-info-border)
|
||||
.btn.btn-success
|
||||
btn-color($btn-success-color, $btn-success-bg, $btn-success-border)
|
||||
.btn.btn-danger
|
||||
btn-color($btn-danger-color, $btn-danger-bg, $btn-danger-border)
|
||||
.btn.btn-warning
|
||||
btn-color($btn-warning-color, $btn-warning-bg, $btn-warning-border)
|
||||
|
||||
textarea.form-control, .ace_editor
|
||||
border-radius $input-border-radius
|
||||
|
||||
.ace_editor
|
||||
border solid 1px $input-border
|
||||
box-shadow inset 0 1px 1px rgba(0, 0, 0, .075)
|
||||
font-family: 'Lucida Grande'
|
||||
|
||||
.ace_editor.ace_focus
|
||||
controlGlow()
|
||||
|
||||
.modal-content
|
||||
background-color $bg
|
||||
|
||||
.jumbotron
|
||||
padding 48px 10px
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user