diff --git a/web/bower.json b/web/bower.json index e7ddc1440..2d526289b 100644 --- a/web/bower.json +++ b/web/bower.json @@ -10,13 +10,15 @@ "qunit": "", "benchmark": "", "benchmarkjs-runner": "", - "bootstrap": "" + "bootstrap": "", + "react-bootstrap": "" }, "install": { "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", + "react-bootstrap": "bower_components/react-bootstrap/react-bootstrap.js" } } } \ No newline at end of file diff --git a/web/gulpfile.js b/web/gulpfile.js index f14bcc3b1..afc4834a7 100644 --- a/web/gulpfile.js +++ b/web/gulpfile.js @@ -6,6 +6,7 @@ var jshint = require("gulp-jshint"); var less = require("gulp-less"); var livereload = require("gulp-livereload"); var minifyCSS = require('gulp-minify-css'); +var plumber = require("gulp-plumber"); var react = require("gulp-react"); var sourcemaps = require('gulp-sourcemaps'); var uglify = require('gulp-uglify'); @@ -19,11 +20,13 @@ var path = { 'vendor/lodash/lodash.js', 'vendor/react/react-with-addons.js', 'vendor/react-router/react-router.js', + 'vendor/react-bootstrap/react-bootstrap.js' ], app: [ - 'js/router.jsx', - 'js/certinstall.jsx', - 'js/mitmproxy.js', + 'js/datastructures.js', + 'js/footer.react.js', + 'js/header.react.js', + 'js/mitmproxy.react.js', ], }, css: { @@ -40,6 +43,7 @@ gulp.task("fonts", function () { function styles(files, dev) { return (gulp.src(files, {base: "src", cwd: "src"}) + .pipe(plumber()) .pipe(dev ? sourcemaps.init() : gutil.noop()) .pipe(less()) .pipe(dev ? sourcemaps.write(".", {sourceRoot: "/static"}) : gutil.noop()) @@ -58,8 +62,9 @@ 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(dev ? sourcemaps.init() : gutil.noop()) - .pipe(react()) + .pipe(react({harmony: true})) .pipe(concat(filename)) .pipe(!dev ? uglify() : gutil.noop()) .pipe(dev ? sourcemaps.write(".", {sourceRoot: "/static"}) : gutil.noop()) @@ -75,7 +80,8 @@ gulp.task("scripts-prod", ["scripts-app-prod", "scripts-vendor-prod"]); gulp.task("jshint", function () { return gulp.src(["src/js/**"]) - .pipe(react()) + .pipe(plumber()) + .pipe(react({harmony: true})) .pipe(jshint()) .pipe(jshint.reporter("jshint-stylish")) }); diff --git a/web/package.json b/web/package.json index 8c570bef1..a13190bba 100644 --- a/web/package.json +++ b/web/package.json @@ -22,6 +22,7 @@ "gulp-less": "^1.3.5", "gulp-livereload": "^2.1.1", "gulp-minify-css": "^0.3.8", + "gulp-plumber": "^0.6.5", "gulp-react": "^1.0.1", "gulp-sourcemaps": "^1.1.5", "gulp-uglify": "^1.0.1", diff --git a/web/src/css/app.less b/web/src/css/app.less index de89b6c6a..0a25a90c0 100644 --- a/web/src/css/app.less +++ b/web/src/css/app.less @@ -1,8 +1,12 @@ -.certinstall { - +// www.paulirish.com/2012/box-sizing-border-box-ftw/ +html { + box-sizing: border-box; } -@color: white; -body { - background-color: @color; -} \ No newline at end of file +*, *:before, *:after { + box-sizing: inherit; +} + +@import (less) "layout.less"; +@import (less) "header.less"; +@import (less) "footer.less"; \ No newline at end of file diff --git a/web/src/css/footer.less b/web/src/css/footer.less new file mode 100644 index 000000000..1aa758275 --- /dev/null +++ b/web/src/css/footer.less @@ -0,0 +1,3 @@ +footer { + padding: 0 10px; +} \ No newline at end of file diff --git a/web/src/css/header.less b/web/src/css/header.less new file mode 100644 index 000000000..998c06124 --- /dev/null +++ b/web/src/css/header.less @@ -0,0 +1,62 @@ +header { + + background-color: white; + + .title-bar { + line-height: 25px; + text-align: center; + } + + @separator-color: lighten(grey, 15%); + + nav { + + border-bottom: solid @separator-color 1px; + + a { + display: inline-block; + padding: 3px 14px; + margin: 0 2px -1px; + border: solid transparent 1px; + //text-transform: uppercase; + //font-family: Lato; + + &.active { + border-color: @separator-color; + border-bottom-color: white; + } + &:hover { + /* + @preview: lightgrey; + border-top-color: @preview; + border-left-color: @preview; + border-right-color: @preview; + */ + text-decoration: none; + } + &.special { + @special-color: #396cad; + color: white; + background-color: @special-color; + border-bottom-color: @special-color; + &:hover { + background-color: lighten(@special-color, 10%); + } + } + } + + &:before { + content: " "; + } + + &:after { + clear: both; + } + + } + + .menu { + height: 100px; + border-bottom: solid @separator-color 1px; + } +} \ No newline at end of file diff --git a/web/src/css/layout.less b/web/src/css/layout.less new file mode 100644 index 000000000..e1f222498 --- /dev/null +++ b/web/src/css/layout.less @@ -0,0 +1,36 @@ +html, body, #container { + height: 100%; + margin: 0; + overflow: hidden; +} + +header, footer { + display: block; +} + +@headerheight: 153px; +@footerheight: 25px; + +#container { + //Set padding on container so that #main can take 100% height + //If we don't do it, the scrollbars will be too large. + padding: @headerheight 0 @footerheight; +} + +header { + height: @headerheight; + //Substract #container padding + margin-top: -@headerheight; +} + +#main { + height: 100%; + display: block; + overflow-y: auto; +} + +footer { + //This starts at the beginning of the #container padding, all fine. + height: @footerheight; + line-height: @footerheight; +} diff --git a/web/src/index.html b/web/src/index.html index cf8cb85f0..509ef1eb7 100644 --- a/web/src/index.html +++ b/web/src/index.html @@ -8,14 +8,11 @@ - -
+