summaryrefslogtreecommitdiff
path: root/public/js/lib/chat.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-08-04 10:55:51 -0400
committerJules Laplace <jules@okfoc.us>2015-08-04 10:55:51 -0400
commit1a882d4adf6307dfbd764ae6aaf1a62a724851f1 (patch)
tree481aef83b95f951fd93a111c48b350cd3b6d3886 /public/js/lib/chat.js
parent460dadfdd2c3d91d3759542990702362b85703d3 (diff)
rearrange stuff and stub in chat
Diffstat (limited to 'public/js/lib/chat.js')
-rw-r--r--public/js/lib/chat.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/public/js/lib/chat.js b/public/js/lib/chat.js
new file mode 100644
index 0000000..946954b
--- /dev/null
+++ b/public/js/lib/chat.js
@@ -0,0 +1,27 @@
+var ChatView = View.extend({
+
+ template: $("#collaborator-template").html(),
+
+ events: {
+ "submit form": "send"
+ },
+
+ initialize: function(){
+ this.$msg = this.$("#message")
+ this.$messages = this.$("#messages")
+ },
+
+ add: function(msg){
+ var $el = $( this.template )
+ $el.find(".nick").html(msg.nick)
+ $el.find(".msg").html(msg.msg)
+ },
+
+ send: function(){
+ },
+
+ empty: function(){
+ this.$messages.empty()
+ }
+
+})