From 273106751a93e9bbcf7e709c3e4e107b5668ac01 Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Sun, 6 Mar 2016 01:28:41 +0100 Subject: [PATCH 01/41] add getPlaceholder function to Pub factory --- app/scripts/services/pub.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/scripts/services/pub.js b/app/scripts/services/pub.js index fc5f27b..62a7b68 100644 --- a/app/scripts/services/pub.js +++ b/app/scripts/services/pub.js @@ -14,6 +14,16 @@ angular.module('websiteApp') return { + getPlaceholder: function(placeholder, callback) { + $http.get(pubApi + '?placeholder=' + placeholder, { + cache: true + }) + .then(function(res) { + var data = shuffleArray(res.data); + callback(data); + }, Server.errorHandler); + }, + getCat: function(cat, callback) { $http.get(pubApi + '?category=' + cat, { cache: true From 16af4ddc1b69bacbcb5a74279606bab3cdb8dd4d Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Sun, 6 Mar 2016 01:48:30 +0100 Subject: [PATCH 02/41] create directive ts-pub-placeholder --- app/scripts/directives/tsPubPlaceholder.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 app/scripts/directives/tsPubPlaceholder.js diff --git a/app/scripts/directives/tsPubPlaceholder.js b/app/scripts/directives/tsPubPlaceholder.js new file mode 100644 index 0000000..27c720c --- /dev/null +++ b/app/scripts/directives/tsPubPlaceholder.js @@ -0,0 +1,18 @@ +'use strict'; + +angular.module('websiteApp') + .directive('tsPubPlaceholder', ['Pub', + function(Pub) { + return { + templateUrl: 'views/directives/pub/placeholder.html', + restrict: 'EACM', + scope: { + placeholderName: '=placeholder' + }, + link: function postLink(scope, element, attrs) { + var pubs = Pub.getPlaceholder(scope.placeholderName); + scope.horizontal = pubs[0]; + } + }; + } + ]); From 3ecc9322647731131d687aca5bb261752aafbbcb Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Sun, 6 Mar 2016 01:49:04 +0100 Subject: [PATCH 03/41] update templates to integrate the new ads directive --- app/views/blog.html | 10 ++++++++++ app/views/index.html | 10 ++++++++++ app/views/rankings.html | 10 ++++++++++ app/views/result.html | 12 +++++++++++- app/views/shop.html | 14 ++++++++++++++ app/views/skiclubs.html | 16 ++++++++++++++-- 6 files changed, 69 insertions(+), 3 deletions(-) diff --git a/app/views/blog.html b/app/views/blog.html index d6fe18d..85e29ab 100644 --- a/app/views/blog.html +++ b/app/views/blog.html @@ -1,3 +1,8 @@ +
+
+
+
+
@@ -70,3 +75,8 @@

+
+
+
+
+
diff --git a/app/views/index.html b/app/views/index.html index f41816e..3350fbc 100644 --- a/app/views/index.html +++ b/app/views/index.html @@ -1,6 +1,11 @@
+
+
+
+
+
@@ -50,3 +55,8 @@
+
+
+
+
+
diff --git a/app/views/rankings.html b/app/views/rankings.html index dddefd9..d247074 100644 --- a/app/views/rankings.html +++ b/app/views/rankings.html @@ -1,3 +1,8 @@ +
+
+
+
+
@@ -137,3 +142,8 @@
+
+
+
+
+
diff --git a/app/views/result.html b/app/views/result.html index bbd3583..92b6d50 100644 --- a/app/views/result.html +++ b/app/views/result.html @@ -1,3 +1,8 @@ +
+
+
+
+
@@ -28,4 +33,9 @@

.t { font-weight:bold; } -> + +
+
+
+
+
diff --git a/app/views/shop.html b/app/views/shop.html index d88a1bd..a927395 100644 --- a/app/views/shop.html +++ b/app/views/shop.html @@ -1,3 +1,8 @@ +
+
+
+
+
@@ -87,5 +92,14 @@ Ancien numéro
+ + +
+
+

+
+
+
+
diff --git a/app/views/skiclubs.html b/app/views/skiclubs.html index dcfadb9..33b4195 100644 --- a/app/views/skiclubs.html +++ b/app/views/skiclubs.html @@ -1,3 +1,8 @@ +
+
+
+
+
@@ -46,8 +51,15 @@

{{currentClub.title}}

Contactez-nous

-

+
+
+ +
+
-
+
+
+
+
From 613c6628e10349c54dc89800df5b1cfe848c0740 Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Sun, 6 Mar 2016 19:55:16 +0100 Subject: [PATCH 04/41] update ts-pub-placeholder directive --- app/scripts/directives/tsPubPlaceholder.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/scripts/directives/tsPubPlaceholder.js b/app/scripts/directives/tsPubPlaceholder.js index 27c720c..07dd7f5 100644 --- a/app/scripts/directives/tsPubPlaceholder.js +++ b/app/scripts/directives/tsPubPlaceholder.js @@ -6,12 +6,11 @@ angular.module('websiteApp') return { templateUrl: 'views/directives/pub/placeholder.html', restrict: 'EACM', - scope: { - placeholderName: '=placeholder' - }, + replace: true, link: function postLink(scope, element, attrs) { - var pubs = Pub.getPlaceholder(scope.placeholderName); - scope.horizontal = pubs[0]; + var pubs = Pub.getPlaceholder(attrs.placeholder); + scope.pubs = pubs; + console.log(pubs); } }; } From 9488af9a349ede00c3ad63a4353bf76cfa1a7d54 Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Sun, 6 Mar 2016 19:55:40 +0100 Subject: [PATCH 05/41] update index view --- app/views/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/index.html b/app/views/index.html index 3350fbc..67a0632 100644 --- a/app/views/index.html +++ b/app/views/index.html @@ -3,7 +3,7 @@
-
+
From 4899a541590c0e0266db4cb8459a022192643436 Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Sun, 6 Mar 2016 19:56:07 +0100 Subject: [PATCH 06/41] add placeholder view for directive --- app/views/directives/pub/placeholder.html | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 app/views/directives/pub/placeholder.html diff --git a/app/views/directives/pub/placeholder.html b/app/views/directives/pub/placeholder.html new file mode 100644 index 0000000..22d2a78 --- /dev/null +++ b/app/views/directives/pub/placeholder.html @@ -0,0 +1,5 @@ + From e139f73d8a15bbc50844cae9e98cd456f2a1c073 Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Sun, 6 Mar 2016 19:56:23 +0100 Subject: [PATCH 07/41] update index.html template --- app/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/app/index.html b/app/index.html index 81d9b8f..3af10b1 100644 --- a/app/index.html +++ b/app/index.html @@ -93,6 +93,7 @@ + From c1a247b7d8512b07abf2a4f8033a4b05c66dd14d Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Wed, 9 Mar 2016 00:47:36 +0100 Subject: [PATCH 08/41] rename tsPubPlaceholder to tsAdPlaceholder directive set scss style update index.html --- app/index.html | 2 +- app/scripts/directives/tsAdPlaceholder.js | 23 ++++++++++++++++ app/scripts/directives/tsPubPlaceholder.js | 17 ------------ app/scripts/services/pub.js | 13 ++++----- app/styles/main.scss | 32 ++++++++++++++++++++++ app/views/directives/core/placeholder.html | 5 ++++ app/views/directives/pub/placeholder.html | 5 ---- app/views/index.html | 8 ++---- 8 files changed, 69 insertions(+), 36 deletions(-) create mode 100644 app/scripts/directives/tsAdPlaceholder.js delete mode 100644 app/scripts/directives/tsPubPlaceholder.js create mode 100644 app/views/directives/core/placeholder.html delete mode 100644 app/views/directives/pub/placeholder.html diff --git a/app/index.html b/app/index.html index 3af10b1..a8a7da1 100644 --- a/app/index.html +++ b/app/index.html @@ -93,7 +93,7 @@ - + diff --git a/app/scripts/directives/tsAdPlaceholder.js b/app/scripts/directives/tsAdPlaceholder.js new file mode 100644 index 0000000..8ee7c56 --- /dev/null +++ b/app/scripts/directives/tsAdPlaceholder.js @@ -0,0 +1,23 @@ +'use strict'; + +angular.module('websiteApp') + .directive('tsAdPlaceholder', ['Pub', + function(Pub) { + return { + templateUrl: 'views/directives/core/placeholder.html', + restrict: 'EACM', + replace: true, + link: function postLink(scope, element, attrs) { + var pubs = Pub.getPlaceholder( + attrs.placeholder, + attrs.category, + function (pubs) { + scope.ad = pubs[0]; + scope.cat = attrs.category; + console.log(pubs); + } + ); + } + }; + } + ]); diff --git a/app/scripts/directives/tsPubPlaceholder.js b/app/scripts/directives/tsPubPlaceholder.js deleted file mode 100644 index 07dd7f5..0000000 --- a/app/scripts/directives/tsPubPlaceholder.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -angular.module('websiteApp') - .directive('tsPubPlaceholder', ['Pub', - function(Pub) { - return { - templateUrl: 'views/directives/pub/placeholder.html', - restrict: 'EACM', - replace: true, - link: function postLink(scope, element, attrs) { - var pubs = Pub.getPlaceholder(attrs.placeholder); - scope.pubs = pubs; - console.log(pubs); - } - }; - } - ]); diff --git a/app/scripts/services/pub.js b/app/scripts/services/pub.js index 62a7b68..90e3993 100644 --- a/app/scripts/services/pub.js +++ b/app/scripts/services/pub.js @@ -14,14 +14,13 @@ angular.module('websiteApp') return { - getPlaceholder: function(placeholder, callback) { - $http.get(pubApi + '?placeholder=' + placeholder, { + getPlaceholder: function(placeholder, cat, callback) { + $http.get(pubApi + '?placeholder=' + placeholder + '&category=' + cat, { cache: true - }) - .then(function(res) { - var data = shuffleArray(res.data); - callback(data); - }, Server.errorHandler); + }).then(function(res) { + var data = shuffleArray(res.data); + callback(data); + }, Server.errorHandler); }, getCat: function(cat, callback) { diff --git a/app/styles/main.scss b/app/styles/main.scss index 8d16223..c29852b 100644 --- a/app/styles/main.scss +++ b/app/styles/main.scss @@ -213,3 +213,35 @@ article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,su font-weight: bold; background-color: $lightgray; } + +/***** ADS ****/ +$ads_categories: ( + square: ( + width: 300px, + height: 250px, + ), + vertical: ( + width: 120px, + height: 600px, + ), + horizontal: ( + width: 468px, + height: 90px, + ), +); + +@each $category, $dimensions in $ads_categories { + .ad_block_#{$category} { + margin: 1px; + + .ad_image_#{$category} { + @each $property, $value in $dimensions { + #{$property}: #{$value}; + } + } + } +} + +.ad_block_horizontal { + margin: 20px auto; +} diff --git a/app/views/directives/core/placeholder.html b/app/views/directives/core/placeholder.html new file mode 100644 index 0000000..f022d17 --- /dev/null +++ b/app/views/directives/core/placeholder.html @@ -0,0 +1,5 @@ + diff --git a/app/views/directives/pub/placeholder.html b/app/views/directives/pub/placeholder.html deleted file mode 100644 index 22d2a78..0000000 --- a/app/views/directives/pub/placeholder.html +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/app/views/index.html b/app/views/index.html index 67a0632..770d35b 100644 --- a/app/views/index.html +++ b/app/views/index.html @@ -1,11 +1,7 @@
-
-
-
-
-
+
@@ -57,6 +53,6 @@
-
+
From ccd54efbac418db61f046dc917f865cd26a7e95f Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Wed, 9 Mar 2016 23:41:36 +0100 Subject: [PATCH 09/41] update ads blocks to use new ad placeholder directive --- app/index.html | 6 ++++-- app/views/blog.html | 12 ++++++------ app/views/index.html | 6 +++++- app/views/news.html | 10 ++++++++++ app/views/rankings.html | 12 ++++++------ app/views/result.html | 12 ++++++------ app/views/shop.html | 12 ++++++------ app/views/skiclubs.html | 12 ++++++------ 8 files changed, 49 insertions(+), 33 deletions(-) diff --git a/app/index.html b/app/index.html index a8a7da1..c51bab2 100644 --- a/app/index.html +++ b/app/index.html @@ -35,9 +35,11 @@
-
+ +
-
+
+
diff --git a/app/views/blog.html b/app/views/blog.html index 85e29ab..1707561 100644 --- a/app/views/blog.html +++ b/app/views/blog.html @@ -1,8 +1,6 @@ -
-
-
-
-
+ +
+
@@ -75,8 +73,10 @@

+
-
+
+ diff --git a/app/views/index.html b/app/views/index.html index 770d35b..440f094 100644 --- a/app/views/index.html +++ b/app/views/index.html @@ -1,7 +1,9 @@
-
+ +
+
@@ -51,8 +53,10 @@
+
+ diff --git a/app/views/news.html b/app/views/news.html index a753eb2..36251ab 100644 --- a/app/views/news.html +++ b/app/views/news.html @@ -1,3 +1,6 @@ + +
+
@@ -30,3 +33,10 @@

+ +
+
+
+
+
+ diff --git a/app/views/rankings.html b/app/views/rankings.html index d247074..3fbdcab 100644 --- a/app/views/rankings.html +++ b/app/views/rankings.html @@ -1,8 +1,6 @@ -
-
-
-
-
+ +
+
@@ -142,8 +140,10 @@
+
-
+
+ diff --git a/app/views/result.html b/app/views/result.html index 92b6d50..587a31d 100644 --- a/app/views/result.html +++ b/app/views/result.html @@ -1,8 +1,6 @@ -
-
-
-
-
+ +
+
@@ -34,8 +32,10 @@

font-weight:bold; } +
-
+
+ diff --git a/app/views/shop.html b/app/views/shop.html index a927395..fe85b6b 100644 --- a/app/views/shop.html +++ b/app/views/shop.html @@ -1,8 +1,6 @@ -
-
-
-
-
+ +
+
@@ -98,8 +96,10 @@
+
-
+
+ diff --git a/app/views/skiclubs.html b/app/views/skiclubs.html index 33b4195..fbc5b67 100644 --- a/app/views/skiclubs.html +++ b/app/views/skiclubs.html @@ -1,8 +1,6 @@ -
-
-
-
-
+ +
+
@@ -58,8 +56,10 @@

{{currentClub.title}}

+
-
+
+ From 97a326daa0588d40f542c20973f166c74425443b Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Wed, 9 Mar 2016 23:55:55 +0100 Subject: [PATCH 10/41] add min-width rule to tsAdPlaceholder directive --- app/scripts/directives/tsAdPlaceholder.js | 25 ++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/app/scripts/directives/tsAdPlaceholder.js b/app/scripts/directives/tsAdPlaceholder.js index 8ee7c56..f4d6252 100644 --- a/app/scripts/directives/tsAdPlaceholder.js +++ b/app/scripts/directives/tsAdPlaceholder.js @@ -1,22 +1,41 @@ 'use strict'; angular.module('websiteApp') - .directive('tsAdPlaceholder', ['Pub', - function(Pub) { + .directive('tsAdPlaceholder', ['$window', 'Pub', + function($window, Pub) { return { templateUrl: 'views/directives/core/placeholder.html', restrict: 'EACM', replace: true, + scope: { + width: '=?minWidth', + }, link: function postLink(scope, element, attrs) { + + var checkWidth = function(width) { + var width = width; + return function() { + if (width >= window.innerWidth) { + element.css('display', 'none'); + } + else { + element.css('display', 'block'); + } + }; + }; + checkWidth = checkWidth(scope.width); + checkWidth(); + var pubs = Pub.getPlaceholder( attrs.placeholder, attrs.category, function (pubs) { scope.ad = pubs[0]; scope.cat = attrs.category; - console.log(pubs); } ); + + angular.element($window).on('resize', checkWidth); } }; } From 38a17f5f9e8161bc437460e5d4ff68c558da7195 Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Wed, 9 Mar 2016 23:56:15 +0100 Subject: [PATCH 11/41] change min-width value for ts-ad-placeholder --- app/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/index.html b/app/index.html index c51bab2..daaa5e7 100644 --- a/app/index.html +++ b/app/index.html @@ -38,7 +38,7 @@
-
+
From a2002633af51ba8c5521e7bce9f4ddf46807d36b Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Thu, 10 Mar 2016 00:27:15 +0100 Subject: [PATCH 12/41] renamed placeholder actu-side to sides for sky scrapper ads on sides --- app/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/index.html b/app/index.html index daaa5e7..a79b803 100644 --- a/app/index.html +++ b/app/index.html @@ -36,9 +36,9 @@
-
+
-
+
From a22cd04b041c93968a7f9318e35b4c315ee07b56 Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Thu, 10 Mar 2016 00:28:04 +0100 Subject: [PATCH 13/41] add ng-hide directive to show ad section only if an ad is defined --- app/views/directives/core/placeholder.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/directives/core/placeholder.html b/app/views/directives/core/placeholder.html index f022d17..2a7b6f2 100644 --- a/app/views/directives/core/placeholder.html +++ b/app/views/directives/core/placeholder.html @@ -1,4 +1,4 @@ -
+
From aed68977044d3b4dd15ee9fef15d0b70944cfa6a Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Wed, 6 Jul 2016 18:46:13 +0200 Subject: [PATCH 14/41] add a first version of gulp file --- gulpfile.js | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 gulpfile.js diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..26de9ca --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,74 @@ +var gulp = require('gulp'); + +// Load plugins +var $ = require('gulp-load-plugin')({camelize: true}); +var server = $.tinyLr(); + +gulp.task('styles', function () { + return gulp.src('app/styles/main.scss') + .pipe($.sass({ + style: 'expanded', + loadPath: ['app/bower_components'] + })) + .pipe($.livereload(server)) + .pipe($.autoprefixer('last 1 version')) + .pipe($.csso()) + .pipe(gulp.dest('dist/styles')) + .pipe($.size()); +}); + +gulp.task('scripts', function () { + return gulp.src('app/scripts/**/*.js') + .pipe($.jshint('.jshintrc')) + .pipe($.jshint.reporter('default')) + .pipe($.concat('main.js')) + .pipe($.livereload(server)) + .pipe($.uglify()) + .pipe(gulp.dest('dist/scripts')) + .pipe($.size()); +}); + +gulp.task('images', function () { + return gulp.src('app/images/**/*') + .pipe($.livereload(server)) + .pipe($.cache($.imagemin({ + optimizationLevel: 3, + progressive: true, + interlaced: true + }))) + .pipe(gulp.dest('dist/images')) + .pipe($.size()); +}); + +gulp.task('watch', function () { + // Listen on port 35729 + server.listen(35729, function (err) { + if (err) { + return console.error(err); + }; + + // Watch .html files + gulp.watch('app/*.html'); + + // Watch .scss files + gulp.watch('app/styles/**/*.scss', ['styles']); + + // Watch .js files + gulp.watch('app/scripts/**/*.js', ['scripts']); + + // Watch image files + gulp.watch('app/images/**/*', ['images']); + }); +}); + +gulp.task('clean', function () { + return gulp.src(['dist/styles', 'dist/scripts', 'dist/images'], {read: false}).pipe($.clean()); +}); + +// Build +gulp.task('build', ['html', 'styles', 'scripts', 'images']); + +// Default task +gulp.task('default', ['clean'], function () { + gulp.start('build'); +}); From 6e8d517ba354d62224e80d7515f891198fe460c3 Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Thu, 7 Jul 2016 17:02:43 +0200 Subject: [PATCH 15/41] config gulp file and refresh of npm packages --- gulpfile.js | 91 +++++++++++++++++++++++++--------------------------- package.json | 49 +++++++++++++--------------- 2 files changed, 65 insertions(+), 75 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 26de9ca..cd6e777 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,8 +1,29 @@ var gulp = require('gulp'); // Load plugins -var $ = require('gulp-load-plugin')({camelize: true}); -var server = $.tinyLr(); +var $ = require('gulp-load-plugins')(); + + +gulp.task('connectDev', function () { + $.connect.server({ + root: ['app', 'tmp'], + port: 8000, + livereload: true + }); +}); + +gulp.task('connectDist', function () { + $.connect.server({ + root: 'dist', + port: 8001, + livereload: true + }); +}); + +gulp.task('html', function () { + return gulp.src('app/*.html') + .pipe($.connect.reload()); +}); gulp.task('styles', function () { return gulp.src('app/styles/main.scss') @@ -10,65 +31,39 @@ gulp.task('styles', function () { style: 'expanded', loadPath: ['app/bower_components'] })) - .pipe($.livereload(server)) - .pipe($.autoprefixer('last 1 version')) - .pipe($.csso()) + .pipe(gulp.dest('app/styles')) + .pipe($.minifycss()) .pipe(gulp.dest('dist/styles')) - .pipe($.size()); + .pipe($.connect.reload()); }); -gulp.task('scripts', function () { - return gulp.src('app/scripts/**/*.js') - .pipe($.jshint('.jshintrc')) - .pipe($.jshint.reporter('default')) - .pipe($.concat('main.js')) - .pipe($.livereload(server)) - .pipe($.uglify()) - .pipe(gulp.dest('dist/scripts')) - .pipe($.size()); -}); - -gulp.task('images', function () { - return gulp.src('app/images/**/*') - .pipe($.livereload(server)) - .pipe($.cache($.imagemin({ - optimizationLevel: 3, - progressive: true, - interlaced: true - }))) - .pipe(gulp.dest('dist/images')) - .pipe($.size()); +gulp.task('scripts', function() { + return gulp.src(['app/scripts/*.js', 'app/scripts/**/*.js']) + .pipe($.uglify('app.min.js', { + outSourceMap: true + })) + .pipe(gulp.dest('dist/scripts')); + .pipe($.connect.reload()); }); gulp.task('watch', function () { - // Listen on port 35729 - server.listen(35729, function (err) { - if (err) { - return console.error(err); - }; + // Watch .html files + gulp.watch(['app/*.html'], ['html']); - // Watch .html files - gulp.watch('app/*.html'); + // Watch .scss files + gulp.watch(['app/styles/**/*.scss'], ['styles']); - // Watch .scss files - gulp.watch('app/styles/**/*.scss', ['styles']); - - // Watch .js files - gulp.watch('app/scripts/**/*.js', ['scripts']); - - // Watch image files - gulp.watch('app/images/**/*', ['images']); - }); + // Watch .js files + gulp.watch(['app/scripts/*.js', 'app/scripts/**/*.js'], ['scripts']); }); gulp.task('clean', function () { - return gulp.src(['dist/styles', 'dist/scripts', 'dist/images'], {read: false}).pipe($.clean()); + return gulp.src(['dist'], {read: false}) + .pipe($.clean()); }); // Build -gulp.task('build', ['html', 'styles', 'scripts', 'images']); +gulp.task('build', ['clean', 'html', 'styles', 'scripts']); // Default task -gulp.task('default', ['clean'], function () { - gulp.start('build'); -}); +gulp.task('default', ['clean', 'build', 'connectDev', 'watch']); diff --git a/package.json b/package.json index 10faf00..2ce6988 100644 --- a/package.json +++ b/package.json @@ -1,34 +1,29 @@ { "name": "website", "version": "0.0.0", + "description": "website =======", + "main": "Gruntfile.js", + "directories": { + "test": "test" + }, "dependencies": {}, "devDependencies": { - "grunt": "~0.4.1", - "grunt-autoprefixer": "~0.4.0", - "grunt-bower-install": "~1.0.0", - "grunt-concurrent": "~0.5.0", - "grunt-contrib-clean": "~0.5.0", - "grunt-contrib-compass": "~0.7.2", - "grunt-contrib-concat": "~0.3.0", - "grunt-contrib-connect": "~0.5.0", - "grunt-contrib-copy": "~0.4.1", - "grunt-contrib-cssmin": "~0.7.0", - "grunt-contrib-htmlmin": "~0.1.3", - "grunt-contrib-imagemin": "~0.3.0", - "grunt-contrib-jshint": "~0.7.1", - "grunt-contrib-uglify": "~0.2.0", - "grunt-contrib-watch": "~0.5.2", - "grunt-google-cdn": "~0.2.0", - "grunt-newer": "~0.6.1", - "grunt-ngmin": "~0.0.2", - "grunt-rev": "~0.1.0", - "grunt-svgmin": "~0.2.0", - "grunt-usemin": "~2.0.0", - "jshint-stylish": "~0.1.3", - "load-grunt-tasks": "~0.4.0", - "time-grunt": "~0.2.1" + "gulp-clean": "^0.3.2", + "gulp-connect": "^4.1.0", + "gulp-imagemin": "^3.0.1", + "gulp-load-plugins": "^1.2.4", + "gulp-minify-css": "^1.2.4", + "gulp-sass": "^2.3.2", + "gulp-uglify": "^1.5.4" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://diadzine@bitbucket.org/ab_tooskich/website.git" }, - "engines": { - "node": ">=0.10.0" - } + "author": "", + "license": "ISC", + "homepage": "https://bitbucket.org/ab_tooskich/website#readme" } From 18131ec51cb0752b7860fbb013dc0c9fe99995e7 Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Fri, 8 Jul 2016 17:13:53 +0200 Subject: [PATCH 16/41] add app/styles/main.css to ignored files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7911b28..1be1b1e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ dist .tmp .sass-cache app/bower_components +app/styles/main.css From 06ee97b5ac758250a3fd2a2617617d1a7490576b Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Fri, 8 Jul 2016 17:14:26 +0200 Subject: [PATCH 17/41] add gulp bower task and npm packages --- gulpfile.js | 42 +++++++++++++++++++++++++++++------------- package.json | 3 ++- 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index cd6e777..89a158e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -3,6 +3,14 @@ var gulp = require('gulp'); // Load plugins var $ = require('gulp-load-plugins')(); +// Config +var config = { +
 bowerDir: './app/bower_components'
, +
 cssPath: './dist/styles', +
 htmlPath: './app', +
 jsPath: './app/scripts', +
 sassPath: './app/styles', +} gulp.task('connectDev', function () { $.connect.server({ @@ -20,41 +28,49 @@ gulp.task('connectDist', function () { }); }); +gulp.task('bower', function() {
 + return $.bower() +
 .pipe(gulp.dest(config.bowerDir))
; +}); + gulp.task('html', function () { - return gulp.src('app/*.html') + return gulp.src(config.htmlPath + '/*.html') .pipe($.connect.reload()); }); gulp.task('styles', function () { - return gulp.src('app/styles/main.scss') + return gulp.src(config.sassPath + '/main.scss') .pipe($.sass({ - style: 'expanded', - loadPath: ['app/bower_components'] + style: 'expanded', + loadPath: [ + config.sassPath, + config.bowerDir + ] })) - .pipe(gulp.dest('app/styles')) - .pipe($.minifycss()) - .pipe(gulp.dest('dist/styles')) + .pipe(gulp.dest(config.sassPath)) + .pipe($.cleanCss()) + .pipe(gulp.dest(config.cssPath)) .pipe($.connect.reload()); }); gulp.task('scripts', function() { - return gulp.src(['app/scripts/*.js', 'app/scripts/**/*.js']) + return gulp.src([config.jsPath + '/*.js', config.jsPath + '/**/*.js']) .pipe($.uglify('app.min.js', { outSourceMap: true })) - .pipe(gulp.dest('dist/scripts')); + .pipe(gulp.dest('dist/scripts')) .pipe($.connect.reload()); }); gulp.task('watch', function () { // Watch .html files - gulp.watch(['app/*.html'], ['html']); + gulp.watch([config.htmlPath + '/*.html'], ['html']); // Watch .scss files - gulp.watch(['app/styles/**/*.scss'], ['styles']); + gulp.watch([config.sassPath + '/**/*.scss'], ['styles']); // Watch .js files - gulp.watch(['app/scripts/*.js', 'app/scripts/**/*.js'], ['scripts']); + gulp.watch([config.jsPath + '/*.js', config.jsPath + '/**/*.js'], ['scripts']); }); gulp.task('clean', function () { @@ -63,7 +79,7 @@ gulp.task('clean', function () { }); // Build -gulp.task('build', ['clean', 'html', 'styles', 'scripts']); +gulp.task('build', ['clean', 'bower', 'html', 'styles', 'scripts']); // Default task gulp.task('default', ['clean', 'build', 'connectDev', 'watch']); diff --git a/package.json b/package.json index 2ce6988..589218b 100644 --- a/package.json +++ b/package.json @@ -8,11 +8,12 @@ }, "dependencies": {}, "devDependencies": { + "gulp-bower": "0.0.13", "gulp-clean": "^0.3.2", + "gulp-clean-css": "^2.0.11", "gulp-connect": "^4.1.0", "gulp-imagemin": "^3.0.1", "gulp-load-plugins": "^1.2.4", - "gulp-minify-css": "^1.2.4", "gulp-sass": "^2.3.2", "gulp-uglify": "^1.5.4" }, From f73581a5b7af493ce796d1557101fef160187fa0 Mon Sep 17 00:00:00 2001 From: diadzine Date: Mon, 11 Jul 2016 09:07:56 +0200 Subject: [PATCH 18/41] update gulp file with images and fonts management --- gulpfile.js | 35 +++++++++++++++++++++++++++++------ package.json | 2 ++ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 89a158e..3c04a6b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -6,8 +6,11 @@ var $ = require('gulp-load-plugins')(); // Config var config = { 
 bowerDir: './app/bower_components'
, + buildPath: './dist', 
 cssPath: './dist/styles', + fontsPath: './app/fonts', 
 htmlPath: './app', + imagesPath: './app/images', 
 jsPath: './app/scripts', 
 sassPath: './app/styles', } @@ -15,7 +18,7 @@ var config = { gulp.task('connectDev', function () { $.connect.server({ root: ['app', 'tmp'], - port: 8000, + port: 8001, livereload: true }); }); @@ -23,7 +26,7 @@ gulp.task('connectDev', function () { gulp.task('connectDist', function () { $.connect.server({ root: 'dist', - port: 8001, + port: 8002, livereload: true }); }); @@ -38,6 +41,13 @@ gulp.task('html', function () { .pipe($.connect.reload()); }); +gulp.task('fonts', function () { + return gulp.src(config.fontsPath + '/*.ttf') + .pipe(gulp.dest(config.sassPath)) + .pipe(gulp.dest(config.buildPath + '/fonts')) + .pipe($.connect.reload()); +}); + gulp.task('styles', function () { return gulp.src(config.sassPath + '/main.scss') .pipe($.sass({ @@ -53,33 +63,46 @@ gulp.task('styles', function () { .pipe($.connect.reload()); }); -gulp.task('scripts', function() { +gulp.task('scripts', function () { return gulp.src([config.jsPath + '/*.js', config.jsPath + '/**/*.js']) .pipe($.uglify('app.min.js', { outSourceMap: true })) - .pipe(gulp.dest('dist/scripts')) + .pipe(gulp.dest(config.buildPath + '/scripts')) + .pipe($.connect.reload()); +}); + +gulp.task('images', function () { + return gulp.src(config.imagesPath + '/*') + .pipe($.image()) + .pipe(gulp.dest(config.buildPath + '/images')) .pipe($.connect.reload()); }); gulp.task('watch', function () { + // Watch font files + gulp.watch([config.fontsPath + '/*'], ['fonts']); + // Watch .html files gulp.watch([config.htmlPath + '/*.html'], ['html']); // Watch .scss files gulp.watch([config.sassPath + '/**/*.scss'], ['styles']); + // Watch images + gulp.watch([config.imagesPath + '/*'], ['images']); + // Watch .js files gulp.watch([config.jsPath + '/*.js', config.jsPath + '/**/*.js'], ['scripts']); }); gulp.task('clean', function () { - return gulp.src(['dist'], {read: false}) + return gulp.src([config.buildPath], {read: false}) .pipe($.clean()); }); // Build -gulp.task('build', ['clean', 'bower', 'html', 'styles', 'scripts']); +gulp.task('build', ['clean', 'bower', 'fonts', 'html', 'styles', 'scripts', 'images']); // Default task gulp.task('default', ['clean', 'build', 'connectDev', 'watch']); diff --git a/package.json b/package.json index 589218b..779b950 100644 --- a/package.json +++ b/package.json @@ -8,10 +8,12 @@ }, "dependencies": {}, "devDependencies": { + "gulp": "^3.9.1", "gulp-bower": "0.0.13", "gulp-clean": "^0.3.2", "gulp-clean-css": "^2.0.11", "gulp-connect": "^4.1.0", + "gulp-image": "^2.0.1", "gulp-imagemin": "^3.0.1", "gulp-load-plugins": "^1.2.4", "gulp-sass": "^2.3.2", From 6e0bc0d0a999eca0254d1df03d5d46d95e428b0f Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Mon, 11 Jul 2016 17:26:53 +0200 Subject: [PATCH 19/41] add recipes for images, misc, html, and others and new npm packages --- app/index.html | 7 ++-- gulpfile.js | 94 +++++++++++++++++++++++++++++++++++--------------- package.json | 11 ++++-- 3 files changed, 77 insertions(+), 35 deletions(-) diff --git a/app/index.html b/app/index.html index ae32c27..8875785 100644 --- a/app/index.html +++ b/app/index.html @@ -11,13 +11,10 @@ - + - - - @@ -85,7 +82,7 @@ - + diff --git a/gulpfile.js b/gulpfile.js index 3c04a6b..1b0b5da 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -36,18 +36,44 @@ gulp.task('bower', function() {
 
 .pipe(gulp.dest(config.bowerDir))
; }); -gulp.task('html', function () { - return gulp.src(config.htmlPath + '/*.html') - .pipe($.connect.reload()); +gulp.task('bower-components', function() {
 + return gulp.src(config.htmlPath + '/bower_components/**/*') +
 .pipe(gulp.dest(config.buildPath + '/bower_components'))
; }); gulp.task('fonts', function () { return gulp.src(config.fontsPath + '/*.ttf') - .pipe(gulp.dest(config.sassPath)) .pipe(gulp.dest(config.buildPath + '/fonts')) .pipe($.connect.reload()); }); +gulp.task('html', function () { + return gulp.src([ + config.htmlPath + '/**/*.html', + '!' + config.htmlPath + '/bower_components/**/*.html' + ]) + .pipe($.useref()) + .pipe($.if('*.js', $.uglify())) + .pipe($.if('*.css', $.cleanCss())) + .pipe(gulp.dest(config.buildPath)) + .pipe($.connect.reload()); +}); + +gulp.task('images', function () { + return gulp.src([config.imagesPath + '/**/*.{gif,ico,jpg,png,svg}']) + .pipe(gulp.dest(config.buildPath + '/images')) + .pipe($.connect.reload()); +}); + +gulp.task('misc', function () { + return gulp.src([ + config.htmlPath + '/favicon.ico', + config.htmlPath + '/robots.txt' + ]) + .pipe($.cache(gulp.dest(config.buildPath))) + .pipe($.connect.reload()); +}); + gulp.task('styles', function () { return gulp.src(config.sassPath + '/main.scss') .pipe($.sass({ @@ -57,25 +83,18 @@ gulp.task('styles', function () { config.bowerDir ] })) - .pipe(gulp.dest(config.sassPath)) + .pipe($.cache(gulp.dest(config.sassPath))) .pipe($.cleanCss()) - .pipe(gulp.dest(config.cssPath)) + .pipe($.cache(gulp.dest(config.cssPath))) .pipe($.connect.reload()); }); gulp.task('scripts', function () { - return gulp.src([config.jsPath + '/*.js', config.jsPath + '/**/*.js']) - .pipe($.uglify('app.min.js', { - outSourceMap: true - })) - .pipe(gulp.dest(config.buildPath + '/scripts')) - .pipe($.connect.reload()); -}); - -gulp.task('images', function () { - return gulp.src(config.imagesPath + '/*') - .pipe($.image()) - .pipe(gulp.dest(config.buildPath + '/images')) + return gulp.src(config.jsPath + '/**/*.js') + .pipe($.concat('scripts.js')) + .pipe($.rename({suffix: '.min'})) + .pipe($.uglify()) + .pipe($.cache(gulp.dest(config.buildPath + '/scripts'))) .pipe($.connect.reload()); }); @@ -84,25 +103,44 @@ gulp.task('watch', function () { gulp.watch([config.fontsPath + '/*'], ['fonts']); // Watch .html files - gulp.watch([config.htmlPath + '/*.html'], ['html']); + gulp.watch([ + config.htmlPath + '/**/*.html', + config.htmlPath + '/favicon.ico', + config.htmlPath + '/robots.txt' + ], ['html']); + + // Watch images + gulp.watch([config.imagesPath + '/**/*.{gif,ico,jpg,png,svg}'], ['images']); + + // Watch misc files + gulp.watch([ + config.htmlPath + '/favicon.ico', + config.htmlPath + '/robots.txt' + ], ['misc']); // Watch .scss files gulp.watch([config.sassPath + '/**/*.scss'], ['styles']); - // Watch images - gulp.watch([config.imagesPath + '/*'], ['images']); - // Watch .js files - gulp.watch([config.jsPath + '/*.js', config.jsPath + '/**/*.js'], ['scripts']); + gulp.watch(config.jsPath + '/**/*.js', ['scripts']); }); -gulp.task('clean', function () { - return gulp.src([config.buildPath], {read: false}) - .pipe($.clean()); +gulp.task('clean-cache', function () { + return $.cache.clearAll(); +}); + +gulp.task('clean', ['clean-cache'], function () { + return gulp.src(config.buildPath + '/*', {read: false}) + .pipe($.rimraf()); }); // Build -gulp.task('build', ['clean', 'bower', 'fonts', 'html', 'styles', 'scripts', 'images']); +gulp.task('build', ['clean'], function () { + gulp.run('bower', 'fonts', 'html', 'images', 'styles', 'scripts'); +}); + +// Dist serve +gulp.task('serve', ['connectDist', 'bower-components', 'fonts', 'html', 'images', 'styles', 'scripts']); // Default task -gulp.task('default', ['clean', 'build', 'connectDev', 'watch']); +gulp.task('default', ['connectDev', 'bower', 'fonts', 'html', 'images', 'styles', 'scripts', 'watch']); diff --git a/package.json b/package.json index 779b950..ebefe9c 100644 --- a/package.json +++ b/package.json @@ -10,14 +10,21 @@ "devDependencies": { "gulp": "^3.9.1", "gulp-bower": "0.0.13", - "gulp-clean": "^0.3.2", + "gulp-cache": "^0.4.5", "gulp-clean-css": "^2.0.11", + "gulp-concat": "^2.6.0", "gulp-connect": "^4.1.0", + "gulp-copy": "0.0.2", + "gulp-if": "^2.0.1", "gulp-image": "^2.0.1", "gulp-imagemin": "^3.0.1", "gulp-load-plugins": "^1.2.4", + "gulp-notify": "^2.2.0", + "gulp-rename": "^1.2.2", + "gulp-rimraf": "^0.2.0", "gulp-sass": "^2.3.2", - "gulp-uglify": "^1.5.4" + "gulp-uglify": "^1.5.4", + "gulp-useref": "^3.1.0" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" From bc18043fc21bae0189a404d425a375360cb1e84c Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Tue, 12 Jul 2016 12:44:32 +0200 Subject: [PATCH 20/41] add gulp autoprefixer, rev and rev-replace npm packages --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index ebefe9c..f81be3f 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "dependencies": {}, "devDependencies": { "gulp": "^3.9.1", + "gulp-autoprefixer": "^3.1.0", "gulp-bower": "0.0.13", "gulp-cache": "^0.4.5", "gulp-clean-css": "^2.0.11", @@ -21,6 +22,8 @@ "gulp-load-plugins": "^1.2.4", "gulp-notify": "^2.2.0", "gulp-rename": "^1.2.2", + "gulp-rev": "^7.1.0", + "gulp-rev-replace": "^0.4.3", "gulp-rimraf": "^0.2.0", "gulp-sass": "^2.3.2", "gulp-uglify": "^1.5.4", From f7ea0c2c9ab42b0889bb43c723b2ed4923cd753b Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Tue, 12 Jul 2016 12:45:10 +0200 Subject: [PATCH 21/41] update gulp file --- gulpfile.js | 49 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 1b0b5da..23601dc 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -83,19 +83,46 @@ gulp.task('styles', function () { config.bowerDir ] })) + .pipe($.autoprefixer({ + browsers: ['last 2 versions'], + cascade: false + })) .pipe($.cache(gulp.dest(config.sassPath))) .pipe($.cleanCss()) .pipe($.cache(gulp.dest(config.cssPath))) .pipe($.connect.reload()); }); -gulp.task('scripts', function () { - return gulp.src(config.jsPath + '/**/*.js') - .pipe($.concat('scripts.js')) - .pipe($.rename({suffix: '.min'})) - .pipe($.uglify()) - .pipe($.cache(gulp.dest(config.buildPath + '/scripts'))) - .pipe($.connect.reload()); +// gulp.task('scripts', function () { +// return gulp.src(config.jsPath + '/**/*.js') +// .pipe($.concat('scripts.js')) +// .pipe($.rename({suffix: '.min'})) +// .pipe($.uglify()) +// .pipe($.cache(gulp.dest(config.buildPath + '/scripts'))) +// .pipe($.rev()) +// .pipe($.cache(gulp.dest(config.buildPath + '/scripts'))) +// .pipe($.rev.manifest(config.buildPath + '/rev-manifest.json', { +// base: config.buildPath, +// merge: true +// })) +// .pipe($.cache(gulp.dest(config.buildPath))) +// .pipe($.connect.reload()); +// }); + +gulp.task("revision", ["styles", "html"], function(){ + return gulp.src(["dist/**/*.css", "dist/**/*.js"]) + .pipe($.rev()) + .pipe(gulp.dest(config.buildPath)) + .pipe($.rev.manifest()) + .pipe(gulp.dest(config.buildPath)) +}) + +gulp.task("revreplace", ["revision"], function(){ + var manifest = gulp.src(config.buildPath + "/rev-manifest.json"); + + return gulp.src(config.buildPath + "/index.html") + .pipe($.revReplace({manifest: manifest})) + .pipe(gulp.dest(config.buildPath)); }); gulp.task('watch', function () { @@ -122,7 +149,7 @@ gulp.task('watch', function () { gulp.watch([config.sassPath + '/**/*.scss'], ['styles']); // Watch .js files - gulp.watch(config.jsPath + '/**/*.js', ['scripts']); + // gulp.watch(config.jsPath + '/**/*.js', ['scripts']); }); gulp.task('clean-cache', function () { @@ -136,11 +163,11 @@ gulp.task('clean', ['clean-cache'], function () { // Build gulp.task('build', ['clean'], function () { - gulp.run('bower', 'fonts', 'html', 'images', 'styles', 'scripts'); + gulp.run('bower', 'bower-components', 'fonts', 'html', 'images', 'styles', 'revreplace'); }); // Dist serve -gulp.task('serve', ['connectDist', 'bower-components', 'fonts', 'html', 'images', 'styles', 'scripts']); +gulp.task('serve', ['connectDist']); // Default task -gulp.task('default', ['connectDev', 'bower', 'fonts', 'html', 'images', 'styles', 'scripts', 'watch']); +gulp.task('default', ['connectDev', 'build', 'watch']); From d826806b0975ef32e413e61ea3f062dc00c4d93a Mon Sep 17 00:00:00 2001 From: diadzine Date: Tue, 26 Jul 2016 15:12:56 +0200 Subject: [PATCH 22/41] add gulp-gh-pages to npm packages --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index f81be3f..0ce210a 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "gulp-concat": "^2.6.0", "gulp-connect": "^4.1.0", "gulp-copy": "0.0.2", + "gulp-gh-pages": "^0.5.4", "gulp-if": "^2.0.1", "gulp-image": "^2.0.1", "gulp-imagemin": "^3.0.1", From e0cacb50b84de84549971717d003e52925bf76d2 Mon Sep 17 00:00:00 2001 From: diadzine Date: Tue, 26 Jul 2016 22:29:27 +0200 Subject: [PATCH 23/41] add publish folder to ignored files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 1be1b1e..e4bf4ee 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ node_modules dist .tmp .sass-cache +.publish app/bower_components app/styles/main.css From d3f4178e876e554c656c3ec478eeba81f94ca48c Mon Sep 17 00:00:00 2001 From: diadzine Date: Tue, 26 Jul 2016 22:30:29 +0200 Subject: [PATCH 24/41] Add deploy task to gulp file --- gulpfile.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gulpfile.js b/gulpfile.js index 23601dc..47195ba 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -166,6 +166,14 @@ gulp.task('build', ['clean'], function () { gulp.run('bower', 'bower-components', 'fonts', 'html', 'images', 'styles', 'revreplace'); }); +// Deploy on gh-pages branch +gulp.task('deploy', function() { + return gulp.src(config.buildPath + '/**/*') + .pipe($.ghPages({ + remoteUrl: "git@bitbucket.org:ab_tooskich/website.git" + })); +}); + // Dist serve gulp.task('serve', ['connectDist']); From def705f87def789a80c3d3b03808714eaddef0dd Mon Sep 17 00:00:00 2001 From: diadzine Date: Tue, 26 Jul 2016 22:50:09 +0200 Subject: [PATCH 25/41] remove remoteUrl from deploy task in gulp file --- gulpfile.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 47195ba..be9812e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -169,9 +169,7 @@ gulp.task('build', ['clean'], function () { // Deploy on gh-pages branch gulp.task('deploy', function() { return gulp.src(config.buildPath + '/**/*') - .pipe($.ghPages({ - remoteUrl: "git@bitbucket.org:ab_tooskich/website.git" - })); + .pipe($.ghPages()); }); // Dist serve From 3be1fae787e270b2d44e81f42ff0138556fc9a7a Mon Sep 17 00:00:00 2001 From: diadzine Date: Wed, 3 Aug 2016 19:41:46 +0200 Subject: [PATCH 26/41] update angularjs version 1.2.18 to 1.5.8 for cloudflare cdn --- app/index.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/index.html b/app/index.html index 8875785..95488f9 100644 --- a/app/index.html +++ b/app/index.html @@ -65,13 +65,13 @@ - - - - - - - + + + + + + + From 9a6c932fa744616322683c88b014bdb2ec3496bc Mon Sep 17 00:00:00 2001 From: diadzine Date: Mon, 8 Aug 2016 09:14:13 +0200 Subject: [PATCH 27/41] refactor gulp tasks --- gulpfile.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index be9812e..490ae0c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -47,7 +47,7 @@ gulp.task('fonts', function () { .pipe($.connect.reload()); }); -gulp.task('html', function () { +gulp.task('html', ["styles"], function () { return gulp.src([ config.htmlPath + '/**/*.html', '!' + config.htmlPath + '/bower_components/**/*.html' @@ -109,7 +109,7 @@ gulp.task('styles', function () { // .pipe($.connect.reload()); // }); -gulp.task("revision", ["styles", "html"], function(){ +gulp.task("revision", ["html"], function(){ return gulp.src(["dist/**/*.css", "dist/**/*.js"]) .pipe($.rev()) .pipe(gulp.dest(config.buildPath)) @@ -163,7 +163,7 @@ gulp.task('clean', ['clean-cache'], function () { // Build gulp.task('build', ['clean'], function () { - gulp.run('bower', 'bower-components', 'fonts', 'html', 'images', 'styles', 'revreplace'); + gulp.run('bower', 'bower-components', 'fonts', 'html', 'images', 'revreplace'); }); // Deploy on gh-pages branch From e803bbf3862e4e6a6aca6755775d80666e124446 Mon Sep 17 00:00:00 2001 From: diadzine Date: Mon, 22 Aug 2016 19:50:17 +0200 Subject: [PATCH 28/41] change API_URL to prod url --- app/scripts/services/server.js | 49 +++++++++++++++++----------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/app/scripts/services/server.js b/app/scripts/services/server.js index 9882d55..3041825 100644 --- a/app/scripts/services/server.js +++ b/app/scripts/services/server.js @@ -1,32 +1,33 @@ 'use strict'; angular.module('websiteApp') - .service('Server', function Server($window, $location) { - // AngularJS will instantiate a singleton by calling "new" on this function + .service('Server', ['$window', '$location', + function Server($window, $location) { + // AngularJS will instantiate a singleton by calling "new" on this function - this.Url = 'http://tooski.webfactional.com/api/'; - // this.Url = 'http://127.0.0.1:8000/'; + this.Url = 'http://tooski.webfactional.com/api/'; - this.sendAnalytics = function() { - $window.ga('send', 'pageview', { - page: $location.path() - }); - }; + this.sendAnalytics = function() { + $window.ga('send', 'pageview', { + page: $location.path() + }); + }; - this.processResponse = function(response) { - return response.map(function(el) { - var result = el.fields; - result.id = el.pk; - result.date = new Date(result.date) - .getTime(); - return result; - }); - }; + this.processResponse = function(response) { + return response.map(function(el) { + var result = el.fields; + result.id = el.pk; + result.date = new Date(result.date) + .getTime(); + return result; + }); + }; - this.errorHandler = function(status, response) { - console.log( - 'There was a connection problem with the server. (' + - status + ')' - ); + this.errorHandler = function(status, response) { + console.log( + 'There was a connection problem with the server. (' + + status + ')' + ); + } } - }); + ]); From 21909aa6adbae72bfc511b2b2209a5caf35f73b0 Mon Sep 17 00:00:00 2001 From: diadzine Date: Mon, 22 Aug 2016 19:51:06 +0200 Subject: [PATCH 29/41] add scripts to html watch method --- gulpfile.js | 1 + 1 file changed, 1 insertion(+) diff --git a/gulpfile.js b/gulpfile.js index 490ae0c..11d9d5e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -131,6 +131,7 @@ gulp.task('watch', function () { // Watch .html files gulp.watch([ + config.jsPath + '/**/*.js', config.htmlPath + '/**/*.html', config.htmlPath + '/favicon.ico', config.htmlPath + '/robots.txt' From f2cc7eb10531aea339057642e683186ecdce1275 Mon Sep 17 00:00:00 2001 From: diadzine Date: Mon, 22 Aug 2016 19:51:24 +0200 Subject: [PATCH 30/41] Fixing DI --- app/scripts/controllers/sponsors.js | 12 ++--- app/scripts/directives/tssideads.js | 68 +++++++++++++++-------------- 2 files changed, 42 insertions(+), 38 deletions(-) diff --git a/app/scripts/controllers/sponsors.js b/app/scripts/controllers/sponsors.js index 614ba1c..2a65edb 100644 --- a/app/scripts/controllers/sponsors.js +++ b/app/scripts/controllers/sponsors.js @@ -8,8 +8,10 @@ * Controller of the websiteApp */ angular.module('websiteApp') - .controller('SponsorsCtrl', function ($scope, Widget) { - Widget.get(2, function(widget) { - $scope.widgetContent = widget; - }); - }); + .controller('SponsorsCtrl', ['$scope', 'Widget', + function ($scope, Widget) { + Widget.get(2, function(widget) { + $scope.widgetContent = widget; + }); + } + ]); diff --git a/app/scripts/directives/tssideads.js b/app/scripts/directives/tssideads.js index a21978c..3a5d97f 100644 --- a/app/scripts/directives/tssideads.js +++ b/app/scripts/directives/tssideads.js @@ -1,41 +1,43 @@ 'use strict'; angular.module('websiteApp') - .directive('tsSideAds', function($window, Pub) { - return { - templateUrl: 'views/directives/core/sideads.html', - restrict: 'EACM', - scope: { - width: '=minWidth', - }, - link: function postLink(scope, element, attrs) { - function shuffle(o) { //v1.0 - for (var j, x, i = o.length; i; j = Math.floor(Math.random() * - i), x = o[--i], o[i] = o[j], o[j] = x); - return o; - }; + .directive('tsSideAds', ['$window', 'Pub', + function($window, Pub) { + return { + templateUrl: 'views/directives/core/sideads.html', + restrict: 'EACM', + scope: { + width: '=minWidth', + }, + link: function postLink(scope, element, attrs) { + function shuffle(o) { //v1.0 + for (var j, x, i = o.length; i; j = Math.floor(Math.random() * + i), x = o[--i], o[i] = o[j], o[j] = x); + return o; + }; - var checkWidth = function(width) { - var width = width; - return function() { - if (width >= window.innerWidth) { - element.css('display', 'none'); - } - else { - element.css('display', 'block'); - } + var checkWidth = function(width) { + var width = width; + return function() { + if (width >= window.innerWidth) { + element.css('display', 'none'); + } + else { + element.css('display', 'block'); + } + }; }; - }; - checkWidth = checkWidth(scope.width); - checkWidth(); + checkWidth = checkWidth(scope.width); + checkWidth(); - Pub.getVerticalBanner(function(banners) { - scope.ad = shuffle(banners)[0]; - }); + Pub.getVerticalBanner(function(banners) { + scope.ad = shuffle(banners)[0]; + }); - angular.element($window) - .on('resize', checkWidth); - } - }; - }); + angular.element($window) + .on('resize', checkWidth); + } + }; + } + ]); From a7cb50895b8774545930754c5515a1060adf51e1 Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Mon, 5 Sep 2016 18:43:36 +0200 Subject: [PATCH 31/41] fix orderBy date in blog posts listing --- app/views/blog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/blog.html b/app/views/blog.html index 1707561..1b201e8 100644 --- a/app/views/blog.html +++ b/app/views/blog.html @@ -8,7 +8,7 @@ {{blogger.name}}
-
+

From 0ec8217f2e911c2e79708e01cf9674d60f2ae7c3 Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Mon, 26 Sep 2016 18:00:51 +0200 Subject: [PATCH 32/41] change sponsors text and styles --- app/styles/main.scss | 12 ++++++++++++ app/views/sponsors.html | 25 +++++++++++++------------ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/app/styles/main.scss b/app/styles/main.scss index c29852b..04ab4c1 100644 --- a/app/styles/main.scss +++ b/app/styles/main.scss @@ -198,6 +198,18 @@ div.blue { padding-top:0px; } +.sponsors-hl { + background-color: #eee; + color: #000; + padding: 10px; + margin: 20px 0 30px 0; + text-align: justify; + + li { + margin: 20px 10px 20px 10px; + } +} + img { max-width:100%; } diff --git a/app/views/sponsors.html b/app/views/sponsors.html index b3ea945..e67e655 100644 --- a/app/views/sponsors.html +++ b/app/views/sponsors.html @@ -24,18 +24,19 @@

Soutenons la relève!

extrêmement importants car un jeune a besoin de sentir que beaucoup de gens sont derrière lui, même s’il ne les connaît pas. Et c’est justement sur ce point que votre aide nous est indispensable!

-

De manière très concrète, pour chaque soutien que nous réussirons à décrocher, - nous appliquerons la clé de répartition suivante:

-

-

    -
  • la moitié des fonds récoltés sera directement versée aux blogueurs - tooski; -
  • -
  • l’autre moitié servira à couvrir les frais techniques dépassant ceux - que tooski prend déjà à sa charge, nous permettant par conséquent - de gérer plus de blogs.
  • -
-

+
+

De manière très concrète, pour chaque soutien que nous réussirons à décrocher, + nous appliquerons la clé de répartition suivante:

+

+

    +
  • les cotisations des mentors sont intégralement reversées aux blogueurs tooski; +
  • +
  • quant aux fonds récoltés auprès des sponsors, la moitié est directement versée + aux blogueurs alors que l’autre moitié sert à couvrir les frais techniques dépassant + ceux que tooski prend déjà à sa charge, afin que nous puissions gérer plus de blogs.
  • +
+

+
Pour devenir mentor From 585a4876f27858cfdf3244fac2f8f446274a66ae Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Mon, 26 Sep 2016 18:06:54 +0200 Subject: [PATCH 33/41] remove "Contactez-nous" block on blog pages --- app/views/blog.html | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/app/views/blog.html b/app/views/blog.html index 1b201e8..c67ee6c 100644 --- a/app/views/blog.html +++ b/app/views/blog.html @@ -58,19 +58,6 @@

-
-
- Contactez-nous ! - -
-
-

Vous êtes skieur de compétition et souhaiteriez avoir votre propre blog sur www.tooski.ch ?

- - Contactez-nous -
-
- -

From c9388e118be7b121132b509604b9e050cfb56e21 Mon Sep 17 00:00:00 2001 From: diadzine Date: Mon, 26 Sep 2016 20:00:29 +0200 Subject: [PATCH 34/41] hide column FIS Code in results table --- app/scripts/controllers/result.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/scripts/controllers/result.js b/app/scripts/controllers/result.js index 66330ab..946dd79 100644 --- a/app/scripts/controllers/result.js +++ b/app/scripts/controllers/result.js @@ -19,6 +19,9 @@ angular.module('websiteApp') .html(result.table) .find('table') .addClass('table table-striped table-condensed'); + // Hack to hide 'FIS Code' column + angular.element('#table-content tr').find('th:nth(2)').hide(); + angular.element('#table-content tr').find('td:nth(2)').hide(); }); } ]); From b4d822e798e272eb9bd6c0d662ba43e1b8941b30 Mon Sep 17 00:00:00 2001 From: diadzine Date: Mon, 26 Sep 2016 20:17:36 +0200 Subject: [PATCH 35/41] hide column FIS Code in results large table --- app/scripts/controllers/result.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/scripts/controllers/result.js b/app/scripts/controllers/result.js index 946dd79..cb0a3ec 100644 --- a/app/scripts/controllers/result.js +++ b/app/scripts/controllers/result.js @@ -20,8 +20,13 @@ angular.module('websiteApp') .find('table') .addClass('table table-striped table-condensed'); // Hack to hide 'FIS Code' column - angular.element('#table-content tr').find('th:nth(2)').hide(); - angular.element('#table-content tr').find('td:nth(2)').hide(); + if (angular.element('#table-content tr:first() th').length > 8) { + var fis = angular.element('#table-content th:contains("FIS Code")'); + var index = fis.parent().children().index(fis); + angular.element('#table-content tr').find('th:nth(' + index + ')').hide(); + angular.element('#table-content tr').find('td:nth(' + index + ')').hide(); + } + }); } ]); From 6b8695c7694d3f7c1567141de80e5b9968e06ca1 Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Tue, 27 Sep 2016 10:56:54 +0200 Subject: [PATCH 36/41] edit sense in sponsor page --- app/views/sponsors.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/sponsors.html b/app/views/sponsors.html index e67e655..610e543 100644 --- a/app/views/sponsors.html +++ b/app/views/sponsors.html @@ -25,8 +25,8 @@

Soutenons la relève!

gens sont derrière lui, même s’il ne les connaît pas. Et c’est justement sur ce point que votre aide nous est indispensable!

-

De manière très concrète, pour chaque soutien que nous réussirons à décrocher, - nous appliquerons la clé de répartition suivante:

+

De manière très concrète, pour chaque soutien que nous réussissons à + décrocher, nous utilisons les fonds de la manière suivante:

  • les cotisations des mentors sont intégralement reversées aux blogueurs tooski; From e9bab9e8ce9d1d36dc8255c6647540ae314a933b Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Mon, 10 Oct 2016 16:34:32 +0200 Subject: [PATCH 37/41] update standings for the new season 2016/17 --- app/views/directives/core/widgetBar.html | 2 +- app/views/rankings.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/directives/core/widgetBar.html b/app/views/directives/core/widgetBar.html index 4f9986d..b69bcc2 100644 --- a/app/views/directives/core/widgetBar.html +++ b/app/views/directives/core/widgetBar.html @@ -2,7 +2,7 @@
    - CM général 2015/16 + CM général 2016/17
    diff --git a/app/views/rankings.html b/app/views/rankings.html index 3fbdcab..b3bd460 100644 --- a/app/views/rankings.html +++ b/app/views/rankings.html @@ -88,7 +88,7 @@
    - Classements 2015/16 + Classements 2016/17
    From fa9eb4b70c01a947a1336bfbb50d0024d78b9eeb Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Fri, 28 Oct 2016 17:26:58 +0200 Subject: [PATCH 38/41] comment out results and rankings pages, links and side blocks --- app/scripts/app.js | 16 ++++++++-------- app/views/directives/core/navbar.html | 6 +++--- app/views/directives/core/widgetBar.html | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/scripts/app.js b/app/scripts/app.js index 301ba2a..aa91a04 100644 --- a/app/scripts/app.js +++ b/app/scripts/app.js @@ -28,10 +28,10 @@ angular templateUrl: 'views/news.html', controller: 'NewsCtrl' }) - .when('/Rankings', { - templateUrl: 'views/rankings.html', - controller: 'RankingsCtrl' - }) + //.when('/Rankings', { + // templateUrl: 'views/rankings.html', + // controller: 'RankingsCtrl' + //}) .when('/Blog', { templateUrl: 'views/blog.html', controller: 'BlogCtrl' @@ -40,10 +40,10 @@ angular templateUrl: 'views/page.html', controller: 'PageCtrl' }) - .when('/Result', { - templateUrl: 'views/result.html', - controller: 'ResultCtrl' - }) + //.when('/Result', { + // templateUrl: 'views/result.html', + // controller: 'ResultCtrl' + //}) .when('/Skiclubs', { templateUrl: 'views/skiclubs.html', controller: 'SkiclubsCtrl' diff --git a/app/views/directives/core/navbar.html b/app/views/directives/core/navbar.html index 5693582..84e1920 100644 --- a/app/views/directives/core/navbar.html +++ b/app/views/directives/core/navbar.html @@ -35,9 +35,9 @@ - - Résultats - + + + Blogs diff --git a/app/views/directives/core/widgetBar.html b/app/views/directives/core/widgetBar.html index b69bcc2..a4ab87b 100644 --- a/app/views/directives/core/widgetBar.html +++ b/app/views/directives/core/widgetBar.html @@ -1,6 +1,6 @@
    -
    +
    From 13d85573cccd83459d25d11907a89665c320e025 Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Thu, 17 Nov 2016 17:02:55 +0100 Subject: [PATCH 39/41] add St. Moritz 2017 link to navbar --- app/views/directives/core/navbar.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/directives/core/navbar.html b/app/views/directives/core/navbar.html index 84e1920..c397dae 100644 --- a/app/views/directives/core/navbar.html +++ b/app/views/directives/core/navbar.html @@ -32,9 +32,6 @@ Actu - - - @@ -47,9 +44,12 @@ Angulation - + Mentors & Sponsors + + St. Moritz 2017 + From 0c56cf190cea155b174475b932ebeade05adbd6d Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Mon, 21 Nov 2016 16:35:57 +0100 Subject: [PATCH 40/41] revomed distinct layout for mag==1, all news look the same --- app/views/news.html | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/app/views/news.html b/app/views/news.html index 36251ab..11682f8 100644 --- a/app/views/news.html +++ b/app/views/news.html @@ -4,28 +4,15 @@
    -

    +

    {{news.title}}

    -

    - {{news.title}} -

    -
    -

    - Auteur:  {{news.author}} -
    - Date:  {{news.date | date:'dd/MM/yyyy'}} -

    -

    -

    +

    Par {{news.author}}, le {{news.date | date:'dd/MM/yyyy'}} à {{news.date | date:'HH:mm'}}

    -
    -
    -
    From 74c64ee9f9cf2ada7d09ae13ff7d924102c7d173 Mon Sep 17 00:00:00 2001 From: Aymeric Bringard Date: Wed, 15 Mar 2017 16:27:05 +0100 Subject: [PATCH 41/41] hide item menu for St Moritz 2017 --- app/views/directives/core/navbar.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/directives/core/navbar.html b/app/views/directives/core/navbar.html index c397dae..6a20bbd 100644 --- a/app/views/directives/core/navbar.html +++ b/app/views/directives/core/navbar.html @@ -47,9 +47,9 @@ Mentors & Sponsors - +