-
Notifications
You must be signed in to change notification settings - Fork 10
Animal Gallery - Vic #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vbenavente
wants to merge
35
commits into
sea-401d5-javascript:master
Choose a base branch
from
vbenavente:development
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
f66af76
setup foder structure, package.json, and eslintrc
297d182
init commit with .gitignore file
1a8dfb4
added karma.conf.js, changed single run to true
26c3484
added server using express
58cd64d
updated server with const app to call express
a56efd5
added basic gulpfile
66e1913
Merge pull request #1 from vbenavente/folderstructure-gulpfileserver
vbenavente b406d39
client.js setup requiring angular and bunny folder
79cd342
bunny controller has needed properties
1903440
noBunny directive added to include only title link and description
7ce41a7
created template html files for each directive, thumbbunny directive …
ac89212
vicbunny directive complete with full size image
e50a1d9
nobunny directive html template created
47a6ef2
finished directive html templates
8732954
index.html complete!
551b0df
Merge pull request #2 from vbenavente/controllers-directives-template…
vbenavente 81e5912
now bundling all html files!
9724d34
Merge pull request #4 from vbenavente/fixpathway-issues
vbenavente 3eb40cf
renamed folders and changed appropriate files for better readability
e00a1d7
renamed folders to be album related, added photoalbum controller
b4c3eb6
Merge pull request #6 from vbenavente/photoalbum-controller-renamefol…
vbenavente 0643600
updated photoalbum directive, still need to work on controller property
ccbe50e
Merge pull request #7 from vbenavente/photoalbum-directives-templates
vbenavente da98e89
photoalbum directivejs added showthumb function and photoalbum direct…
b0314f1
still working on display, directives adjusted to show correct url
97b13f9
fixed full and thumb directives so photos appear
969b4cd
Merge pull request #8 from vbenavente/photoalbum-template-indexhtml
vbenavente 40674f4
radio buttons working!, still need to click on thumb to get full image
39cbc2f
added css to remove bullets, can click thumb to get full image
15f816e
Merge pull request #9 from vbenavente/radiobuttons-fullsimage-onclick
vbenavente 49613c3
updated package.json to start on server.js, added some css styling
19c4abe
Merge pull request #10 from vbenavente/addcss-styling
vbenavente aeead25
added mytest directive js and html for testing and test file
b6b966c
updated package.json updated gulpfile to create test bundle, required…
ace5fa1
Merge pull request #11 from vbenavente/directive-testing
vbenavente File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| **/node_modules/* | ||
| **/vendor/* | ||
| **/build/* | ||
| **/*.min.js | ||
| *.md | ||
| package.json | ||
| Procfile | ||
| npm-debug.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| node_modules | ||
| build | ||
| db | ||
| *_bundle.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| body { | ||
| background-color: #777777; | ||
| } | ||
|
|
||
| ul { | ||
| list-style-type: none; | ||
| background-color: #87CEEB; | ||
| margin: 5px, 0px, 5px, 0px; | ||
| width: 60%; | ||
| padding: 0px, 20px, 0px, 20px; | ||
| } | ||
|
|
||
| li { | ||
| display: inline-block; | ||
| } | ||
|
|
||
| img { | ||
| border: 4px solid #333333; | ||
| margin-top: 3px; | ||
| } | ||
|
|
||
| img:hover { | ||
| transform: scale(1.1); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="description" content=""> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
| <title>Photo Album</title> | ||
| <link rel="stylesheet" href="app.css"> | ||
| </head> | ||
| <body data-ng-app="PhotoAlbum"> | ||
| <main ng-cloak ng-controller="PhotoAlbumController as albumctrl"> | ||
| <photo-album photos="albumctrl.weimeraners.photos" title="{{albumctrl.weimeraners.title}}" description="{{albumctrl.weimeraners.description}}"></photo-album> | ||
| <photo-album photos="albumctrl.piglets.photos" title="{{albumctrl.piglets.title}}" description="{{albumctrl.piglets.description}}"></photo-album> | ||
| <photo-album photos="albumctrl.hedgehogs.photos" title="{{albumctrl.hedgehogs.title}}" description="{{albumctrl.hedgehogs.description}}"></photo-album> | ||
| </main> | ||
| <script src="bundle.js"></script> | ||
| </body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| 'use strict'; | ||
|
|
||
| const angular = require('angular'); | ||
| const app = angular.module('PhotoAlbum', []); | ||
|
|
||
| require('./photoalbum')(app); |
11 changes: 11 additions & 0 deletions
11
vic-bunny/app/js/photoalbum/controllers/bunny-controller.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| 'use strict'; | ||
|
|
||
| module.exports = function(app) { | ||
| app.controller('BunnyController', ['$scope', function() { | ||
| this.title = 'Vicious Bunny'; | ||
| this.height = 400; | ||
| this.width = 400; | ||
| this.description = 'Don\'t get too close or this vicious little monster will attack! This particular species can devour the average man in 13.7 seconds.'; | ||
| this.link = 'http://f.cl.ly/items/3g3J1G0w122M360w380O/3726490195_f7cc75d377_o.jpg'; | ||
| }]); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| module.exports = function(app) { | ||
| require('./bunny-controller')(app); | ||
| require('./photoalbum-controller')(app); | ||
| }; |
64 changes: 64 additions & 0 deletions
64
vic-bunny/app/js/photoalbum/controllers/photoalbum-controller.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| 'use strict'; | ||
|
|
||
| module.exports = function(app) { | ||
| app.controller('PhotoAlbumController', PhotoAlbumController); | ||
|
|
||
| function PhotoAlbumController() { | ||
| this.weimeraners = { | ||
| title: 'Weimeraner Puppies Photo Album', | ||
| description: 'Weimeraners are adorable!', | ||
| photos: [ | ||
| { | ||
| url:'https://www.greenfieldpuppies.com/wp-content/plugins/gfp/images/big/pup_x_1371865636_0.jpg', | ||
| alt:'Adorable Weimeraner 1' | ||
| }, | ||
| { | ||
| url:'http://tracieblue.com/last_litter/Blue%20Weimaraner%20Puppy%20Pink%201.jpg', | ||
| alt:'Adorable Weimeraner 2' | ||
| }, | ||
| { | ||
| url:'https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTJxJ1p4MBzwQBU6h3GFmieJOdfydtFhymksj4mCnE0FJwAij33rA', | ||
| alt:'Adorable Weimeraner 3' | ||
| } | ||
| ] | ||
| }; | ||
|
|
||
| this.piglets = { | ||
| title: 'Piglets Photo Album', | ||
| description: 'Piglets are too cute!', | ||
| photos: [ | ||
| { | ||
| url:'http://www.tehcute.com/pics/201307/piglet-keeping-cool.jpg', | ||
| alt:'Too Cute Piglet 1' | ||
| }, | ||
| { | ||
| url:'https://c2.staticflickr.com/6/5019/5476287563_ee1ab67638_z.jpg', | ||
| alt:'Too Cute Piglet 2' | ||
| }, | ||
| { | ||
| url:'http://justcuteanimals.com/wp-content/uploads/2014/09/cute-piglet-animal-pictures-pigs-piggies-pics.jpg', | ||
| alt:'Too Cute Piglet 3' | ||
| } | ||
| ] | ||
| }; | ||
|
|
||
| this.hedgehogs = { | ||
| title: 'Hedgehogs Photo Album', | ||
| description: 'Hedgehogs are Adorable!', | ||
| photos: [ | ||
| { | ||
| url:'https://s-media-cache-ak0.pinimg.com/236x/d5/65/75/d56575af0463fff19dc043545edceced.jpg', | ||
| alt:'Adorable Hedgehog 1' | ||
| }, | ||
| { | ||
| url:'http://justcuteanimals.com/wp-content/uploads/2012/11/cute-animal-skateboard-baby-hedgehog-table-pics.jpg', | ||
| alt:'Adorable Hedgehog 2' | ||
| }, | ||
| { | ||
| url:'http://40.media.tumblr.com/1e0315765429e4d2e5315a86bb176e02/tumblr_nmxdzmT3QD1ura9vuo1_500.jpg', | ||
| alt:'Adorable Hedgehog 3' | ||
| } | ||
| ] | ||
| }; | ||
| } | ||
| }; |
13 changes: 13 additions & 0 deletions
13
vic-bunny/app/js/photoalbum/directives/fullsize-directive.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| module.exports = function(app) { | ||
| app.directive('fullSize', function() { | ||
| return { | ||
| templateUrl: | ||
| './templates/photoalbum/fullsize-directive.html', | ||
| restrict: 'E', | ||
| scope: { | ||
| url: '=', | ||
| alt: '=' | ||
| } | ||
| }; | ||
| }); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| module.exports = function(app) { | ||
| require('./textonly-directive')(app); | ||
| require('./thumbsize-directive')(app); | ||
| require('./fullsize-directive')(app); | ||
| require('./photoalbum-directive')(app); | ||
| require('./mytest')(app); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| module.exports = function(app) { | ||
| app.directive('myTest', function() { | ||
| return { | ||
| templateUrl: './templates/photoalbum/mytest.html', | ||
| scope: { | ||
| data: '=' | ||
| }, | ||
| replace: true | ||
| }; | ||
| }); | ||
| }; |
31 changes: 31 additions & 0 deletions
31
vic-bunny/app/js/photoalbum/directives/photoalbum-directive.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| module.exports = function(app) { | ||
| app.directive('photoAlbum', function() { | ||
| return { | ||
| templateUrl: | ||
| './templates/photoalbum/photoalbum-directive.html', | ||
| restrict: 'E', | ||
| scope: { | ||
| title: '@', | ||
| description: '@', | ||
| photos: '=' | ||
| }, | ||
|
|
||
| controller:function($scope) { | ||
| $scope.mode = 'text'; | ||
| $scope.changeView = function() { | ||
| console.log($scope.mode); | ||
| }; | ||
|
|
||
| $scope.showThumbAsFull = function(photo) { | ||
| if(!photo) { | ||
| $scope.mode = 'thumb'; | ||
| return; | ||
| } | ||
|
|
||
| $scope.currentPhoto = photo; | ||
| $scope.mode = 'full'; | ||
| }; | ||
| } | ||
| }; | ||
| }); | ||
| }; |
14 changes: 14 additions & 0 deletions
14
vic-bunny/app/js/photoalbum/directives/textonly-directive.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| module.exports = function(app) { | ||
| app.directive('textOnly', function() { | ||
| return { | ||
| templateUrl: | ||
| './templates/photoalbum/textonly-directive.html', | ||
| restrict: 'E', | ||
| scope: { | ||
| title: '@', | ||
| link: '@', | ||
| description: '@' | ||
| } | ||
| }; | ||
| }); | ||
| }; |
13 changes: 13 additions & 0 deletions
13
vic-bunny/app/js/photoalbum/directives/thumbsize-directive.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| module.exports = function(app) { | ||
| app.directive('thumbSize', function() { | ||
| return { | ||
| templateUrl: | ||
| './templates/photoalbum/thumbsize-directive.html', | ||
| restrict: 'E', | ||
| scope: { | ||
| url: '=', | ||
| alt: '=' | ||
| } | ||
| }; | ||
| }); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| module.exports = function(app) { | ||
| require('./controllers')(app); | ||
| require('./directives')(app); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <li> | ||
| <img src="{{url}}" height="400" width="400" alt="{{alt}}"> | ||
| </li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <div> | ||
| <h2>{{data}}</h2> | ||
| </div> |
13 changes: 13 additions & 0 deletions
13
vic-bunny/app/templates/photoalbum/photoalbum-directive.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <div> | ||
| <ul ng-if="mode === 'text'"> | ||
| <text-only title="{{title}}" description="{{description}}"></text-only> | ||
| </ul> | ||
| <ul ng-if="mode === 'thumb'"> | ||
| <thumb-size url="photo.url" alt="photo.alt" ng-repeat="photo in photos" ng-click="showThumbAsFull(photo)"></thumb-size> | ||
| </ul> | ||
| <ul> | ||
| <full-size ng-if="mode === 'full'" url="currentPhoto.url" alt="photo.alt" ng-click="showThumbAsFull()"></full-size> | ||
| </ul> | ||
| <label>Table View<input type="radio" name="mode" value="text" ng-model="mode" ng-click="changeView()"/></label> | ||
| <label>Grid View<input type="radio" name="mode" value="thumb" ng-model="mode" ng-click="changeView()"/></label> | ||
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| <li> | ||
| <h1>{{title}}</h1> | ||
| <h3>{{description}}</h3> | ||
| </li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <li> | ||
| <img src="{{url}}" width="100" height="100" alt="{{alt}}"> | ||
| </li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| 'use strict'; | ||
|
|
||
| const gulp = require('gulp'); | ||
| const eslint = require('gulp-eslint'); | ||
| const webpack = require('webpack-stream'); | ||
|
|
||
| var files = ['*.js', './app/*.js', './app/js/*.js', './app/js/photoalbum/*.js', './app/js/photoalbum/controllers/*.js', './app/js/photoalbum/directives/*.js']; | ||
|
|
||
| const paths = { | ||
| js:__dirname + '/app/js/**/**/*.js', | ||
| html:__dirname + '/app/**/*.html', | ||
| css:__dirname + '/app/css/*.css' | ||
| }; | ||
|
|
||
| gulp.task('lint', () => { | ||
| return gulp.src(files) | ||
| .pipe(eslint()) | ||
| .pipe(eslint.format()); | ||
| }); | ||
|
|
||
| gulp.task('copy-html', () => { | ||
| return gulp.src(paths.html) | ||
| .pipe(gulp.dest(__dirname + '/build')); | ||
| }); | ||
|
|
||
| gulp.task('copy-css', () => { | ||
| return gulp.src(paths.css) | ||
| .pipe(gulp.dest(__dirname + '/build')); | ||
| }); | ||
|
|
||
| gulp.task('bundle', () => { | ||
| return gulp.src(paths.js) | ||
| .pipe(webpack({ | ||
| output: { | ||
| filename: 'bundle.js' | ||
| } | ||
| })) | ||
| .pipe(gulp.dest('./build')); | ||
| }); | ||
|
|
||
| gulp.task('bundle:test', () => { | ||
| return gulp.src('./test/**/*-test.js') | ||
| .pipe(webpack({ | ||
| output:{ | ||
| filename: 'test_bundle.js' | ||
| }, | ||
| module: { | ||
| loaders: [{ | ||
| test: /\.html$/, | ||
| loader: 'html' | ||
| }] | ||
| } | ||
| })).pipe(gulp.dest('./test')); | ||
| }); | ||
|
|
||
| gulp.task('default', ['bundle', 'copy-html', 'copy-css']); | ||
|
|
||
| gulp.task('watch', () => { | ||
| gulp.watch(paths.js, ['lint', 'bundle']); | ||
| gulp.watch(paths.html, ['copy-html']); | ||
| gulp.watch(paths.css, ['copy-css']); | ||
| }); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will work. But, since you have a client.js set up you should be using that to require in the rest if the js files.