Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions dan-stineback/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
**/node_modules/*
**/vendor/*
**/*.min.js
/*.md
/package.json
/npm-debug.log
/procfile
/build/*
42 changes: 42 additions & 0 deletions dan-stineback/.eslintrc
Original file line number Diff line number Diff line change
@@ -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"
}
86 changes: 86 additions & 0 deletions dan-stineback/.gitignore
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions dan-stineback/app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Bunny App</title>
</head>
<body data-ng-app="BunnyApp">
<main ng-cloak ng-controller="imageController as settings">

<title-directive title="{{settings.title}}" url="{{settings.url}}" description="{{settings.description}}"></title-directive>

<thumbnail-display url="{{settings.url}}"></thumbnail-display>

<image-display url="{{settings.url}}" height="{{settings.height}}" width="{{settings.width}}" title="{{settings.title}}" big="{{settings.big}}"></image-display>

</main>
<script src="bundle.js"></script>
</body>
</html>
6 changes: 6 additions & 0 deletions dan-stineback/app/js/client.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict';

const angular = require('angular');

var BunnyApp = angular.module('BunnyApp', []);
require('./first')(BunnyApp);
12 changes: 12 additions & 0 deletions dan-stineback/app/js/first/controllers/imageController.js
Original file line number Diff line number Diff line change
@@ -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';

}]);
};
5 changes: 5 additions & 0 deletions dan-stineback/app/js/first/controllers/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = function(app) {
require('./imageController')(app);
};
17 changes: 17 additions & 0 deletions dan-stineback/app/js/first/directives/imageDirective.js
Original file line number Diff line number Diff line change
@@ -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: '@'
}
};
});
};
6 changes: 6 additions & 0 deletions dan-stineback/app/js/first/directives/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict';
module.exports =function(app) {
require('./thumbnailDirective')(app);
require('./imageDirective')(app);
require('./titleDirective')(app);
};
14 changes: 14 additions & 0 deletions dan-stineback/app/js/first/directives/thumbnailDirective.js
Original file line number Diff line number Diff line change
@@ -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: '@'
}
};
});
};
15 changes: 15 additions & 0 deletions dan-stineback/app/js/first/directives/titleDirective.js
Original file line number Diff line number Diff line change
@@ -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: '@'
}
};

});
};
4 changes: 4 additions & 0 deletions dan-stineback/app/js/first/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = function(app) {
require('./controllers')(app);
require('./directives')(app);
};
5 changes: 5 additions & 0 deletions dan-stineback/app/templates/firstApp/bunnyApp.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div>
Title: {{title}}<br>
url: {{url}}<br>
description: {{description}}
</div>
5 changes: 5 additions & 0 deletions dan-stineback/app/templates/firstApp/image.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div>
<img src="{{url}}" height="{{height}}" width="{{width}}"><br>
Title: {{title}}<br>
description: {{big}}
</div>
3 changes: 3 additions & 0 deletions dan-stineback/app/templates/firstApp/thumbnail.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div>
<img src="{{url}}" height="100px" width="100px">
</div>
54 changes: 54 additions & 0 deletions dan-stineback/gulpfile.js
Original file line number Diff line number Diff line change
@@ -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'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove if not used

};

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'], ()=>{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove if not used

// 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']);
69 changes: 69 additions & 0 deletions dan-stineback/karma.conf.js
Original file line number Diff line number Diff line change
@@ -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
});
};
Loading