From fdbd8bc793823dadf5d3c270cc9033349609ba50 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Mon, 16 Feb 2015 22:58:02 +0100 Subject: Added installation stuff --- .gitignore | 2 ++ bower.json | 20 ++++++++++++++++++++ gulpfile.js | 47 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 31 +++++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 .gitignore create mode 100644 bower.json create mode 100644 gulpfile.js create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..26aea3b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +bower_components/* +node_modules/* diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..db63d0a --- /dev/null +++ b/bower.json @@ -0,0 +1,20 @@ +{ + "name": "Botleagues Client", + "version": "0.0.0", + "homepage": "https://github.com/camilstaps/Botleagues", + "authors": [ + "Camil Staps " + ], + "license": "GPL v3.0", + "private": true, + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ], + "dependencies": { + "bootstrap": "~3.3.2" + } +} diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..e777bbc --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,47 @@ +// include gulp +var gulp = require('gulp'); + +// include plugins +var jshint = require('gulp-jshint'); +var changed = require('gulp-changed'); +var minifyHTML = require('gulp-minify-html'); +var concat = require('gulp-concat'); +var stripDebug = require('gulp-strip-debug'); +var uglify = require('gulp-uglify'); +var autoprefix = require('gulp-autoprefixer'); +var minifyCSS = require('gulp-minify-css'); + +// JS hint task +gulp.task('jshint', function(){ + gulp.src('./src/scripts/*.js') + .pipe(jshint()) + .pipe(jshint.reporter('default')); +}); + +// minify new/changed HTML +gulp.task('htmlpage', function(){ + var src = './src/*.html'; + var dst = './build'; + gulp.src(src) + .pipe(changed(dst)) + .pipe(minifyHTML()) + .pipe(gulp.dest(dst)); +}); + +// JS concat, strip debugging and minify +gulp.task('scripts', function(){ + gulp.src(['./src/scripts/lib.js', './src/scripts/*.js']) + .pipe(concat('script.js')) + .pipe(stripDebug()) + .pipe(uglify()) + .pipe(gulp.dest('./build/scripts')); +}); + +// CSS concat, auto-prefix and minify +gulp.task('styles', function(){ + gulp.src(['./src/styles/*.css']) + .pipe(concat('styles.css')) + .pipe(autoprefix('last 2 versions')) + .pipe(minifyCSS()) + .pipe(gulp.dest('./build/styles/')); +}); diff --git a/package.json b/package.json new file mode 100644 index 0000000..e5ab04e --- /dev/null +++ b/package.json @@ -0,0 +1,31 @@ +{ + "name": "Botleagues", + "version": "0.0.0", + "description": "", + "main": ".", + "dependencies": { + "gulp": "^3.8.11", + "gulp-autoprefixer": "^2.1.0", + "gulp-changed": "^1.1.1", + "gulp-concat": "^2.5.0", + "gulp-jshint": "^1.9.2", + "gulp-minify-css": "^0.4.5", + "gulp-minify-html": "^0.1.8", + "gulp-strip-debug": "^1.0.2", + "gulp-uglify": "^1.1.0" + }, + "devDependencies": {}, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://github.com/camilstaps/Botleagues" + }, + "author": "Camil Staps ", + "license": "GPL v3.0", + "bugs": { + "url": "https://github.com/camilstaps/Botleagues/issues" + }, + "homepage": "https://github.com/camilstaps/Botleagues" +} -- cgit v1.2.3 From ea6357b9502f5f48c1984b51a57872dcc7e682ab Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Mon, 16 Feb 2015 23:00:03 +0100 Subject: Added gulp default task --- gulpfile.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gulpfile.js b/gulpfile.js index e777bbc..b37e899 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -11,6 +11,10 @@ var uglify = require('gulp-uglify'); var autoprefix = require('gulp-autoprefixer'); var minifyCSS = require('gulp-minify-css'); +// Default task +gulp.task('default', ['jshint', 'htmlpage', 'scripts', 'styles'], function(){ +}); + // JS hint task gulp.task('jshint', function(){ gulp.src('./src/scripts/*.js') -- cgit v1.2.3 From 4d2c34e36b2573cbca7eca5f8b186f20590c0ae3 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Tue, 17 Feb 2015 15:31:56 +0100 Subject: Added bootswatch gulp stuff --- .gitignore | 1 + gulpfile.js | 135 ++++++++++++++++++++++++++++++++++++++++------------------- package.json | 12 +++++- 3 files changed, 104 insertions(+), 44 deletions(-) diff --git a/.gitignore b/.gitignore index 26aea3b..36a8a47 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ bower_components/* node_modules/* +assets/* diff --git a/gulpfile.js b/gulpfile.js index b37e899..2030db9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,51 +1,100 @@ -// include gulp -var gulp = require('gulp'); - -// include plugins -var jshint = require('gulp-jshint'); -var changed = require('gulp-changed'); -var minifyHTML = require('gulp-minify-html'); -var concat = require('gulp-concat'); -var stripDebug = require('gulp-strip-debug'); -var uglify = require('gulp-uglify'); -var autoprefix = require('gulp-autoprefixer'); -var minifyCSS = require('gulp-minify-css'); - -// Default task -gulp.task('default', ['jshint', 'htmlpage', 'scripts', 'styles'], function(){ -}); +// see https://github.com/tugberkugurlu/gulp-bootswatch-sample/ + +var gulp = require('gulp'), + minifycss = require('gulp-minify-css'), + concat = require('gulp-concat'), + less = require('gulp-less'), + gulpif = require('gulp-if'), + order = require('gulp-order'), + gutil = require('gulp-util'), + rename = require('gulp-rename'), + foreach = require('gulp-foreach'), + debug = require('gulp-debug'), + path =require('path'), + merge = require('merge-stream'), + del = require('del'); -// JS hint task -gulp.task('jshint', function(){ - gulp.src('./src/scripts/*.js') - .pipe(jshint()) - .pipe(jshint.reporter('default')); +var bootswatch_theme = 'superhero'; + +gulp.task('default', ['clean'], function() { + gulp.start('fonts', 'styles'); }); -// minify new/changed HTML -gulp.task('htmlpage', function(){ - var src = './src/*.html'; - var dst = './build'; - gulp.src(src) - .pipe(changed(dst)) - .pipe(minifyHTML()) - .pipe(gulp.dest(dst)); +gulp.task('clean', function(cb) { + del(['assets/css', 'assets/js', 'assets/less', 'assets/img', 'assets/fonts'], cb) }); -// JS concat, strip debugging and minify -gulp.task('scripts', function(){ - gulp.src(['./src/scripts/lib.js', './src/scripts/*.js']) - .pipe(concat('script.js')) - .pipe(stripDebug()) - .pipe(uglify()) - .pipe(gulp.dest('./build/scripts')); +gulp.task('fonts', function() { + + var fileList = [ + 'bower_components/bootstrap/dist/fonts/*', + 'bower_components/fontawesome/fonts/*' + ]; + + return gulp.src(fileList) + .pipe(gulp.dest('assets/fonts')); }); -// CSS concat, auto-prefix and minify -gulp.task('styles', function(){ - gulp.src(['./src/styles/*.css']) - .pipe(concat('styles.css')) - .pipe(autoprefix('last 2 versions')) - .pipe(minifyCSS()) - .pipe(gulp.dest('./build/styles/')); +gulp.task('styles', function() { + + var baseContent = '@import "bower_components/bootstrap/less/bootstrap.less";@import "bower_components/bootswatch/' + bootswatch_theme + '/variables.less";@import "bower_components/bootswatch/' + bootswatch_theme + '/bootswatch.less";@import "bower_components/bootstrap/less/utilities.less";'; + var isBootswatchFile = function(file) { + var suffix = 'bootswatch.less'; + return file.path.indexOf(suffix, file.path.length - suffix.length) !== -1; + } + + var isBootstrapFile = function(file) { + var suffix = 'bootstrap-', + fileName = path.basename(file.path); + + return fileName.indexOf(suffix) == 0; + } + + var fileList = [ + 'client/less/main.less', + 'bower_components/bootswatch/**/bootswatch.less', + 'bower_components/fontawesome/css/font-awesome.css' + ]; + + return gulp.src(fileList) + .pipe(gulpif(isBootswatchFile, foreach(function(stream, file) { + var themeName = path.basename(path.dirname(file.path)), + content = replaceAll(baseContent, bootswatch_theme, themeName), + file = string_src('bootstrap-' + themeName + '.less', content); + + return file; + }))) + .pipe(less()) + .pipe(gulp.dest('assets/css')) + .pipe(gulpif(isBootstrapFile, foreach(function(stream, file) { + var fileName = path.basename(file.path), + themeName = fileName.substring(fileName.indexOf('-') + 1, fileName.indexOf('.')); + + // http://stackoverflow.com/questions/21719833/gulp-how-to-add-src-files-in-the-middle-of-a-pipe + // https://github.com/gulpjs/gulp/blob/master/docs/recipes/using-multiple-sources-in-one-task.md + return merge(stream, gulp.src(['assets/css/font-awesome.css', 'assets/css/main.css'])) + .pipe(concat('style-' + themeName + ".css")) + .pipe(gulp.dest('assets/css')) + .pipe(rename({suffix: '.min'})) + .pipe(minifycss()) + .pipe(gulp.dest('assets/css')); + }))) }); + +// http://stackoverflow.com/questions/1144783/replacing-all-occurrences-of-a-string-in-javascript +function escapeRegExp(string) { + return string.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); +} + +function replaceAll(string, find, replace) { + return string.replace(new RegExp(escapeRegExp(find), 'g'), replace); +} + +function string_src(filename, string) { + var src = require('stream').Readable({ objectMode: true }) + src._read = function () { + this.push(new gutil.File({ cwd: "", base: "", path: filename, contents: new Buffer(string) })) + this.push(null) + } + return src +} \ No newline at end of file diff --git a/package.json b/package.json index e5ab04e..f6d5fa9 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,17 @@ "gulp-strip-debug": "^1.0.2", "gulp-uglify": "^1.1.0" }, - "devDependencies": {}, + "devDependencies": { + "del": "^1.1.1", + "gulp-debug": "^2.0.0", + "gulp-foreach": "^0.1.0", + "gulp-if": "^1.2.5", + "gulp-less": "^3.0.0", + "gulp-order": "^1.1.1", + "gulp-rename": "^1.2.0", + "gulp-util": "^3.0.3", + "merge-stream": "^0.1.7" + }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, -- cgit v1.2.3 From 112b5129a6a252ec120ddb09592980a1f031141f Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Mon, 27 Apr 2015 14:24:40 +0200 Subject: Bootswatch --- bower.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bower.json b/bower.json index db63d0a..ade515a 100644 --- a/bower.json +++ b/bower.json @@ -15,6 +15,7 @@ "tests" ], "dependencies": { - "bootstrap": "~3.3.2" + "bootstrap": "~3.3.2", + "bootswatch": "~3.3.4+1" } } -- cgit v1.2.3 From ae7fa5dc179c1d5e01847a8b27578d912876c42a Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Mon, 27 Apr 2015 14:37:57 +0200 Subject: Moved to build directory --- .gitignore | 2 +- gulpfile.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 36a8a47..de3532b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ bower_components/* node_modules/* -assets/* +build/* diff --git a/gulpfile.js b/gulpfile.js index 2030db9..c75ee12 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -21,7 +21,7 @@ gulp.task('default', ['clean'], function() { }); gulp.task('clean', function(cb) { - del(['assets/css', 'assets/js', 'assets/less', 'assets/img', 'assets/fonts'], cb) + del(['build/assets/css', 'build/assets/js', 'build/assets/less', 'build/assets/img', 'build/assets/fonts'], cb) }); gulp.task('fonts', function() { @@ -32,7 +32,7 @@ gulp.task('fonts', function() { ]; return gulp.src(fileList) - .pipe(gulp.dest('assets/fonts')); + .pipe(gulp.dest('build/assets/fonts')); }); gulp.task('styles', function() { @@ -65,19 +65,19 @@ gulp.task('styles', function() { return file; }))) .pipe(less()) - .pipe(gulp.dest('assets/css')) + .pipe(gulp.dest('build/assets/css')) .pipe(gulpif(isBootstrapFile, foreach(function(stream, file) { var fileName = path.basename(file.path), themeName = fileName.substring(fileName.indexOf('-') + 1, fileName.indexOf('.')); // http://stackoverflow.com/questions/21719833/gulp-how-to-add-src-files-in-the-middle-of-a-pipe // https://github.com/gulpjs/gulp/blob/master/docs/recipes/using-multiple-sources-in-one-task.md - return merge(stream, gulp.src(['assets/css/font-awesome.css', 'assets/css/main.css'])) + return merge(stream, gulp.src(['build/assets/css/font-awesome.css', 'build/assets/css/main.css'])) .pipe(concat('style-' + themeName + ".css")) - .pipe(gulp.dest('assets/css')) + .pipe(gulp.dest('build/assets/css')) .pipe(rename({suffix: '.min'})) .pipe(minifycss()) - .pipe(gulp.dest('assets/css')); + .pipe(gulp.dest('build/assets/css')); }))) }); -- cgit v1.2.3 From 8e8ab506710da272e325dc5e1a12a428149f20df Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Mon, 27 Apr 2015 16:21:04 +0200 Subject: Jade, imagemin, bower dependencies, gulpfile --- bower.json | 6 ++-- gulpfile.js | 101 ++++++++++++++++++++++++++++++++++++++++++++------------- package.json | 25 +++++++------- src/index.jade | 8 +++++ 4 files changed, 103 insertions(+), 37 deletions(-) create mode 100644 src/index.jade diff --git a/bower.json b/bower.json index ade515a..45ca94f 100644 --- a/bower.json +++ b/bower.json @@ -11,11 +11,11 @@ "**/.*", "node_modules", "bower_components", - "test", - "tests" + "build" ], "dependencies": { "bootstrap": "~3.3.2", - "bootswatch": "~3.3.4+1" + "bootswatch": "~3.3.4+1", + "fontawesome": "~4.3.0" } } diff --git a/gulpfile.js b/gulpfile.js index c75ee12..b7e9091 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,43 +1,54 @@ // see https://github.com/tugberkugurlu/gulp-bootswatch-sample/ var gulp = require('gulp'), - minifycss = require('gulp-minify-css'), + changed = require('gulp-changed'), concat = require('gulp-concat'), - less = require('gulp-less'), + debug = require('gulp-debug'), + foreach = require('gulp-foreach'), gulpif = require('gulp-if'), - order = require('gulp-order'), gutil = require('gulp-util'), + imagemin = require('gulp-imagemin'), + jade = require('gulp-jade'), + jshint = require('gulp-jshint'), + less = require('gulp-less'), + minifycss = require('gulp-minify-css'), + minifyhtml = require('gulp-minify-html'), + order = require('gulp-order'), rename = require('gulp-rename'), - foreach = require('gulp-foreach'), - debug = require('gulp-debug'), - path =require('path'), + stripdebug = require('gulp-strip-debug'), + uglify = require('gulp-uglify'), + path = require('path'), merge = require('merge-stream'), del = require('del'); var bootswatch_theme = 'superhero'; -gulp.task('default', ['clean'], function() { - gulp.start('fonts', 'styles'); +gulp.task('default', [], function() { + gulp.start('fonts', 'styles', 'scripts', 'images', 'jade'); }); gulp.task('clean', function(cb) { - del(['build/assets/css', 'build/assets/js', 'build/assets/less', 'build/assets/img', 'build/assets/fonts'], cb) + del(['./build/assets/css', './build/assets/js', './build/assets/less', './build/assets/img', './build/assets/fonts', './build/*.html'], cb) }); gulp.task('fonts', function() { var fileList = [ - 'bower_components/bootstrap/dist/fonts/*', - 'bower_components/fontawesome/fonts/*' + './bower_components/bootstrap/dist/fonts/*', + './bower_components/fontawesome/fonts/*' ]; + + var dst = './build/assets/fonts'; return gulp.src(fileList) - .pipe(gulp.dest('build/assets/fonts')); + .pipe(changed(dst)) + .pipe(gulp.dest(dst)); }); gulp.task('styles', function() { - var baseContent = '@import "bower_components/bootstrap/less/bootstrap.less";@import "bower_components/bootswatch/' + bootswatch_theme + '/variables.less";@import "bower_components/bootswatch/' + bootswatch_theme + '/bootswatch.less";@import "bower_components/bootstrap/less/utilities.less";'; + var baseContent = '@import "./bower_components/bootstrap/less/bootstrap.less";@import "./bower_components/bootswatch/' + bootswatch_theme + '/variables.less";@import "./bower_components/bootswatch/' + bootswatch_theme + '/bootswatch.less";@import "./bower_components/bootstrap/less/utilities.less";'; + var isBootswatchFile = function(file) { var suffix = 'bootswatch.less'; return file.path.indexOf(suffix, file.path.length - suffix.length) !== -1; @@ -51,12 +62,21 @@ gulp.task('styles', function() { } var fileList = [ - 'client/less/main.less', - 'bower_components/bootswatch/**/bootswatch.less', - 'bower_components/fontawesome/css/font-awesome.css' + './bower_components/bootswatch/' + bootswatch_theme + '/bootswatch.less', + './bower_components/fontawesome/css/font-awesome.css' ]; + + var dst = './build/assets/css'; + var bootswatch_dst = 'bootswatch.css'; return gulp.src(fileList) + .pipe(changed(dst, {extension: '.css', destination: function(file){ + if (isBootswatchFile(file)) { + return 'bootswatch.css'; + } else { + return file; + } + }})) .pipe(gulpif(isBootswatchFile, foreach(function(stream, file) { var themeName = path.basename(path.dirname(file.path)), content = replaceAll(baseContent, bootswatch_theme, themeName), @@ -65,20 +85,57 @@ gulp.task('styles', function() { return file; }))) .pipe(less()) - .pipe(gulp.dest('build/assets/css')) .pipe(gulpif(isBootstrapFile, foreach(function(stream, file) { var fileName = path.basename(file.path), themeName = fileName.substring(fileName.indexOf('-') + 1, fileName.indexOf('.')); // http://stackoverflow.com/questions/21719833/gulp-how-to-add-src-files-in-the-middle-of-a-pipe // https://github.com/gulpjs/gulp/blob/master/docs/recipes/using-multiple-sources-in-one-task.md - return merge(stream, gulp.src(['build/assets/css/font-awesome.css', 'build/assets/css/main.css'])) - .pipe(concat('style-' + themeName + ".css")) - .pipe(gulp.dest('build/assets/css')) + return merge(stream, gulp.src(['./build/assets/css/font-awesome.css', './build/assets/css/main.css'])) + .pipe(concat('bootswatch.css')) + .pipe(gulp.dest(dst)) .pipe(rename({suffix: '.min'})) - .pipe(minifycss()) - .pipe(gulp.dest('build/assets/css')); + .pipe(minifycss()); }))) + .pipe(gulp.dest(dst)); +}); + +gulp.task('scripts', function(){ + var fileList = [ + './bower_components/bootstrap/dist/js/bootstrap.min.js', + './bower_components/jquery/jquery.min.js', + './src/js/*.js' + ]; + + var dst = './build/assets/js'; + + gulp.src(fileList) + .pipe(changed(dst, {destination: 'script.js'})) + .pipe(concat('script.js')) + .pipe(stripdebug()) + .pipe(uglify()) + .pipe(gulp.dest(dst)); +}); + +gulp.task('images', function(){ + var src = './src/img/**/*', + dst = './build/img'; + + gulp.src(src) + .pipe(changed(dst)) + .pipe(imagemin()) + .pipe(gulp.dest(dst)); +}); + +gulp.task('jade', function(){ + var src = './src/*.jade', + dst = './build'; + + gulp.src(src) + .pipe(changed(dst, {extension: 'html'})) + .pipe(jade()) + .pipe(minifyhtml()) + .pipe(gulp.dest(dst)); }); // http://stackoverflow.com/questions/1144783/replacing-all-occurrences-of-a-string-in-javascript diff --git a/package.json b/package.json index f6d5fa9..82d01d3 100644 --- a/package.json +++ b/package.json @@ -3,27 +3,28 @@ "version": "0.0.0", "description": "", "main": ".", - "dependencies": { - "gulp": "^3.8.11", - "gulp-autoprefixer": "^2.1.0", - "gulp-changed": "^1.1.1", - "gulp-concat": "^2.5.0", - "gulp-jshint": "^1.9.2", - "gulp-minify-css": "^0.4.5", - "gulp-minify-html": "^0.1.8", - "gulp-strip-debug": "^1.0.2", - "gulp-uglify": "^1.1.0" - }, + "dependencies": {}, "devDependencies": { "del": "^1.1.1", + "gulp": "^3.8.11", + "gulp-autoprefixer": "^2.1.0", + "gulp-changed": "~1.2.1", + "gulp-concat": "~2.5.2", "gulp-debug": "^2.0.0", "gulp-foreach": "^0.1.0", "gulp-if": "^1.2.5", + "gulp-imagemin": "~2.2.1", + "gulp-jade": "~1.0.0" + "gulp-jshint": "^1.9.2", "gulp-less": "^3.0.0", + "gulp-minify-css": "^0.4.5", + "gulp-minify-html": "~1.0.2", "gulp-order": "^1.1.1", "gulp-rename": "^1.2.0", + "gulp-strip-debug": "~1.0.2", + "gulp-uglify": "~1.2.0", "gulp-util": "^3.0.3", - "merge-stream": "^0.1.7" + "merge-stream": "^0.1.7", }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" diff --git a/src/index.jade b/src/index.jade new file mode 100644 index 0000000..dda3b97 --- /dev/null +++ b/src/index.jade @@ -0,0 +1,8 @@ +doctype html +html(lang="en") + head + title= Botleagues + link(rel='stylesheet', href='/assets/css/bootswatch.css', type='text/css') + link(rel='stylesheet', href='/assets/css/fontawesome.css', type='text/css') + body + p Hello world. \ No newline at end of file -- cgit v1.2.3 From 9ba61ebd7fc87dcaaddcd34dcd7f39e2858cefed Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Mon, 27 Apr 2015 17:29:43 +0200 Subject: Jade <3, BotleaguesApi.js --- gulpfile.js | 19 +++++++++++++++++-- package.json | 3 ++- src/include/foot.jade | 2 ++ src/include/head.jade | 8 ++++++++ src/include/layout-main.jade | 21 +++++++++++++++++++++ src/index.jade | 32 ++++++++++++++++++++++++-------- src/js/BotleaguesApi.js | 22 ++++++++++++++++++++++ 7 files changed, 96 insertions(+), 11 deletions(-) create mode 100644 src/include/foot.jade create mode 100644 src/include/head.jade create mode 100644 src/include/layout-main.jade create mode 100644 src/js/BotleaguesApi.js diff --git a/gulpfile.js b/gulpfile.js index b7e9091..2abb17e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -24,9 +24,17 @@ var gulp = require('gulp'), var bootswatch_theme = 'superhero'; gulp.task('default', [], function() { + gulp.start('styles', 'scripts', 'images', 'jade'); +}); + +gulp.task('all', [], function() { gulp.start('fonts', 'styles', 'scripts', 'images', 'jade'); }); +gulp.task('rebuild', ['clean'], function() { + gulp.start('all'); +}); + gulp.task('clean', function(cb) { del(['./build/assets/css', './build/assets/js', './build/assets/less', './build/assets/img', './build/assets/fonts', './build/*.html'], cb) }); @@ -102,9 +110,8 @@ gulp.task('styles', function() { gulp.task('scripts', function(){ var fileList = [ + './bower_components/jquery/dist/jquery.min.js', './bower_components/bootstrap/dist/js/bootstrap.min.js', - './bower_components/jquery/jquery.min.js', - './src/js/*.js' ]; var dst = './build/assets/js'; @@ -115,6 +122,14 @@ gulp.task('scripts', function(){ .pipe(stripdebug()) .pipe(uglify()) .pipe(gulp.dest(dst)); + + var src = './src/js/*.js'; + + gulp.src(src) + .pipe(changed(dst)) + .pipe(stripdebug()) + .pipe(uglify()) + .pipe(gulp.dest(dst)); }); gulp.task('images', function(){ diff --git a/package.json b/package.json index 82d01d3..8850d7a 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "gulp-foreach": "^0.1.0", "gulp-if": "^1.2.5", "gulp-imagemin": "~2.2.1", - "gulp-jade": "~1.0.0" + "gulp-jade": "~1.0.0", "gulp-jshint": "^1.9.2", "gulp-less": "^3.0.0", "gulp-minify-css": "^0.4.5", @@ -25,6 +25,7 @@ "gulp-uglify": "~1.2.0", "gulp-util": "^3.0.3", "merge-stream": "^0.1.7", + "markdown-js": "0.0.3" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" diff --git a/src/include/foot.jade b/src/include/foot.jade new file mode 100644 index 0000000..4bb069f --- /dev/null +++ b/src/include/foot.jade @@ -0,0 +1,2 @@ +script(src='/assets/js/script.js', type='text/javascript') +script(src='/assets/js/BotleaguesApi.js', type='text/javascript') \ No newline at end of file diff --git a/src/include/head.jade b/src/include/head.jade new file mode 100644 index 0000000..63cb17c --- /dev/null +++ b/src/include/head.jade @@ -0,0 +1,8 @@ +title Botleagues + +meta(charset='utf-8') +meta(http-equiv='X-UA-Compatible', content='IE=edge') +meta(name='viewport', content='width=device-width, initial-scale=1') + +link(rel='stylesheet', href='/assets/css/bootswatch.css', type='text/css') +link(rel='stylesheet', href='/assets/css/font-awesome.css', type='text/css') \ No newline at end of file diff --git a/src/include/layout-main.jade b/src/include/layout-main.jade new file mode 100644 index 0000000..68ff9de --- /dev/null +++ b/src/include/layout-main.jade @@ -0,0 +1,21 @@ +doctype html +html(lang="en") + head + include ./head.jade + + body + .container + + .header.clearfix + nav: ul.nav.nav-pills.pull-right + li.active(role='presentation'): a(href='#') Home + li(role='presentation'): a(href='#') About + li(role='presentation'): a(href='#') Contact + h3 Botleagues + + block content + + footer.footer: :markdown + © [ViviSoft](http://vivisoft.nl/) 2015 + + include ./foot.jade \ No newline at end of file diff --git a/src/index.jade b/src/index.jade index dda3b97..7ade8fe 100644 --- a/src/index.jade +++ b/src/index.jade @@ -1,8 +1,24 @@ -doctype html -html(lang="en") - head - title= Botleagues - link(rel='stylesheet', href='/assets/css/bootswatch.css', type='text/css') - link(rel='stylesheet', href='/assets/css/fontawesome.css', type='text/css') - body - p Hello world. \ No newline at end of file +extends ./include/layout-main.jade + +block content + .jumbotron + h1 Welcome + p.lead Botleagues: write Java bots for different games, join competitions and win prizes! + p.row + a.btn.btn-lg.btn-success.pull-right(href='#', role='button') Sign up + + .row.marketing + .col-lg-6 + h4 Subheading + p Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum. + h4 Subheading + p Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet fermentum. + h4 Subheading + p Maecenas sed diam eget risus varius blandit sit amet non magna. + .col-lg-6 + h4 Subheading + p Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum. + h4 Subheading + p Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet fermentum. + h4 Subheading + p Maecenas sed diam eget risus varius blandit sit amet non magna. \ No newline at end of file diff --git a/src/js/BotleaguesApi.js b/src/js/BotleaguesApi.js new file mode 100644 index 0000000..44e9c0e --- /dev/null +++ b/src/js/BotleaguesApi.js @@ -0,0 +1,22 @@ +function BotleaguesApi(){} + +BotleaguesApi.url = 'https://api.local.botleagues.camilstaps.nl'; + +BotleaguesApi.request = function(user_options) { + var options = { + endpoint: null, + method: 'GET', + dataType: 'jsonp', + jsonp: 'callback' + }; + for (var name in user_options) { + options[name] = user_options[name]; + } + + console.log(options); + + var url = BotleaguesApi.url + options['endpoint']; + delete options['endpoint']; + + jQuery.ajax(url, options); +} \ No newline at end of file -- cgit v1.2.3 From 2c8f1011bb2329f350396bbfe1c5486d4af7f719 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Mon, 27 Apr 2015 22:14:10 +0200 Subject: Working jsonp --- gulpfile.js | 4 +++- src/js/BotleaguesApi.js | 5 +---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 2abb17e..3c3e596 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -23,6 +23,8 @@ var gulp = require('gulp'), var bootswatch_theme = 'superhero'; +var production = false; + gulp.task('default', [], function() { gulp.start('styles', 'scripts', 'images', 'jade'); }); @@ -127,7 +129,7 @@ gulp.task('scripts', function(){ gulp.src(src) .pipe(changed(dst)) - .pipe(stripdebug()) + .pipe(gulpif(production, stripdebug())) .pipe(uglify()) .pipe(gulp.dest(dst)); }); diff --git a/src/js/BotleaguesApi.js b/src/js/BotleaguesApi.js index 44e9c0e..c37adab 100644 --- a/src/js/BotleaguesApi.js +++ b/src/js/BotleaguesApi.js @@ -6,15 +6,12 @@ BotleaguesApi.request = function(user_options) { var options = { endpoint: null, method: 'GET', - dataType: 'jsonp', - jsonp: 'callback' + dataType: 'jsonp' }; for (var name in user_options) { options[name] = user_options[name]; } - console.log(options); - var url = BotleaguesApi.url + options['endpoint']; delete options['endpoint']; -- cgit v1.2.3 From f0218468f76a01e7644bc727ea9502015a5047c3 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Thu, 7 May 2015 12:00:54 +0300 Subject: Register page & more --- src/about.jade | 21 +++++++++++++++++++++ src/include/foot.jade | 4 +++- src/include/layout-main.jade | 13 ++++++++++--- src/index.jade | 7 +++++-- src/js/Botleagues.js | 22 ++++++++++++++++++++++ src/js/BotleaguesApi.js | 19 ------------------- src/js/BotleaguesCallback.js | 5 +++++ src/js/forms.js | 11 +++++++++++ src/register.jade | 30 ++++++++++++++++++++++++++++++ 9 files changed, 107 insertions(+), 25 deletions(-) create mode 100644 src/about.jade create mode 100644 src/js/Botleagues.js delete mode 100644 src/js/BotleaguesApi.js create mode 100644 src/js/BotleaguesCallback.js create mode 100644 src/js/forms.js create mode 100644 src/register.jade diff --git a/src/about.jade b/src/about.jade new file mode 100644 index 0000000..2c424d4 --- /dev/null +++ b/src/about.jade @@ -0,0 +1,21 @@ +extends ./include/layout-main.jade + +block menu + -var selected = '/about' + +block content + .row + .col-lg-6 + h4 Subheading + p Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum. + h4 Subheading + p Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet fermentum. + h4 Subheading + p Maecenas sed diam eget risus varius blandit sit amet non magna. + .col-lg-6 + h4 Subheading + p Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum. + h4 Subheading + p Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet fermentum. + h4 Subheading + p Maecenas sed diam eget risus varius blandit sit amet non magna. \ No newline at end of file diff --git a/src/include/foot.jade b/src/include/foot.jade index 4bb069f..3c49021 100644 --- a/src/include/foot.jade +++ b/src/include/foot.jade @@ -1,2 +1,4 @@ script(src='/assets/js/script.js', type='text/javascript') -script(src='/assets/js/BotleaguesApi.js', type='text/javascript') \ No newline at end of file +script(src='/assets/js/Botleagues.js', type='text/javascript') +script(src='/assets/js/BotleaguesCallback.js', type='text/javascript') +script(src='/assets/js/forms.js', type='text/javascript') \ No newline at end of file diff --git a/src/include/layout-main.jade b/src/include/layout-main.jade index 68ff9de..b680d9f 100644 --- a/src/include/layout-main.jade +++ b/src/include/layout-main.jade @@ -6,11 +6,18 @@ html(lang="en") body .container + block menu + -var selected = '/'; //default + + -var menu = { 'Home': '/', 'About': '/about', 'Contact': '/contact' }; + .header.clearfix nav: ul.nav.nav-pills.pull-right - li.active(role='presentation'): a(href='#') Home - li(role='presentation'): a(href='#') About - li(role='presentation'): a(href='#') Contact + each val, key in menu + if selected === val + li.active(role='presentation'): a(href=val,title=key)= key + else + li(role='presentation'): a(href=val,title=key)= key h3 Botleagues block content diff --git a/src/index.jade b/src/index.jade index 7ade8fe..f405884 100644 --- a/src/index.jade +++ b/src/index.jade @@ -1,13 +1,16 @@ extends ./include/layout-main.jade +block menu + -var selected = '/' + block content .jumbotron h1 Welcome p.lead Botleagues: write Java bots for different games, join competitions and win prizes! p.row - a.btn.btn-lg.btn-success.pull-right(href='#', role='button') Sign up + a.btn.btn-lg.btn-success.pull-right(href='/register', role='button') Register now - .row.marketing + .row .col-lg-6 h4 Subheading p Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum. diff --git a/src/js/Botleagues.js b/src/js/Botleagues.js new file mode 100644 index 0000000..fd8ed21 --- /dev/null +++ b/src/js/Botleagues.js @@ -0,0 +1,22 @@ +function Botleagues(){} + +Botleagues.url = 'https://api.local.botleagues.camilstaps.nl'; + +Botleagues.request = function(user_options, callback) { + var options = { + endpoint: null, + method: 'GET', + dataType: 'json', + done: function(data) { + callback(data); + } + }; + for (var name in user_options) { + options[name] = user_options[name]; + } + + var url = Botleagues.url + '/' + options['endpoint']; + delete options['endpoint']; + + jQuery.ajax(url, options); +}; \ No newline at end of file diff --git a/src/js/BotleaguesApi.js b/src/js/BotleaguesApi.js deleted file mode 100644 index c37adab..0000000 --- a/src/js/BotleaguesApi.js +++ /dev/null @@ -1,19 +0,0 @@ -function BotleaguesApi(){} - -BotleaguesApi.url = 'https://api.local.botleagues.camilstaps.nl'; - -BotleaguesApi.request = function(user_options) { - var options = { - endpoint: null, - method: 'GET', - dataType: 'jsonp' - }; - for (var name in user_options) { - options[name] = user_options[name]; - } - - var url = BotleaguesApi.url + options['endpoint']; - delete options['endpoint']; - - jQuery.ajax(url, options); -} \ No newline at end of file diff --git a/src/js/BotleaguesCallback.js b/src/js/BotleaguesCallback.js new file mode 100644 index 0000000..4c05262 --- /dev/null +++ b/src/js/BotleaguesCallback.js @@ -0,0 +1,5 @@ +function BotleaguesCallback(){} + +BotleaguesCallback.register = function(data) { + console.log(data); +}; \ No newline at end of file diff --git a/src/js/forms.js b/src/js/forms.js new file mode 100644 index 0000000..5ad9959 --- /dev/null +++ b/src/js/forms.js @@ -0,0 +1,11 @@ +$('form.form-register').submit(function(){ + Botleagues.request({ + endpoint: 'user', + method: 'POST', + data: { + email: $(this).find('input[name="email"]').val(), + password: $(this).find('input[name="password"]').val() + } + }, BotleaguesCallback.register); + event.preventDefault(); +}); \ No newline at end of file diff --git a/src/register.jade b/src/register.jade new file mode 100644 index 0000000..2aca779 --- /dev/null +++ b/src/register.jade @@ -0,0 +1,30 @@ +extends ./include/layout-main.jade + +block menu + -var selected = '/register' + +block content + .row + .col-lg-6 + h4 Register + form.form-register + .form-group + label(for="register-email") Email + input.form-control#register-email(type='email',name='email',placeholder="Enter email") + .form-group + label(for="register-password") Password + input.form-control#register-password(type='password',name='password',placeholder="Enter password") + .form-group + label(for="register-password2") Password (confirmation) + input.form-control#register-password2(type='password',name='password',placeholder="Enter password again") + .checkbox: label + input#accepts-toc(type='checkbox',name="accepts-toc") + | I accept the terms and conditions + button.btn.btn-lg.btn-success.pull-right(type='submit') Register + .col-lg-6 + h4 Subheading + p Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum. + h4 Subheading + p Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet fermentum. + h4 Subheading + p Maecenas sed diam eget risus varius blandit sit amet non magna. \ No newline at end of file -- cgit v1.2.3 From 36811d9e42876dddc3ff7e75611191a2c83017f9 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Thu, 7 May 2015 14:20:28 +0300 Subject: Login --- src/include/foot.jade | 1 + src/js/BotleaguesCallback.js | 4 +++- src/js/BotleaguesFrontend.js | 7 +++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 src/js/BotleaguesFrontend.js diff --git a/src/include/foot.jade b/src/include/foot.jade index 3c49021..1e383f2 100644 --- a/src/include/foot.jade +++ b/src/include/foot.jade @@ -1,4 +1,5 @@ script(src='/assets/js/script.js', type='text/javascript') script(src='/assets/js/Botleagues.js', type='text/javascript') script(src='/assets/js/BotleaguesCallback.js', type='text/javascript') +script(src='/assets/js/BotleaguesFrontend.js', type='text/javascript') script(src='/assets/js/forms.js', type='text/javascript') \ No newline at end of file diff --git a/src/js/BotleaguesCallback.js b/src/js/BotleaguesCallback.js index 4c05262..271deb0 100644 --- a/src/js/BotleaguesCallback.js +++ b/src/js/BotleaguesCallback.js @@ -2,4 +2,6 @@ function BotleaguesCallback(){} BotleaguesCallback.register = function(data) { console.log(data); -}; \ No newline at end of file +}; + +BotleaguesCallback.login = function(data) {} \ No newline at end of file diff --git a/src/js/BotleaguesFrontend.js b/src/js/BotleaguesFrontend.js new file mode 100644 index 0000000..37e84d4 --- /dev/null +++ b/src/js/BotleaguesFrontend.js @@ -0,0 +1,7 @@ +function BotleaguesFrontend(){} + +BotleaguesFrontend.login = function() { + Botleagues.request({ + endpoint: 'user/login' + }, BotleaguesCallback.login); +}; \ No newline at end of file -- cgit v1.2.3 From 9de17f00941e56d7c063241e3f87bfeb70e50276 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Thu, 7 May 2015 15:43:22 +0300 Subject: HTTP authentication --- src/js/Botleagues.js | 4 ++++ src/js/BotleaguesCallback.js | 4 +++- src/js/BotleaguesFrontend.js | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/js/Botleagues.js b/src/js/Botleagues.js index fd8ed21..efc56d8 100644 --- a/src/js/Botleagues.js +++ b/src/js/Botleagues.js @@ -19,4 +19,8 @@ Botleagues.request = function(user_options, callback) { delete options['endpoint']; jQuery.ajax(url, options); +}; + +Botleagues.redirect = function(user_options) { + window.location = Botleagues.url + '/' + user_options['endpoint']; }; \ No newline at end of file diff --git a/src/js/BotleaguesCallback.js b/src/js/BotleaguesCallback.js index 271deb0..1efe8d6 100644 --- a/src/js/BotleaguesCallback.js +++ b/src/js/BotleaguesCallback.js @@ -4,4 +4,6 @@ BotleaguesCallback.register = function(data) { console.log(data); }; -BotleaguesCallback.login = function(data) {} \ No newline at end of file +BotleaguesCallback.login = function(data) { + console.log(data); +} \ No newline at end of file diff --git a/src/js/BotleaguesFrontend.js b/src/js/BotleaguesFrontend.js index 37e84d4..461ce92 100644 --- a/src/js/BotleaguesFrontend.js +++ b/src/js/BotleaguesFrontend.js @@ -1,7 +1,7 @@ function BotleaguesFrontend(){} BotleaguesFrontend.login = function() { - Botleagues.request({ - endpoint: 'user/login' - }, BotleaguesCallback.login); + Botleagues.redirect({ + endpoint: 'user/login?redirect=http://local.botleagues.camilstaps.nl/' + }); }; \ No newline at end of file -- cgit v1.2.3 From 3282ddaa098463adc778a2a81f5239769c922f65 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Thu, 7 May 2015 16:50:29 +0300 Subject: Register form + validation --- src/css/forms.less | 3 +++ src/css/style.less | 1 + src/include/head.jade | 3 ++- src/include/layout-main.jade | 2 ++ src/js/Botleagues.js | 4 ++-- src/js/BotleaguesCallback.js | 33 ++++++++++++++++++++++++++++----- src/js/BotleaguesFrontend.js | 21 +++++++++++++++++++++ src/js/forms.js | 1 + src/register.jade | 2 +- 9 files changed, 61 insertions(+), 9 deletions(-) create mode 100644 src/css/forms.less create mode 100644 src/css/style.less diff --git a/src/css/forms.less b/src/css/forms.less new file mode 100644 index 0000000..233bde5 --- /dev/null +++ b/src/css/forms.less @@ -0,0 +1,3 @@ +label { + display: block; +} \ No newline at end of file diff --git a/src/css/style.less b/src/css/style.less new file mode 100644 index 0000000..f32a0b2 --- /dev/null +++ b/src/css/style.less @@ -0,0 +1 @@ +@import 'forms.less'; \ No newline at end of file diff --git a/src/include/head.jade b/src/include/head.jade index 63cb17c..b3b12e4 100644 --- a/src/include/head.jade +++ b/src/include/head.jade @@ -5,4 +5,5 @@ meta(http-equiv='X-UA-Compatible', content='IE=edge') meta(name='viewport', content='width=device-width, initial-scale=1') link(rel='stylesheet', href='/assets/css/bootswatch.css', type='text/css') -link(rel='stylesheet', href='/assets/css/font-awesome.css', type='text/css') \ No newline at end of file +link(rel='stylesheet', href='/assets/css/font-awesome.css', type='text/css') +link(rel='stylesheet', href='/assets/css/style.css', type='text/css') \ No newline at end of file diff --git a/src/include/layout-main.jade b/src/include/layout-main.jade index b680d9f..72331ee 100644 --- a/src/include/layout-main.jade +++ b/src/include/layout-main.jade @@ -20,6 +20,8 @@ html(lang="en") li(role='presentation'): a(href=val,title=key)= key h3 Botleagues + #messages + block content footer.footer: :markdown diff --git a/src/js/Botleagues.js b/src/js/Botleagues.js index efc56d8..f9d34b7 100644 --- a/src/js/Botleagues.js +++ b/src/js/Botleagues.js @@ -7,8 +7,8 @@ Botleagues.request = function(user_options, callback) { endpoint: null, method: 'GET', dataType: 'json', - done: function(data) { - callback(data); + complete: function(data) { + callback(data.responseJSON); } }; for (var name in user_options) { diff --git a/src/js/BotleaguesCallback.js b/src/js/BotleaguesCallback.js index 1efe8d6..f162e7c 100644 --- a/src/js/BotleaguesCallback.js +++ b/src/js/BotleaguesCallback.js @@ -1,9 +1,32 @@ function BotleaguesCallback(){} BotleaguesCallback.register = function(data) { - console.log(data); -}; + $('form.form-register .form-group') + .removeClass('has-feedback has-success has-warning, has-error') + .find('.form-control-feedback').remove(); -BotleaguesCallback.login = function(data) { - console.log(data); -} \ No newline at end of file + if (typeof data.error !== 'undefined') { + BotleaguesFrontend.error({message: data.error, prepend_to: $('form.form-register')}); + if (typeof data.errors !== 'undefined') { + for (var key in data.errors) { + var error_msg = data.errors[key].join('; '); + + $('#register-' + key) + .attr('title', error_msg) + .parent() + .addClass('has-feedback has-error') + .append( + $('') + .addClass('glyphicon glyphicon-remove form-control-feedback') + .attr('aria-hidden', true) + ) + .find('label') + .append( + $('') + .addClass('pull-right text-danger') + .text(error_msg) + ); + } + } + } +}; \ No newline at end of file diff --git a/src/js/BotleaguesFrontend.js b/src/js/BotleaguesFrontend.js index 461ce92..e9ab570 100644 --- a/src/js/BotleaguesFrontend.js +++ b/src/js/BotleaguesFrontend.js @@ -1,5 +1,26 @@ function BotleaguesFrontend(){} +BotleaguesFrontend.error = function(user_options) { + options = { + dismissable: true, + prepend_to: $('#messages'), + type: 'danger' + }; + for (var key in user_options) { + options[key] = user_options[key]; + } + + var html = '
'; + if (options.dismissable === true) + html += '×'; + html += options.message; + html += '
'; + + html = $(html); + + html.prependTo(options.prepend_to).delay(3000).fadeOut().queue(html.remove); +}; + BotleaguesFrontend.login = function() { Botleagues.redirect({ endpoint: 'user/login?redirect=http://local.botleagues.camilstaps.nl/' diff --git a/src/js/forms.js b/src/js/forms.js index 5ad9959..24f0f43 100644 --- a/src/js/forms.js +++ b/src/js/forms.js @@ -7,5 +7,6 @@ $('form.form-register').submit(function(){ password: $(this).find('input[name="password"]').val() } }, BotleaguesCallback.register); + event.preventDefault(); }); \ No newline at end of file diff --git a/src/register.jade b/src/register.jade index 2aca779..8f79715 100644 --- a/src/register.jade +++ b/src/register.jade @@ -7,7 +7,7 @@ block content .row .col-lg-6 h4 Register - form.form-register + form.form-register(action='#') .form-group label(for="register-email") Email input.form-control#register-email(type='email',name='email',placeholder="Enter email") -- cgit v1.2.3 From b9cd9394b2ac76fce7d247a76bd63d0b60517fbf Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Thu, 7 May 2015 16:50:44 +0300 Subject: Gulpfile with CSS from src --- gulpfile.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 3c3e596..595e542 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -57,7 +57,11 @@ gulp.task('fonts', function() { gulp.task('styles', function() { - var baseContent = '@import "./bower_components/bootstrap/less/bootstrap.less";@import "./bower_components/bootswatch/' + bootswatch_theme + '/variables.less";@import "./bower_components/bootswatch/' + bootswatch_theme + '/bootswatch.less";@import "./bower_components/bootstrap/less/utilities.less";'; + var baseContent = + '@import "./bower_components/bootstrap/less/bootstrap.less";' + + '@import "./bower_components/bootswatch/' + bootswatch_theme + '/variables.less";' + + '@import "./bower_components/bootswatch/' + bootswatch_theme + '/bootswatch.less";' + + '@import "./bower_components/bootstrap/less/utilities.less";'; var isBootswatchFile = function(file) { var suffix = 'bootswatch.less'; @@ -73,7 +77,8 @@ gulp.task('styles', function() { var fileList = [ './bower_components/bootswatch/' + bootswatch_theme + '/bootswatch.less', - './bower_components/fontawesome/css/font-awesome.css' + './bower_components/fontawesome/css/font-awesome.css', + './src/css/style.less' ]; var dst = './build/assets/css'; @@ -107,6 +112,7 @@ gulp.task('styles', function() { .pipe(rename({suffix: '.min'})) .pipe(minifycss()); }))) + .pipe(minifycss()) .pipe(gulp.dest(dst)); }); -- cgit v1.2.3 From d64f492efdc618a2eeeba6be0781a076dd3368bc Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Sun, 10 May 2015 16:40:07 +0300 Subject: jquery-cookie --- bower.json | 3 ++- gulpfile.js | 1 + package.json | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bower.json b/bower.json index 45ca94f..ea0dd59 100644 --- a/bower.json +++ b/bower.json @@ -16,6 +16,7 @@ "dependencies": { "bootstrap": "~3.3.2", "bootswatch": "~3.3.4+1", - "fontawesome": "~4.3.0" + "fontawesome": "~4.3.0", + "jquery-cookie": "~1.4.1" } } diff --git a/gulpfile.js b/gulpfile.js index 595e542..a3c28e1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -120,6 +120,7 @@ gulp.task('scripts', function(){ var fileList = [ './bower_components/jquery/dist/jquery.min.js', './bower_components/bootstrap/dist/js/bootstrap.min.js', + './bower_components/jquery-cookie/jquery.cookie.js' ]; var dst = './build/assets/js'; diff --git a/package.json b/package.json index 8850d7a..d5c122a 100644 --- a/package.json +++ b/package.json @@ -24,8 +24,8 @@ "gulp-strip-debug": "~1.0.2", "gulp-uglify": "~1.2.0", "gulp-util": "^3.0.3", - "merge-stream": "^0.1.7", - "markdown-js": "0.0.3" + "markdown-js": "0.0.3", + "merge-stream": "^0.1.7" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" -- cgit v1.2.3