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/app.css b/dan-stineback/app/app.css new file mode 100644 index 0000000..f30bcc6 --- /dev/null +++ b/dan-stineback/app/app.css @@ -0,0 +1,10 @@ +body { + background-color: #fff; +} +div { + float: left; +} + +.toggle { + float: none; +} diff --git a/dan-stineback/app/index.html b/dan-stineback/app/index.html new file mode 100644 index 0000000..987d3fb --- /dev/null +++ b/dan-stineback/app/index.html @@ -0,0 +1,33 @@ + + + + + Bunny App + + + +
+ + + +

{{albums.dragonPhotos.title}}

+

{{albums.dragonPhotos.description}}

+
+

{{albums.cowPhotos.title}}

+

{{albums.cowPhotos.description}}

+
+

{{albums.pupPhotos.title}}

+

{{albums.pupPhotos.description}}

+
+ +
+ + + 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..4c126ec --- /dev/null +++ b/dan-stineback/app/js/first/controllers/index.js @@ -0,0 +1,6 @@ +'use strict'; + +module.exports = function(app) { + require('./imageController')(app); + require('./photoController')(app); +}; diff --git a/dan-stineback/app/js/first/controllers/photoController.js b/dan-stineback/app/js/first/controllers/photoController.js new file mode 100644 index 0000000..57bd50c --- /dev/null +++ b/dan-stineback/app/js/first/controllers/photoController.js @@ -0,0 +1,77 @@ +'use strict'; +module.exports = function(app) { + app.controller('PhotosController', PhotosController); + + function PhotosController() { + this.height = '400', + this.width = '400', + this.dragonPhotos = { + title:'Dragon photos', + description:'Pictures of Daragons', + photos:[ + { + url: 'http://vignette2.wikia.nocookie.net/dragonhandbook/images/e/e5/Chaos_breathing_fire.jpeg/revision/latest?cb=20130815032055', + title: 'Dragon one', + description: 'Firebreathing' + }, + { + url: 'http://images2.fanpop.com/image/photos/8700000/Red-dragon-dragons-8714488-688-868.jpg', + title: 'Dragon two', + description: 'lighting' + + }, + { + url: 'http://static.tvtropes.org/pmwiki/pub/images/How-to-Train-Your-Dragon-2_3414.jpg', + title: 'Dragon three', + description: 'Sharptooth' + + } + ] + }; + + this.cowPhotos = { + title:'Cow Photos', + description:'Pictures of Cows', + photos:[ + { + url: 'http://resources3.news.com.au/images/2012/03/27/1226311/607271-cow.jpg', + title: 'Cow one', + description: 'Silly Cow' + }, + { + url: 'http://i.telegraph.co.uk/multimedia/archive/02532/Cows_2532445b.jpg', + title: 'Cow two', + description: 'many silly cows' + }, + { + url: 'http://fillyourplate.org/blog/wp-content/uploads/2015/07/bigstock-Head-of-funny-cow-looking-to-a-48484160-418x512.jpg', + title: 'Cow three', + description: 'Horn cow' + } + ] + }; + + this.pupPhotos = { + title:'Pup Photos', + description:'Pictures of puppies', + photos:[ + { + url: 'http://theilovedogssite.com/wp-content/uploads/2015/01/4577137586_5f4cf7fbd3_z.jpg', + title: 'Pup one', + description: 'Brown pup' + }, + { + url: 'http://barkingroyalty.com/wp-content/uploads/2015/12/cutest-puppies.jpg', + title: 'Pup two', + description: 'red collar pup' + }, + { + url: 'http://www.pluspets.net/wp-content/uploads/2010/07/Cutest-Puppies1.jpg', + title: 'Pup three', + description: 'lab pup' + } + ] + }; + + } +}; 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..14d8096 --- /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..449b340 --- /dev/null +++ b/dan-stineback/app/js/first/directives/index.js @@ -0,0 +1,7 @@ +'use strict'; +module.exports =function(app) { + require('./thumbnailDirective')(app); + require('./imageDirective')(app); + require('./titleDirective')(app); + require('./photo_directive')(app); +}; diff --git a/dan-stineback/app/js/first/directives/photo_directive.js b/dan-stineback/app/js/first/directives/photo_directive.js new file mode 100644 index 0000000..a8bf738 --- /dev/null +++ b/dan-stineback/app/js/first/directives/photo_directive.js @@ -0,0 +1,39 @@ +'use strict'; +module.exports = function(app){ + app.directive('photoAlbum', function(){ + return{ + restrict: 'AEC', + templateUrl: './templates/firstApp/photo.html', + scope: { + photos: '=', + url: '=', + title: '=', + description: '=', + photo: '=' + + + }, + controller: function($scope) { + $scope.photoText = false; + $scope.photoTextAgain = true; + + $scope.changeView = function() { + console.log($scope.mode); + }; + // $scope.currentPhoto = $scope.photos; + $scope.toggle = function(photo) { + console.log(photo); + + $scope.currentPhoto = photo; + let photoArray = []; + photoArray.push(photo); + console.log(photoArray); + + $scope.photoText = !$scope.photoText; + $scope.photoTextAgain = !$scope.photoTextAgain; + }; + + } + }; + }); +}; 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..4b610fd --- /dev/null +++ b/dan-stineback/app/js/first/directives/thumbnailDirective.js @@ -0,0 +1,16 @@ +'use strict'; +module.exports = function(app){ + app.directive('thumbnailDisplay', function(){ + return{ + restrict: 'AEC', + templateUrl: './templates/firstApp/thumbnail.html', + scope: { + url: '=', + height: '=', + width: '=', + title: '=', + description: '=' + } + }; + }); +}; 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..5ca0dd1 --- /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..219fdd9 --- /dev/null +++ b/dan-stineback/app/templates/firstApp/image.html @@ -0,0 +1,4 @@ +
+
+ +
diff --git a/dan-stineback/app/templates/firstApp/photo.html b/dan-stineback/app/templates/firstApp/photo.html new file mode 100644 index 0000000..0b4a607 --- /dev/null +++ b/dan-stineback/app/templates/firstApp/photo.html @@ -0,0 +1,28 @@ + +
+ +
+ + +
+
+ +
+ +
+
+ +
+ Large image and click image for text +
diff --git a/dan-stineback/app/templates/firstApp/thumbnail.html b/dan-stineback/app/templates/firstApp/thumbnail.html new file mode 100644 index 0000000..d42561f --- /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'); +});