aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2014-09-13 23:57:01 +0200
committerMaximilian Hils <git@maximilianhils.com>2014-09-13 23:57:01 +0200
commit7b74d207f39e642e5029a4855da47314ce224a33 (patch)
treeb893ea277d1b7d9fa8172df982cbcb6799d75e54
parentd2475e6a146534b5e7aaf2cc7b0b9a75e418415e (diff)
downloadmitmproxy-7b74d207f39e642e5029a4855da47314ce224a33.tar.gz
mitmproxy-7b74d207f39e642e5029a4855da47314ce224a33.tar.bz2
mitmproxy-7b74d207f39e642e5029a4855da47314ce224a33.zip
update Gruntfile
-rw-r--r--.gitignore1
-rw-r--r--web/.jshintrc4
-rw-r--r--web/Gruntfile.js38
-rw-r--r--web/gulpfile.js2
-rw-r--r--web/src/css/footer.less1
-rw-r--r--web/src/js/datastructures.es6.js (renamed from web/src/js/datastructures.js)2
-rw-r--r--web/src/js/footer.react.js3
-rw-r--r--web/src/test.html2
8 files changed, 32 insertions, 21 deletions
diff --git a/.gitignore b/.gitignore
index a306bb16..d75774f3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,4 +22,5 @@ libpathod
node_modules
bower_components
+*.compiled.js
*.map \ No newline at end of file
diff --git a/web/.jshintrc b/web/.jshintrc
new file mode 100644
index 00000000..acdf04d3
--- /dev/null
+++ b/web/.jshintrc
@@ -0,0 +1,4 @@
+{
+ "loopfunc": true,
+ "esnext": true
+} \ No newline at end of file
diff --git a/web/Gruntfile.js b/web/Gruntfile.js
index b737e1ff..5fe5a402 100644
--- a/web/Gruntfile.js
+++ b/web/Gruntfile.js
@@ -1,16 +1,20 @@
var cssfiles = {
- "../libmproxy/web/static/mitmproxy.css": "src/css/mitmproxy.less",
+ "../libmproxy/web/static/css/app.css": "src/css/app.less",
+ "../libmproxy/web/static/css/vendor.css": "src/css/vendor.less",
};
var jsfiles = {
- "../libmproxy/web/static/mitmproxy.js": [
+ "../libmproxy/web/static/js/vendor.js": [
'src/vendor/jquery/jquery.js',
- 'src/vendor/lodash/dist/lodash.js',
+ 'src/vendor/lodash/lodash.js',
'src/vendor/react/react-with-addons.js',
- 'src/vendor/react-router/dist/react-router.js',
- 'src/vendor/bootstrap-customized.js',
- 'src/js/router_jsx.js',
- 'src/js/certinstall_jsx.js',
- 'src/js/mitmproxy.js',
+ 'src/vendor/react-router/react-router.js',
+ 'src/vendor/react-bootstrap/react-bootstrap.js',
+ ],
+ "../libmproxy/web/static/js/app.js": [
+ 'src/js/datastructures.compiled.js',
+ 'src/js/footer.compiled.js',
+ 'src/js/header.compiled.js',
+ 'src/js/mitmproxy.compiled.js',
],
};
@@ -24,7 +28,7 @@ module.exports = function (grunt) {
{
expand: true,
flatten: true,
- src: ['src/vendor/fontawesome/fonts/*'],
+ src: ['src/vendor/fontawesome/fontawesome-webfont.*'],
dest: '../libmproxy/web/static/fonts'
}
],
@@ -52,10 +56,13 @@ module.exports = function (grunt) {
files: [{
expand: true,
cwd: 'src/js',
- src: ['*.jsx'],
+ src: ['*.react.js','*.es6.js'],
dest: 'src/js',
- ext: '_jsx.js'
+ ext: '.compiled.js'
}]
+ },
+ options: {
+ harmony: true
}
},
uglify: {
@@ -63,6 +70,7 @@ module.exports = function (grunt) {
options: {
mangle: false,
compress: false,
+ beautify: true,
sourceMap: true,
sourceMapIncludeSources: true,
},
@@ -78,9 +86,9 @@ module.exports = function (grunt) {
},
jshint: {
options: {
- loopfunc: true,
+ jshintrc: ".jshintrc",
},
- all: ['src/js/*.js'],
+ all: ['src/js/*.js','!src/js/*.react.js'],
gruntfile: ['Gruntfile.js']
},
qunit: {
@@ -88,14 +96,14 @@ module.exports = function (grunt) {
},
watch: {
less: {
- files: ['src/css/*.less', 'src/css/*.css'],
+ files: ['src/css/**'],
tasks: ['less:dev'],
options: {
livereload: true,
}
},
jsx: {
- files: ['src/js/*.jsx'],
+ files: ['src/js/*.react.js','src/js/*.es6.js'],
tasks: ['react:all'],
},
js: {
diff --git a/web/gulpfile.js b/web/gulpfile.js
index afc4834a..55a99b15 100644
--- a/web/gulpfile.js
+++ b/web/gulpfile.js
@@ -23,7 +23,7 @@ var path = {
'vendor/react-bootstrap/react-bootstrap.js'
],
app: [
- 'js/datastructures.js',
+ 'js/datastructures.es6.js',
'js/footer.react.js',
'js/header.react.js',
'js/mitmproxy.react.js',
diff --git a/web/src/css/footer.less b/web/src/css/footer.less
index 1aa75827..52512b60 100644
--- a/web/src/css/footer.less
+++ b/web/src/css/footer.less
@@ -1,3 +1,4 @@
footer {
padding: 0 10px;
+ text-align: center;
} \ No newline at end of file
diff --git a/web/src/js/datastructures.js b/web/src/js/datastructures.es6.js
index 59f64e66..4bc781b2 100644
--- a/web/src/js/datastructures.js
+++ b/web/src/js/datastructures.es6.js
@@ -64,7 +64,7 @@ class DummyFlowStore extends FlowStore {
}
-SETTINGS_CHANGED = "settings.change";
+var SETTINGS_CHANGED = "settings.change";
class Settings extends EventEmitter {
constructor(){
diff --git a/web/src/js/footer.react.js b/web/src/js/footer.react.js
index 96506e85..9b36d841 100644
--- a/web/src/js/footer.react.js
+++ b/web/src/js/footer.react.js
@@ -2,9 +2,6 @@
var Footer = React.createClass({
render : function(){
- var style = {
- textAlign: "center"
- };
return (<footer>
<span className="label label-success">transparent mode</span>
</footer>);
diff --git a/web/src/test.html b/web/src/test.html
index 9de604e4..bba1e44f 100644
--- a/web/src/test.html
+++ b/web/src/test.html
@@ -8,7 +8,7 @@
<script src="vendor/jquery/jquery.js"></script>
<script src="vendor/underscore/underscore.js"></script>
<script src="vendor/lodash/dist/lodash.js"></script>
- <script src="js/datastructures.js"></script>
+ <script src="js/datastructures.es6.js"></script>
<script src="js/scurve.js"></script>
<script src="js/entropy.js"></script>
<script src="js/orders.js"></script>