1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-12 17:26:17 +00:00
This commit is contained in:
Rokt33r
2015-05-26 17:05:00 +09:00
commit 3e5fe1284d
7 changed files with 504 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
/build
/node_modules

99
Gulpfile.js Normal file
View File

@@ -0,0 +1,99 @@
var gulp = require('gulp')
var sass = require('gulp-sass')
var autoprefixer = require('gulp-autoprefixer')
var templateCache = require('gulp-angular-templatecache')
var globby = require('globby')
var template = require('gulp-template')
var concat = require('gulp-concat')
var del = require('del')
var runSequence = require('run-sequence')
var rev = require('gulp-rev')
var merge = require('merge-stream')
var ngAnnotate = require('gulp-ng-annotate')
var uglify = require('gulp-uglify')
var minifyCss = require('gulp-minify-css')
var livereload = require('gulp-livereload')
var config = require('./build.config.js')
gulp.task('js', function(){
return gulp.src(['src/**/*.js']).pipe(gulp.dest('build'))
})
gulp.task('sass', function () {
return gulp.src('src/**/*.scss')
.pipe(sass({errLogToConsole: true}))
.pipe(autoprefixer())
.pipe(concat('all.css'))
.pipe(gulp.dest('build'))
.pipe(livereload())
})
gulp.task('tpls', function(){
return gulp.src('src/**/*.tpl.html')
.pipe(templateCache())
.pipe(gulp.dest('build'))
})
gulp.task('index', function () {
var files = globby.sync(['build/**/*', '!build/vendor/**/*'])
var filter = function (files, ext) {
return files.filter(function (file) {
var reg = new RegExp('.+\.' + ext + '$')
return file.match(reg)
}).map(function (file) {
return file.replace('build/', '')
})
}
var scripts = filter(files, 'js')
var styles = filter(files, 'css')
return gulp.src('src/index.html')
.pipe(template({
scripts: scripts,
styles: styles,
env: 'build'
}))
.pipe(gulp.dest('build'))
.pipe(livereload())
})
gulp.task('build', function (cb) {
runSequence(['js', 'sass', 'tpls', 'vendor'], 'index', cb)
})
gulp.task('watch', function (cb) {
gulp.watch(['src/**/*.js'], ['js'])
gulp.watch('src/**/*.scss', ['sass'])
gulp.watch('src/**/*.tpl.html', ['tpls'])
gulp.watch(['build/**/*.js', 'src/index.html'], ['index'])
livereload.listen()
})
gulp.task('del', function (cb) {
del(['build/**/*'], cb)
})
gulp.task('default', function (cb) {
runSequence('del', 'build', 'watch', cb)
})
gulp.task('vendor', function () {
var vendors = config.vendors
vendorFiles = vendors.map(function (vendor) {
return vendor.src
})
return gulp.src(vendorFiles)
.pipe(gulp.dest('build/vendor'))
})

44
build.config.js Normal file
View File

@@ -0,0 +1,44 @@
module.exports = {
vendors: [
{
name:'ace',
src:'node_modules/@rokt33r/ace-builds/src/**/*',
cdn:'https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.9/ace.js'
},
{
name:'angular',
src:'node_modules/angular/angular.js',
cdn:'https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js'
},
{
name:'angular-ui-ace',
src:'node_modules/@rokt33r/angular-ui-ace/src/ui-ace.js',
cdn:'https://cdn.rawgit.com/angular-ui/ui-ace/v0.2.3/ui-ace.min.js'
},
{
name:'angular-bootstrap',
src:'node_modules/angular-bootstrap/dist/ui-bootstrap-tpls.js',
cdn:'https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.12.1/ui-bootstrap-tpls.min.js'
},
{
name:'angular-sanitize',
src:'node_modules/angular-sanitize/angular-sanitize.js',
cdn:'https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.15/angular-animate.min.js'
},
{
name:'angular-ui-router',
src:'node_modules/angular-ui-router/build/angular-ui-router.js',
cdn:'https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.14/angular-ui-router.min.js'
},
{
name:'ui-select',
src:'node_modules/ui-select/dist/select.js',
cdn:'https://cdnjs.cloudflare.com/ajax/libs/angular-ui-select/0.11.2/select.js'
},
{
name:'satellizer',
src:'node_modules/satellizer/satellizer.js',
cdn:'https://cdn.jsdelivr.net/satellizer/0.10.1/satellizer.min.js'
}
]
}

56
package.json Normal file
View File

@@ -0,0 +1,56 @@
{
"name": "codexen-app",
"version": "0.0.1",
"description": "CodeXen App",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Rokt33r/codexen-app.git"
},
"keywords": [
"codexen",
"snippet",
"template",
"task",
"runner",
"remote"
],
"author": "Dick Choi <fluke8259@gmail.com> (http://kazup.co)",
"license": "ISC",
"bugs": {
"url": "https://github.com/Rokt33r/codexen-app/issues"
},
"homepage": "https://github.com/Rokt33r/codexen-app#readme",
"dependencies": {
"@rokt33r/ace-builds": "^1.1.9",
"@rokt33r/angular-ui-ace": "^0.2.3",
"angular": "^1.3.15",
"angular-bootstrap": "^0.12.0",
"angular-sanitize": "^1.3.15",
"angular-ui-router": "^0.2.15",
"font-awesome": "^4.3.0",
"satellizer": "^0.10.1",
"ui-select": "^0.11.2"
},
"devDependencies": {
"bootstrap-sass": "^3.3.4",
"del": "^1.2.0",
"globby": "^2.0.0",
"gulp": "^3.8.11",
"gulp-angular-templatecache": "^1.6.0",
"gulp-autoprefixer": "^2.3.0",
"gulp-concat": "^2.5.2",
"gulp-livereload": "^3.8.0",
"gulp-minify-css": "^1.1.1",
"gulp-ng-annotate": "^0.5.3",
"gulp-rev": "^4.0.0",
"gulp-sass": "^2.0.1",
"gulp-template": "^3.0.0",
"gulp-uglify": "^1.2.0",
"merge-stream": "^0.1.7",
"run-sequence": "^1.1.0"
}
}

50
src/_bootstrap.scss Normal file
View File

@@ -0,0 +1,50 @@
// Core variables and mixins
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/variables";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/mixins";
// Reset and dependencies
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/normalize";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/print";
// @import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/glyphicons";
// 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";

221
src/_ui-select.scss Normal file
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;
}
.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;
}

32
src/index.html Normal file
View File

@@ -0,0 +1,32 @@
<!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">
<meta name="description" content="CodeXen - Short code storage service">
<title>Codexen!</title>
</head>
<body>
<div ui-view name="side-view" 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-ace.js"></script>
<script src="vendor/ui-bootstrap-tpls.js"></script>
<script src="vendor/select.js"></script>
<% scripts.forEach(function(script){ %>
<script src="<%=script %>"></script>
<% }) %>
</body>
</html>