mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-11-10 15:21:56 +00:00
Added gatherer counter as a react component
This commit is contained in:
parent
0bd2935361
commit
9f4fd9be53
96 changed files with 1341 additions and 28 deletions
29
README.md
Normal file
29
README.md
Normal file
|
@ -0,0 +1,29 @@
|
|||
# SWS Gather App
|
||||
|
||||
## Status
|
||||
|
||||
A stateless, flexible and realtime micro web service to arrange SWS gathers for ENSL.org
|
||||
|
||||
## Run
|
||||
|
||||
```bash
|
||||
npm install
|
||||
|
||||
npm start
|
||||
```
|
||||
|
||||
## Todo
|
||||
|
||||
- ENSL.org: Authentication
|
||||
- ENSL.org: Pull user data and bans
|
||||
- ENSL.org: API to allow ENSL to pull current gather status
|
||||
- Steam Integration: Pull hive stats
|
||||
- Steam Integration: Outbound steam messaging
|
||||
- Steam Integration: Pull avatars
|
||||
- Admin tools
|
||||
- Add a backend datastore to persist gather data and messages
|
||||
- Add sounds
|
||||
|
||||
## License
|
||||
|
||||
MIT Licensed
|
|
@ -1,13 +1,33 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = function (io) {
|
||||
var root = io.of("/");
|
||||
var authorised = io.of("/authorised");
|
||||
|
||||
var emitCount = function () {
|
||||
root.emit('gatherCount', {
|
||||
count: root.sockets.length
|
||||
});
|
||||
};
|
||||
|
||||
var onConnection = function (socket) {
|
||||
emitCount();
|
||||
};
|
||||
|
||||
var onDisconnect = function (socket) {
|
||||
emitCount();
|
||||
};
|
||||
|
||||
io.on('connection', function (socket) {
|
||||
socket.emit('welcome', { hello: 'world' });
|
||||
// socket.on('my other event', function (data) {
|
||||
// console.log(data);
|
||||
// });
|
||||
socket.on('disconnect', function () {
|
||||
io.emit('user disconnected');
|
||||
|
||||
onConnection(socket);
|
||||
|
||||
socket.on('disconnect', function (socket) {
|
||||
onDisconnect();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// socket.on('my other event', function (data) {
|
||||
// console.log(data);
|
||||
// });
|
15
index.js
15
index.js
|
@ -1,12 +1,12 @@
|
|||
"use strict";
|
||||
|
||||
var express = require("express");
|
||||
var app = express();
|
||||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
var config = require(path.join(__dirname, "config/config.js"));
|
||||
var express = require("express");
|
||||
var app = express();
|
||||
var server = require('http').Server(app);
|
||||
var io = require('socket.io')(server);
|
||||
var config = require(path.join(__dirname, "config/config.js"));
|
||||
|
||||
// Configure express
|
||||
require(path.join(__dirname, "config/express"))(app);
|
||||
|
@ -15,8 +15,15 @@ require(path.join(__dirname, "config/express"))(app);
|
|||
require(path.join(__dirname, "config/routes"))(app);
|
||||
|
||||
// Configure socket.io server
|
||||
|
||||
server.listen(config.port);
|
||||
|
||||
require(path.join(__dirname, "config/socketio"))(io);
|
||||
|
||||
console.log("Listening on port", config.port);
|
||||
|
||||
module.exports = app;
|
||||
module.exports = {
|
||||
app: app,
|
||||
server: server,
|
||||
io: io
|
||||
};
|
17
lib/react/app.jsx
Normal file
17
lib/react/app.jsx
Normal file
|
@ -0,0 +1,17 @@
|
|||
var MenuCounter = React.createClass({
|
||||
componentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
this.setProps({count: data.count});
|
||||
},
|
||||
render: function () {
|
||||
return (
|
||||
<li>
|
||||
<a href="#"><i className="fa fa-users fa-fw"></i> Gatherers ({this.props.count})</a>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
React.render(<MenuCounter count={0} />, document.getElementById('side-menu'));
|
28
npm-debug.log
Normal file
28
npm-debug.log
Normal file
|
@ -0,0 +1,28 @@
|
|||
0 info it worked if it ends with ok
|
||||
1 verbose cli [ '/Users/cablanchard/.nvm/v0.10.38/bin/node',
|
||||
1 verbose cli '/Users/cablanchard/.nvm/v0.10.38/bin/npm',
|
||||
1 verbose cli 'start' ]
|
||||
2 info using npm@1.4.28
|
||||
3 info using node@v0.10.38
|
||||
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
|
||||
5 info prestart sws_gathers@1.0.0
|
||||
6 info start sws_gathers@1.0.0
|
||||
7 verbose unsafe-perm in lifecycle true
|
||||
8 info sws_gathers@1.0.0 Failed to exec start script
|
||||
9 error sws_gathers@1.0.0 start: `node index.js`
|
||||
9 error Exit status 8
|
||||
10 error Failed at the sws_gathers@1.0.0 start script.
|
||||
10 error This is most likely a problem with the sws_gathers package,
|
||||
10 error not with npm itself.
|
||||
10 error Tell the author that this fails on your system:
|
||||
10 error node index.js
|
||||
10 error You can get their info via:
|
||||
10 error npm owner ls sws_gathers
|
||||
10 error There is likely additional logging output above.
|
||||
11 error System Darwin 14.3.0
|
||||
12 error command "/Users/cablanchard/.nvm/v0.10.38/bin/node" "/Users/cablanchard/.nvm/v0.10.38/bin/npm" "start"
|
||||
13 error cwd /Users/cablanchard/Developer/node/sws_gathers
|
||||
14 error node -v v0.10.38
|
||||
15 error npm -v 1.4.28
|
||||
16 error code ELIFECYCLE
|
||||
17 verbose exit [ 1, true ]
|
15
package.json
15
package.json
|
@ -9,7 +9,10 @@
|
|||
],
|
||||
"scripts": {
|
||||
"test": "NODE_ENV=test mocha spec/",
|
||||
"start": "node index.js"
|
||||
"start": "node index.js",
|
||||
"compile:dev:react": "node_modules/react-tools/bin/jsx --watch -x jsx lib/react/ public/js/",
|
||||
"compile:react": "node_modules/react-tools/bin/jsx -x jsx lib/react/ public/js/",
|
||||
"dev": "nodemon index.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -22,14 +25,18 @@
|
|||
},
|
||||
"homepage": "https://github.com/cblanc/sws_gathers",
|
||||
"dependencies": {
|
||||
"chai": "~3.1.0",
|
||||
"express": "~4.13.1",
|
||||
"express-handlebars": "~2.0.1",
|
||||
"mocha": "~2.2.5",
|
||||
"morgan": "~1.6.1",
|
||||
"node-mysql": "~0.4.2",
|
||||
"socket.io": "~1.3.5",
|
||||
"supertest": "~1.0.1",
|
||||
"react-tools": "~0.13.3",
|
||||
"winston": "~1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "~3.1.0",
|
||||
"mocha": "~2.2.5",
|
||||
"nodemon": "~1.3.7",
|
||||
"supertest": "~1.0.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"}, "#"),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, null), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,21 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
this.props.count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, {count: 0}), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,24 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
onComponentDidMount: function () {
|
||||
socket.on('gatherCount', updateCount)
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
this.props.count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, {count: 0}), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,18 @@
|
|||
var gathererCounter = React.createClass({displayName: "gathererCounter",
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"}, "#"),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
getInitialState: function () {
|
||||
return {
|
||||
count: 0
|
||||
};
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
this.getState('count')
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, {count: 0}), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,25 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
getInitialState: {
|
||||
count: 0
|
||||
},
|
||||
updateCount: function (count) {
|
||||
this.setState({ count: count })
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"}, "#"),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, null), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,17 @@
|
|||
var gathererCounter = React.createClass({displayName: "gathererCounter",
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"}, "#"),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
})
|
|
@ -0,0 +1,21 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
this.props.count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, null), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,17 @@
|
|||
var MenuCounter = React.createClass({displayName: "MenuCounter",
|
||||
componentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
this.setProps({count: data.count});
|
||||
},
|
||||
render: function () {
|
||||
return (
|
||||
React.createElement("li", null,
|
||||
React.createElement("a", {href: "#"}, React.createElement("i", {className: "fa fa-users fa-fw"}), " Gatherers (", this.props.count, ")")
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(MenuCounter, {count: 0}), document.getElementById('side-menu'));
|
|
@ -0,0 +1,45 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
componentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
console.log(data);
|
||||
this.setProps({count: data.count});
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
this.props.count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
var MenuCounter = React.createClass({displayName: "MenuCounter",
|
||||
componentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
console.log(data);
|
||||
this.setProps({count: data.count});
|
||||
},
|
||||
render: function () {
|
||||
return (
|
||||
React.createElement("li", null,
|
||||
React.createElement("a", {href: "#"}, React.createElement("i", {className: "fa fa-users fa-fw"}), " Gatherers")
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, {count: 0}), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,26 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
getInitialState: function () {
|
||||
return {
|
||||
count: 0
|
||||
};
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
this.props.count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, {count: 0}), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,44 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
componentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
console.log(data);
|
||||
this.setProps({count: data.count});
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
this.props.count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
var MenuCounter = React.createClass({displayName: "MenuCounter",
|
||||
componentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
this.setProps({count: data.count});
|
||||
},
|
||||
render: function () {
|
||||
return (
|
||||
React.createElement("li", null,
|
||||
React.createElement("a", {href: "#"}, React.createElement("i", {className: "fa fa-users fa-fw"}), " Gatherers (", this.props.count, ")")
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(MenuCounter, {count: 0}), document.getElementById('sideMenu'));
|
|
@ -0,0 +1,25 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
getInitialState: {
|
||||
count: 0
|
||||
},
|
||||
updateCount: function (count) {
|
||||
this.setState({ count: count });
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"}, "#"),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, null), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,17 @@
|
|||
var gathererCounter = React.createClass({displayName: "gathererCounter",
|
||||
render: function () {
|
||||
return (React.createElement("div", {class: "panel panel-primary"},
|
||||
React.createElement("div", {class: "panel-heading"},
|
||||
React.createElement("div", {class: "row"},
|
||||
React.createElement("div", {class: "col-xs-3"},
|
||||
React.createElement("i", {class: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {class: "col-xs-9 text-right"},
|
||||
React.createElement("div", {class: "huge", id: "gather-counter"}, "#"),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
})
|
|
@ -0,0 +1,27 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
onComponentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
this.props.count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, {count: 0}), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,28 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
onComponentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
console.log(data);
|
||||
this.setProps({count: data.count});
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
this.props.count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, {count: 0}), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,27 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
onComponentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function () {
|
||||
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
this.props.count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, {count: 0}), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,25 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
getInitialState: {
|
||||
count: 0
|
||||
},
|
||||
updateCount: function (count) {
|
||||
this.setState({ count: count });
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"}, count),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, null), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,27 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
onComponentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
this.setProps({count: data.count});
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
this.props.count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, {count: 0}), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,44 @@
|
|||
// var GathererCounter = React.createClass({
|
||||
// componentDidMount: function () {
|
||||
// socket.on('gatherCount', this.updateCount)
|
||||
// },
|
||||
// updateCount: function (data) {
|
||||
// console.log(data);
|
||||
// this.setProps({count: data.count});
|
||||
// },
|
||||
// render: function () {
|
||||
// return (<div className="panel panel-primary">
|
||||
// <div className="panel-heading">
|
||||
// <div className="row">
|
||||
// <div className="col-xs-3">
|
||||
// <i className="fa fa-users fa-5x"></i>
|
||||
// </div>
|
||||
// <div className="col-xs-9 text-right">
|
||||
// <div className="huge" id="gather-counter">
|
||||
// {this.props.count}
|
||||
// </div>
|
||||
// <div>Gatherers Online</div>
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>);
|
||||
// }
|
||||
// });
|
||||
|
||||
var MenuCounter = React.createClass({displayName: "MenuCounter",
|
||||
componentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
this.setProps({count: data.count});
|
||||
},
|
||||
render: function () {
|
||||
return (
|
||||
React.createElement("li", null,
|
||||
React.createElement("a", {href: "#"}, React.createElement("i", {className: "fa fa-users fa-fw"}), " Gatherers (", this.props.count, ")")
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(MenuCounter, {count: 0}), document.getElementById('side-menu'));
|
|
@ -0,0 +1,45 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
componentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
console.log(data);
|
||||
this.setProps({count: data.count});
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
this.props.count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
var MenuCounter = React.createClass({displayName: "MenuCounter",
|
||||
componentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
console.log(data);
|
||||
this.setProps({count: data.count});
|
||||
},
|
||||
render: function () {
|
||||
return (
|
||||
React.createElement("li", null,
|
||||
React.createElement("a", {href: "#"}, React.createElement("i", {className: "fa fa-users fa-fw"}), " Gatherers (", this.props.count, ")")
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(MenuCounter, {count: 0}), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,27 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
onComponentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
this.setProps({count: data.count})
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
this.props.count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, {count: 0}), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,45 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
componentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
console.log(data);
|
||||
this.setProps({count: data.count});
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
this.props.count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
var MenuCounter = React.createClass({displayName: "MenuCounter",
|
||||
componentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
console.log(data);
|
||||
this.setProps({count: data.count});
|
||||
},
|
||||
render: function () {
|
||||
return (
|
||||
React.createElement("li", null,
|
||||
React.createElement("a", {href: "#"}, React.createElement("i", {class: "fa fa-users fa-fw"}), " Gatherers")
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, {count: 0}), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,45 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
componentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
console.log(data);
|
||||
this.setProps({count: data.count});
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
this.props.count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
var MenuCounter = React.createClass({displayName: "MenuCounter",
|
||||
componentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
console.log(data);
|
||||
this.setProps({count: data.count});
|
||||
},
|
||||
render: function () {
|
||||
return (
|
||||
React.createElement("li", null,
|
||||
React.createElement("a", {href: "#"}, React.createElement("i", {className: "fa fa-users fa-fw"}), " Gatherers (", this.props.count, ")")
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(MenuCounter, {count: 0}), document.getElementById('sideMenu'));
|
|
@ -0,0 +1,25 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
onComponentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
this.props.count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, {count: 0}), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,21 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
this.state.count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, null), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,27 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
onComponentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function () {
|
||||
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
this.props.count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, {count: 0}), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,22 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
getInitialState: {
|
||||
count: 0
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"}, "#"),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, null), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,45 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
componentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
console.log(data);
|
||||
this.setProps({count: data.count});
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
this.props.count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
var MenuCounter = React.createClass({displayName: "MenuCounter",
|
||||
componentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
console.log(data);
|
||||
this.setProps({count: data.count});
|
||||
},
|
||||
render: function () {
|
||||
return (
|
||||
React.createElement("li", null,
|
||||
React.createElement("a", {href: "#"}, React.createElement("i", {className: "fa fa-users fa-fw"}), " Gatherers (", this.props.count, ")")
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, {count: 0}), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,29 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
getInitialState: function () {
|
||||
return {
|
||||
count: 0
|
||||
};
|
||||
},
|
||||
updateCount: function (count) {
|
||||
this.setState({ count: count });
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
this.state.count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, null), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,44 @@
|
|||
// var GathererCounter = React.createClass({
|
||||
// componentDidMount: function () {
|
||||
// socket.on('gatherCount', this.updateCount)
|
||||
// },
|
||||
// updateCount: function (data) {
|
||||
// console.log(data);
|
||||
// this.setProps({count: data.count});
|
||||
// },
|
||||
// render: function () {
|
||||
// return (<div className="panel panel-primary">
|
||||
// <div className="panel-heading">
|
||||
// <div className="row">
|
||||
// <div className="col-xs-3">
|
||||
// <i className="fa fa-users fa-5x"></i>
|
||||
// </div>
|
||||
// <div className="col-xs-9 text-right">
|
||||
// <div className="huge" id="gather-counter">
|
||||
// {this.props.count}
|
||||
// </div>
|
||||
// <div>Gatherers Online</div>
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>);
|
||||
// }
|
||||
// });
|
||||
|
||||
var MenuCounter = React.createClass({displayName: "MenuCounter",
|
||||
componentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
this.setProps({count: data.count});
|
||||
},
|
||||
render: function () {
|
||||
return (
|
||||
React.createElement("li", null,
|
||||
React.createElement("a", {href: "#"}, React.createElement("i", {className: "fa fa-users fa-fw"}), " Gatherers (", this.props.count, ")")
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(MenuCounter, {count: 0}), document.getElementById('sideMenu'));
|
|
@ -0,0 +1,27 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
getInitialState: {
|
||||
count: 0
|
||||
},
|
||||
updateCount: function (count) {
|
||||
this.setState({ count: count });
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, null), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,55 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
componentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
console.log(data);
|
||||
this.setProps({count: data.count});
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
this.props.count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
var MenuCounter = React.createClass({displayName: "MenuCounter",
|
||||
componentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
console.log(data);
|
||||
this.setProps({count: data.count});
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
this.props.count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, {count: 0}), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,28 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
componentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
console.log(data);
|
||||
this.setProps({count: data.count});
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
this.props.count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, {count: 0}), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1,17 @@
|
|||
var gathererCounter = React.createClass({displayName: "gathererCounter",
|
||||
render: function () {
|
||||
return React.createElement("div", {class: "panel panel-primary"},
|
||||
React.createElement("div", {class: "panel-heading"},
|
||||
React.createElement("div", {class: "row"},
|
||||
React.createElement("div", {class: "col-xs-3"},
|
||||
React.createElement("i", {class: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {class: "col-xs-9 text-right"},
|
||||
React.createElement("div", {class: "huge", id: "gather-counter"}, "#"),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
})
|
|
@ -0,0 +1,36 @@
|
|||
var TodoList = React.createClass({displayName: "TodoList",
|
||||
render: function() {
|
||||
var createItem = function(itemText, index) {
|
||||
return React.createElement("li", {key: index + itemText}, itemText);
|
||||
};
|
||||
return React.createElement("ul", null, this.props.items.map(createItem));
|
||||
}
|
||||
});
|
||||
var TodoApp = React.createClass({displayName: "TodoApp",
|
||||
getInitialState: function() {
|
||||
return {items: [], text: ''};
|
||||
},
|
||||
onChange: function(e) {
|
||||
this.setState({text: e.target.value});
|
||||
},
|
||||
handleSubmit: function(e) {
|
||||
e.preventDefault();
|
||||
var nextItems = this.state.items.concat([this.state.text]);
|
||||
var nextText = '';
|
||||
this.setState({items: nextItems, text: nextText});
|
||||
},
|
||||
render: function() {
|
||||
return (
|
||||
React.createElement("div", null,
|
||||
React.createElement("h3", null, "TODO"),
|
||||
React.createElement(TodoList, {items: this.state.items}),
|
||||
React.createElement("form", {onSubmit: this.handleSubmit},
|
||||
React.createElement("input", {onChange: this.onChange, value: this.state.text}),
|
||||
React.createElement("button", null, 'Add #' + (this.state.items.length + 1))
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
;
|
|
@ -0,0 +1,29 @@
|
|||
var GathererCounter = React.createClass({displayName: "GathererCounter",
|
||||
getInitialState: function () {
|
||||
return {
|
||||
count: 0
|
||||
};
|
||||
},
|
||||
updateCount: function (count) {
|
||||
this.setState({ count: count });
|
||||
},
|
||||
render: function () {
|
||||
return (React.createElement("div", {className: "panel panel-primary"},
|
||||
React.createElement("div", {className: "panel-heading"},
|
||||
React.createElement("div", {className: "row"},
|
||||
React.createElement("div", {className: "col-xs-3"},
|
||||
React.createElement("i", {className: "fa fa-users fa-5x"})
|
||||
),
|
||||
React.createElement("div", {className: "col-xs-9 text-right"},
|
||||
React.createElement("div", {className: "huge", id: "gather-counter"},
|
||||
count
|
||||
),
|
||||
React.createElement("div", null, "Gatherers Online")
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(GathererCounter, null), document.getElementById('gatherCounter'));
|
|
@ -0,0 +1 @@
|
|||
{".js":"080c6ac9782b94536500ddb350a5a2db6c79c5d0.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"0a3704e0b971d6f8290a3efc871a57617ee0a15a.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"0f7a03f450663801d6dd518f98f0159430a961a2.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"118a4cc431c96eec7da652f52e2df24d6e42ed76.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"1227d9a0a98eed5691b8b934fb063dcac5f13229.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"1228defbf9e48f4397afe98096ac50d35831f4c5.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"1d1eb608f03c6968254b21820c0e6f5cdc7fca1c.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"2a1c89bcf1d4766dc10811dc8af9e6d5e5c8d669.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"2c77c19cdf0cf3bb958d4d66837ecfea8429a5d6.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"2fae87380d9cbedf1f340e41a1c628ada82fd6cc.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"310ea820901d05e2a9359da8adddc9e6cf835bbf.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"34e2a72c687db357db0c445f72112ed0ad0401d8.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"3fd71a95a716773a5542267ff559c1bac2ebd145.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"40fb7f3f70110d45ff88674c6cbfcf0466ca557c.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"4d35c87752610737362769003ed6019e24089dea.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"51cfd3c15651e482a0ce10069fcf434d420ad98c.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"5dd21e9811e1241f0744a7ea32beb42c2ed54fdc.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"6260a333593fcc33d9027d706c015f2e705c331c.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"68b46e2bdadd0334fc1af6e052359eb68b503eb1.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"7be73b3106cc6f137224bab56add0f7977a5b99d.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"830113443f1bba72e5c4c1e2a13223670ae34242.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"8b9451cc3a7abd2a28be5fa6626539b93402d66e.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"93a25a468d2afb76df9d1d8966b5dcc7fd24615e.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"94c16abfa314165bd1983e75b460c106a2d99b73.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"9d8ecfeafcaa8db65383a974e2453381be3612ac.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"9fb0d8b7cb67d528683cacd6ee470c2d09a977b6.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"a28d643d1ec29221f3ae842225f079fd9ffd44df.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"a7fa23dd16e23ce4a104450771900f33506daba4.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"afb9f21d4b0493b888e844b98a1ab0d4dffa3811.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"b0020dd1109aa45c3d5802819eb39a06841576c3.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"ce88f1373c1f06ccee52908b62f8f161fb0d639c.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"cf8e0d8551497ff3cf3d7b0ea18565cf0edb955d.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"d48909f4009e432b2547dce2a1c564f0e21ddd46.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"d79d327bc320e60fdb01101f85c02adc2b76e98f.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"ddfa618fa4dfdf81625ea52e7bb9239de3744884.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"deed142860f8fe418abdf965eed14561d915bcca.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"def246f0d40dc81b6306e2774afdc7d57c51e331.js"}
|
|
@ -0,0 +1 @@
|
|||
{".js":"e71005362b97fa1f4fe7451d16b9fbc9439501f7.js"}
|
|
@ -0,0 +1,17 @@
|
|||
var MenuCounter = React.createClass({displayName: "MenuCounter",
|
||||
componentDidMount: function () {
|
||||
socket.on('gatherCount', this.updateCount)
|
||||
},
|
||||
updateCount: function (data) {
|
||||
this.setProps({count: data.count});
|
||||
},
|
||||
render: function () {
|
||||
return (
|
||||
React.createElement("li", null,
|
||||
React.createElement("a", {href: "#"}, React.createElement("i", {className: "fa fa-users fa-fw"}), " Gatherers (", this.props.count, ")")
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(MenuCounter, {count: 0}), document.getElementById('side-menu'));
|
13
public/js/client.js
Normal file
13
public/js/client.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
var socket = io("http://localhost:8000/");
|
||||
|
||||
socket.on("connect", function () {
|
||||
console.log("Connected!");
|
||||
});
|
||||
|
||||
socket.on("reconnect", function () {
|
||||
|
||||
});
|
||||
|
||||
socket.on("disconnect", function () {
|
||||
|
||||
});
|
16
public/js/react-0.13.3.min.js
vendored
Normal file
16
public/js/react-0.13.3.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
public/js/socket.io-1.3.5.js
Normal file
3
public/js/socket.io-1.3.5.js
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,3 +0,0 @@
|
|||
$(function () {
|
||||
|
||||
});
|
|
@ -1,7 +1,17 @@
|
|||
/*
|
||||
* metismenu - v2.0.2
|
||||
* A jQuery menu plugin
|
||||
* https://github.com/onokumus/metisMenu
|
||||
*
|
||||
* Made by Osman Nuri Okumus
|
||||
* Under MIT License
|
||||
*/
|
||||
|
||||
!function(a){"use strict";function b(){var a=document.createElement("mm"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}function c(b){return this.each(function(){var c=a(this),d=c.data("mm"),f=a.extend({},e.DEFAULTS,c.data(),"object"==typeof b&&b);d||c.data("mm",d=new e(this,f)),"string"==typeof b&&d[b]()})}a.fn.emulateTransitionEnd=function(b){var c=!1,e=this;a(this).one("mmTransitionEnd",function(){c=!0});var f=function(){c||a(e).trigger(d.end)};return setTimeout(f,b),this};var d=b();d&&(a.event.special.mmTransitionEnd={bindType:d.end,delegateType:d.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}});var e=function(b,c){this.$element=a(b),this.options=a.extend({},e.DEFAULTS,c),this.transitioning=null,this.init()};e.TRANSITION_DURATION=350,e.DEFAULTS={toggle:!0,doubleTapToGo:!1,activeClass:"active",collapseClass:"collapse",collapseInClass:"in",collapsingClass:"collapsing"},e.prototype.init=function(){var b=this,c=this.options.activeClass,d=this.options.collapseClass,e=this.options.collapseInClass;this.$element.find("li."+c).has("ul").children("ul").addClass(d+" "+e),this.$element.find("li").not("."+c).has("ul").children("ul").addClass(d),this.options.doubleTapToGo&&this.$element.find("li."+c).has("ul").children("a").addClass("doubleTapToGo"),this.$element.find("li").has("ul").children("a").on("click.metisMenu",function(d){var e=a(this),f=e.parent("li"),g=f.children("ul");return d.preventDefault(),f.hasClass(c)?b.hide(g):b.show(g),b.options.doubleTapToGo&&b.doubleTapToGo(e)&&"#"!==e.attr("href")&&""!==e.attr("href")?(d.stopPropagation(),void(document.location=e.attr("href"))):void 0})},e.prototype.doubleTapToGo=function(a){var b=this.$element;return a.hasClass("doubleTapToGo")?(a.removeClass("doubleTapToGo"),!0):a.parent().children("ul").length?(b.find(".doubleTapToGo").removeClass("doubleTapToGo"),a.addClass("doubleTapToGo"),!1):void 0},e.prototype.show=function(b){var c=this.options.activeClass,f=this.options.collapseClass,g=this.options.collapseInClass,h=this.options.collapsingClass,i=a(b),j=i.parent("li");if(!this.transitioning&&!i.hasClass(g)){j.addClass(c),this.options.toggle&&this.hide(j.siblings().children("ul."+g)),i.removeClass(f).addClass(h).height(0),this.transitioning=1;var k=function(){i.removeClass(h).addClass(f+" "+g).height(""),this.transitioning=0};return d?void i.one("mmTransitionEnd",a.proxy(k,this)).emulateTransitionEnd(e.TRANSITION_DURATION).height(i[0].scrollHeight):k.call(this)}},e.prototype.hide=function(b){var c=this.options.activeClass,f=this.options.collapseClass,g=this.options.collapseInClass,h=this.options.collapsingClass,i=a(b);if(!this.transitioning&&i.hasClass(g)){i.parent("li").removeClass(c),i.height(i.height())[0].offsetHeight,i.addClass(h).removeClass(f).removeClass(g),this.transitioning=1;var j=function(){this.transitioning=0,i.removeClass(h).addClass(f)};return d?void i.height(0).one("mmTransitionEnd",a.proxy(j,this)).emulateTransitionEnd(e.TRANSITION_DURATION):j.call(this)}};var f=a.fn.metisMenu;a.fn.metisMenu=c,a.fn.metisMenu.Constructor=e,a.fn.metisMenu.noConflict=function(){return a.fn.metisMenu=f,this}}(jQuery);
|
||||
|
||||
|
||||
$(function() {
|
||||
|
||||
$('#side-menu').metisMenu();
|
||||
|
||||
});
|
||||
|
||||
//Loads the correct sidebar on window load,
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
{".js":"43480afd5f69e4669e8d9e74b6aacf91ffe7cedc.js"}
|
0
public/react/app.js
Normal file
0
public/react/app.js
Normal file
|
@ -1,6 +1,8 @@
|
|||
<div id="page-wrapper" style="min-height: 750px;">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-md-6" id="gatherCounter">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
{{>menu}}
|
||||
{{{ body }}}
|
||||
</div>
|
||||
{{>foot}}
|
||||
</body>
|
||||
</html>
|
2
views/partials/foot.hbs
Normal file
2
views/partials/foot.hbs
Normal file
|
@ -0,0 +1,2 @@
|
|||
<script src="/js/client.js"></script>
|
||||
<script src="/js/app.js"></script>
|
|
@ -13,8 +13,7 @@
|
|||
|
||||
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
|
||||
<script src="https://cdn.socket.io/socket.io-1.3.5.js"></script>
|
||||
<script src="/js/socket.io-1.3.5.js"></script>
|
||||
<script src="/js/theme.js"></script>
|
||||
<script src="/js/app.js"></script>
|
||||
<script src="/js/socketio.js"></script>
|
||||
<script src="/js/react-0.13.3.min.js"></script>
|
||||
</head>
|
|
@ -12,10 +12,14 @@
|
|||
<ul class="nav navbar-top-links navbar-right">
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
<i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
|
||||
<i class="fa fa-user fa-fw"></i> Settings <i class="fa fa-caret-down"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-user">
|
||||
<li><a href="#"><i class="fa fa-gear fa-fw"></i> Settings</a>
|
||||
<li><a href="#"><i class="fa fa-gear fa-fw"></i> Profile</a>
|
||||
</li>
|
||||
<li><a href="#"><i class="fa fa-flag fa-fw"></i> Notifications</a>
|
||||
</li>
|
||||
<li><a href="#"><i class="fa fa-music fa-fw"></i> Sounds</a>
|
||||
</li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="login.html"><i class="fa fa-sign-out fa-fw"></i> Logout</a>
|
||||
|
@ -27,8 +31,20 @@
|
|||
<div class="navbar-default sidebar" role="navigation">
|
||||
<div class="sidebar-nav navbar-collapse">
|
||||
<ul class="nav" id="side-menu">
|
||||
<li>
|
||||
<a href="/"><i class="fa fa-dashboard fa-fw"></i> Gathers</a>
|
||||
|
||||
|
||||
|
||||
<li class="">
|
||||
<a href="#"><i class="fa fa-users fa-fw"></i> Gatherers</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="#"><i class="fa fa-users-o fa-fw"></i> You</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="#"><i class="fa fa-users-o fa-fw"></i> Gatherer #1</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="#"><i class="fa fa-users-o fa-fw"></i> Gatherer #2</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue