update Gruntfile

This commit is contained in:
Maximilian Hils 2014-09-13 23:57:01 +02:00
parent d2475e6a14
commit 7b74d207f3
8 changed files with 32 additions and 21 deletions

1
.gitignore vendored
View File

@ -22,4 +22,5 @@ libpathod
node_modules node_modules
bower_components bower_components
*.compiled.js
*.map *.map

4
web/.jshintrc Normal file
View File

@ -0,0 +1,4 @@
{
"loopfunc": true,
"esnext": true
}

View File

@ -1,16 +1,20 @@
var cssfiles = { 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 = { var jsfiles = {
"../libmproxy/web/static/mitmproxy.js": [ "../libmproxy/web/static/js/vendor.js": [
'src/vendor/jquery/jquery.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/react-with-addons.js',
'src/vendor/react-router/dist/react-router.js', 'src/vendor/react-router/react-router.js',
'src/vendor/bootstrap-customized.js', 'src/vendor/react-bootstrap/react-bootstrap.js',
'src/js/router_jsx.js', ],
'src/js/certinstall_jsx.js', "../libmproxy/web/static/js/app.js": [
'src/js/mitmproxy.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, expand: true,
flatten: true, flatten: true,
src: ['src/vendor/fontawesome/fonts/*'], src: ['src/vendor/fontawesome/fontawesome-webfont.*'],
dest: '../libmproxy/web/static/fonts' dest: '../libmproxy/web/static/fonts'
} }
], ],
@ -52,10 +56,13 @@ module.exports = function (grunt) {
files: [{ files: [{
expand: true, expand: true,
cwd: 'src/js', cwd: 'src/js',
src: ['*.jsx'], src: ['*.react.js','*.es6.js'],
dest: 'src/js', dest: 'src/js',
ext: '_jsx.js' ext: '.compiled.js'
}] }]
},
options: {
harmony: true
} }
}, },
uglify: { uglify: {
@ -63,6 +70,7 @@ module.exports = function (grunt) {
options: { options: {
mangle: false, mangle: false,
compress: false, compress: false,
beautify: true,
sourceMap: true, sourceMap: true,
sourceMapIncludeSources: true, sourceMapIncludeSources: true,
}, },
@ -78,9 +86,9 @@ module.exports = function (grunt) {
}, },
jshint: { jshint: {
options: { options: {
loopfunc: true, jshintrc: ".jshintrc",
}, },
all: ['src/js/*.js'], all: ['src/js/*.js','!src/js/*.react.js'],
gruntfile: ['Gruntfile.js'] gruntfile: ['Gruntfile.js']
}, },
qunit: { qunit: {
@ -88,14 +96,14 @@ module.exports = function (grunt) {
}, },
watch: { watch: {
less: { less: {
files: ['src/css/*.less', 'src/css/*.css'], files: ['src/css/**'],
tasks: ['less:dev'], tasks: ['less:dev'],
options: { options: {
livereload: true, livereload: true,
} }
}, },
jsx: { jsx: {
files: ['src/js/*.jsx'], files: ['src/js/*.react.js','src/js/*.es6.js'],
tasks: ['react:all'], tasks: ['react:all'],
}, },
js: { js: {

View File

@ -23,7 +23,7 @@ var path = {
'vendor/react-bootstrap/react-bootstrap.js' 'vendor/react-bootstrap/react-bootstrap.js'
], ],
app: [ app: [
'js/datastructures.js', 'js/datastructures.es6.js',
'js/footer.react.js', 'js/footer.react.js',
'js/header.react.js', 'js/header.react.js',
'js/mitmproxy.react.js', 'js/mitmproxy.react.js',

View File

@ -1,3 +1,4 @@
footer { footer {
padding: 0 10px; padding: 0 10px;
text-align: center;
} }

View File

@ -64,7 +64,7 @@ class DummyFlowStore extends FlowStore {
} }
SETTINGS_CHANGED = "settings.change"; var SETTINGS_CHANGED = "settings.change";
class Settings extends EventEmitter { class Settings extends EventEmitter {
constructor(){ constructor(){

View File

@ -2,9 +2,6 @@
var Footer = React.createClass({ var Footer = React.createClass({
render : function(){ render : function(){
var style = {
textAlign: "center"
};
return (<footer> return (<footer>
<span className="label label-success">transparent mode</span> <span className="label label-success">transparent mode</span>
</footer>); </footer>);

View File

@ -8,7 +8,7 @@
<script src="vendor/jquery/jquery.js"></script> <script src="vendor/jquery/jquery.js"></script>
<script src="vendor/underscore/underscore.js"></script> <script src="vendor/underscore/underscore.js"></script>
<script src="vendor/lodash/dist/lodash.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/scurve.js"></script>
<script src="js/entropy.js"></script> <script src="js/entropy.js"></script>
<script src="js/orders.js"></script> <script src="js/orders.js"></script>