//>>built
define(["dijit","dojo","dojox","dojo/require!dijit/layout/LayoutContainer,dijit/_Templated"],function(_1,_2,_3){
_2.provide("dojox.xmpp.widget.ChatSession");
_2.require("dijit.layout.LayoutContainer");
_2.require("dijit._Templated");
_2.declare("dojox.xmpp.widget.ChatSession",[_1.layout.LayoutContainer,_1._Templated],{templateString:_2.cache("dojox.xmpp.widget","templates/ChatSession.html","
"),enableSubWidgets:true,widgetsInTemplate:true,widgetType:"ChatSession",chatWith:null,instance:null,postCreate:function(){
},displayMessage:function(_4,_5){
if(_4){
var _6=_4.from?this.chatWith:"me";
this.messages.domNode.innerHTML+=""+_6+": "+_4.body+"
";
this.goToLastMessage();
}
},goToLastMessage:function(){
this.messages.domNode.scrollTop=this.messages.domNode.scrollHeight;
},onKeyPress:function(e){
var _7=e.keyCode||e.charCode;
if((_7==_2.keys.ENTER)&&(this.chatInput.value!="")){
this.instance.sendMessage({body:this.chatInput.value});
this.displayMessage({body:this.chatInput.value},"out");
this.chatInput.value="";
}
}});
});