$(function () { "use strict"; var UserCounter = React.createClass({displayName: "UserCounter", render: function () { return ( React.createElement("li", null, React.createElement("a", {href: "#"}, React.createElement("i", {className: "fa fa-users fa-fw"}), " Online", React.createElement("span", {className: "badge add-left"}, " ", this.props.count, " ") ) ) ); } }); var UserLogin = React.createClass({displayName: "UserLogin", authorizeId: function (id) { id = parseInt(id, 10); socket.emit("users:authorize", { id: id }); }, handleSubmit: function (e) { e.preventDefault(); var id = React.findDOMNode(this.refs.authorize_id).value.trim(); if (!id) return; React.findDOMNode(this.refs.authorize_id).value = ''; this.authorizeId(id); return; }, render: function () { return ( React.createElement("form", {onSubmit: this.handleSubmit}, React.createElement("div", {className: "input-group signin"}, React.createElement("input", { id: "btn-input", type: "text", className: "form-control", ref: "authorize_id", placeholder: "Choose an ID..."}), React.createElement("span", {className: "input-group-btn"}, React.createElement("input", { type: "submit", className: "btn btn-primary", id: "btn-chat", value: "Login"}) ) ), React.createElement("div", {className: "signin"}, React.createElement("p", {className: "text-center"}, React.createElement("small", null, "Just a temporary measure until genuine authentication is implemented")) ) ) ); } }) var UserLine = React.createClass({displayName: "UserLine", render: function () { return ( React.createElement("li", null, React.createElement("a", {href: "#"}, this.props.user.username) ) ); } }); var UserMenu = React.createClass({displayName: "UserMenu", componentDidMount: function () { socket.on('userCount', this.updateUsers); }, updateUsers: function (data) { this.setProps({ count: data.count, users: data.users }); }, render: function () { var users = this.props.users.map(function (user) { return ( React.createElement(UserLine, {user: user}) ); }); return ( React.createElement("ul", {className: "nav", id: "side-menu"}, React.createElement(UserCounter, React.__spread({}, this.props)), users, React.createElement("li", null, React.createElement("br", null), React.createElement(UserLogin, null), React.createElement("br", null)) ) ); } }); var Chatroom = React.createClass({displayName: "Chatroom", componentDidMount: function () { var self = this; var TIMER_INTERVAL = 60000; // Every minute socket.on("message:new", function (data) { var history = self.props.history; history.push(data); self.setProps({ history: history }); self.scrollToBottom(); }); // Message History Retrieved socket.on("message:refresh", function (data) { self.setProps({ history: data.chatHistory }); self.scrollToBottom(); }); socket.emit("message:refresh", {}); self.timer = setInterval(function () { self.refs.messages.refreshTime(); }, TIMER_INTERVAL); }, componentDidUnmount: function () { clearInterval(this.timer); }, sendMessage: function (message) { socket.emit("newMessage", {message: message}); }, scrollToBottom: function () { var node = React.findDOMNode(this.refs.messageContainer); console.log(node) node.scrollTop = node.scrollHeight; }, render: function () { var messages = this.props.history.map(function (message) { return ( React.createElement(ChatMessage, { avatar: message.author.avatar, username: message.author.username, content: message.content, ref: "messages", createdAt: message.createdAt}) ); }); return ( React.createElement("div", {className: "panel panel-default"}, React.createElement("div", {className: "panel-heading"}, "Gather Chat"), React.createElement("div", {className: "panel-body"}, React.createElement("ul", {className: "chat", id: "chatmessages", ref: "messageContainer"}, messages ) ), React.createElement("div", {className: "panel-footer"}, React.createElement(MessageBar, null) ) ) ); } }); var ChatMessage = React.createClass({displayName: "ChatMessage", getInitialState: function () { return { timeAgo: $.timeago(this.props.createdAt) } }, imageUrl: function () { var BASE_URL = "http://www.ensl.org/" return BASE_URL + this.props.avatar; }, refreshTime: function () { var self = this; self.setState({ timeAgo: $.timeago(self.props.createdAt) }); }, render: function () { return ( React.createElement("li", {className: "left clearfix"}, React.createElement("span", {className: "chat-img pull-left"}, React.createElement("img", { src: this.imageUrl(), alt: "User Avatar", height: "40", width: "40", className: "img-circle"}) ), React.createElement("div", {className: "chat-body clearfix"}, React.createElement("div", {className: "header"}, React.createElement("strong", {className: "primary-font"}, this.props.username), React.createElement("small", {className: "pull-right text-muted"}, React.createElement("i", {className: "fa fa-clock-o fa-fw"}), " ", this.state.timeAgo ) ), React.createElement("p", null, this.props.content) ) ) ); } }); var MessageBar = React.createClass({displayName: "MessageBar", sendMessage: function (content) { socket.emit("message:new", { content: content }); }, handleSubmit: function (e) { e.preventDefault(); var content = React.findDOMNode(this.refs.content).value.trim(); if (!content) return; React.findDOMNode(this.refs.content).value = ''; this.sendMessage(content); return; }, render: function () { return ( React.createElement("form", {onSubmit: this.handleSubmit}, React.createElement("div", {className: "input-group"}, React.createElement("input", { id: "btn-input", type: "text", className: "form-control", ref: "content", placeholder: "Be polite please..."}), React.createElement("span", {className: "input-group-btn"}, React.createElement("input", { type: "submit", className: "btn btn-primary", id: "btn-chat", value: "Send"}) ) ) ) ); } }); var socket; function initialiseComponents () { var socketUrl = window.location.protocol + "//" + window.location.host; socket = io(socketUrl) .on("connect", function () { console.log("Connected"); }) .on("reconnect", function () { console.log("Reconnected"); }) .on("disconnect", function () { console.log("Disconnected") }); React.render(React.createElement(UserMenu, {count: 0, users: []}), document.getElementById('side-menu')); React.render(React.createElement(Chatroom, {history: []}), document.getElementById('chatroom')); }; initialiseComponents(); }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNmb3JtZWQuanMiLCJzb3VyY2VzIjpbbnVsbF0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLENBQUMsQ0FBQyxZQUFZOztBQUVkLFlBQVksQ0FBQzs7QUFFYixJQUFJLGlDQUFpQywyQkFBQTtDQUNwQyxNQUFNLEVBQUUsWUFBWTtFQUNuQjtHQUNDLG9CQUFBLElBQUcsRUFBQSxJQUFDLEVBQUE7SUFDSCxvQkFBQSxHQUFFLEVBQUEsQ0FBQSxDQUFDLElBQUEsRUFBSSxDQUFDLEdBQUksQ0FBQSxFQUFBO0tBQ1gsb0JBQUEsR0FBRSxFQUFBLENBQUEsQ0FBQyxTQUFBLEVBQVMsQ0FBQyxtQkFBb0IsQ0FBSSxDQUFBLEVBQUEsU0FBQSxFQUFBLENBQUE7QUFBQSxLQUNyQyxvQkFBQSxNQUFLLEVBQUEsQ0FBQSxDQUFDLFNBQUEsRUFBUyxDQUFDLGdCQUFpQixDQUFBLEVBQUEsR0FBQSxFQUFFLElBQUksQ0FBQyxLQUFLLENBQUMsS0FBSyxFQUFDLEdBQVEsQ0FBQTtJQUN6RCxDQUFBO0dBQ0EsQ0FBQTtJQUNKO0VBQ0Y7QUFDRixDQU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