1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-27 16:41:41 +00:00

rebuild app structure

This commit is contained in:
Rokt33r
2015-06-08 03:56:28 +09:00
parent 010ee6a711
commit 67d8183582
61 changed files with 705 additions and 1266 deletions

View File

@@ -1,49 +0,0 @@
// Core variables and mixins
@import "variables";
@import "mixins";
// Reset and dependencies
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/normalize";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/print";
// Core CSS
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/scaffolding";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/type";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/code";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/grid";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/tables";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/forms";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/buttons";
// Components
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/component-animations";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/dropdowns";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/button-groups";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/input-groups";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/navs";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/navbar";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/breadcrumbs";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/pagination";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/pager";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/labels";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/badges";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/jumbotron";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/thumbnails";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/alerts";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/progress-bars";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/media";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/list-group";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/panels";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/responsive-embed";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/wells";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/close";
// Components w/ JavaScript
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/modals";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/tooltip";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/popovers";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/carousel";
// Utility classes
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/utilities";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/responsive-utilities";

View File

@@ -1 +0,0 @@
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/mixins";

View File

@@ -1,222 +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;
}
.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: 4px; /* FIXME hardcoded value :-/ */
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;
}
.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 3px;
}
.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: #333;
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: #262626;
background-color: #f5f5f5;
}
.ui-select-bootstrap .ui-select-choices-row.active>a {
color: #fff;
text-decoration: none;
outline: 0;
background-color: #428bca;
}
.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;
}

View File

@@ -1,11 +0,0 @@
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/variables";
$side-view-bg: $navbar-inverse-bg;
$side-view-color: $navbar-inverse-color;
$side-view-link-color: $navbar-inverse-link-color;
$side-view-link-active-color: $navbar-inverse-link-active-color;
$side-view-link-hover-color: $navbar-inverse-link-hover-color;
$side-view-link-active-bg: $navbar-inverse-link-active-bg;
$side-view-link-hover-bg: $navbar-inverse-link-hover-bg;
$border-color: #ddd;

View File

@@ -7,17 +7,5 @@ angular.module('codexen', [
'ui.bootstrap',
'satellizer',
'angular-md5',
'templates',
'codexen.config',
'codexen.directives',
'codexen.filters',
'codexen.modals',
'codexen.services',
'codexen.states'])
'templates'])
angular.module('templates', [])
angular.module('codexen.config', [])
angular.module('codexen.directives', [])
angular.module('codexen.filters', [])
angular.module('codexen.modals', [])
angular.module('codexen.services', [])
angular.module('codexen.states', [])

View File

@@ -1,2 +1,2 @@
angular.module('codexen.config')
.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"])
angular.module('codexen')
.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'])

View File

