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 --- gulpfile.js | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 gulpfile.js (limited to 'gulpfile.js') 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/')); +}); -- 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(+) (limited to 'gulpfile.js') 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(-) (limited to 'gulpfile.js') 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 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(-) (limited to 'gulpfile.js') 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 (limited to 'gulpfile.js') 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 (limited to 'gulpfile.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(-) (limited to 'gulpfile.js') 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 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(-) (limited to 'gulpfile.js') 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(-) (limited to 'gulpfile.js') 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