From d86c6843bee552e4e04e35811185603ad6892b3e Mon Sep 17 00:00:00 2001 From: Nasta Date: Thu, 17 Sep 2015 15:48:25 +0300 Subject: [PATCH] fix roots, create full release version, msg center refactoring, fix html minification, etc. --- gulpfile.js | 88 +- src/404.html | 8 +- src/app/app.js | 2 +- src/app/common/directives/animatedChange.js | 6 +- src/app/common/directives/autoFocus.js | 2 +- src/app/common/directives/ngFileSelect.js | 4 +- src/app/common/directives/zoomIn.js | 4 +- src/app/common/modules/upload.js | 6 +- src/app/components/backTop/backTop.js | 2 +- src/app/components/msgCenter/msgCenter.html | 108 +-- src/app/components/msgCenter/msgCenter.js | 107 ++- src/app/components/pageTop/pageTop.html | 2 +- src/app/components/pageTop/pageTop.js | 34 +- src/app/components/pieCharts/pieCharts.js | 14 +- src/app/components/sidebar/_sidebar.scss | 1 + src/app/components/sidebar/sidebar.js | 80 +- src/app/components/widgets/widgets.js | 4 +- src/app/pages/buttons/buttons.js | 20 +- src/app/pages/charts/charts.js | 14 +- .../charts/widgets/areaChart/areaChart.js | 74 +- .../pages/charts/widgets/barChart/barChart.js | 36 +- .../charts/widgets/funnelChart/funnelChart.js | 34 +- .../charts/widgets/lineChart/lineChart.js | 72 +- .../pages/charts/widgets/pieChart/pieChart.js | 58 +- src/app/pages/dashboard/dashboard.js | 26 +- .../dashboard/widgets/amChart/amChart.js | 40 +- .../widgets/amChartMap/amChartMap.js | 252 +++--- .../pages/dashboard/widgets/chart/chart.js | 26 +- .../dashboard/widgets/timeline/timeline.html | 6 +- src/app/pages/dashboard/widgets/todo/todo.js | 20 +- src/app/pages/form/inputs/inputs.js | 30 +- .../form/inputs/widgets/switch/switch.js | 4 +- src/app/pages/form/layouts/layouts.js | 20 +- src/app/pages/icons/icons.js | 239 +++-- src/app/pages/icons/widgets/kameleon.html | 2 +- .../pages/icons/widgets/kameleonRounded.html | 2 +- src/app/pages/maps/maps.js | 18 +- .../maps/widgets/google-maps/google-maps.js | 2 +- .../pages/maps/widgets/leaflet/_leaflet.scss | 4 +- src/app/pages/maps/widgets/leaflet/leaflet.js | 4 +- .../maps/widgets/map-bubbles/map-bubbles.js | 832 +++++++++--------- .../pages/maps/widgets/map-lines/map-lines.js | 74 +- src/app/pages/modals/modals.js | 14 +- .../widgets/notifications/notifications.js | 2 +- src/app/pages/profile/profile.js | 44 +- .../profile/profileModal/profileModal.js | 2 +- src/app/pages/tables/tables.js | 22 +- src/app/pages/tables/widgets/basicTable.html | 10 +- .../pages/tables/widgets/borderedTable.html | 10 +- src/app/pages/tables/widgets/hoverRows.html | 10 +- src/app/pages/typography/typography.html | 12 +- src/app/pages/typography/typography.js | 2 +- src/assets/img/comments.svg | 67 ++ src/assets/img/shopping-cart.svg | 48 + src/assets/js/global-variables.js | 34 +- src/auth.html | 8 +- src/index.html | 14 +- src/reg.html | 8 +- 58 files changed, 1412 insertions(+), 1276 deletions(-) create mode 100644 src/assets/img/comments.svg create mode 100644 src/assets/img/shopping-cart.svg diff --git a/gulpfile.js b/gulpfile.js index 573f301..8a2d42a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -3,7 +3,7 @@ var gulp = require('gulp'); var sass = require('gulp-sass'); var autoprefix = require('gulp-autoprefixer'); var minifyCSS = require('gulp-minify-css'); -var concat = require("gulp-concat"); +var concat = require('gulp-concat'); var changed = require('gulp-changed'); var imagemin = require('gulp-imagemin'); var stripDebug = require('gulp-strip-debug'); @@ -12,51 +12,51 @@ var eventStream = require('event-stream'); var templateCache = require('gulp-angular-templatecache'); var minifyHTML = require('gulp-minify-html'); -gulp.task("minify-404-css", function () { - var vendorFiles = gulp.src("./src/assets/css/lib/bootstrap.min.css"); - var appFiles = gulp.src('./src/assets/css/404.scss').pipe(sass({ style: 'compressed' }).on('error', sass.logError)); +gulp.task('minify-404-css', function () { + var vendorFiles = gulp.src('src/assets/css/lib/bootstrap.min.css'); + var appFiles = gulp.src('src/assets/css/404.scss').pipe(sass({ style: 'compressed' }).on('error', sass.logError)); return eventStream.concat(vendorFiles, appFiles) .pipe(concat('404.min.css')) .pipe(autoprefix('last 4 version')) .pipe(minifyCSS()) - .pipe(gulp.dest("./src/release/css/")); + .pipe(gulp.dest('src/release/css/')); }); -gulp.task("minify-auth-css", function () { - var vendorFiles = gulp.src("./src/assets/css/lib/bootstrap.min.css"); - var appFiles = gulp.src('./src/assets/css/auth.scss').pipe(sass({ style: 'compressed' }).on('error', sass.logError)); +gulp.task('minify-auth-css', function () { + var vendorFiles = gulp.src('src/assets/css/lib/bootstrap.min.css'); + var appFiles = gulp.src('src/assets/css/auth.scss').pipe(sass({ style: 'compressed' }).on('error', sass.logError)); return eventStream.concat(vendorFiles, appFiles) - .pipe(concat("auth.min.css")) + .pipe(concat('auth.min.css')) .pipe(autoprefix('last 4 versions')) .pipe(minifyCSS()) - .pipe(gulp.dest("./src/release/css/")) + .pipe(gulp.dest('src/release/css/')) }); -gulp.task("minify-css", ['minify-404-css', 'minify-auth-css'], function () { - var vendorFiles = gulp.src("./src/assets/css/lib/*.css"); - var appFiles = gulp.src('./src/assets/css/main.scss').pipe(sass({ style: 'compressed' }).on('error', sass.logError)); +gulp.task('minify-css', ['minify-404-css', 'minify-auth-css'], function () { + var vendorFiles = gulp.src('src/assets/css/lib/*.css'); + var appFiles = gulp.src('src/assets/css/main.scss').pipe(sass({ style: 'compressed' }).on('error', sass.logError)); return eventStream.concat(vendorFiles, appFiles) - .pipe(concat("index.min.css")) + .pipe(concat('index.min.css')) .pipe(autoprefix('last 2 versions')) .pipe(minifyCSS()) - .pipe(gulp.dest("./src/release/css/")) + .pipe(gulp.dest('src/release/css/')) }); var imgSrc = [ - './src/assets/img/*', - './src/assets/pictures/*', - './src/app/pages/dashboard/widgets/timeline/img/*', - './src/app/pages/profile/img/*', - './src/app/pages/icons/widgets/kameleon-img/*', - './src/assets/js/lib/amChart/images/*', - './src/app/pages/maps/widgets/leaflet/images/*', + 'src/assets/img/*', + 'src/assets/pictures/*', + 'src/app/pages/dashboard/widgets/timeline/img/*', + 'src/app/pages/profile/img/*', + 'src/app/pages/icons/widgets/kameleon-img/*', + 'src/assets/js/lib/amChart/images/*', + 'src/app/pages/maps/widgets/leaflet/images/*', ]; gulp.task('imagemin', function () { - var imgDst = './src/release/img/'; + var imgDst = 'src/release/img/'; return gulp .src(imgSrc) .pipe(changed(imgDst)) @@ -66,43 +66,51 @@ gulp.task('imagemin', function () { gulp.task('js', function () { var libSrc = [ - "./src/assets/js/lib/jquery.min.js", - "./src/assets/js/lib/angular.min.js", - "./src/assets/js/global-variables.js", - "./src/assets/js/lib/**/*.js", - "./src/app/**/lib/**/*.js" + 'src/assets/js/lib/jquery.min.js', + 'src/assets/js/lib/angular.min.js', + 'src/assets/js/global-variables.js', + 'src/assets/js/lib/**/*.js', + 'src/app/**/lib/**/*.js' ]; var src = [ - "./src/app/**/*.js", - "!./src/app/**/lib/**/*.js" + 'src/app/**/*.js', + '!src/app/**/lib/**/*.js' ]; - var dst = './src/release/js/'; + var dst = 'src/release/js/'; gulp.src(libSrc).pipe(concat('lib.min.js')).pipe(stripDebug()).pipe(uglify()).pipe(gulp.dest(dst)); gulp.src(src).pipe(concat('bundle.min.js')).pipe(uglify()).pipe(gulp.dest(dst)); }); gulp.task('font', function () { - var fontSrc = './src/assets/css/fonts/*'; - var fontDst = './src/release/fonts/'; + var fontSrc = 'src/assets/css/fonts/*'; + var fontDst = 'src/release/fonts/'; gulp.src(fontSrc).pipe(gulp.dest(fontDst)); }); gulp.task('templateCache', function() { return gulp.src('src/app/**/*.html') - .pipe(minifyHTML({ conditionals: true, spare: true })) - .pipe(templateCache({ root: '/app/', module: 'BlurAdmin' })) + .pipe(minifyHTML({ conditionals: true, spare: true, empty: true })) + .pipe(templateCache({ root: 'app/', module: 'BlurAdmin' })) .pipe(gulp.dest('src/release/js')); }); -gulp.task("watch", function () { - gulp.watch(["./src/app/**/*.css", "./src/assets/**/*.css", "./**/*.scss "], ["minify-css"]); - gulp.watch(imgSrc, ["imagemin"]); - gulp.watch(["./src/app/**/*.js", "./src/assets/**/*.js"], ["js"]); +gulp.task('html', function(){ + return gulp.src('src/*.html') + .pipe(minifyHTML({ conditionals: true, spare: true, empty: true })) + .pipe(gulp.dest('src/release/')); }); -gulp.task("init", ["minify-css", "imagemin", "js", "font", 'templateCache']); +gulp.task('watch', function () { + gulp.watch(['src/app/**/*.css', 'src/assets/**/*.css', './**/*.scss '], ['minify-css']); + gulp.watch(imgSrc, ['imagemin']); + gulp.watch(['src/app/**/*.js', 'src/assets/**/*.js'], ['js']); + gulp.watch(['src/app/**/*.html'], ['templateCache']); + gulp.watch(['src/*.html'], ['html']); +}); + +gulp.task('init', ['minify-css', 'imagemin', 'js', 'font', 'templateCache', 'html']); gulp.task('default', ['init']); \ No newline at end of file diff --git a/src/404.html b/src/404.html index 5750349..815fe3d 100644 --- a/src/404.html +++ b/src/404.html @@ -8,11 +8,11 @@ - - - + + + - + diff --git a/src/app/app.js b/src/app/app.js index b9662fb..a0fa052 100644 --- a/src/app/app.js +++ b/src/app/app.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var blurAdminApp = angular.module('BlurAdmin', [ 'ui.sortable', diff --git a/src/app/common/directives/animatedChange.js b/src/app/common/directives/animatedChange.js index f1321d9..4cf8129 100644 --- a/src/app/common/directives/animatedChange.js +++ b/src/app/common/directives/animatedChange.js @@ -4,11 +4,11 @@ 'use strict'; -blurAdminApp.directive('animatedChange', ["$timeout", function ($timeout) { +blurAdminApp.directive('animatedChange', ['$timeout', function ($timeout) { return { link: function (scope, element) { $timeout(function () { - var newValue = element.attr("new-value"); + var newValue = element.attr('new-value'); var oldvalue = parseInt(element.html()); function changeValue(val) { @@ -27,7 +27,7 @@ blurAdminApp.directive('animatedChange', ["$timeout", function ($timeout) { } } $timeout(function () { - element.next().find("i").addClass("show-arr"); + element.next().find('i').addClass('show-arr'); }, 500); }, 3500); } diff --git a/src/app/common/directives/autoFocus.js b/src/app/common/directives/autoFocus.js index 4a61c53..e15104e 100644 --- a/src/app/common/directives/autoFocus.js +++ b/src/app/common/directives/autoFocus.js @@ -1,6 +1,6 @@ 'use strict'; -blurAdminApp.directive('autoFocus', ["$timeout", "$parse", function ($timeout, $parse) { +blurAdminApp.directive('autoFocus', ['$timeout', '$parse', function ($timeout, $parse) { return { link: function (scope, element, attrs) { var model = $parse(attrs.autoFocus); diff --git a/src/app/common/directives/ngFileSelect.js b/src/app/common/directives/ngFileSelect.js index 741e61f..c165de4 100644 --- a/src/app/common/directives/ngFileSelect.js +++ b/src/app/common/directives/ngFileSelect.js @@ -1,7 +1,7 @@ -blurAdminApp.directive("ngFileSelect", function () { +blurAdminApp.directive('ngFileSelect', function () { return { link: function ($scope, el) { - el.bind("change", function (e) { + el.bind('change', function (e) { $scope.file = (e.srcElement || e.target).files[0]; $scope.getFile(); }) diff --git a/src/app/common/directives/zoomIn.js b/src/app/common/directives/zoomIn.js index 4305d0e..9fed91e 100644 --- a/src/app/common/directives/zoomIn.js +++ b/src/app/common/directives/zoomIn.js @@ -15,8 +15,8 @@ blurAdminApp.directive('zoomIn', ['$timeout', function ($timeout) { } $timeout(function () { - elem.removeClass("invisible"); - elem.addClass("animated zoomIn"); + elem.removeClass('invisible'); + elem.addClass('animated zoomIn'); }, delay); } }; diff --git a/src/app/common/modules/upload.js b/src/app/common/modules/upload.js index 844e9e8..dc24c67 100644 --- a/src/app/common/modules/upload.js +++ b/src/app/common/modules/upload.js @@ -1,7 +1,7 @@ (function (blurAdminApp) { - blurAdminApp.factory("fileReader", fileReader); - fileReader.$inject = ["$q"]; + blurAdminApp.factory('fileReader', fileReader); + fileReader.$inject = ['$q']; function fileReader ($q) { var onLoad = function(reader, deferred, scope) { @@ -22,7 +22,7 @@ var onProgress = function(reader, scope) { return function (event) { - scope.$broadcast("fileProgress", + scope.$broadcast('fileProgress', { total: event.total, loaded: event.loaded diff --git a/src/app/components/backTop/backTop.js b/src/app/components/backTop/backTop.js index dd6c7b7..329b5c6 100644 --- a/src/app/components/backTop/backTop.js +++ b/src/app/components/backTop/backTop.js @@ -9,6 +9,6 @@ blurAdminApp.directive('backTop', function () { 'speed': 500 }); }], - templateUrl: '/app/components/backTop/backTop.html' + templateUrl: 'app/components/backTop/backTop.html' }; }); diff --git a/src/app/components/msgCenter/msgCenter.html b/src/app/components/msgCenter/msgCenter.html index 9443dfb..c887552 100644 --- a/src/app/components/msgCenter/msgCenter.html +++ b/src/app/components/msgCenter/msgCenter.html @@ -15,57 +15,11 @@ Settings
- -
+
+
-
Vladimir posted a new article.
- 1 min ago -
-
- -
-
-
Konstantin changed his contact information.
- 2 hrs ago -
-
- -
-
-
-
-
New orders received.
- 5 hrs ago -
-
- -
-
-
Andrey replied to your comment.
- 1 day ago -
-
- -
-
-
Today is Anastasiya's birthday.
- 2 days ago -
-
- -
-
-
-
-
New comments on your post.
- 3 days ago -
-
- -
-
-
Konstantin invited you to join the event.
- 1 week ago +
+ {{ msg.time }}
@@ -75,67 +29,21 @@