From bb0154638a3a16cd0fea591d3d973bad3b38099a Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Tue, 17 Mar 2015 16:18:13 +0700 Subject: [PATCH] Get rid of jQuery --- Makefile | 3 +-- app/bower.json | 1 - app/index.html | 2 +- app/jsx/app.jsx | 12 ++++++------ app/jsx/charts/data.jsx | 2 +- build/index.html | 4 ++-- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 0aae423..d2ddb5b 100644 --- a/Makefile +++ b/Makefile @@ -6,10 +6,9 @@ cloc: static: $(UGLIFY) \ - app/bower_components/react/react.js \ + app/bower_components/react/react.min.js \ app/bower_components/react-router/build/global/ReactRouter.js \ app/bower_components/lodash/lodash.js \ - app/bower_components/jquery/dist/jquery.js \ app/js/* \ app/jsx/build/*/* \ > build/app.js diff --git a/app/bower.json b/app/bower.json index 46d6d8e..769af93 100644 --- a/app/bower.json +++ b/app/bower.json @@ -4,7 +4,6 @@ "dependencies": { "react": "0.12.2", "react-router": "0.12.4", - "jquery": "2.1.3", "lodash": "3.5.0", "normalize.css": "3.0.2" } diff --git a/app/index.html b/app/index.html index afd18f4..f6516e3 100644 --- a/app/index.html +++ b/app/index.html @@ -19,8 +19,8 @@ - + diff --git a/app/jsx/app.jsx b/app/jsx/app.jsx index d2660da..2a15127 100644 --- a/app/jsx/app.jsx +++ b/app/jsx/app.jsx @@ -16,8 +16,8 @@ var App = React.createClass({ mixins: [Router.Navigation, Router.State], orgsURL: '/api/orgs', - teamsURL: '/api/teams?org=', - usersURL: '/api/users?org=', + teamsURL: '/api/teams', + usersURL: '/api/users', getInitialState: function() { return { @@ -35,7 +35,7 @@ var App = React.createClass({ }, loadOrgs: function() { - $.get(this.orgsURL, function(res){ + getURL(this.orgsURL, {}, function(res) { this.setState({orgs: res}); if (res !== null) { for (var i = 0; i < res.length; i++) { @@ -47,7 +47,7 @@ var App = React.createClass({ }, loadTeams: function() { - $.get(this.teamsURL + this.getParams().org, function(res){ + getURL(this.teamsURL, {org: this.getParams().org}, function(res) { this.setState({teams: res}); if (res !== null) { for (var i = 0; i < res.length; i++) { @@ -59,7 +59,7 @@ var App = React.createClass({ }, loadUsers: function() { - $.get(this.usersURL + this.getParams().org, function(res){ + getURL(this.usersURL, {org: this.getParams().org}, function(res) { this.setState({users: res}); if (res !== null) { for (var i = 0; i < res.length; i++) { @@ -70,7 +70,7 @@ var App = React.createClass({ }.bind(this)); }, - render: function(){ + render: function() { return (
diff --git a/app/jsx/charts/data.jsx b/app/jsx/charts/data.jsx index 86fb78d..3141938 100644 --- a/app/jsx/charts/data.jsx +++ b/app/jsx/charts/data.jsx @@ -37,7 +37,7 @@ var ChartDataMixin = { currentParams: paramsHash, state: 'loadingData' }, function() { - $.get(this.props.api, this.apiParams(), function(res){ + getURL(this.props.api, this.apiParams(), function(res){ this.setState({ rawData: res || [], state: 'newData' diff --git a/build/index.html b/build/index.html index 730266b..ea5dd48 100644 --- a/build/index.html +++ b/build/index.html @@ -8,9 +8,9 @@ - + - +