Skip to content

Commit

Permalink
Merge branch 'master' of ssh.github.com:cortesi/mitmproxy
Browse files Browse the repository at this point in the history
  • Loading branch information
cortesi committed Sep 14, 2014
2 parents 17868f6 + abc91d6 commit adfaa1e
Show file tree
Hide file tree
Showing 11 changed files with 15,542 additions and 44 deletions.
2 changes: 1 addition & 1 deletion web/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"path": "src/vendor",
"sources": {
"lodash": "bower_components/lodash/dist/lodash.js",
"react": "bower_components/react/react-with-addons.js",
"react": ["bower_components/react/react-with-addons.js", "bower_components/react/JSXTransformer.js"],
"react-bootstrap": "bower_components/react-bootstrap/react-bootstrap.js"
}
}
Expand Down
20 changes: 17 additions & 3 deletions web/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ var jshint = require("gulp-jshint");
var less = require("gulp-less");
var livereload = require("gulp-livereload");
var minifyCSS = require('gulp-minify-css');
var notify = require("gulp-notify");
var plumber = require("gulp-plumber");
var qunit = require("gulp-qunit");
var react = require("gulp-react");
var sourcemaps = require('gulp-sourcemaps');
var uglify = require('gulp-uglify');


var dont_break_on_errors = function(){
return plumber(function(error){
notify.onError("Error: <%= error.message %>").apply(this, arguments);
this.emit('end');
});
};

var path = {
dist: "../libmproxy/web/",
js: {
Expand Down Expand Up @@ -43,7 +52,7 @@ gulp.task("fonts", function () {

function styles(files, dev) {
return (gulp.src(files, {base: "src", cwd: "src"})
.pipe(plumber())
.pipe(dont_break_on_errors())
.pipe(dev ? sourcemaps.init() : gutil.noop())
.pipe(less())
.pipe(dev ? sourcemaps.write(".", {sourceRoot: "/static"}) : gutil.noop())
Expand All @@ -62,7 +71,7 @@ gulp.task("styles-prod", ["styles-app-prod", "styles-vendor-prod"]);

function scripts(files, filename, dev) {
return gulp.src(files, {base: "src", cwd: "src"})
.pipe(plumber())
.pipe(dont_break_on_errors())
.pipe(dev ? sourcemaps.init() : gutil.noop())
.pipe(react({harmony: true}))
.pipe(concat(filename))
Expand All @@ -80,7 +89,7 @@ gulp.task("scripts-prod", ["scripts-app-prod", "scripts-vendor-prod"]);

gulp.task("jshint", function () {
return gulp.src(["src/js/**"])
.pipe(plumber())
.pipe(dont_break_on_errors())
.pipe(react({harmony: true}))
.pipe(jshint())
.pipe(jshint.reporter("jshint-stylish"))
Expand All @@ -92,6 +101,11 @@ gulp.task("html", function () {
.pipe(livereload({ auto: false }));
});

gulp.task('test', function() {
return gulp.src('src/test.html')
.pipe(qunit({verbose: true}));
});

common = ["fonts", "html", "jshint"];
gulp.task("dev", common.concat(["styles-dev", "scripts-dev"]));
gulp.task("prod", common.concat(["styles-prod", "scripts-prod"]));
Expand Down
2 changes: 2 additions & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
"gulp-less": "^1.3.5",
"gulp-livereload": "^2.1.1",
"gulp-minify-css": "^0.3.8",
"gulp-notify": "^1.6.0",
"gulp-plumber": "^0.6.5",
"gulp-qunit": "^0.3.3",
"gulp-react": "^1.0.1",
"gulp-sourcemaps": "^1.1.5",
"gulp-uglify": "^1.0.1",
Expand Down
3 changes: 2 additions & 1 deletion web/src/css/app.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ html {

@import (less) "layout.less";
@import (less) "header.less";
@import (less) "footer.less";
@import (less) "footer.less";

2 changes: 1 addition & 1 deletion web/src/css/footer.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
footer {
padding: 0 10px;
text-align: center;
//text-align: center;
}
Loading

0 comments on commit adfaa1e

Please sign in to comment.