diff --git a/dan-stineback/.eslintignore b/dan-stineback/.eslintignore new file mode 100644 index 0000000..8c5c3c8 --- /dev/null +++ b/dan-stineback/.eslintignore @@ -0,0 +1,8 @@ +**/node_modules/* +**/vendor/* +**/*.min.js +/*.md +/package.json +/npm-debug.log +/procfile +/build/* diff --git a/dan-stineback/.eslintrc b/dan-stineback/.eslintrc new file mode 100644 index 0000000..4d749b1 --- /dev/null +++ b/dan-stineback/.eslintrc @@ -0,0 +1,42 @@ +{ +"rules": { +"no-console": 0, +"indent": [ +2, +2 +], +"quotes": [ +2, +"single" +], +"linebreak-style": [ +2, +"unix" +], +"semi": [ +2, +"always" +] +}, +"env": { +"es6": true, +"node": true, +"browser": true, +"mocha": true, +"jasmine": true +}, +"globals": { +"describe": false, +"it": false, +"beforeEach": false, +"afterEach": false, +"before": false, +"after": false +}, +"ecmaFeatures": { +"modules": true, +"experimentalObjectRestSpread": true, +"impliedStrict": true +}, +"extends": "eslint:recommended" +} diff --git a/dan-stineback/.gitignore b/dan-stineback/.gitignore new file mode 100644 index 0000000..594c750 --- /dev/null +++ b/dan-stineback/.gitignore @@ -0,0 +1,86 @@ +# application specific +build/* +db/ + +# Created by https://www.gitignore.io/api/node,osx,vim + +### Node ### +# Logs +logs +*.log +npm-debug.log* + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules +jspm_packages + +# Optional npm cache directory +.npm + +# Optional REPL history +.node_repl_history + + +### OSX ### +*.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + + +### Vim ### +# swap +[._]*.s[a-w][a-z] +[._]s[a-w][a-z] +# session +Session.vim +# temporary +.netrwhist +*~ +# auto-generated tag files +tags diff --git a/dan-stineback/app/index.html b/dan-stineback/app/index.html new file mode 100644 index 0000000..f2d753e --- /dev/null +++ b/dan-stineback/app/index.html @@ -0,0 +1,19 @@ + + + + + Bunny App + + +
+ + + + + + + +
+ + + diff --git a/dan-stineback/app/js/client.js b/dan-stineback/app/js/client.js new file mode 100644 index 0000000..33c7a9a --- /dev/null +++ b/dan-stineback/app/js/client.js @@ -0,0 +1,6 @@ +'use strict'; + +const angular = require('angular'); + +var BunnyApp = angular.module('BunnyApp', []); +require('./first')(BunnyApp); diff --git a/dan-stineback/app/js/first/controllers/imageController.js b/dan-stineback/app/js/first/controllers/imageController.js new file mode 100644 index 0000000..ad53688 --- /dev/null +++ b/dan-stineback/app/js/first/controllers/imageController.js @@ -0,0 +1,12 @@ +'use strict'; +module.exports = function(app) { + app.controller('imageController', ['$scope', function() { + this.url = 'http://f.cl.ly/items/3g3J1G0w122M360w380O/3726490195_f7cc75d377_o.jpg'; + this.height = 400; + this.width = 400; + this.title = 'Bunny Picture'; + this.description = 'A Cute picture of a bunny.'; + this.big = 'A BIG Cute Bunny Picture'; + + }]); +}; diff --git a/dan-stineback/app/js/first/controllers/index.js b/dan-stineback/app/js/first/controllers/index.js new file mode 100644 index 0000000..999d0be --- /dev/null +++ b/dan-stineback/app/js/first/controllers/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function(app) { + require('./imageController')(app); +}; diff --git a/dan-stineback/app/js/first/directives/imageDirective.js b/dan-stineback/app/js/first/directives/imageDirective.js new file mode 100644 index 0000000..e7aebcd --- /dev/null +++ b/dan-stineback/app/js/first/directives/imageDirective.js @@ -0,0 +1,17 @@ +'use strict'; +module.exports = function(app){ + app.directive('imageDisplay', function(){ + return{ + restrict: 'AEC', + templateUrl: './templates/firstApp/image.html', + scope: { + url: '@', + height: '@', + width: '@', + title: '@', + description: '@', + big: '@' + } + }; + }); +}; diff --git a/dan-stineback/app/js/first/directives/index.js b/dan-stineback/app/js/first/directives/index.js new file mode 100644 index 0000000..e04c6a1 --- /dev/null +++ b/dan-stineback/app/js/first/directives/index.js @@ -0,0 +1,6 @@ +'use strict'; +module.exports =function(app) { + require('./thumbnailDirective')(app); + require('./imageDirective')(app); + require('./titleDirective')(app); +}; diff --git a/dan-stineback/app/js/first/directives/thumbnailDirective.js b/dan-stineback/app/js/first/directives/thumbnailDirective.js new file mode 100644 index 0000000..031c4ba --- /dev/null +++ b/dan-stineback/app/js/first/directives/thumbnailDirective.js @@ -0,0 +1,14 @@ +'use strict'; +module.exports = function(app){ + app.directive('thumbnailDisplay', function(){ + return{ + restrict: 'AEC', + templateUrl: './templates/firstApp/thumbnail.html', + scope: { + url: '@', + height: '@', + width: '@' + } + }; + }); +}; diff --git a/dan-stineback/app/js/first/directives/titleDirective.js b/dan-stineback/app/js/first/directives/titleDirective.js new file mode 100644 index 0000000..bb10f79 --- /dev/null +++ b/dan-stineback/app/js/first/directives/titleDirective.js @@ -0,0 +1,15 @@ +'use strict'; +module.exports = function(app) { + app.directive('titleDirective', function() { + return { + templateUrl: './templates/firstApp/bunnyApp.html', + restrict: 'AEC', + scope: { + title: '@', + description: '@', + url: '@' + } + }; + + }); +}; diff --git a/dan-stineback/app/js/first/index.js b/dan-stineback/app/js/first/index.js new file mode 100644 index 0000000..e7d6cfa --- /dev/null +++ b/dan-stineback/app/js/first/index.js @@ -0,0 +1,4 @@ +module.exports = function(app) { + require('./controllers')(app); + require('./directives')(app); +}; diff --git a/dan-stineback/app/templates/firstApp/bunnyApp.html b/dan-stineback/app/templates/firstApp/bunnyApp.html new file mode 100644 index 0000000..4ebd8cb --- /dev/null +++ b/dan-stineback/app/templates/firstApp/bunnyApp.html @@ -0,0 +1,5 @@ +
+ Title: {{title}}
+ url: {{url}}
+ description: {{description}} +
diff --git a/dan-stineback/app/templates/firstApp/image.html b/dan-stineback/app/templates/firstApp/image.html new file mode 100644 index 0000000..d993255 --- /dev/null +++ b/dan-stineback/app/templates/firstApp/image.html @@ -0,0 +1,5 @@ +
+
+ Title: {{title}}
+ description: {{big}} +
diff --git a/dan-stineback/app/templates/firstApp/thumbnail.html b/dan-stineback/app/templates/firstApp/thumbnail.html new file mode 100644 index 0000000..c9803fb --- /dev/null +++ b/dan-stineback/app/templates/firstApp/thumbnail.html @@ -0,0 +1,3 @@ +
+ +
diff --git a/dan-stineback/gulpfile.js b/dan-stineback/gulpfile.js new file mode 100644 index 0000000..9fb5705 --- /dev/null +++ b/dan-stineback/gulpfile.js @@ -0,0 +1,54 @@ +'use strict'; + +const gulp = require('gulp'); +const webpack = require('webpack-stream'); +const clean = require('gulp-clean'); + +const paths = { + js: __dirname + '/app/**/*.js', + html: __dirname + '/app/**/*.html' + // css: __dirname + '/app/**/*.css' +}; + +gulp.task('clean', ()=>{ + return gulp.src('./build/*', {read:false}) + .pipe(clean()); +}); + +gulp.task('copy-html', ['clean'], ()=>{ + return gulp.src(paths.html) + .pipe(gulp.dest('./build')); +}); + +// gulp.task('copy-css', ['clean'], ()=>{ +// return gulp.src(paths.css) +// .pipe(gulp.dest('./build')); +// }); + +gulp.task('bundle', ['clean'], ()=>{ + return gulp.src(paths.js) + .pipe(webpack({ + output: { + filename: 'bundle.js' + } + })) + .pipe(gulp.dest('./build')); +}); + +gulp.task('bundle:test', () => { + return gulp.src(__dirname + '/test/*_test.js') + .pipe(webpack({ + output: { + filename: 'test_bundle.js' + } + })) + .pipe(gulp.dest(__dirname + '/test')); +}); + +gulp.task('watch', ()=>{ + gulp.watch('./app/*', ['build']); +}); + +gulp.task('build', ['clean', 'copy-html', 'bundle']); + +gulp.task('default', ['build']); diff --git a/dan-stineback/karma.conf.js b/dan-stineback/karma.conf.js new file mode 100644 index 0000000..4fb873d --- /dev/null +++ b/dan-stineback/karma.conf.js @@ -0,0 +1,69 @@ +// Karma configuration +// Generated on Wed Jun 15 2016 14:20:45 GMT-0700 (PDT) + +module.exports = function(config) { + config.set({ + + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: '', + + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['jasmine'], + + + // list of files / patterns to load in the browser + files: [ + 'test/test_bundle.js' + ], + + + // list of files to exclude + exclude: [ + ], + + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + }, + + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['progress'], + + + // web server port + port: 9876, + + + // enable / disable colors in the output (reporters and logs) + colors: true, + + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: false, + + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: ['Chrome'], + + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: true, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: Infinity + }); +}; diff --git a/dan-stineback/package.json b/dan-stineback/package.json new file mode 100644 index 0000000..2cebf20 --- /dev/null +++ b/dan-stineback/package.json @@ -0,0 +1,22 @@ +{ + "name": "template-angular", + "version": "0.1.0", + "description": "template-angular", + "main": "index.html", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "start": "node server.js" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "express": "^4.13.4" + }, + "devDependencies": { + "angular": "^1.5.6", + "gulp": "^3.9.1", + "gulp-clean": "^0.3.2", + "webpack-stream": "^3.2.0" + } +} diff --git a/dan-stineback/server.js b/dan-stineback/server.js new file mode 100644 index 0000000..75bc855 --- /dev/null +++ b/dan-stineback/server.js @@ -0,0 +1,9 @@ +'use strict'; +const express = require('express'); +const app = express(); + +app.use(express.static(__dirname + '/build')); + +app.listen(3030, () => { + console.log('server is running on 3030'); +});