Page Menu
Home
Code
Search
Configure Global Search
Log In
Files
F947151
ChatSession.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
ChatSession.js
View Options
/*
Copyright (c) 2004-2009, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if
(
!
dojo
.
_hasResource
[
"dojox.xmpp.widget.ChatSession"
]){
dojo
.
_hasResource
[
"dojox.xmpp.widget.ChatSession"
]
=
true
;
dojo
.
provide
(
"dojox.xmpp.widget.ChatSession"
);
dojo
.
declare
(
"dojox.xmpp.widget.ChatSession"
,[
dijit
.
layout
.
LayoutContainer
,
dijit
.
_Templated
],{
templateString
:
dojo
.
cache
(
"dojox.xmpp.widget"
,
"templates/ChatSession.html"
,
"<div>\n<div dojoAttachPoint=\"messages\" dojoType=\"dijit.layout.ContentPane\" layoutAlign=\"client\" style=\"overflow:auto\">\n</div>\n<div dojoType=\"dijit.layout.ContentPane\" layoutAlign=\"bottom\" style=\"border-top: 2px solid #333333; height: 35px;\"><input dojoAttachPoint=\"chatInput\" dojoAttachEvent=\"onkeypress: onKeyPress\" style=\"width: 100%;height: 35px;\" /></div>\n</div>\n"
),
enableSubWidgets
:
true
,
widgetsInTemplate
:
true
,
widgetType
:
"ChatSession"
,
chatWith
:
null
,
instance
:
null
,
postCreate
:
function
(){
},
displayMessage
:
function
(
_1
,
_2
){
if
(
_1
){
var
_3
=
_1
.
from
?
this
.
chatWith
:
"me"
;
this
.
messages
.
domNode
.
innerHTML
+=
"<b>"
+
_3
+
":</b> "
+
_1
.
body
+
"<br/>"
;
this
.
goToLastMessage
();
}
},
goToLastMessage
:
function
(){
this
.
messages
.
domNode
.
scrollTop
=
this
.
messages
.
domNode
.
scrollHeight
;
},
onKeyPress
:
function
(
e
){
var
_4
=
e
.
keyCode
||
e
.
charCode
;
if
((
_4
==
dojo
.
keys
.
ENTER
)
&&
(
this
.
chatInput
.
value
!=
""
)){
this
.
instance
.
sendMessage
({
body
:
this
.
chatInput
.
value
});
this
.
displayMessage
({
body
:
this
.
chatInput
.
value
},
"out"
);
this
.
chatInput
.
value
=
""
;
}
}});
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 26, 10:32 (1 d, 9 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27010
Default Alt Text
ChatSession.js (1 KB)
Attached To
rZEDHG ZedLegacy
Event Timeline
Log In to Comment