@@ -1,8 +1,7 @@
/* global angular */
angular.module('codexen.config')
.constant('apiUrl', 'http://localhost:8000/')
.config(function ($authProvider, $httpProvider) {
$authProvider.baseUrl = 'http://localhost:8000/'
angular.module('codexen')
.config(function ($authProvider, $httpProvider, apiUrl) {
$authProvider.baseUrl = apiUrl
$httpProvider.defaults.useXDomain = true
delete $httpProvider.defaults.headers.common['X-Requested-With']

View File

@@ -1,5 +1,5 @@
/* global angular */
angular.module('codexen.states')
angular.module('codexen')
.config(function ($stateProvider, $urlRouterProvider) {
$urlRouterProvider
.when('/auth', '/auth/register')
@@ -12,18 +12,18 @@ angular.module('codexen.states')
url: '/auth',
views: {
'main-view': {
templateUrl: 'states/auth/auth.tpl.html'
templateUrl: 'tpls/states/auth.tpl.html'
}
}
})
.state('auth.register', {
url: '/register',
templateUrl: 'states/auth/register.tpl.html',
templateUrl: 'tpls/states/auth.register.tpl.html',
controller: 'AuthRegisterController as vm'
})
.state('auth.signin', {
url: '/signin',
templateUrl: 'states/auth/signin.tpl.html',
templateUrl: 'tpls/states/auth.signin.tpl.html',
controller: 'AuthSignInController as vm'
})
@@ -32,14 +32,14 @@ angular.module('codexen.states')
url: '/snippets',
views: {
'main-view': {
templateUrl: 'states/snippets/list.tpl.html',
templateUrl: 'tpls/states/snippets.list.tpl.html',
controller: 'SnippetsListController as vm'
}
}
})
.state('snippets.detail', {
url: '/:id',
templateUrl: 'states/snippets/detail.tpl.html',
templateUrl: 'tpls/states/snippets.detail.tpl.html',
controller: 'SnippetsDetailController as vm'
})
@@ -48,7 +48,7 @@ angular.module('codexen.states')
url: '/',
views: {
'main-view': {
templateUrl: 'states/home/home.tpl.html',
templateUrl: 'tpls/states/home.tpl.html',
controller: 'HomeController as vm'
}
}

View File

@@ -0,0 +1,36 @@
/* global angular */
angular.module('codexen')
.controller('SideNavController', function ($auth, User, $rootScope, $scope) {
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.user
})
}
}
reloadUser()
vm.signOut = function () {
$auth.logout()
.then(function () {
console.log('Sign Out')
$rootScope.$broadcast('userSignOut')
})
}
$scope.$on('userSignIn', function () {
vm.isAuthenticated = true
reloadUser()
})
$scope.$on('userSignOut', function () {
vm.isAuthenticated = false
vm.currentUser = null
})
})

View File

