mirror of
https://github.com/fergalmoran/dss.git
synced 2025-12-22 09:38:18 +00:00
45 lines
1.3 KiB
JavaScript
45 lines
1.3 KiB
JavaScript
// Generated by CoffeeScript 1.4.0
|
|
(function() {
|
|
var __hasProp = {}.hasOwnProperty,
|
|
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
|
|
|
define(['marionette', 'app.lib/realtimeController', 'text!/tpl/ChatView'], function(Marionette, RealtimeController, Template) {
|
|
var ChatView;
|
|
ChatView = (function(_super) {
|
|
var controller;
|
|
|
|
__extends(ChatView, _super);
|
|
|
|
function ChatView() {
|
|
return ChatView.__super__.constructor.apply(this, arguments);
|
|
}
|
|
|
|
controller = new RealtimeController();
|
|
|
|
ChatView.prototype.template = _.template(Template);
|
|
|
|
ChatView.prototype.ui = {
|
|
chatMessage: '#chat-message'
|
|
};
|
|
|
|
ChatView.prototype.events = {
|
|
"click #chat-send": "sendChatMessage"
|
|
};
|
|
|
|
ChatView.prototype.sendChatMessage = function() {
|
|
var message;
|
|
console.log("ChatView: sendChatMessage");
|
|
message = this.ui.chatMessage.val();
|
|
if (message) {
|
|
return controller.sendMessage(message);
|
|
}
|
|
};
|
|
|
|
return ChatView;
|
|
|
|
})(Marionette.ItemView);
|
|
return ChatView;
|
|
});
|
|
|
|
}).call(this);
|