Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
9daed43
init file set up
dstineback Jun 21, 2016
2728788
added controllers to the directive index
dstineback Jun 21, 2016
e1e36a2
added thumbnail controller
dstineback Jun 21, 2016
d4533a9
added thumbnail directive
dstineback Jun 21, 2016
1ffa8b6
renamed the template html
dstineback Jun 21, 2016
0c37af5
added directives to index.html
dstineback Jun 21, 2016
5d30866
added stuff to .eslint and took out test folder, also took out depend…
dstineback Jun 21, 2016
481bd0a
first test of app and it was not working
dstineback Jun 21, 2016
a062160
was able to fix all the path bugs and finally had pictures displaying…
dstineback Jun 21, 2016
16e2f08
hacked way at a few different things but will need to make another ht…
dstineback Jun 21, 2016
fbd2603
Took out 2 controllers. Found out we needed just one controller for t…
dstineback Jun 21, 2016
b62d4ad
added images and photo controller
dstineback Jun 22, 2016
447fbb1
added directives
dstineback Jun 22, 2016
4c0e316
added a div to index. Very stuck and not sure where to go from here. …
dstineback Jun 22, 2016
e062cf0
changed the controller
dstineback Jun 22, 2016
dbd1810
getting album to display but not pictures yet
dstineback Jun 22, 2016
cb70e72
have pictures displaying
dstineback Jun 22, 2016
41dcfad
have pictures showing and hiding
dstineback Jun 22, 2016
e104b2c
changed normal size
dstineback Jun 22, 2016
7fb67b1
save before class
dstineback Jun 22, 2016
a2d39ed
save before submitting
dstineback Jun 23, 2016
7f0a932
fixed bug, working
dstineback Jun 23, 2016
0038d2f
last update
dstineback Jun 23, 2016
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
10 changes: 10 additions & 0 deletions dan-stineback/app/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
body {
background-color: #fff;
}
div {
float: left;
}

.toggle {
float: none;
}
33 changes: 33 additions & 0 deletions dan-stineback/app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Bunny App</title>
<link rel="stylesheet" href="app.css">
</head>
<body data-ng-app="BunnyApp">
<main ng-cloak ng-controller="PhotosController as albums">
<!-- <div>

<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>
</div> -->


<h1>{{albums.dragonPhotos.title}}</h1>
<h3>{{albums.dragonPhotos.description}}</h1>
<photo-album photos="albums.dragonPhotos.photos"></photo-album><br>
<h1>{{albums.cowPhotos.title}}</h1>
<h3>{{albums.cowPhotos.description}}</h1>
<photo-album photos="albums.cowPhotos.photos"></photo-album><br>
<h1>{{albums.pupPhotos.title}}</h1>
<h3>{{albums.pupPhotos.description}}</h1>
<photo-album photos="albums.pupPhotos.photos"></photo-album><br>

</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';

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

module.exports = function(app) {
require('./imageController')(app);
require('./photoController')(app);
};
77 changes: 77 additions & 0 deletions dan-stineback/app/js/first/controllers/photoController.js
Original file line number Diff line number Diff line change
@@ -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'
}
]
};

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

not used

console.log($scope.mode);
};
// $scope.currentPhoto = $scope.photos;
$scope.toggle = function(photo) {
console.log(photo);

$scope.currentPhoto = photo;
let photoArray = [];
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.

don't see this photoArray being using anywhere?

photoArray.push(photo);
console.log(photoArray);

$scope.photoText = !$scope.photoText;
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.

could photoText and photoTextAgain be a single variable - it looks like they always change the same way and are initialized the same?

$scope.photoTextAgain = !$scope.photoTextAgain;
};

}
};
});
};
16 changes: 16 additions & 0 deletions dan-stineback/app/js/first/directives/thumbnailDirective.js
Original file line number Diff line number Diff line change
@@ -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: '='
}
};
});
};
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>
Loading