@@ -1,22 +1,6 @@
angular.module('codexen.modals')
.factory('editSnippetModal', function ($modal) {
var open = function (snippet) {
return $modal.open({
resolve:{
snippet: function () {
return snippet
}
},
templateUrl:'modals/edit-snippet-modal.tpl.html',
controller:'EditSnippetModalController as vm'
})
}
return {
open: open
}
})
.controller('EditSnippetModalController', function ($modalInstance, aceModes, $log, Snippet, $rootScope, Tag, snippet){
/* global angular */
angular.module('codexen')
.controller('EditSnippetModalController', function ($modalInstance, aceModes, $log, Snippet, $rootScope, Tag, snippet) {
var vm = this
vm.aceModes = aceModes
@@ -24,13 +8,13 @@ angular.module('codexen.modals')
console.log(snippet)
vm.submit = function () {
console.log('mode: ',vm.snippet.mode)
console.log('mode: ', vm.snippet.mode)
var params = {
description: vm.snippet.description,
callSign: vm.snippet.callSign,
mode: vm.snippet.mode==null?null:vm.snippet.mode.toLowerCase(),
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 {_id: tag._id, name: tag.name} }):[]
tags: angular.isArray(vm.snippet.tags) ? vm.snippet.tags.map(function (tag) { return {_id: tag._id, name: tag.name} }) : []
}
Snippet.update(vm.snippet._id, params)
@@ -43,7 +27,7 @@ angular.module('codexen.modals')
// vm.tags = []
vm.tagCandidates = []
vm.refreshTagCandidates = function (tagName) {
if (tagName == null || tagName == '') return null
if (tagName == null || tagName === '') return null
return Tag.findByName(tagName)
.success(function (data) {
console.log('tags fetched!!', data)
@@ -52,8 +36,8 @@ angular.module('codexen.modals')
}
vm.transform = function (tagName) {
return {
_id:0,
name:tagName
_id: 0,
name: tagName
}
}

View File

@@ -1,16 +1,5 @@
angular.module('codexen.modals')
.factory('newSnippetModal', function ($modal) {
var open = function () {
return $modal.open({
templateUrl:'modals/new-snippet-modal.tpl.html',
controller:'NewSnippetModalController as vm'
})
}
return {
open: open
}
})
/* global angular */
angular.module('codexen')
.controller('NewSnippetModalController', function ($modalInstance, aceModes, $log, Snippet, $rootScope, Tag){
var vm = this
@@ -20,21 +9,21 @@ angular.module('codexen.modals')
var params = {
description: vm.description,
callSign: vm.callSign,
mode: vm.mode==null?null:vm.mode.toLowerCase(),
mode: vm.mode == null ? null : vm.mode.toLowerCase(),
content: vm.content,
tags: angular.isArray(vm.tags)?vm.tags.map(function (tag) { return {_id: tag._id, name: tag.name} }):[]
tags: angular.isArray(vm.tags) ? vm.tags.map(function (tag) { return {_id: tag._id, name: tag.name} }) : []
}
Snippet.create(params)
.success(function(data){
.success(function (data) {
$modalInstance.close(data.snippet)
})
}
// vm.tags = []
vm.tagCandidates = []
vm.refreshTagCandidates = function(tagName) {
if (tagName == null || tagName == '') return null
vm.refreshTagCandidates = function (tagName) {
if (tagName == null || tagName === '') return null
return Tag.findByName(tagName)
.success(function (data) {
console.log('tags fetched!!', data)
@@ -43,8 +32,8 @@ angular.module('codexen.modals')
}
vm.transform = function (tagName) {
return {
_id:0,
name:tagName
_id: 0,
name: tagName
}
}

View File

@@ -1,5 +1,5 @@
/* global angular */
angular.module('codexen.states')
angular.module('codexen')
.controller('AuthRegisterController', function ($auth, $log) {
var vm = this
vm.isEmpty = function (obj) {

View File

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

View File

@@ -1,5 +1,5 @@
/* global angular */
angular.module('codexen.states')
angular.module('codexen')
.controller('SnippetsDetailController', function (Snippet, $state, $rootScope) {
var vm = this

View File

@@ -1,5 +1,5 @@
/* global angular */
angular.module('codexen.states')
angular.module('codexen')
.controller('SnippetsListController', function ($auth, Snippet, $scope, $state) {
var vm = this

View File

@@ -1,12 +1,13 @@
angular.module('codexen.directives')
.directive('btnEditSnippet', function (editSnippetModal, $rootScope) {
/* global angular */
angular.module('codexen')
.directive('btnEditSnippet', function (Modal, $rootScope) {
return {
scope:{
scope: {
snippet: '=btnEditSnippet'
},
link: function (scope, el) {
el.on('click', function () {
editSnippetModal.open(scope.snippet)
Modal.editSnippet(scope.snippet)
.result.then(function (snippet) {
$rootScope.$broadcast('snippetUpdated', snippet)
}, function () {

View File

@@ -1,9 +1,10 @@
angular.module('codexen.directives')
.directive('btnNewSnippet', function (newSnippetModal, $rootScope) {
/* global angular */
angular.module('codexen')
.directive('btnNewSnippet', function (Modal, $rootScope) {
return {
link: function (scope, el) {
el.on('click', function () {
newSnippetModal.open()
Modal.newSnippet()
.result.then(function (snippet) {
console.log('event fire', snippet)
$rootScope.$broadcast('snippetUpdated', snippet)

View File

@@ -1,42 +1,8 @@
angular.module('codexen.directives')
.directive('sideNav', function(){
/* global angular */
angular.module('codexen')
.directive('sideNav', function () {
return {
templateUrl: 'directives/side-nav.tpl.html',
templateUrl: 'tpls/directives/side-nav.tpl.html',
controller: 'SideNavController as vm'
}
})
.controller('SideNavController', function($auth, User, $rootScope, $scope){
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.user
})
}
}
reloadUser()
vm.signOut = function () {
$auth.logout()
.then(function () {
console.log('Sign Out')
$rootScope.$broadcast('userSignOut')
})
}
$scope.$on('userSignIn', function () {
vm.isAuthenticated = true
reloadUser()
})
$scope.$on('userSignOut', function () {
vm.isAuthenticated = false
vm.currentUser = null
})
})

View File

@@ -1,25 +0,0 @@
@import "../variables";
@import "../mixins";
$side-view-link-hover-color: $gray-dark;
$side-view-link-active-color: $link-color;
$side-view-link-active-bg: $body-bg;
#side-view ul.nav.nav-pills{
li hr{
margin: 5px 0;
border-color: lighten($gray-dark, 20%);
}
li a{
color: white;
&:hover{
color: $side-view-link-hover-color;
}
}
li.active a{
color:$side-view-link-active-color;
background-color: $side-view-link-active-bg;
}
}

View File

@@ -1,12 +1,13 @@
angular.module('codexen.directives')
/* global angular */
angular.module('codexen')
.directive('tags', function () {
return {
restrict:'A',
template: '<p class="tags" ng-if="tags.length">'+
'<i class="fa fa-tags"></i> '+
'<a ng-repeat="tag in tags" href="#">#<span ng-bind="tag.name"></span></a>'+
restrict: 'A',
template: '<p class="tags" ng-if="tags.length">' +
'<i class="fa fa-tags"></i> ' +
'<a ng-repeat="tag in tags" href="#">#<span ng-bind="tag.name"></span></a>' +
'</p>',
scope:{
scope: {
tags: '='
}
}

View File

@@ -1,7 +1,7 @@
/* global angular */
angular.module('codexen.filters')
.filter('fromNow', function() {
return function(input) {
/* global angular moment */
angular.module('codexen')
.filter('fromNow', function () {
return function (input) {
return moment(input).fromNow()
}
})

View File

@@ -11,7 +11,7 @@
<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">
<% styles.forEach(function(style){ %>
<link rel="stylesheet" href="<%=style %>" media="screen" title="no title" charset="utf-8">
<% }) %>

View File

@@ -1,57 +0,0 @@
$fa-font-path: "./resources/fonts";
@import "../node_modules/font-awesome/scss/font-awesome";
@import "bootstrap";
@import "ui-select";
html {
overflow: hidden;
height: 100%;
}
body {
height: 100%;
overflow: auto;
font-family: "Lato", sans-serif;
}
label{
font-family: "Lato", sans-serif;
}
textarea{
resize: vertical;
}
#side-view{
position:absolute;
top: 0;
bottom: 0;
left: 0;
width: 200px;
color: $navbar-inverse-color;
background-color: $side-view-bg;
box-sizing: border-box;
padding: 10px 0 10px 10px;
.nav.nav-pills>li>a{
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
}
.alert{
margin: 5px 0;
}
#main-view{
position:absolute;
top: 0;
bottom: 0;
left: 200px;
right: 0;
overflow-x: hidden;
overflow-y: auto;
}
.inline-form-control{
@extend .form-control;
width: auto;
display: inline-block;
}

View File

@@ -1,12 +0,0 @@
@import "../variables";
$editor-border-color: $border-color;
.new-snippet-modal{
.ace_editor {
height: 200px;
border: solid 1px $editor-border-color;
border-radius: 5px;
}
}

27
src/services/Modal.js Normal file
View File

@@ -0,0 +1,27 @@
/* global angular */
angular.module('codexen')
.factory('Modal', function ($modal) {
var newSnippet = function () {
return $modal.open({
templateUrl: 'tpls/modals/new-snippet-modal.tpl.html',
controller: 'NewSnippetModalController as vm'
})
}
var editSnippet = function (snippet) {
return $modal.open({
resolve: {
snippet: function () {
return snippet
}
},
templateUrl: 'tpls/modals/edit-snippet-modal.tpl.html',
controller: 'EditSnippetModalController as vm'
})
}
return {
newSnippet: newSnippet,
editSnippet: editSnippet
}
})

View File

@@ -1,4 +1,5 @@
angular.module('codexen.services')
/* global angular */
angular.module('codexen')
.factory('Snippet', function ($http, $auth, apiUrl) {
var findByUser = function (user) {
var url = apiUrl + 'snippets/search'

View File

@@ -1,4 +1,5 @@
angular.module('codexen.services')
/* global angular */
angular.module('codexen')
.factory('Tag', function ($http, apiUrl) {
var findByName = function (tagName) {
var url = apiUrl + 'tags/search'

View File

@@ -1,6 +1,7 @@
angular.module('codexen.services')
/* global angular */
angular.module('codexen')
.factory('User', function ($http, apiUrl, $rootScope, $state) {
$rootScope.$on('userSignOut', function(){
$rootScope.$on('userSignOut', function () {
$state.go('auth.signin')
})

View File

@@ -1,6 +0,0 @@
@import "../../variables";
@import "../../mixins";
.home-state{
padding: 10px;
}

View File

@@ -1,117 +0,0 @@
@import "../../variables";
@import "../../mixins";
$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{
position: absolute;
top: 0;
bottom: 0;
left: 0;
width: $left-pane-width;
overflow:hidden;
border-right: solid 1px $pane-border-color;
.snippet-search{
position: absolute;
top: 0;
height: 50px;
left: 0;
right: 0;
border-bottom: solid 1px $snippet-list-border-color;
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-bottom: solid 1px $snippet-list-border-color;
h4{
margin: 0;
}
&:hover{
background-color: $snippet-list-item-hover-bg;
}
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;
}
}
.snippets-detail-state{
.detail-header{
padding: 5px 10px;
height: 50px;
border-bottom: solid 1px $border-color;
.detail-header-title{
small{
font-size: 0.6em;
}
line-height: 40px;
font-size: 1.2em;
}
.detail-header-control{
padding:3px;
}
}
.detail-body{
padding: 5px 10px;
.ace_editor {
min-height: 300px;
border: solid 1px $border-color;
border-radius: 5px;
}
}
}
.tags{
word-break: break-all;
a{
margin: 0 2px;
}
}

49
src/styles/bootstrap.styl vendored Normal file
View File

@@ -0,0 +1,49 @@
// Core variables and mixins
@import 'vars'
@import 'mixins'
// Utilities
@import '../../node_modules/bootstrap-styl/bootstrap/utilities'
@import '../../node_modules/bootstrap-styl/bootstrap/responsive-utilities'
// Reset and dependencies
@import '../../node_modules/bootstrap-styl/bootstrap/normalize'
@import '../../node_modules/bootstrap-styl/bootstrap/print'
// Core CSS
@import '../../node_modules/bootstrap-styl/bootstrap/scaffolding'
@import '../../node_modules/bootstrap-styl/bootstrap/type'
// @import '../../node_modules/bootstrap-styl/bootstrap/code'
@import '../../node_modules/bootstrap-styl/bootstrap/grid'
@import '../../node_modules/bootstrap-styl/bootstrap/tables'
@import '../../node_modules/bootstrap-styl/bootstrap/forms'
@import '../../node_modules/bootstrap-styl/bootstrap/buttons'
// Components
@import '../../node_modules/bootstrap-styl/bootstrap/component-animations'
@import '../../node_modules/bootstrap-styl/bootstrap/dropdowns'
@import '../../node_modules/bootstrap-styl/bootstrap/button-groups'
@import '../../node_modules/bootstrap-styl/bootstrap/input-groups'
@import '../../node_modules/bootstrap-styl/bootstrap/navs'
@import '../../node_modules/bootstrap-styl/bootstrap/navbar'
// @import '../../node_modules/bootstrap-styl/bootstrap/breadcrumbs'
@import '../../node_modules/bootstrap-styl/bootstrap/pagination'
@import '../../node_modules/bootstrap-styl/bootstrap/pager'
@import '../../node_modules/bootstrap-styl/bootstrap/labels'
@import '../../node_modules/bootstrap-styl/bootstrap/badges'
@import '../../node_modules/bootstrap-styl/bootstrap/jumbotron'
@import '../../node_modules/bootstrap-styl/bootstrap/thumbnails'
@import '../../node_modules/bootstrap-styl/bootstrap/alerts'
@import '../../node_modules/bootstrap-styl/bootstrap/progress-bars'
@import '../../node_modules/bootstrap-styl/bootstrap/media'
@import '../../node_modules/bootstrap-styl/bootstrap/list-group'
@import '../../node_modules/bootstrap-styl/bootstrap/panels'
@import '../../node_modules/bootstrap-styl/bootstrap/responsive-embed'
@import '../../node_modules/bootstrap-styl/bootstrap/wells'
@import '../../node_modules/bootstrap-styl/bootstrap/close'
// Components w/ JavaScript
@import '../../node_modules/bootstrap-styl/bootstrap/modals'
@import '../../node_modules/bootstrap-styl/bootstrap/tooltip'
@import '../../node_modules/bootstrap-styl/bootstrap/popovers'
// @import '../../node_modules/bootstrap-styl/bootstrap/carousel'

View File

@@ -0,0 +1,20 @@
$side-view-link-hover-color= $gray-dark
$side-view-link-active-color= $link-color
$side-view-link-active-bg= $body-bg
#side-view ul.nav.nav-pills
li hr
margin: 5px 0
border-color: lighten($gray-dark, 20%)
li a
color: white
&:hover
color: $side-view-link-hover-color
li.active a
color:$side-view-link-active-color
background-color: $side-view-link-active-bg

View File

@@ -0,0 +1,221 @@
/*!
* 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
.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: 4px /* FIXME hardcoded value :-/ */
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
.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 3px
.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: #333
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: #262626
background-color: #f5f5f5
.ui-select-bootstrap .ui-select-choices-row.active>a
color: #fff
text-decoration: none
outline: 0
background-color: #428bca
.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

77
src/styles/main.styl Normal file
View File

@@ -0,0 +1,77 @@
@import 'bootstrap'
@import 'modals/*'
@import 'directives/*'
@import 'states/*'
// @import 'mixins/*'
html
overflow: hidden
height: 100%
body
height: 100%
overflow: auto
font-family: "Lato", sans-serif
color $color
background-color: $bg
// body:before
// content ''
// background-image url('http://img10.deviantart.net/f372/i/2014/283/8/3/blue_pattern_design_free_vector_by_vecree-d829oba.jpg')
// filter blur(5px)
// opacity 1
// position absolute
// left 0
// top 0
// bottom 0
// right 0
label
font-family: "Lato", sans-serif
color $color
textarea
resize: vertical
#side-view
position:absolute
top: 0
bottom: 0
left: 0
width: 200px
background-color: $bgDarker
border-right solid 2px $borderEdge
box-sizing: border-box
padding: 10px 0 10px 10px
.nav.nav-pills>li
&.active>a{
background-color $bg
}
.nav.nav-pills>li>a
color white
border-top-right-radius: 0
border-bottom-right-radius: 0
.alert
margin: 5px 0
#main-view
position:absolute
top: 0
bottom: 0
left: 200px
right: 0
overflow-x: hidden
overflow-y: auto
background-color $bg
.inline-form-control
@extend .form-control
width: auto
display: inline-block

1
src/styles/mixins.styl Normal file
View File

@@ -0,0 +1 @@
@import '../../node_modules/bootstrap-styl/bootstrap/mixins'

View File

@@ -0,0 +1,8 @@
$editor-border-color= $border-color
.new-snippet-modal
.ace_editor
height: 200px
border: solid 1px $editor-border-color
border-radius: 5px

View File

@@ -0,0 +1,2 @@
.home-state
padding 10px

View File

@@ -0,0 +1,112 @@
$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
position: absolute
top: 0
bottom: 0
left: 0
width: $left-pane-width
overflow:hidden
border-right: solid 1px $pane-border-color
.snippet-search
position: absolute
top: 0
height: 50px
left: 0
right: 0
border-bottom: solid 1px $snippet-list-border-color
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-bottom: solid 1px $snippet-list-border-color
h4
margin: 0
&:hover
background-color: $snippet-list-item-hover-bg
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
.snippets-detail-state
.detail-header
padding: 5px 10px
height: 50px
border-bottom: solid 1px $border-color
.detail-header-title
small
font-size: 0.6em
line-height: 40px
font-size: 1.2em
.detail-header-control
padding:3px
.detail-body
padding: 5px 10px
.ace_editor
min-height: 300px
border: solid 1px $border-color
border-radius: 5px
.tags
word-break: break-all
a
margin: 0 2px

12
src/styles/vars.styl Normal file
View File

@@ -0,0 +1,12 @@
@import '../../node_modules/bootstrap-styl/bootstrap/variables'
$brandColor= #26A7D5
$colorEdge= white
$color= #777
$border= #444
$borderEdge= #26A7D5
$bg= RGBA(38, 58, 71, 1)
$bgDarker= RGBA(25, 41, 52, 1)