mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-12 17:26:17 +00:00
tag as v0.1
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
||||
/node_modules
|
||||
/electron_build
|
||||
.env
|
||||
dist/
|
||||
|
||||
63
Gulpfile.js
63
Gulpfile.js
@@ -20,21 +20,56 @@ var ngAnnotate = require('gulp-ng-annotate')
|
||||
var uglify = require('gulp-uglify')
|
||||
var minifyCss = require('gulp-minify-css')
|
||||
var merge = require('merge-stream')
|
||||
var concat = require('gulp-concat')
|
||||
var streamqueue = require('streamqueue')
|
||||
var minifyHtml = require('gulp-minify-html')
|
||||
|
||||
var config = require('./build.config.js')
|
||||
|
||||
gulp.task('env', function () {
|
||||
return gulp.src('tpls/env.js')
|
||||
.pipe(template({
|
||||
apiUrl: env.BUILD_API_URL
|
||||
}))
|
||||
.pipe(gulp.dest('build/config'))
|
||||
gulp.task('js', function () {
|
||||
return streamqueue({objectMode: true},
|
||||
gulp.src('tpls/env.js')
|
||||
.pipe(template({
|
||||
apiUrl: env.BUILD_API_URL
|
||||
})),
|
||||
gulp.src(['src/**/*.js'])
|
||||
)
|
||||
.pipe(changed('build'))
|
||||
.pipe(gulp.dest('build'))
|
||||
})
|
||||
|
||||
gulp.task('js', function () {
|
||||
return gulp.src(['src/**/*.js'])
|
||||
.pipe(changed('build'))
|
||||
.pipe(gulp.dest('build'))
|
||||
gulp.task('dist', function () {
|
||||
var js = streamqueue({objectMode: true},
|
||||
gulp.src(['src/**/*.js']),
|
||||
gulp.src('tpls/env.js')
|
||||
.pipe(template({
|
||||
apiUrl: env.DIST_API_URL
|
||||
})),
|
||||
gulp.src('src/**/*.tpl.html')
|
||||
.pipe(templateCache())
|
||||
)
|
||||
.pipe(ngAnnotate())
|
||||
.pipe(uglify())
|
||||
.pipe(concat('app.js'))
|
||||
.pipe(gulp.dest('dist'))
|
||||
|
||||
var css = gulp.src('src/styles/main.styl')
|
||||
.pipe(plumber({errorHandler: notify.onError('Error: <%= error.message %>')}))
|
||||
.pipe(styl())
|
||||
.pipe(autoprefixer())
|
||||
.pipe(minifyCss())
|
||||
.pipe(gulp.dest('dist'))
|
||||
|
||||
var index = gulp.src('src/index.html')
|
||||
.pipe(template({
|
||||
scripts: ['app.js'],
|
||||
styles: ['main.css'],
|
||||
env: 'dist'
|
||||
}))
|
||||
.pipe(minifyHtml())
|
||||
.pipe(gulp.dest('dist'))
|
||||
|
||||
return merge(js, css, index)
|
||||
})
|
||||
|
||||
gulp.task('styl', function () {
|
||||
@@ -72,7 +107,7 @@ gulp.task('index', function () {
|
||||
.pipe(template({
|
||||
scripts: scripts,
|
||||
styles: styles,
|
||||
env: env
|
||||
env: 'build'
|
||||
}))
|
||||
.pipe(gulp.dest('build'))
|
||||
.pipe(livereload())
|
||||
@@ -100,13 +135,11 @@ gulp.task('resources', function () {
|
||||
})
|
||||
|
||||
gulp.task('build', function (cb) {
|
||||
runSequence(['env', 'js', 'styl', 'tpls', 'vendor', 'resources'], 'index', cb)
|
||||
runSequence(['js', 'styl', 'tpls', 'vendor', 'resources'], 'index', cb)
|
||||
})
|
||||
|
||||
gulp.task('watch', function (cb) {
|
||||
gulp.watch(['.env', 'tpls/env.js'], ['env'])
|
||||
|
||||
gulp.watch('src/**/*.js', ['js'])
|
||||
gulp.watch(['.env', 'tpls/env.js', 'src/**/*.js'], ['js'])
|
||||
|
||||
gulp.watch('src/styles/**/*.styl', ['styl'])
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* global angular */
|
||||
angular.module('codexen.popup')
|
||||
.constant('apiUrl', 'http://localhost:8000/')
|
||||
.constant('apiUrl', 'http://codexen-server-dev.elasticbeanstalk.com/')
|
||||
.config(function ($authProvider, $httpProvider, apiUrl) {
|
||||
$authProvider.baseUrl = apiUrl
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ module.exports = function (gulp) {
|
||||
gulp.task('elec-env', function () {
|
||||
return gulp.src('tpls/env.js')
|
||||
.pipe(template({
|
||||
apiUrl: env.BUILD_API_URL
|
||||
apiUrl: env.ELEC_API_URL
|
||||
}))
|
||||
.pipe(gulp.dest('electron_build/config'))
|
||||
})
|
||||
@@ -78,7 +78,7 @@ module.exports = function (gulp) {
|
||||
.pipe(template({
|
||||
scripts: scripts,
|
||||
styles: styles,
|
||||
env: env
|
||||
env: 'build'
|
||||
}))
|
||||
.pipe(gulp.dest('electron_build'))
|
||||
.pipe(livereload())
|
||||
|
||||
@@ -68,5 +68,9 @@
|
||||
"satellizer": "^0.10.1",
|
||||
"ui-select": "^0.11.2"
|
||||
},
|
||||
"devDependencies": {}
|
||||
"devDependencies": {
|
||||
"gulp-concat": "^2.5.2",
|
||||
"gulp-minify-html": "^1.0.3",
|
||||
"streamqueue": "^1.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.controller('SnippetsListController', function ($auth, Snippet, $scope, $state, $scope, $filter, mySnippets) {
|
||||
.controller('SnippetsListController', function ($auth, Snippet, $scope, $state, $scope, $filter, mySnippets, User) {
|
||||
var vm = this
|
||||
|
||||
vm.isLoading = false
|
||||
@@ -12,6 +12,16 @@ angular.module('codexen')
|
||||
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()
|
||||
|
||||
@@ -11,7 +11,16 @@
|
||||
<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">
|
||||
|
||||
|
||||
<% if(env === 'dist') { %>
|
||||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
|
||||
<% } %>
|
||||
|
||||
<% if(env === 'build') { %>
|
||||
<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">
|
||||
<% }) %>
|
||||
@@ -22,15 +31,30 @@
|
||||
<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>
|
||||
<% if(env === 'dist') { %>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.9/ace.js" charset="utf-8"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js" charset="utf-8"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular-sanitize.min.js" charset="utf-8"></script>
|
||||
<script src="https://cdn.rawgit.com/angular-ui/ui-router/0.2.15/release/angular-ui-router.min.js" charset="utf-8"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.13.0/ui-bootstrap-tpls.min.js" charset="utf-8"></script>
|
||||
<script src="https://cdn.rawgit.com/angular-ui/ui-select/v0.12.0/dist/select.min.js" charset="utf-8"></script>
|
||||
<script src="https://cdn.jsdelivr.net/satellizer/0.11.2/satellizer.min.js"></script>
|
||||
<script src="https://cdn.rawgit.com/gdi2290/angular-md5/v0.1.7/angular-md5.min.js" charset="utf-8"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.3/moment.min.js" charset="utf-8"></script>
|
||||
<% } %>
|
||||
|
||||
<% if(env === 'build') { %>
|
||||
<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>
|
||||
<% } %>
|
||||
|
||||
|
||||
<% scripts.forEach(function(script){ %>
|
||||
<script src="<%=script %>"></script>
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
@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/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'
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
<h1 class="jumbotron">Codexen App <small>v0.1</small></h1>
|
||||
<p>
|
||||
App for Code snippets<br>
|
||||
|
||||
App: <a href="https://github.com/Rokt33r/codexen-app">Rokt33r/codexen-app</a><br>
|
||||
Server: <a href="https://github.com/Rokt33r/codexen-server">Rokt33r/codexen-server</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<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" src="http://www.gravatar.com/avatar/ea0b6ad1c11700120d1af08810caa19d" alt="" />
|
||||
<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">
|
||||
|
||||
Reference in New Issue
Block a user