1
0
Fork 0

Get rid of jQuery

This commit is contained in:
Gregory Eremin 2015-03-17 16:18:13 +07:00
parent c27ad86947
commit bb0154638a
6 changed files with 11 additions and 13 deletions

View File

@ -6,10 +6,9 @@ cloc:
static: static:
$(UGLIFY) \ $(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/react-router/build/global/ReactRouter.js \
app/bower_components/lodash/lodash.js \ app/bower_components/lodash/lodash.js \
app/bower_components/jquery/dist/jquery.js \
app/js/* \ app/js/* \
app/jsx/build/*/* \ app/jsx/build/*/* \
> build/app.js > build/app.js

View File

@ -4,7 +4,6 @@
"dependencies": { "dependencies": {
"react": "0.12.2", "react": "0.12.2",
"react-router": "0.12.4", "react-router": "0.12.4",
"jquery": "2.1.3",
"lodash": "3.5.0", "lodash": "3.5.0",
"normalize.css": "3.0.2" "normalize.css": "3.0.2"
} }

View File

@ -19,8 +19,8 @@
<script src="/bower_components/react/react.js"></script> <script src="/bower_components/react/react.js"></script>
<script src="/bower_components/react-router/build/global/ReactRouter.js"></script> <script src="/bower_components/react-router/build/global/ReactRouter.js"></script>
<script src="/bower_components/lodash/lodash.js"></script> <script src="/bower_components/lodash/lodash.js"></script>
<script src="/bower_components/jquery/dist/jquery.js"></script>
<script src="/js/date.js"></script> <script src="/js/date.js"></script>
<script src="/js/http.js"></script>
<script src="/js/colors.js"></script> <script src="/js/colors.js"></script>
<script src="/js/svground.js"></script> <script src="/js/svground.js"></script>
<script src="/jsx/build/charts/charts.js"></script> <script src="/jsx/build/charts/charts.js"></script>

View File

@ -16,8 +16,8 @@ var App = React.createClass({
mixins: [Router.Navigation, Router.State], mixins: [Router.Navigation, Router.State],
orgsURL: '/api/orgs', orgsURL: '/api/orgs',
teamsURL: '/api/teams?org=', teamsURL: '/api/teams',
usersURL: '/api/users?org=', usersURL: '/api/users',
getInitialState: function() { getInitialState: function() {
return { return {
@ -35,7 +35,7 @@ var App = React.createClass({
}, },
loadOrgs: function() { loadOrgs: function() {
$.get(this.orgsURL, function(res){ getURL(this.orgsURL, {}, function(res) {
this.setState({orgs: res}); this.setState({orgs: res});
if (res !== null) { if (res !== null) {
for (var i = 0; i < res.length; i++) { for (var i = 0; i < res.length; i++) {
@ -47,7 +47,7 @@ var App = React.createClass({
}, },
loadTeams: function() { loadTeams: function() {
$.get(this.teamsURL + this.getParams().org, function(res){ getURL(this.teamsURL, {org: this.getParams().org}, function(res) {
this.setState({teams: res}); this.setState({teams: res});
if (res !== null) { if (res !== null) {
for (var i = 0; i < res.length; i++) { for (var i = 0; i < res.length; i++) {
@ -59,7 +59,7 @@ var App = React.createClass({
}, },
loadUsers: function() { loadUsers: function() {
$.get(this.usersURL + this.getParams().org, function(res){ getURL(this.usersURL, {org: this.getParams().org}, function(res) {
this.setState({users: res}); this.setState({users: res});
if (res !== null) { if (res !== null) {
for (var i = 0; i < res.length; i++) { for (var i = 0; i < res.length; i++) {

View File

@ -37,7 +37,7 @@ var ChartDataMixin = {
currentParams: paramsHash, currentParams: paramsHash,
state: 'loadingData' state: 'loadingData'
}, function() { }, function() {
$.get(this.props.api, this.apiParams(), function(res){ getURL(this.props.api, this.apiParams(), function(res){
this.setState({ this.setState({
rawData: res || [], rawData: res || [],
state: 'newData' state: 'newData'

View File

@ -8,9 +8,9 @@
<link rel="apple-touch-icon" sizes="114x114" href="/images/favicon_128.png"> <link rel="apple-touch-icon" sizes="114x114" href="/images/favicon_128.png">
<link rel="apple-touch-icon" sizes="72x72" href="/images/favicon_128.png"> <link rel="apple-touch-icon" sizes="72x72" href="/images/favicon_128.png">
<link rel="apple-touch-icon" sizes="144x144" href="/images/favicon_128.png"> <link rel="apple-touch-icon" sizes="144x144" href="/images/favicon_128.png">
<link rel="stylesheet" href="/empact.css"> <link rel="stylesheet" href="/app.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600"> <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600">
</head> </head>
<body></body> <body></body>
<script src="/empact.js"></script> <script src="/app.js"></script>
</html> </html>