Skip to content
Open

Test #31

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
7 changes: 7 additions & 0 deletions ruben/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**/node_modules/*
**/vendor/*
**/*.min.js
**/build/*
**/test/*_bundle*
*.md
package.json
45 changes: 45 additions & 0 deletions ruben/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"rules": {
"no-console": 0,
"indent": [
2,
2,
{
"SwitchCase": 1
}
],
"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"
}
1 change: 1 addition & 0 deletions ruben/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
build/
6 changes: 3 additions & 3 deletions ruben/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@


<h1>{{album.puppies.title}}</h1>
<h3>{{album.puppies.description}}</h1>
<h2>{{album.puppies.description}}</h2>
<album-directive photos="album.puppies.album"></album-directive>
<h1>{{album.koalas.title}}</h1>
<h3>{{album.koalas.description}}</h1>
<h2>{{album.koalas.description}}</h2>
<album-directive photos="album.koalas.album"></album-directive>
<h1>{{album.pandas.title}}</h1>
<h3>{{album.pandas.description}}</h1>
<h2>{{album.pandas.description}}</h2>
<album-directive photos="album.pandas.album"></album-directive>

</main>
Expand Down
4 changes: 2 additions & 2 deletions ruben/app/js/client.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const angular = require('angular');
// const angular = require('angular');

let ImageApp = angular.module('ImageApp', []);
var ImageApp = require('angular').module('ImageApp', []);
require('./first')(ImageApp);
6 changes: 3 additions & 3 deletions ruben/app/js/first/directives/TitleDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ module.exports = function(app) {
restrict: 'E',
templateUrl: './templates/title-image.html',
scope: {
title: '@',
url: '@',
description: '@'
title: '=',
url: '=',
description: '='
}
};
});
Expand Down
11 changes: 11 additions & 0 deletions ruben/app/js/first/directives/dummy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = function(app) {
app.directive('dummy', function() {
return {
templateUrl: './templates/dummy.html',
scope: {
data: '='
},
replace: true
};
});
};
1 change: 1 addition & 0 deletions ruben/app/js/first/directives/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ module.exports = function(app) {
require('./TitleDirective')(app);
require('./SmallDirective')(app);
require('./AlbumDirective')(app);
require('./dummy')(app);
};
6 changes: 6 additions & 0 deletions ruben/app/templates/album.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@

<lable>Full Image Album<input type="radio" name="mode" value="list" ng-model="mode" ng-change="changeView()"/></lable>
<lable>Small Image Album<input type="radio" name="mode" value="single" ng-model="mode" ng-change="changeView()"/></lable>


<div ng-hide="test">
<h1>{{title}}</h1>
<h2>{{description}}</h2>
</div>
3 changes: 3 additions & 0 deletions ruben/app/templates/dummy.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div>
<h2>{{data}}</h2>
</div>
4 changes: 4 additions & 0 deletions ruben/app/templates/full-image.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<div>
<div>
<h1>{{title}}</h1>
<h2>{{description}}</h2>
</div>
<img src="{{url}}" alt="">
</div>
6 changes: 5 additions & 1 deletion ruben/app/templates/small-image.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<div>
<div>
<h1>{{title}}</h1>
<h2>{{description}}</h2>
</div>
<img src="{{url}}" height= "100px" width="100px" alt="{{title}}">
</div
</div>
4 changes: 2 additions & 2 deletions ruben/app/templates/title-image.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div>
<h3>{{title}}</h3>
<h1>{{title}}</h1>
<h3>{{url}}</h3>
<h3>{{description}}</h3>
<h2>{{description}}</h2>
</div>
4 changes: 2 additions & 2 deletions ruben/build/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@

'use strict';

const angular = __webpack_require__(1);
// const angular = require('angular');

let ImageApp = angular.module('ImageApp', []);
var ImageApp = __webpack_require__(1).module('ImageApp', []);
__webpack_require__(3)(ImageApp);


Expand Down
6 changes: 3 additions & 3 deletions ruben/build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@


<h1>{{album.puppies.title}}</h1>
<h3>{{album.puppies.description}}</h1>
<h2>{{album.puppies.description}}</h2>
<album-directive photos="album.puppies.album"></album-directive>
<h1>{{album.koalas.title}}</h1>
<h3>{{album.koalas.description}}</h1>
<h2>{{album.koalas.description}}</h2>
<album-directive photos="album.koalas.album"></album-directive>
<h1>{{album.pandas.title}}</h1>
<h3>{{album.pandas.description}}</h1>
<h2>{{album.pandas.description}}</h2>
<album-directive photos="album.pandas.album"></album-directive>

</main>
Expand Down
6 changes: 6 additions & 0 deletions ruben/build/templates/album.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@

<lable>Full Image Album<input type="radio" name="mode" value="list" ng-model="mode" ng-change="changeView()"/></lable>
<lable>Small Image Album<input type="radio" name="mode" value="single" ng-model="mode" ng-change="changeView()"/></lable>


<div ng-hide="test">
<h1>{{title}}</h1>
<h2>{{description}}</h2>
</div>
4 changes: 4 additions & 0 deletions ruben/build/templates/full-image.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<div>
<div>
<h1>{{title}}</h1>
<h2>{{description}}</h2>
</div>
<img src="{{url}}" alt="">
</div>
6 changes: 5 additions & 1 deletion ruben/build/templates/small-image.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<div>
<div>
<h1>{{title}}</h1>
<h2>{{description}}</h2>
</div>
<img src="{{url}}" height= "100px" width="100px" alt="{{title}}">
</div
</div>
4 changes: 2 additions & 2 deletions ruben/build/templates/title-image.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div>
<h3>{{title}}</h3>
<h1>{{title}}</h1>
<h3>{{url}}</h3>
<h3>{{description}}</h3>
<h2>{{description}}</h2>
</div>
15 changes: 11 additions & 4 deletions ruben/gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use strict';
const gulp = require('gulp');
const webpack = require('webpack-stream');

Expand All @@ -23,19 +24,25 @@ gulp.task('bundle', () => {
});

gulp.task('bundle:test', () => {
return gulp.src(__dirname + '/test/*test.js')
return gulp.src('./test/**/*_test.js')
.pipe(webpack({
output: {
filename: 'test_bundle.js'
},
module: {
loaders: [{
test: /\.html$/,
loader: 'html'
}]
}
}))
.pipe(gulp.dest(__dirname + '/test'))
})).pipe(gulp.dest('./test'));
});

gulp.task('watch', () => {
gulp.watch(paths.html, ['copy']);
gulp.watch(paths.js, ['bundle']);
gulp.watch('./app/css/app.css', ['copy']);
gulp.watch('./test/**/*_test.js', ['bundle:test']);
});

gulp.task('default', ['bundle:test', 'bundle', 'copy',]);
gulp.task('default', ['bundle:test', 'bundle', 'copy']);
6 changes: 3 additions & 3 deletions ruben/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function(config) {

// list of files / patterns to load in the browser
files: [
'test/test_bundle.js'
'test/test_bundle.js'
],


Expand Down Expand Up @@ -65,5 +65,5 @@ module.exports = function(config) {
// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity
})
}
});
};
Loading