From 6a161be6b4c526fcc5f6581c7faff00a2c976f37 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Thu, 18 Sep 2014 00:01:45 +0200 Subject: [PATCH] .jsx -> .jsx.js Rename jsx files to be compatible with Chrome Dev Tools and Workspace Mapping. --- libmproxy/web/static/js/app.js | 9 ++++++--- web/gulpfile.js | 10 +++++----- .../js/components/{eventlog.jsx => eventlog.jsx.js} | 0 .../js/components/{flowtable.jsx => flowtable.jsx.js} | 9 ++++++--- web/src/js/components/{footer.jsx => footer.jsx.js} | 0 web/src/js/components/{header.jsx => header.jsx.js} | 0 .../js/components/{proxyapp.jsx => proxyapp.jsx.js} | 0 7 files changed, 17 insertions(+), 11 deletions(-) rename web/src/js/components/{eventlog.jsx => eventlog.jsx.js} (100%) rename web/src/js/components/{flowtable.jsx => flowtable.jsx.js} (92%) rename web/src/js/components/{footer.jsx => footer.jsx.js} (100%) rename web/src/js/components/{header.jsx => header.jsx.js} (100%) rename web/src/js/components/{proxyapp.jsx => proxyapp.jsx.js} (100%) diff --git a/libmproxy/web/static/js/app.js b/libmproxy/web/static/js/app.js index ea49db4d4..df1c91def 100644 --- a/libmproxy/web/static/js/app.js +++ b/libmproxy/web/static/js/app.js @@ -456,7 +456,7 @@ var FlowRow = React.createClass({displayName: 'FlowRow', flow: flow }); }.bind(this)); - return React.DOM.tr(null, columns); + return React.DOM.tr({onClick: this.props.onClick}, columns); } }); @@ -473,7 +473,7 @@ var FlowTableBody = React.createClass({displayName: 'FlowTableBody', render: function(){ var rows = this.props.flows.map(function(flow){ //TODO: Add UUID - return FlowRow({flow: flow, columns: this.props.columns}); + return FlowRow({onClick: this.props.onClick, flow: flow, columns: this.props.columns}); }.bind(this)); return React.DOM.tbody(null, rows); } @@ -593,6 +593,9 @@ var FlowTable = React.createClass({displayName: 'FlowTable', flows: this.flowStore.getAll() }); }, + onClick: function(e){ + console.log("rowclick", e); + }, render: function () { var flows = this.state.flows.map(function(flow){ return React.DOM.div(null, flow.request.method, " ", flow.request.scheme, "://", flow.request.host, flow.request.path); @@ -600,7 +603,7 @@ var FlowTable = React.createClass({displayName: 'FlowTable', return ( React.DOM.table({className: "flow-table"}, FlowTableHead({columns: this.state.columns}), - FlowTableBody({columns: this.state.columns, flows: this.state.flows}) + FlowTableBody({onClick: this.onClick, columns: this.state.columns, flows: this.state.flows}) ) ); } diff --git a/web/gulpfile.js b/web/gulpfile.js index 66554051f..6b1758d58 100644 --- a/web/gulpfile.js +++ b/web/gulpfile.js @@ -41,11 +41,11 @@ var path = { 'js/stores/eventlogstore.js', 'js/stores/flowstore.js', 'js/connection.js', - 'js/components/header.jsx', - 'js/components/flowtable.jsx', - 'js/components/eventlog.jsx', - 'js/components/footer.jsx', - 'js/components/proxyapp.jsx', + 'js/components/header.jsx.js', + 'js/components/flowtable.jsx.js', + 'js/components/eventlog.jsx.js', + 'js/components/footer.jsx.js', + 'js/components/proxyapp.jsx.js', 'js/app.js', ], }, diff --git a/web/src/js/components/eventlog.jsx b/web/src/js/components/eventlog.jsx.js similarity index 100% rename from web/src/js/components/eventlog.jsx rename to web/src/js/components/eventlog.jsx.js diff --git a/web/src/js/components/flowtable.jsx b/web/src/js/components/flowtable.jsx.js similarity index 92% rename from web/src/js/components/flowtable.jsx rename to web/src/js/components/flowtable.jsx.js index a94e559fe..39721baf4 100644 --- a/web/src/js/components/flowtable.jsx +++ b/web/src/js/components/flowtable.jsx.js @@ -9,7 +9,7 @@ var FlowRow = React.createClass({ flow: flow }); }.bind(this)); - return {columns}; + return {columns}; } }); @@ -26,7 +26,7 @@ var FlowTableBody = React.createClass({ render: function(){ var rows = this.props.flows.map(function(flow){ //TODO: Add UUID - return ; + return ; }.bind(this)); return {rows}; } @@ -146,6 +146,9 @@ var FlowTable = React.createClass({ flows: this.flowStore.getAll() }); }, + onClick: function(e){ + console.log("rowclick", e); + }, render: function () { var flows = this.state.flows.map(function(flow){ return
{flow.request.method} {flow.request.scheme}://{flow.request.host}{flow.request.path}
; @@ -153,7 +156,7 @@ var FlowTable = React.createClass({ return ( - +
); } diff --git a/web/src/js/components/footer.jsx b/web/src/js/components/footer.jsx.js similarity index 100% rename from web/src/js/components/footer.jsx rename to web/src/js/components/footer.jsx.js diff --git a/web/src/js/components/header.jsx b/web/src/js/components/header.jsx.js similarity index 100% rename from web/src/js/components/header.jsx rename to web/src/js/components/header.jsx.js diff --git a/web/src/js/components/proxyapp.jsx b/web/src/js/components/proxyapp.jsx.js similarity index 100% rename from web/src/js/components/proxyapp.jsx rename to web/src/js/components/proxyapp.jsx.js