2017-12-12 01:43:48 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var gulp = require('gulp');
|
|
|
|
var concatCss = require('gulp-concat-css');
|
2018-02-14 02:57:19 +00:00
|
|
|
var cleanCSS = require('gulp-clean-css');
|
|
|
|
|
2018-02-22 05:20:30 +00:00
|
|
|
gulp.task('minify_code', () => {
|
2018-02-24 05:36:57 +00:00
|
|
|
return gulp.src(['common-files/*.css', 'userContent-files/*.css', 'userContent-files/*/*.css', 'userChrome-files/*', 'userChrome-files/*/*.css'])
|
2018-02-22 05:20:30 +00:00
|
|
|
.pipe(cleanCSS({
|
|
|
|
level : 2 ,
|
|
|
|
format: 'beautify'
|
|
|
|
}))
|
|
|
|
.pipe(gulp.dest(function(file) {
|
|
|
|
return file.base;
|
|
|
|
}));
|
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task('minify_chrome', () => {
|
|
|
|
return gulp.src(['userChrome.css'])
|
|
|
|
.pipe(cleanCSS({
|
|
|
|
level : 2 ,
|
|
|
|
format: 'beautify'
|
|
|
|
}))
|
|
|
|
.pipe(gulp.dest('.'));
|
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task('minify_content', () => {
|
|
|
|
return gulp.src(['userContent.css'])
|
|
|
|
.pipe(cleanCSS({
|
|
|
|
level : 2 ,
|
|
|
|
format: 'beautify'
|
|
|
|
}))
|
|
|
|
.pipe(gulp.dest('.'));
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-12-12 01:43:48 +00:00
|
|
|
|
|
|
|
/**********************************
|
2018-02-04 21:12:19 +00:00
|
|
|
* *
|
|
|
|
* userContent.css *
|
|
|
|
* *
|
2017-12-12 01:43:48 +00:00
|
|
|
**********************************/
|
|
|
|
|
2018-01-31 21:36:34 +00:00
|
|
|
/* userContent file with no addons */
|
|
|
|
gulp.task('userContent_no_addons', function() {
|
2018-02-22 05:20:30 +00:00
|
|
|
return gulp.src(['color_variables.css', 'common-files/*.css', 'userContent-files/*.css'])
|
2018-01-31 21:36:34 +00:00
|
|
|
.pipe(concatCss('userContent_no_addons.css'))
|
|
|
|
.pipe(gulp.dest('./alternative_user_files'));
|
2017-12-12 01:43:48 +00:00
|
|
|
});
|
|
|
|
|
2018-01-31 21:36:34 +00:00
|
|
|
|
|
|
|
/* Add everything to userContent */
|
2018-02-24 01:41:55 +00:00
|
|
|
gulp.task('userContent_all', ['minify_code', 'userContent_no_addons'], function() {
|
2018-02-22 05:20:30 +00:00
|
|
|
return gulp.src(['color_variables.css', 'common-files/*.css', 'userContent-files/*.css', 'userContent-files/*/*.css'])
|
2017-12-12 01:43:48 +00:00
|
|
|
.pipe(concatCss('userContent.css'))
|
|
|
|
.pipe(gulp.dest('.'));
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************
|
2018-02-04 21:12:19 +00:00
|
|
|
* *
|
|
|
|
* userChrome.css *
|
|
|
|
* *
|
2017-12-12 01:43:48 +00:00
|
|
|
**********************************/
|
|
|
|
|
2018-02-22 05:20:30 +00:00
|
|
|
/* Add everything to userChrome */
|
2018-02-04 21:12:19 +00:00
|
|
|
gulp.task('userChrome_windows', function() {
|
2018-02-22 05:20:30 +00:00
|
|
|
return gulp.src(['color_variables.css', 'common-files/*.css', 'userChrome-files/*.css', 'userChrome-files/windows_fixes/*.css' ])
|
2018-02-04 21:12:19 +00:00
|
|
|
.pipe(concatCss('userChrome_windows.css'))
|
|
|
|
.pipe(gulp.dest('./alternative_user_files'));
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2018-02-22 05:20:30 +00:00
|
|
|
/* Add everything to userChrome */
|
2018-02-24 02:55:05 +00:00
|
|
|
gulp.task('userChrome_all', ['minify_code', 'userChrome_windows'], function() {
|
2018-02-22 05:20:30 +00:00
|
|
|
return gulp.src(['color_variables.css', 'common-files/*.css', 'userChrome-files/*.css'])
|
2017-12-12 06:26:47 +00:00
|
|
|
.pipe(concatCss('userChrome.css'))
|
|
|
|
.pipe(gulp.dest('.'));
|
|
|
|
});
|
2018-02-14 02:57:19 +00:00
|
|
|
|
2018-02-24 02:55:05 +00:00
|
|
|
/* Add everything to userChrome */
|
|
|
|
gulp.task('all', ['userChrome_all', 'userContent_all'], function() {
|
|
|
|
return gulp.src(['userChrome.css', 'userContent.css'])
|
|
|
|
.pipe(cleanCSS({
|
2018-02-24 05:36:57 +00:00
|
|
|
level : 1 ,
|
2018-02-24 02:55:05 +00:00
|
|
|
format: 'beautify'
|
|
|
|
}))
|
|
|
|
.pipe(gulp.dest('.'));
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-02-14 02:57:19 +00:00
|
|
|
|
|
|
|
/**********************************
|
|
|
|
* *
|
|
|
|
* Other *
|
|
|
|
* *
|
|
|
|
**********************************/
|
|
|
|
|
|
|
|
|
|
|
|
gulp.task('minify-pdf', () => {
|
|
|
|
return gulp.src(['userContent-files/webpages/pdf.css'])
|
|
|
|
.pipe(cleanCSS({
|
2018-02-24 05:36:57 +00:00
|
|
|
level : 1 ,
|
2018-02-14 02:57:19 +00:00
|
|
|
format: 'beautify'
|
|
|
|
}))
|
|
|
|
.pipe(gulp.dest('./userContent-files/webpages'));
|
|
|
|
});
|