Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
4f3d34eb
Commit
4f3d34eb
authored
May 31, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into gh-pages
parents
1ae5aaed
7974ffc7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
282 additions
and
199 deletions
+282
-199
CHANGES.rst
CHANGES.rst
+2
-0
converse.css
converse.css
+6
-4
converse.js
converse.js
+262
-184
converse.min.css
converse.min.css
+1
-1
converse.min.js
converse.min.js
+1
-1
mock.js
mock.js
+2
-1
spec/ChatRoomSpec.js
spec/ChatRoomSpec.js
+8
-8
No files found.
CHANGES.rst
View file @
4f3d34eb
...
@@ -8,6 +8,8 @@ Changelog
...
@@ -8,6 +8,8 @@ Changelog
[jcbrand]
[jcbrand]
- Bugfix: Cannot join chatroom when clicking from a list of rooms.
- Bugfix: Cannot join chatroom when clicking from a list of rooms.
[jcbrand]
[jcbrand]
- Add better support for kicking or banning users from chatrooms.
[jcbrand]
0.3 (2013-05-21)
0.3 (2013-05-21)
----------------
----------------
...
...
converse.css
View file @
4f3d34eb
...
@@ -87,7 +87,8 @@ img.centered {
...
@@ -87,7 +87,8 @@ img.centered {
.chatroom
.chat-body
{
.chatroom
.chat-body
{
height
:
272px
;
height
:
272px
;
background-color
:
white
;
background-color
:
white
;
border-radius
:
4px
;
border-bottom-right-radius
:
4px
;
border-bottom-left-radius
:
4px
;
}
}
.chatroom
.chat-area
{
.chatroom
.chat-area
{
...
@@ -193,11 +194,11 @@ ul.participant-list li.moderator {
...
@@ -193,11 +194,11 @@ ul.participant-list li.moderator {
display
:
inline-block
;
display
:
inline-block
;
}
}
.chat-event
,
.chat-date
,
.chat-
help
{
.chat-event
,
.chat-date
,
.chat-
info
{
color
:
#808080
;
color
:
#808080
;
}
}
li
.chat-
help
{
li
.chat-
info
{
padding-left
:
10px
;
padding-left
:
10px
;
}
}
...
@@ -410,7 +411,8 @@ a.configure-chatroom-button {
...
@@ -410,7 +411,8 @@ a.configure-chatroom-button {
.chat-body
p
{
.chat-body
p
{
font-size
:
14px
;
font-size
:
14px
;
color
:
#666
;
color
:
#666
;
margin
:
5px
;
padding
:
5px
;
margin
:
0
;
}
}
.chatroom-form
legend
{
.chatroom-form
legend
{
...
...
converse.js
View file @
4f3d34eb
...
@@ -249,7 +249,6 @@
...
@@ -249,7 +249,6 @@
time
=
converse
.
toISOString
(
new
Date
());
time
=
converse
.
toISOString
(
new
Date
());
}
}
if
(
from
==
converse
.
bare_jid
)
{
if
(
from
==
converse
.
bare_jid
)
{
fullname
=
'
me
'
;
sender
=
'
me
'
;
sender
=
'
me
'
;
}
else
{
}
else
{
sender
=
'
them
'
;
sender
=
'
them
'
;
...
@@ -283,7 +282,7 @@
...
@@ -283,7 +282,7 @@
action_template
:
_
.
template
(
action_template
:
_
.
template
(
'
<div class="chat-message {{extra_classes}}">
'
+
'
<div class="chat-message {{extra_classes}}">
'
+
'
<span class="chat-message-{{sender}}">{{time}}
:
</span>
'
+
'
<span class="chat-message-{{sender}}">{{time}}
**{{username}}
</span>
'
+
'
<span class="chat-message-content">{{message}}</span>
'
+
'
<span class="chat-message-content">{{message}}</span>
'
+
'
</div>
'
),
'
</div>
'
),
...
@@ -291,6 +290,31 @@
...
@@ -291,6 +290,31 @@
'
<time class="chat-date" datetime="{{isodate}}">{{datestring}}</time>
'
'
<time class="chat-date" datetime="{{isodate}}">{{datestring}}</time>
'
),
),
appendMessage
:
function
(
$el
,
msg_dict
)
{
var
this_date
=
converse
.
parseISO8601
(
msg_dict
.
time
),
text
=
msg_dict
.
message
,
match
=
text
.
match
(
/^
\/(
.*
?)(?:
(
.*
))?
$/
),
sender
=
msg_dict
.
sender
,
template
,
username
;
if
((
match
)
&&
(
match
[
1
]
===
'
me
'
))
{
text
=
text
.
replace
(
/^
\/
me/
,
''
);
template
=
this
.
action_template
;
username
=
msg_dict
.
fullname
;
}
else
{
template
=
this
.
message_template
;
username
=
sender
===
'
me
'
&&
sender
||
msg_dict
.
fullname
;
}
$el
.
find
(
'
div.chat-event
'
).
remove
();
$el
.
append
(
template
({
'
sender
'
:
sender
,
'
time
'
:
this_date
.
toLocaleTimeString
().
substring
(
0
,
4
),
'
message
'
:
text
,
'
username
'
:
username
,
'
extra_classes
'
:
msg_dict
.
delayed
&&
'
delayed
'
||
''
}));
},
insertStatusNotification
:
function
(
message
,
replace
)
{
insertStatusNotification
:
function
(
message
,
replace
)
{
var
$chat_content
=
this
.
$el
.
find
(
'
.chat-content
'
);
var
$chat_content
=
this
.
$el
.
find
(
'
.chat-content
'
);
$chat_content
.
find
(
'
div.chat-event
'
).
remove
().
end
()
$chat_content
.
find
(
'
div.chat-event
'
).
remove
().
end
()
...
@@ -303,7 +327,7 @@
...
@@ -303,7 +327,7 @@
times
=
this
.
model
.
messages
.
pluck
(
'
time
'
),
times
=
this
.
model
.
messages
.
pluck
(
'
time
'
),
this_date
=
converse
.
parseISO8601
(
time
),
this_date
=
converse
.
parseISO8601
(
time
),
$chat_content
=
this
.
$el
.
find
(
'
.chat-content
'
),
$chat_content
=
this
.
$el
.
find
(
'
.chat-content
'
),
previous_message
,
idx
,
prev_date
,
isodate
;
previous_message
,
idx
,
prev_date
,
isodate
,
text
,
match
;
// If this message is on a different day than the one received
// If this message is on a different day than the one received
// prior, then indicate it on the chatbox.
// prior, then indicate it on the chatbox.
...
@@ -325,15 +349,7 @@
...
@@ -325,15 +349,7 @@
this
.
insertStatusNotification
(
message
.
get
(
'
fullname
'
)
+
'
'
+
'
is typing
'
);
this
.
insertStatusNotification
(
message
.
get
(
'
fullname
'
)
+
'
'
+
'
is typing
'
);
return
;
return
;
}
else
{
}
else
{
$chat_content
.
find
(
'
div.chat-event
'
).
remove
();
this
.
appendMessage
(
$chat_content
,
_
.
clone
(
message
.
attributes
));
$chat_content
.
append
(
this
.
message_template
({
'
sender
'
:
message
.
get
(
'
sender
'
),
'
time
'
:
this_date
.
toLocaleTimeString
().
substring
(
0
,
5
),
'
message
'
:
message
.
get
(
'
message
'
),
'
username
'
:
message
.
get
(
'
fullname
'
),
'
extra_classes
'
:
message
.
get
(
'
delayed
'
)
&&
'
delayed
'
||
''
}));
}
}
if
((
message
.
get
(
'
sender
'
)
!=
'
me
'
)
&&
(
converse
.
windowState
==
'
blur
'
))
{
if
((
message
.
get
(
'
sender
'
)
!=
'
me
'
)
&&
(
converse
.
windowState
==
'
blur
'
))
{
converse
.
incrementMsgCounter
();
converse
.
incrementMsgCounter
();
...
@@ -352,7 +368,7 @@
...
@@ -352,7 +368,7 @@
var
$chat_content
=
this
.
$el
.
find
(
'
.chat-content
'
),
i
,
var
$chat_content
=
this
.
$el
.
find
(
'
.chat-content
'
),
i
,
msgs_length
=
msgs
.
length
;
msgs_length
=
msgs
.
length
;
for
(
i
=
0
;
i
<
msgs_length
;
i
++
)
{
for
(
i
=
0
;
i
<
msgs_length
;
i
++
)
{
$chat_content
.
append
(
$
(
'
<div class="chat-
help
">
'
+
msgs
[
i
]
+
'
</div>
'
));
$chat_content
.
append
(
$
(
'
<div class="chat-
info
">
'
+
msgs
[
i
]
+
'
</div>
'
));
}
}
this
.
scrollDown
();
this
.
scrollDown
();
},
},
...
@@ -373,15 +389,15 @@
...
@@ -373,15 +389,15 @@
return
;
return
;
}
}
else
if
(
match
[
1
]
===
"
help
"
)
{
else
if
(
match
[
1
]
===
"
help
"
)
{
msgs
=
[
msgs
=
[
'
<strong>/help</strong>: Show this menu
'
,
'
<strong>/help</strong>: Show this menu
'
,
'
<strong>/me</strong>: Write in the third person
'
,
'
<strong>/clear</strong>: Remove messages
'
'
<strong>/clear</strong>: Remove messages
'
];
];
this
.
addHelpMessages
(
msgs
);
this
.
addHelpMessages
(
msgs
);
return
;
return
;
}
}
}
}
var
message
=
$msg
({
from
:
converse
.
bare_jid
,
to
:
bare_jid
,
type
:
'
chat
'
,
id
:
timestamp
})
var
message
=
$msg
({
from
:
converse
.
bare_jid
,
to
:
bare_jid
,
type
:
'
chat
'
,
id
:
timestamp
})
.
c
(
'
body
'
).
t
(
text
).
up
()
.
c
(
'
body
'
).
t
(
text
).
up
()
.
c
(
'
active
'
,
{
'
xmlns
'
:
'
http://jabber.org/protocol/chatstates
'
});
.
c
(
'
active
'
,
{
'
xmlns
'
:
'
http://jabber.org/protocol/chatstates
'
});
...
@@ -395,7 +411,7 @@
...
@@ -395,7 +411,7 @@
converse
.
connection
.
send
(
forwarded
);
converse
.
connection
.
send
(
forwarded
);
// Add the new message
// Add the new message
this
.
model
.
messages
.
create
({
this
.
model
.
messages
.
create
({
fullname
:
'
me
'
,
fullname
:
converse
.
xmppstatus
.
get
(
'
fullname
'
)
||
converse
.
bare_jid
,
sender
:
'
me
'
,
sender
:
'
me
'
,
time
:
converse
.
toISOString
(
new
Date
()),
time
:
converse
.
toISOString
(
new
Date
()),
message
:
text
message
:
text
...
@@ -483,20 +499,20 @@
...
@@ -483,20 +499,20 @@
},
},
template
:
_
.
template
(
template
:
_
.
template
(
'
<div class="chat-head chat-head-chatbox">
'
+
'
<div class="chat-head chat-head-chatbox">
'
+
'
<a class="close-chatbox-button">X</a>
'
+
'
<a class="close-chatbox-button">X</a>
'
+
'
<a href="{{url}}" target="_blank" class="user">
'
+
'
<a href="{{url}}" target="_blank" class="user">
'
+
'
<div class="chat-title"> {{ fullname }} </div>
'
+
'
<div class="chat-title"> {{ fullname }} </div>
'
+
'
</a>
'
+
'
</a>
'
+
'
<p class="user-custom-message"><p/>
'
+
'
<p class="user-custom-message"><p/>
'
+
'
</div>
'
+
'
</div>
'
+
'
<div class="chat-content"></div>
'
+
'
<div class="chat-content"></div>
'
+
'
<form class="sendXMPPMessage" action="" method="post">
'
+
'
<form class="sendXMPPMessage" action="" method="post">
'
+
'
<textarea
'
+
'
<textarea
'
+
'
type="text"
'
+
'
type="text"
'
+
'
class="chat-textarea"
'
+
'
class="chat-textarea"
'
+
'
placeholder="Personal message"/>
'
+
'
placeholder="Personal message"/>
'
+
'
</form>
'
),
'
</form>
'
),
render
:
function
()
{
render
:
function
()
{
this
.
$el
.
attr
(
'
id
'
,
this
.
model
.
get
(
'
box_id
'
))
this
.
$el
.
attr
(
'
id
'
,
this
.
model
.
get
(
'
box_id
'
))
...
@@ -629,9 +645,9 @@
...
@@ -629,9 +645,9 @@
$
.
getJSON
(
portal_url
+
"
/search-users?q=
"
+
$
(
ev
.
target
).
find
(
'
input.username
'
).
val
(),
function
(
data
)
{
$
.
getJSON
(
portal_url
+
"
/search-users?q=
"
+
$
(
ev
.
target
).
find
(
'
input.username
'
).
val
(),
function
(
data
)
{
var
$ul
=
$
(
'
.search-xmpp ul
'
);
var
$ul
=
$
(
'
.search-xmpp ul
'
);
$ul
.
find
(
'
li.found-user
'
).
remove
();
$ul
.
find
(
'
li.found-user
'
).
remove
();
$ul
.
find
(
'
li.chat-
help
'
).
remove
();
$ul
.
find
(
'
li.chat-
info
'
).
remove
();
if
(
!
data
.
length
)
{
if
(
!
data
.
length
)
{
$ul
.
append
(
'
<li class="chat-
help
">No users found</li>
'
);
$ul
.
append
(
'
<li class="chat-
info
">No users found</li>
'
);
}
}
$
(
data
).
each
(
function
(
idx
,
obj
)
{
$
(
data
).
each
(
function
(
idx
,
obj
)
{
...
@@ -876,14 +892,11 @@
...
@@ -876,14 +892,11 @@
server
,
$server
,
server
,
$server
,
jid
,
jid
,
$nick
=
this
.
$el
.
find
(
'
input.new-chatroom-nick
'
),
$nick
=
this
.
$el
.
find
(
'
input.new-chatroom-nick
'
),
nick
=
$nick
.
val
();
nick
=
$nick
.
val
(),
chatroom
;
if
(
!
nick
)
{
if
(
!
nick
)
{
$nick
.
addClass
(
'
error
'
);
}
$nick
.
addClass
(
'
error
'
);
else
{
$nick
.
removeClass
(
'
error
'
);
}
}
else
{
$nick
.
removeClass
(
'
error
'
);
}
if
(
ev
.
type
===
'
click
'
)
{
if
(
ev
.
type
===
'
click
'
)
{
jid
=
$
(
ev
.
target
).
attr
(
'
data-room-jid
'
);
jid
=
$
(
ev
.
target
).
attr
(
'
data-room-jid
'
);
...
@@ -905,7 +918,7 @@
...
@@ -905,7 +918,7 @@
}
}
}
}
if
(
!
nick
)
{
return
;
}
if
(
!
nick
)
{
return
;
}
c
onverse
.
chatboxes
.
create
({
c
hatroom
=
converse
.
chatboxes
.
createChatBox
({
'
id
'
:
jid
,
'
id
'
:
jid
,
'
jid
'
:
jid
,
'
jid
'
:
jid
,
'
name
'
:
Strophe
.
unescapeNode
(
Strophe
.
getNodeFromJid
(
jid
)),
'
name
'
:
Strophe
.
unescapeNode
(
Strophe
.
getNodeFromJid
(
jid
)),
...
@@ -913,6 +926,9 @@
...
@@ -913,6 +926,9 @@
'
chatroom
'
:
true
,
'
chatroom
'
:
true
,
'
box_id
'
:
hex_sha1
(
jid
)
'
box_id
'
:
hex_sha1
(
jid
)
});
});
if
(
!
chatroom
.
get
(
'
connected
'
))
{
converse
.
chatboxesview
.
views
[
jid
].
connect
(
null
);
}
}
}
});
});
...
@@ -1022,7 +1038,7 @@
...
@@ -1022,7 +1038,7 @@
'
click a.configure-chatroom-button
'
:
'
configureChatRoom
'
,
'
click a.configure-chatroom-button
'
:
'
configureChatRoom
'
,
'
keypress textarea.chat-textarea
'
:
'
keyPressed
'
'
keypress textarea.chat-textarea
'
:
'
keyPressed
'
},
},
info_template
:
_
.
template
(
'
<div class="chat-
event
">{{message}}</div>
'
),
info_template
:
_
.
template
(
'
<div class="chat-
info
">{{message}}</div>
'
),
sendChatRoomMessage
:
function
(
body
)
{
sendChatRoomMessage
:
function
(
body
)
{
var
match
=
body
.
replace
(
/^
\s
*/
,
""
).
match
(
/^
\/(
.*
?)(?:
(
.*
))?
$/
)
||
[
false
],
var
match
=
body
.
replace
(
/^
\s
*/
,
""
).
match
(
/^
\/(
.*
?)(?:
(
.*
))?
$/
)
||
[
false
],
...
@@ -1031,6 +1047,9 @@
...
@@ -1031,6 +1047,9 @@
case
'
msg
'
:
case
'
msg
'
:
// TODO: Private messages
// TODO: Private messages
break
;
break
;
case
'
clear
'
:
this
.
$el
.
find
(
'
.chat-content
'
).
empty
();
break
;
case
'
topic
'
:
case
'
topic
'
:
converse
.
connection
.
muc
.
setTopic
(
this
.
model
.
get
(
'
jid
'
),
match
[
2
]);
converse
.
connection
.
muc
.
setTopic
(
this
.
model
.
get
(
'
jid
'
),
match
[
2
]);
break
;
break
;
...
@@ -1048,15 +1067,15 @@
...
@@ -1048,15 +1067,15 @@
break
;
break
;
case
'
help
'
:
case
'
help
'
:
$chat_content
=
this
.
$el
.
find
(
'
.chat-content
'
);
$chat_content
=
this
.
$el
.
find
(
'
.chat-content
'
);
$chat_content
.
append
(
'
<div class="chat-help"><strong>/help</strong>: Show this menu</div>
'
+
msgs
=
[
'
<div class="chat-help"><strong>/topic</strong>: Set chatroom topic</div>
'
);
'
<strong>/help</strong>: Show this menu
'
,
/* TODO:
'
<strong>/me</strong>: Write in the third person
'
,
$chat_content.append($('<div class="chat-help"><strong>/kick</strong>: Kick out user</div>'));
'
<strong>/topic</strong>: Set chatroom topic
'
,
$chat_content.append($('<div class="chat-help"><strong>/ban</strong>: Ban user</div>'));
'
<strong>/kick</strong>: Kick user from chatroom
'
,
$chat_content.append($('<div class="chat-help"><strong>/op $user</strong>: Remove messages</div>'));
'
<strong>/ban</strong>: Ban user from chatroom
'
,
$chat_content.append($('<div class="chat-help"><strong>/deop $user</strong>: Remove messages</div>'));
'
<strong>/clear</strong>: Remove messages
'
*/
];
this
.
scrollDown
(
);
this
.
addHelpMessages
(
msgs
);
break
;
break
;
default
:
default
:
this
.
last_msgid
=
converse
.
connection
.
muc
.
groupchat
(
this
.
model
.
get
(
'
jid
'
),
body
);
this
.
last_msgid
=
converse
.
connection
.
muc
.
groupchat
(
this
.
model
.
get
(
'
jid
'
),
body
);
...
@@ -1085,7 +1104,8 @@
...
@@ -1085,7 +1104,8 @@
'
</div>
'
+
'
</div>
'
+
'
<div class="participants">
'
+
'
<div class="participants">
'
+
'
<ul class="participant-list"></ul>
'
+
'
<ul class="participant-list"></ul>
'
+
'
</div>
'
),
'
</div>
'
),
render
:
function
()
{
render
:
function
()
{
this
.
$el
.
attr
(
'
id
'
,
this
.
model
.
get
(
'
box_id
'
))
this
.
$el
.
attr
(
'
id
'
,
this
.
model
.
get
(
'
box_id
'
))
...
@@ -1094,27 +1114,38 @@
...
@@ -1094,27 +1114,38 @@
},
},
renderChatArea
:
function
()
{
renderChatArea
:
function
()
{
this
.
$el
.
find
(
'
img.spinner.centered
'
).
remove
();
if
(
!
this
.
$el
.
find
(
'
.chat-area
'
).
length
)
{
this
.
$el
.
find
(
'
.chat-body
'
).
append
(
this
.
chatarea_template
());
this
.
$el
.
find
(
'
.chat-body
'
).
empty
().
append
(
this
.
chatarea_template
());
}
return
this
;
return
this
;
},
},
initialize
:
function
()
{
connect
:
function
(
password
)
{
converse
.
connection
.
muc
.
join
(
if
(
_
.
has
(
converse
.
connection
.
muc
.
rooms
,
this
.
model
.
get
(
'
jid
'
)))
{
this
.
model
.
get
(
'
jid
'
),
// If the room exists, it already has event listeners, so we
this
.
model
.
get
(
'
nick
'
),
// doing add them again.
$
.
proxy
(
this
.
onChatRoomMessage
,
this
),
converse
.
connection
.
muc
.
join
(
$
.
proxy
(
this
.
onChatRoomPresence
,
this
),
this
.
model
.
get
(
'
jid
'
),
this
.
model
.
get
(
'
nick
'
),
null
,
null
,
null
,
password
);
$
.
proxy
(
this
.
onChatRoomRoster
,
this
),
}
else
{
null
);
converse
.
connection
.
muc
.
join
(
this
.
model
.
get
(
'
jid
'
),
this
.
model
.
get
(
'
nick
'
),
$
.
proxy
(
this
.
onChatRoomMessage
,
this
),
$
.
proxy
(
this
.
onChatRoomPresence
,
this
),
$
.
proxy
(
this
.
onChatRoomRoster
,
this
),
password
);
}
},
initialize
:
function
()
{
this
.
connect
(
null
);
this
.
model
.
messages
.
on
(
'
add
'
,
this
.
showMessage
,
this
);
this
.
model
.
messages
.
on
(
'
add
'
,
this
.
showMessage
,
this
);
this
.
model
.
on
(
'
destroy
'
,
function
(
model
,
response
,
options
)
{
this
.
model
.
on
(
'
destroy
'
,
function
(
model
,
response
,
options
)
{
this
.
$el
.
hide
(
'
fast
'
);
this
.
$el
.
hide
(
'
fast
'
);
converse
.
connection
.
muc
.
leave
(
converse
.
connection
.
muc
.
leave
(
this
.
model
.
get
(
'
jid
'
),
this
.
model
.
get
(
'
jid
'
),
this
.
model
.
get
(
'
nick
'
),
this
.
model
.
get
(
'
nick
'
),
this
.
onLeave
,
$
.
proxy
(
this
.
onLeave
,
this
)
,
undefined
);
undefined
);
},
},
this
);
this
);
...
@@ -1122,7 +1153,9 @@
...
@@ -1122,7 +1153,9 @@
this
.
render
().
show
().
model
.
messages
.
fetch
({
add
:
true
});
this
.
render
().
show
().
model
.
messages
.
fetch
({
add
:
true
});
},
},
onLeave
:
function
()
{},
onLeave
:
function
()
{
this
.
model
.
set
(
'
connected
'
,
false
);
},
form_input_template
:
_
.
template
(
'
<label>{{label}}<input name="{{name}}" type="{{type}}" value="{{value}}"></label>
'
),
form_input_template
:
_
.
template
(
'
<label>{{label}}<input name="{{name}}" type="{{type}}" value="{{value}}"></label>
'
),
select_option_template
:
_
.
template
(
'
<option value="{{value}}">{{label}}</option>
'
),
select_option_template
:
_
.
template
(
'
<option value="{{value}}">{{label}}</option>
'
),
...
@@ -1261,6 +1294,14 @@
...
@@ -1261,6 +1294,14 @@
);
);
},
},
submitPassword
:
function
(
ev
)
{
ev
.
preventDefault
();
var
password
=
this
.
$el
.
find
(
'
.chatroom-form
'
).
find
(
'
input[type=password]
'
).
val
();
this
.
$el
.
find
(
'
.chatroom-form-container
'
).
replaceWith
(
'
<img class="spinner centered" src="images/spinner.gif"/>
'
);
this
.
connect
(
password
);
},
renderPasswordForm
:
function
()
{
renderPasswordForm
:
function
()
{
this
.
$el
.
find
(
'
img.centered.spinner
'
).
remove
();
this
.
$el
.
find
(
'
img.centered.spinner
'
).
remove
();
this
.
$el
.
find
(
'
.chat-body
'
).
append
(
this
.
$el
.
find
(
'
.chat-body
'
).
append
(
...
@@ -1274,40 +1315,144 @@
...
@@ -1274,40 +1315,144 @@
this
.
$el
.
find
(
'
.chatroom-form
'
).
on
(
'
submit
'
,
$
.
proxy
(
this
.
submitPassword
,
this
));
this
.
$el
.
find
(
'
.chatroom-form
'
).
on
(
'
submit
'
,
$
.
proxy
(
this
.
submitPassword
,
this
));
},
},
renderErrorMessage
:
function
(
msg
)
{
showDisconnectMessage
:
function
(
msg
)
{
this
.
$el
.
find
(
'
.chat-area
'
).
remove
();
this
.
$el
.
find
(
'
.participants
'
).
remove
();
this
.
$el
.
find
(
'
img.centered.spinner
'
).
remove
();
this
.
$el
.
find
(
'
img.centered.spinner
'
).
remove
();
this
.
$el
.
find
(
'
.chat-body
'
).
append
(
$
(
'
<p>
'
+
msg
+
'
</p>
'
));
this
.
$el
.
find
(
'
.chat-body
'
).
append
(
$
(
'
<p>
'
+
msg
+
'
</p>
'
));
},
},
submitPassword
:
function
(
ev
)
{
infoMessages
:
{
ev
.
preventDefault
();
100
:
'
This room is not anonymous
'
,
var
password
=
this
.
$el
.
find
(
'
.chatroom-form
'
).
find
(
'
input[type=password]
'
).
val
();
102
:
'
This room now shows unavailable members
'
,
this
.
$el
.
find
(
'
.chatroom-form-container
'
).
replaceWith
(
103
:
'
This room does not show unavailable members
'
,
'
<img class="spinner centered" src="images/spinner.gif"/>
'
);
104
:
'
Non-privacy-related room configuration has changed
'
,
converse
.
connection
.
muc
.
join
(
170
:
'
Room logging is now enabled
'
,
this
.
model
.
get
(
'
jid
'
),
171
:
'
Room logging is now disabled
'
,
this
.
model
.
get
(
'
nick
'
),
172
:
'
This room is now non-anonymous
'
,
$
.
proxy
(
this
.
onChatRoomMessage
,
this
),
173
:
'
This room is now semi-anonymous
'
,
$
.
proxy
(
this
.
onChatRoomPresence
,
this
),
174
:
'
This room is now fully-anonymous
'
,
$
.
proxy
(
this
.
onChatRoomRoster
,
this
),
201
:
'
A new room has been created
'
,
password
);
210
:
'
Your nickname has been changed
'
},
actionInfoMessages
:
{
301
:
'
has been banned
'
,
307
:
'
has been kicked out
'
,
321
:
"
has been removed because of an affiliation change
"
,
322
:
"
has been removed for not being a member
"
},
disconnectMessages
:
{
301
:
'
You have been banned from this room
'
,
307
:
'
You have been kicked from this room
'
,
321
:
"
You have been removed from this room because of an affiliation change
"
,
322
:
"
You have been removed from this room because the room
"
+
"
has changed to members-only and you're not a member
"
,
332
:
"
You have been removed from this room because the MUC
"
+
"
(Multi-user chat) service is being shut down.
"
},
showStatusMessages
:
function
(
$el
,
is_self
)
{
/* Check for status codes and communicate their purpose to the user
* See: http://xmpp.org/registrar/mucstatus.html
*/
var
$chat_content
=
this
.
$el
.
find
(
'
.chat-content
'
),
$stats
=
$el
.
find
(
'
status
'
),
disconnect_msgs
=
[],
info_msgs
=
[],
action_msgs
=
[],
msgs
,
i
;
for
(
i
=
0
;
i
<
$stats
.
length
;
i
++
)
{
var
stat
=
$stats
[
i
].
getAttribute
(
'
code
'
);
if
(
is_self
)
{
if
(
_
.
contains
(
_
.
keys
(
this
.
disconnectMessages
),
stat
))
{
disconnect_msgs
.
push
(
this
.
disconnectMessages
[
stat
]);
}
}
else
{
if
(
_
.
contains
(
_
.
keys
(
this
.
infoMessages
),
stat
))
{
info_msgs
.
push
(
this
.
infoMessages
[
stat
]);
}
else
if
(
_
.
contains
(
_
.
keys
(
this
.
actionInfoMessages
),
stat
))
{
action_msgs
.
push
(
'
<strong>
'
+
Strophe
.
unescapeNode
(
Strophe
.
getResourceFromJid
(
$el
.
attr
(
'
from
'
)))
+
'
</strong>
'
+
this
.
actionInfoMessages
[
stat
]);
}
}
}
if
(
disconnect_msgs
.
length
>
0
)
{
for
(
i
=
0
;
i
<
disconnect_msgs
.
length
;
i
++
)
{
this
.
showDisconnectMessage
(
disconnect_msgs
[
i
]);
}
this
.
model
.
set
(
'
connected
'
,
false
)
return
;
}
this
.
renderChatArea
();
for
(
i
=
0
;
i
<
info_msgs
.
length
;
i
++
)
{
$chat_content
.
append
(
this
.
info_template
({
message
:
info_msgs
[
i
]}));
}
for
(
i
=
0
;
i
<
action_msgs
.
length
;
i
++
)
{
$chat_content
.
append
(
this
.
info_template
({
message
:
action_msgs
[
i
]}));
}
this
.
scrollDown
();
},
showErrorMessage
:
function
(
$error
,
room
)
{
var
$chat_content
=
this
.
$el
.
find
(
'
.chat-content
'
);
// We didn't enter the room, so we must remove it from the MUC
// add-on
converse
.
connection
.
muc
.
removeRoom
(
room
.
name
);
if
(
$error
.
attr
(
'
type
'
)
==
'
auth
'
)
{
if
(
$error
.
find
(
'
not-authorized
'
).
length
)
{
this
.
renderPasswordForm
();
}
else
if
(
$error
.
find
(
'
registration-required
'
).
length
)
{
this
.
showDisconnectMessage
(
'
You are not on the member list of this room
'
);
}
else
if
(
$error
.
find
(
'
forbidden
'
).
length
)
{
this
.
showDisconnectMessage
(
'
You have been banned from this room
'
);
}
}
else
if
(
$error
.
attr
(
'
type
'
)
==
'
modify
'
)
{
if
(
$error
.
find
(
'
jid-malformed
'
).
length
)
{
this
.
showDisconnectMessage
(
'
No nickname was specified
'
);
}
}
else
if
(
$error
.
attr
(
'
type
'
)
==
'
cancel
'
)
{
if
(
$error
.
find
(
'
not-allowed
'
).
length
)
{
this
.
showDisconnectMessage
(
'
You are not allowed to create new rooms
'
);
}
else
if
(
$error
.
find
(
'
not-acceptable
'
).
length
)
{
this
.
showDisconnectMessage
(
"
Your nickname doesn't conform to this room's policies
"
);
}
else
if
(
$error
.
find
(
'
conflict
'
).
length
)
{
this
.
showDisconnectMessage
(
"
Your nickname is already taken
"
);
}
else
if
(
$error
.
find
(
'
item-not-found
'
).
length
)
{
this
.
showDisconnectMessage
(
"
This room does not (yet) exist
"
);
}
else
if
(
$error
.
find
(
'
service-unavailable
'
).
length
)
{
this
.
showDisconnectMessage
(
"
This room has reached it's maximum number of occupants
"
);
}
}
},
},
onChatRoomPresence
:
function
(
presence
,
room
)
{
onChatRoomPresence
:
function
(
presence
,
room
)
{
var
nick
=
room
.
nick
,
var
nick
=
room
.
nick
,
$presence
=
$
(
presence
),
$presence
=
$
(
presence
),
from
=
$presence
.
attr
(
'
from
'
),
$item
;
from
=
$presence
.
attr
(
'
from
'
),
if
(
$presence
.
attr
(
'
type
'
)
!==
'
error
'
)
{
is_self
=
(
$presence
.
find
(
"
status[code='110']
"
).
length
)
||
(
from
==
room
.
name
+
'
/
'
+
Strophe
.
escapeNode
(
nick
)),
if
(
!
this
.
$el
.
find
(
'
.chat-area
'
).
length
)
{
this
.
renderChatArea
();
}
$item
;
if
(
$presence
.
attr
(
'
type
'
)
===
'
error
'
)
{
this
.
model
.
set
(
'
connected
'
,
false
)
this
.
showErrorMessage
(
$presence
.
find
(
'
error
'
),
room
);
}
else
{
this
.
model
.
set
(
'
connected
'
,
true
);
this
.
showStatusMessages
(
$presence
,
is_self
);
if
(
!
this
.
model
.
get
(
'
connected
'
))
{
return
true
;
}
if
(
$presence
.
find
(
"
status[code='201']
"
).
length
)
{
if
(
$presence
.
find
(
"
status[code='201']
"
).
length
)
{
// This is a new chatroom. We create an instant
// This is a new chatroom. We create an instant
// chatroom, and let the user manually set any
// chatroom, and let the user manually set any
// configuration setting.
// configuration setting.
converse
.
connection
.
muc
.
createInstantRoom
(
room
.
name
);
converse
.
connection
.
muc
.
createInstantRoom
(
room
.
name
);
}
}
if
((
$presence
.
find
(
"
status[code='110']
"
).
length
)
||
(
from
==
room
.
name
+
'
/
'
+
Strophe
.
escapeNode
(
nick
)))
{
if
(
is_self
)
{
// Check to see if it's our own presence
// code 110 indicates it but ejabberd doesn't seem to comply
$item
=
$presence
.
find
(
'
item
'
);
$item
=
$presence
.
find
(
'
item
'
);
if
(
$item
.
length
)
{
if
(
$item
.
length
)
{
if
(
$item
.
attr
(
'
affiliation
'
)
==
'
owner
'
)
{
if
(
$item
.
attr
(
'
affiliation
'
)
==
'
owner
'
)
{
...
@@ -1318,67 +1463,11 @@
...
@@ -1318,67 +1463,11 @@
// check if server changed our nick
// check if server changed our nick
this
.
model
.
set
({
'
nick
'
:
Strophe
.
getResourceFromJid
(
from
)});
this
.
model
.
set
({
'
nick
'
:
Strophe
.
getResourceFromJid
(
from
)});
}
}
}
}
}
else
{
var
$error
=
$presence
.
find
(
'
error
'
),
$chat_content
=
this
.
$el
.
find
(
'
.chat-content
'
);
// We didn't enter the room, so we must remove it from the MUC
// add-on
converse
.
connection
.
muc
.
removeRoom
(
room
.
name
);
if
(
$error
.
attr
(
'
type
'
)
==
'
auth
'
)
{
if
(
$error
.
find
(
'
not-authorized
'
).
length
)
{
this
.
renderPasswordForm
();
}
else
if
(
$error
.
find
(
'
registration-required
'
).
length
)
{
this
.
renderErrorMessage
(
'
You are not on the member list of this room
'
);
}
else
if
(
$error
.
find
(
'
forbidden
'
).
length
)
{
this
.
renderErrorMessage
(
'
You have been banned from this room
'
);
}
}
else
if
(
$error
.
attr
(
'
type
'
)
==
'
modify
'
)
{
if
(
$error
.
find
(
'
jid-malformed
'
).
length
)
{
this
.
renderErrorMessage
(
'
No nickname was specified
'
);
}
}
else
if
(
$error
.
attr
(
'
type
'
)
==
'
cancel
'
)
{
if
(
$error
.
find
(
'
not-allowed
'
).
length
)
{
this
.
renderErrorMessage
(
'
You are not allowed to create new rooms
'
);
}
else
if
(
$error
.
find
(
'
not-acceptable
'
).
length
)
{
this
.
renderErrorMessage
(
"
Your nickname doesn't conform to this room's policies
"
);
}
else
if
(
$error
.
find
(
'
conflict
'
).
length
)
{
this
.
renderErrorMessage
(
"
Your nickname is already taken
"
);
}
else
if
(
$error
.
find
(
'
item-not-found
'
).
length
)
{
this
.
renderErrorMessage
(
"
This room does not (yet) exist
"
);
}
else
if
(
$error
.
find
(
'
service-unavailable
'
).
length
)
{
this
.
renderErrorMessage
(
"
This room has reached it's maximum number of occupants
"
);
}
}
}
}
return
true
;
return
true
;
},
},
communicateStatusCodes
:
function
(
$message
,
$chat_content
)
{
/* Parse the message for status codes and communicate their purpose
* to the user.
* See: http://xmpp.org/registrar/mucstatus.html
*/
var
status_messages
=
{
100
:
'
This room is not anonymous
'
,
102
:
'
This room now shows unavailable members
'
,
103
:
'
This room does not show unavailable members
'
,
104
:
'
Non-privacy-related room configuration has changed
'
,
170
:
'
Room logging is now enabled
'
,
171
:
'
Room logging is now disabled
'
,
172
:
'
This room is now non-anonymous
'
,
173
:
'
This room is now semi-anonymous
'
,
174
:
'
This room is now fully-anonymous
'
};
$message
.
find
(
'
x
'
).
find
(
'
status
'
).
each
(
$
.
proxy
(
function
(
idx
,
item
)
{
var
code
=
$
(
item
).
attr
(
'
code
'
);
var
message
=
code
&&
status_messages
[
code
]
||
null
;
if
(
message
)
{
$chat_content
.
append
(
this
.
info_template
({
message
:
message
}));
}
},
this
));
},
onChatRoomMessage
:
function
(
message
)
{
onChatRoomMessage
:
function
(
message
)
{
var
$message
=
$
(
message
),
var
$message
=
$
(
message
),
body
=
$message
.
children
(
'
body
'
).
text
(),
body
=
$message
.
children
(
'
body
'
).
text
(),
...
@@ -1408,31 +1497,18 @@
...
@@ -1408,31 +1497,18 @@
datestring
:
message_date
.
toString
().
substring
(
0
,
15
)
datestring
:
message_date
.
toString
().
substring
(
0
,
15
)
}));
}));
}
}
this
.
communicateStatusCodes
(
$message
,
$chat_content
);
this
.
showStatusMessages
(
$message
);
if
(
subject
)
{
if
(
subject
)
{
this
.
$el
.
find
(
'
.chatroom-topic
'
).
text
(
subject
).
attr
(
'
title
'
,
subject
);
this
.
$el
.
find
(
'
.chatroom-topic
'
).
text
(
subject
).
attr
(
'
title
'
,
subject
);
$chat_content
.
append
(
this
.
info_template
({
'
message
'
:
'
Topic set by
'
+
sender
+
'
to:
'
+
subject
}));
$chat_content
.
append
(
this
.
info_template
({
'
message
'
:
'
Topic set by
'
+
sender
+
'
to:
'
+
subject
}));
}
}
if
(
!
body
)
{
return
true
;
}
if
(
!
body
)
{
return
true
;
}
match
=
body
.
match
(
/^
\/(
.*
?)(?:
(
.*
))?
$/
);
this
.
appendMessage
(
$chat_content
,
if
((
match
)
&&
(
match
[
1
]
===
'
me
'
))
{
{
'
message
'
:
body
,
body
=
body
.
replace
(
/^
\/
me/
,
'
*
'
+
sender
);
'
sender
'
:
sender
===
this
.
model
.
get
(
'
nick
'
)
&&
'
me
'
||
'
room
'
,
template
=
this
.
action_template
;
'
fullname
'
:
sender
,
}
else
{
'
time
'
:
converse
.
toISOString
(
message_datetime
)
template
=
this
.
message_template
;
});
}
if
(
sender
===
this
.
model
.
get
(
'
nick
'
))
{
sender
=
'
me
'
;
}
$chat_content
.
append
(
template
({
'
sender
'
:
sender
==
'
me
'
&&
sender
||
'
room
'
,
'
time
'
:
message_datetime
.
toLocaleTimeString
().
substring
(
0
,
5
),
'
message
'
:
body
,
'
username
'
:
sender
,
'
extra_classes
'
:
delayed
&&
'
delayed
'
||
''
})
);
this
.
scrollDown
();
this
.
scrollDown
();
return
true
;
return
true
;
},
},
...
@@ -1452,7 +1528,7 @@
...
@@ -1452,7 +1528,7 @@
),
),
onChatRoomRoster
:
function
(
roster
,
room
)
{
onChatRoomRoster
:
function
(
roster
,
room
)
{
if
(
!
this
.
$el
.
find
(
'
.chat-area
'
).
length
)
{
this
.
renderChatArea
();
}
this
.
renderChatArea
();
var
controlboxview
=
converse
.
chatboxesview
.
views
.
controlbox
,
var
controlboxview
=
converse
.
chatboxesview
.
views
.
controlbox
,
roster_size
=
_
.
size
(
roster
),
roster_size
=
_
.
size
(
roster
),
$participant_list
=
this
.
$el
.
find
(
'
.participant-list
'
),
$participant_list
=
this
.
$el
.
find
(
'
.participant-list
'
),
...
@@ -1498,9 +1574,19 @@
...
@@ -1498,9 +1574,19 @@
});
});
},
},
createChatBox
:
function
(
attrs
)
{
var
chatbox
=
this
.
get
(
attrs
.
jid
);
if
(
chatbox
)
{
chatbox
.
trigger
(
'
show
'
);
}
else
{
chatbox
=
this
.
create
(
attrs
);
}
return
chatbox
;
},
messageReceived
:
function
(
message
)
{
messageReceived
:
function
(
message
)
{
var
partner_jid
,
$message
=
$
(
message
),
var
partner_jid
,
$message
=
$
(
message
),
message_from
=
$message
.
attr
(
'
from
'
);
message_from
=
$message
.
attr
(
'
from
'
);
if
(
message_from
==
converse
.
connection
.
jid
)
{
if
(
message_from
==
converse
.
connection
.
jid
)
{
// FIXME: Forwarded messages should be sent to specific resources,
// FIXME: Forwarded messages should be sent to specific resources,
// not broadcasted
// not broadcasted
...
@@ -1609,21 +1695,15 @@
...
@@ -1609,21 +1695,15 @@
openChat
:
function
(
ev
)
{
openChat
:
function
(
ev
)
{
ev
.
preventDefault
();
ev
.
preventDefault
();
var
jid
=
Strophe
.
getBareJidFromJid
(
this
.
model
.
get
(
'
jid
'
)),
converse
.
chatboxes
.
createChatBox
({
chatbox
=
converse
.
chatboxes
.
get
(
jid
);
'
id
'
:
this
.
model
.
get
(
'
jid
'
),
if
(
chatbox
)
{
'
jid
'
:
this
.
model
.
get
(
'
jid
'
),
chatbox
.
trigger
(
'
show
'
);
'
fullname
'
:
this
.
model
.
get
(
'
fullname
'
),
}
else
{
'
image_type
'
:
this
.
model
.
get
(
'
image_type
'
),
converse
.
chatboxes
.
create
({
'
image
'
:
this
.
model
.
get
(
'
image
'
),
'
id
'
:
this
.
model
.
get
(
'
jid
'
),
'
url
'
:
this
.
model
.
get
(
'
url
'
),
'
jid
'
:
this
.
model
.
get
(
'
jid
'
),
'
status
'
:
this
.
model
.
get
(
'
status
'
)
'
fullname
'
:
this
.
model
.
get
(
'
fullname
'
),
});
'
image_type
'
:
this
.
model
.
get
(
'
image_type
'
),
'
image
'
:
this
.
model
.
get
(
'
image
'
),
'
url
'
:
this
.
model
.
get
(
'
url
'
),
'
status
'
:
this
.
model
.
get
(
'
status
'
)
});
}
},
},
removeContact
:
function
(
ev
)
{
removeContact
:
function
(
ev
)
{
...
@@ -2333,9 +2413,10 @@
...
@@ -2333,9 +2413,10 @@
'
<label>BOSH Service URL:</label>
'
+
'
<label>BOSH Service URL:</label>
'
+
'
<input type="text" id="bosh_service_url">
'
),
'
<input type="text" id="bosh_service_url">
'
),
connect
:
function
(
$form
,
jid
,
password
)
{
connect
:
function
(
jid
,
password
)
{
var
$button
=
$form
.
find
(
'
input[type=submit]
'
),
var
connection
=
new
Strophe
.
Connection
(
converse
.
bosh_service_url
);
connection
=
new
Strophe
.
Connection
(
converse
.
bosh_service_url
);
$button
.
hide
().
after
(
'
<img class="spinner login-submit" src="images/spinner.gif"/>
'
);
connection
.
connect
(
jid
,
password
,
$
.
proxy
(
function
(
status
,
message
)
{
connection
.
connect
(
jid
,
password
,
$
.
proxy
(
function
(
status
,
message
)
{
if
(
status
===
Strophe
.
Status
.
CONNECTED
)
{
if
(
status
===
Strophe
.
Status
.
CONNECTED
)
{
console
.
log
(
'
Connected
'
);
console
.
log
(
'
Connected
'
);
...
@@ -2391,10 +2472,7 @@
...
@@ -2391,10 +2472,7 @@
$pw_input
.
addClass
(
'
error
'
);
$pw_input
.
addClass
(
'
error
'
);
}
}
if
(
errors
)
{
return
;
}
if
(
errors
)
{
return
;
}
this
.
connect
(
$form
,
jid
,
password
);
var
$button
=
$form
.
find
(
'
input[type=submit]
'
);
$button
.
hide
().
after
(
'
<img class="spinner login-submit" src="images/spinner.gif"/>
'
);
this
.
connect
(
jid
,
password
);
},
},
remove
:
function
()
{
remove
:
function
()
{
...
...
converse.min.css
View file @
4f3d34eb
.hidden
{
display
:
none
;}
.locked
{
background
:
url(images/emblem-readonly.png)
no-repeat
right
;
padding-right
:
22px
;}
span
.spinner
{
background
:
url(images/spinner.gif)
no-repeat
center
;
width
:
22px
;
height
:
22px
;
padding
:
0
2px
0
2px
;
display
:
block
;}
span
.spinner.hor_centered
{
left
:
40%
;
position
:
absolute
;}
img
.spinner
{
width
:
auto
;
border
:
none
;
box-shadow
:
none
;
-moz-box-shadow
:
none
;
-webkit-box-shadow
:
none
;
margin
:
0
;
padding
:
0
5px
0
5px
;}
img
.centered
{
position
:
absolute
;
top
:
30%
;
left
:
50%
;
margin
:
0
0
0
-25%
;}
#chatpanel
{
z-index
:
99
;
position
:
fixed
;
bottom
:
0
;
right
:
0
;
height
:
332px
;
width
:
auto
;}
#toggle-controlbox
{
position
:
fixed
;
font-size
:
80%
;
bottom
:
0
;
right
:
0
;
border-top-right-radius
:
4px
;
border-top-left-radius
:
4px
;
background
:
#e3e2e2
;
border
:
1px
solid
#c3c3c3
;
border-bottom
:
none
;
padding
:
.25em
.5em
;
margin-right
:
1em
;
height
:
1.1em
;}
#connecting-to-chat
{
background
:
url(images/spinner.gif)
no-repeat
left
;
padding-left
:
1.4em
;}
.chat-head
{
color
:
#fff
;
margin
:
0
;
font-size
:
100%
;
border-top-right-radius
:
4px
;
border-top-left-radius
:
4px
;
padding
:
3px
0
3px
7px
;}
.chat-head-chatbox
{
background-color
:
#596a72
;
background-color
:
rgba
(
89
,
106
,
114
,
1
);}
.chat-head-chatroom
{
background-color
:
#2D617A
;}
.chatroom
.chat-body
{
height
:
272px
;
background-color
:
white
;
border-radius
:
4px
;}
.chatroom
.chat-area
{
float
:
left
;
width
:
200px
;}
.chatroom
.chat
{
overflow
:
auto
;
height
:
400px
;
border
:
solid
1px
#ccc
;}
.chatroom
.participants
{
float
:
left
;
width
:
99px
;
height
:
272px
;
background-color
:
white
;
overflow
:
auto
;
border-right
:
1px
solid
#999
;
border-bottom
:
1px
solid
#999
;
border-bottom-right-radius
:
4px
;}
.participants
ul
.participant-list
li
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
display
:
block
;
font-size
:
12px
;
padding
:
.5em
0
0
.5em
;
cursor
:
default
;}
ul
.participant-list
li
.moderator
{
color
:
#FE0007
;}
.chatroom
form
.sendXMPPMessage
{
-webkit-border-bottom-right-radius
:
0
;
border-bottom-right-radius
:
0
;}
.chatroom
.participant-list
{
list-style
:
none
;}
.chat-blink
{
background-color
:
#176689
;
border-right
:
1px
solid
#176689
;
border-left
:
1px
solid
#176689
;}
.chat-content
{
padding
:
.3em
;
font-size
:
13px
;
color
:
#333
;
height
:
193px
;
overflow-y
:
auto
;
border
:
1px
solid
#999
;
border-bottom
:
0
;
border-top
:
0
;
background-color
:
#fff
;
line-height
:
1.3em
;}
.chat-textarea
{
border
:
0
;
height
:
50px
;}
.chat-textarea-chatbox-selected
{
border
:
1px
solid
#578308
;
margin
:
0
;}
.chat-textarea-chatroom-selected
{
border
:
2px
solid
#2D617A
;
margin
:
0
;}
.chat-info
{
color
:
#666
;}
.chat-message-me
{
font-weight
:
bold
;
color
:
#436976
;}
.chat-message-room
{
font-weight
:
bold
;
color
:
#4B7003
;}
.chat-message-them
{
font-weight
:
bold
;
color
:
#F62817
;
white-space
:
nowrap
;
max-width
:
100px
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
display
:
inline-block
;}
.chat-event
,
.chat-date
,
.chat-help
{
color
:
#808080
;}
li
.chat-help
{
padding-left
:
10px
;}
.chat-date
{
display
:
inline-block
;
padding-top
:
10px
;}
div
#settings
,
div
#chatrooms
,
div
#login-dialog
{
height
:
272px
;}
p
.not-implemented
{
margin-top
:
3em
;
margin-left
:
.3em
;
color
:
#808080
;}
div
.delayed
.chat-message-them
{
color
:
#FB5D50
;}
div
.delayed
.chat-message-me
{
color
:
#7EABBB
;}
input
.error
{
border
:
1px
solid
red
;}
.conn-feedback.error
{
color
:
red
;}
.chat-message-error
{
color
:
#76797C
;
font-size
:
90%
;
font-weight
:
normal
;}
.chat-head
.avatar
{
float
:
left
;
margin-right
:
6px
;}
div
.chat-title
{
color
:
white
;
font-weight
:
bold
;
line-height
:
15px
;
display
:
block
;
margin-top
:
2px
;
margin-right
:
20px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
text-shadow
:
rgba
(
0
,
0
,
0
,
0.51
)
0
-1px
0
;
height
:
1em
;}
.chat-head-chatbox
,
.chat-head-chatroom
{
background
:
linear-gradient
(
top
,
rgba
(
206
,
220
,
231
,
1
)
0
,
rgba
(
89
,
106
,
114
,
1
)
100%
);
height
:
33px
;
position
:
relative
;}
p
.user-custom-message
,
p
.chatroom-topic
{
font-size
:
80%
;
font-style
:
italic
;
height
:
1.3em
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
margin
:
0
;}
.activated
{
display
:
block
!important
;}
a
.subscribe-to-user
{
padding-left
:
2em
;
font-weight
:
bold
;}
dl
.add-converse-contact
{
margin
:
0
0
0
.5em
;}
.fancy-dropdown
{
border
:
1px
solid
#ddd
;
height
:
22px
;}
.fancy-dropdown
a
.choose-xmpp-status
,
.fancy-dropdown
a
.toggle-xmpp-contact-form
{
text-shadow
:
0
1px
0
rgba
(
255
,
255
,
255
,
1
);
padding-left
:
2em
;
display
:
block
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
float
:
left
;
width
:
130px
;}
#fancy-xmpp-status-select
a
.change-xmpp-status-message
{
background
:
url('images/pencil_icon.png')
no-repeat
right
3px
;
float
:
right
;
clear
:
right
;
height
:
22px
;}
ul
#found-users
{
padding
:
10px
0
5px
5px
;
border
:
0
;}
form
.search-xmpp-contact
{
margin
:
0
;
padding-left
:
5px
;
padding
:
0
0
5px
5px
;}
form
.search-xmpp-contact
input
{
width
:
8em
;}
.oc-chat-head
{
margin
:
0
;
color
:
#FFF
;
border-top-right-radius
:
4px
;
border-top-left-radius
:
4px
;
height
:
35px
;
clear
:
right
;
background-color
:
#5390C8
;
padding
:
3px
0
0
0
;}
a
.configure-chatroom-button
,
a
.close-chatbox-button
{
margin-top
:
.2em
;
margin-right
:
.5em
;
cursor
:
pointer
;
float
:
right
;
width
:
12px
;
-moz-box-shadow
:
inset
0
1px
0
0
#fff
;
-webkit-box-shadow
:
inset
0
1px
0
0
#fff
;
box-shadow
:
inset
0
1px
0
0
#fff
;
background
:
-webkit-gradient
(
linear
,
left
top
,
left
bottom
,
color-stop
(
0.05
,
#fff
),
color-stop
(
1
,
#f6f6f6
));
background
:
-moz-linear-gradient
(
center
top
,
#fff
5%
,
#f6f6f6
100%
);
filter
:
progid
:
DXImageTransform
.
Microsoft
.
gradient
(
startColorstr
=
'#ffffff'
,
endColorstr
=
'#f6f6f6'
);
-moz-border-radius
:
6px
;
-webkit-border-radius
:
6px
;
border-radius
:
6px
;
border
:
1px
solid
#888
;
display
:
inline-block
;
color
:
#666
!important
;
font-family
:
arial
;
font-size
:
12px
;
font-weight
:
bold
;
text-decoration
:
none
;
text-shadow
:
1px
1px
0
#fff
;}
a
.configure-chatroom-button
{
padding
:
0
4px
;
background
:
#fff
url('images/preferences-system.png')
no-repeat
center
center
;}
.close-chatbox-button
{
padding
:
0
2px
0
6px
;}
.close-chatbox-button
:hover
{
background
:
-webkit-gradient
(
linear
,
left
top
,
left
bottom
,
color-stop
(
0.05
,
#f6f6f6
),
color-stop
(
1
,
#fff
));
background
:
-moz-linear-gradient
(
center
top
,
#f6f6f6
5%
,
#fff
100%
);
filter
:
progid
:
DXImageTransform
.
Microsoft
.
gradient
(
startColorstr
=
'#f6f6f6'
,
endColorstr
=
'#ffffff'
);
background-color
:
#f6f6f6
;}
.close-chatbox-button
:active
{
position
:
relative
;
top
:
1px
;}
.oc-chat-content
dt
{
margin
:
0
;
padding-top
:
.5em
;}
.chatroom-form-container
{
color
:
#666
;
padding
:
5px
;
height
:
262px
;
overflow-y
:
auto
;
border-bottom-right-radius
:
4px
;
border-bottom-left-radius
:
4px
;}
.chatroom-form
{
background
:
white
;
font-size
:
12px
;
padding
:
0
;}
.chat-body
p
{
font-size
:
14px
;
color
:
#666
;
margin
:
5px
;}
.chatroom-form
legend
{
font-size
:
14px
;
font-weight
:
bold
;
margin-bottom
:
5px
;}
.chatroom-form
label
{
font-weight
:
bold
;
display
:
block
;
clear
:
both
;}
.chatroom-form
label
input
,
.chatroom-form
label
select
{
float
:
right
;}
#converse-roster
dd
.odd
{
background-color
:
#DCEAC5
;}
#converse-roster
dd
.current-xmpp-contact
{
clear
:
both
;}
#converse-roster
dd
.current-xmpp-contact
,
#converse-roster
dd
.current-xmpp-contact
:hover
{
background
:
url(images/user_online_panel.png)
no-repeat
5px
2px
;}
#converse-roster
dd
.current-xmpp-contact.offline
:hover
,
#converse-roster
dd
.current-xmpp-contact.unavailable
:hover
,
#converse-roster
dd
.current-xmpp-contact.offline
,
#converse-roster
dd
.current-xmpp-contact.unavailable
{
background
:
url(images/user_offline_panel.png)
no-repeat
5px
2px
;}
#converse-roster
dd
.current-xmpp-contact.dnd
,
#converse-roster
dd
.current-xmpp-contact.dnd
:hover
{
background
:
url(images/user_busy_panel.png)
no-repeat
5px
2px
;}
#converse-roster
dd
.current-xmpp-contact.xa
,
#converse-roster
dd
.current-xmpp-contact.xa
:hover
,
#converse-roster
dd
.current-xmpp-contact.away
,
#converse-roster
dd
.current-xmpp-contact.away
:hover
{
background
:
url(images/user_away_panel.png)
no-repeat
5px
2px
;}
#converse-roster
dd
.requesting-xmpp-contact
button
{
margin-left
:
.5em
;}
#converse-roster
dd
a
,
#converse-roster
dd
span
{
text-shadow
:
0
1px
0
rgba
(
250
,
250
,
250
,
1
);
display
:
inline-block
;
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;}
#converse-roster
dd
a
{
margin-left
:
1.3em
;}
#converse-roster
dd
span
{
width
:
125px
;}
.remove-xmpp-contact-dialog
.ui-dialog-buttonpane
{
border
:
none
;}
#converse-roster
{
height
:
200px
;
overflow-y
:
auto
;
overflow-x
:
hidden
;
width
:
100%
;
margin
:
0
;
position
:
relative
;
top
:
0
;
border
:
none
;
margin-top
:
.5em
;}
#available-chatrooms
dd
{
overflow-x
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
display
:
inline-block
;
width
:
165px
;}
#available-chatrooms
dt
,
#converse-roster
dt
{
font-weight
:
normal
;
font-size
:
13px
;
color
:
#666
;
border
:
none
;
padding
:
0
0
.3em
.5em
;
text-shadow
:
0
1px
0
rgba
(
250
,
250
,
250
,
1
);}
#converse-roster
dt
{
display
:
none
;}
dd
.available-chatroom
,
#converse-roster
dd
{
font-weight
:
bold
;
border
:
none
;
display
:
block
;
padding
:
0
0
0
.5em
;
color
:
#666
;
text-shadow
:
0
1px
0
rgba
(
250
,
250
,
250
,
1
);}
.room-info
{
font-size
:
11px
;
font-style
:
normal
;
font-weight
:
normal
;}
li
.room-info
{
display
:
block
;
margin-left
:
5px
;}
div
.room-info
{
clear
:
left
;}
p
.room-info
{
margin
:
0
;
padding
:
0
;
display
:
block
;
white-space
:
normal
;}
a
.room-info
{
background
:
url('images/information.png')
no-repeat
right
top
;
width
:
22px
;
float
:
right
;
display
:
none
;
clear
:
right
;}
a
.open-room
{
float
:
left
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
overflow-x
:
hidden
;}
dd
.available-chatroom
:hover
a
.room-info
{
display
:
inline-block
;}
dd
.available-chatroom
:hover
a
.open-room
{
width
:
75%
;}
#converse-roster
dd
a
.remove-xmpp-contact
{
background
:
url('images/delete_icon.png')
no-repeat
right
top
;
padding
:
0
0
1em
0
;
float
:
right
;
width
:
22px
;
margin
:
0
;
display
:
none
;}
#converse-roster
dd
:hover
a
.remove-xmpp-contact
{
display
:
inline-block
;}
#converse-roster
dd
:hover
a
.open-chat
{
width
:
75%
;}
.chatbox
,
.chatroom
{
box-shadow
:
1px
1px
5px
1px
rgba
(
0
,
0
,
0
,
0.4
);
display
:
none
;
float
:
right
;
margin-right
:
15px
;
z-index
:
20
;
border-radius
:
4px
;}
.chatbox
{
width
:
201px
;}
.chatroom
{
width
:
300px
;
height
:
311px
;}
.oc-chat-content
{
height
:
272px
;
width
:
199px
;
padding
:
0
;
border-bottom-right-radius
:
4px
;
border-bottom-left-radius
:
4px
;}
.oc-chat-content
dd
{
margin-left
:
0
;
margin-bottom
:
0
;
padding
:
1em
;}
.oc-chat-content
dd
.odd
{
background-color
:
#DCEAC5
;}
div
#controlbox-panes
{
background
:
-moz-linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
1
)
0
,
rgba
(
240
,
240
,
240
,
1
)
100%
);
background
:
-ms-linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
1
)
0
,
rgba
(
240
,
240
,
240
,
1
)
100%
);
background
:
-o-linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
1
)
0
,
rgba
(
240
,
240
,
240
,
1
)
100%
);
background
:
-webkit-gradient
(
linear
,
left
top
,
left
bottom
,
color-stop
(
0%
,
rgba
(
255
,
255
,
255
,
1
)),
color-stop
(
100%
,
rgba
(
240
,
240
,
240
,
1
)));
background
:
-webkit-linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
1
)
0
,
rgba
(
240
,
240
,
240
,
1
)
100%
);
background
:
linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
1
)
0
,
rgba
(
240
,
240
,
240
,
1
)
100%
);
background-color
:
white
;
border-bottom-left-radius
:
4px
;
border-bottom-right-radius
:
4px
;
border
:
1px
solid
#999
;
width
:
199px
;}
form
#converse-login
{
background
:
white
;
padding
:
2em
0
.3em
.5em
;}
form
#converse-login
input
{
display
:
block
;
width
:
90%
;}
form
#converse-login
.login-submit
{
margin-top
:
1em
;
width
:
auto
;}
form
.set-xmpp-status
{
background
:
none
;
padding
:
.5em
0
.5em
.5em
;}
form
.add-chatroom
{
background
:
none
;
padding
:
3px
;}
form
.add-chatroom
input
[
type
=
text
]
{
width
:
95%
;
margin
:
3px
;}
form
.add-chatroom
input
[
type
=
button
],
form
.add-chatroom
input
[
type
=
submit
]
{
width
:
50%
;}
select
#select-xmpp-status
{
float
:
right
;
margin-right
:
.5em
;}
.chat-head
#controlbox-tabs
{
text-align
:
center
;
display
:
inline
;
overflow
:
hidden
;
font-size
:
12px
;
list-style-type
:
none
;}
.chat-head
#controlbox-tabs
li
{
float
:
left
;
list-style
:
none
;
padding-left
:
0
;
text-shadow
:
white
0
1px
0
;
width
:
40%
;}
ul
#controlbox-tabs
li
a
{
display
:
block
;
font-size
:
12px
;
height
:
34px
;
line-height
:
34px
;
margin
:
0
;
text-align
:
center
;
text-decoration
:
none
;
border
:
1px
solid
#999
;
border-top-right-radius
:
4px
;
border-top-left-radius
:
4px
;
color
:
#666
;
text-shadow
:
0
1px
0
rgba
(
250
,
250
,
250
,
1
);}
.chat-head
#controlbox-tabs
li
a
:hover
{
color
:
black
;}
.chat-head
#controlbox-tabs
li
a
{
background-color
:
white
;
box-shadow
:
inset
0
0
8px
rgba
(
0
,
0
,
0
,
0.2
);}
ul
#controlbox-tabs
a
.current
,
ul
#controlbox-tabs
a
.current
:hover
{
box-shadow
:
none
;
color
:
#000
;
border-bottom
:
0
;
height
:
35px
;}
div
#users
,
div
#chatrooms
,
div
#login-dialog
,
div
#settings
{
border
:
0
;
font-size
:
14px
;
width
:
199px
;
background-color
:
white
;
border-bottom-right-radius
:
4px
;
border-bottom-left-radius
:
4px
;}
div
#chatrooms
{
overflow-y
:
auto
;}
form
.sendXMPPMessage
{
background
:
white
;
border
:
1px
solid
#999
;
padding
:
.5em
;
margin
:
0
;
position
:
relative
;
-webkit-border-radius
:
4px
;
-moz-border-radius
:
4px
;
border-radius
:
4px
;
-moz-background-clip
:
padding
;
-webkit-background-clip
:
padding-box
;
background-clip
:
padding-box
;
border-top-left-radius
:
0
;
border-top-right-radius
:
0
;
height
:
54px
;}
form
#set-custom-xmpp-status
{
float
:
left
;
padding
:
0
;}
#set-custom-xmpp-status
button
{
padding
:
1px
2px
1px
1px
;}
.chatbox
dl
.dropdown
{
margin-right
:
.5em
;
margin-bottom
:
0
;
background-color
:
#f0f0f0
;}
.chatbox
.dropdown
dd
,
.dropdown
dt
,
.dropdown
ul
{
margin
:
0
;
padding
:
0
;}
.chatbox
.dropdown
dd
{
position
:
relative
;}
input
.custom-xmpp-status
{
width
:
138px
;}
form
.add-xmpp-contact
{
background
:
none
;
padding
:
5px
;}
form
.add-xmpp-contact
input
{
width
:
125px
;}
.chatbox
.dropdown
dt
a
span
{
cursor
:
pointer
;
display
:
block
;
padding
:
5px
;}
.chatbox
.dropdown
dd
ul
{
padding
:
5px
0
5px
0
;
list-style
:
none
;
position
:
absolute
;
left
:
0
;
top
:
0
;
border
:
1px
solid
#ddd
;
border-top
:
0
;
width
:
99%
;
z-index
:
21
;
background-color
:
#f0f0f0
;}
.chatbox
.dropdown
li
{
list-style
:
none
;
padding-left
:
0
;}
.set-xmpp-status
.dropdown
dd
ul
{
z-index
:
22
;}
.chatbox
.dropdown
a
{
padding
:
3px
0
0
25px
;
display
:
block
;
height
:
22px
;}
.chatbox
.dropdown
a
.toggle-xmpp-contact-form
{
background
:
url('images/add_icon.png')
no-repeat
4px
2px
;}
.chatbox
.dropdown
a
.online
{
background
:
url(images/user_online_panel.png)
no-repeat
3px
4px
;}
.chatbox
.dropdown
a
.offline
{
background
:
url(images/user_offline_panel.png)
no-repeat
3px
4px
;}
.chatbox
.dropdown
a
.dnd
{
background
:
url(images/user_busy_panel.png)
no-repeat
3px
4px
;}
.chatbox
.dropdown
a
.away
{
background
:
url(images/user_away_panel.png)
no-repeat
3px
4px
;}
.chatbox
.dropdown
dd
ul
a
:hover
{
background-color
:
#bed6e5
;}
.hidden
{
display
:
none
;}
.locked
{
background
:
url(images/emblem-readonly.png)
no-repeat
right
;
padding-right
:
22px
;}
span
.spinner
{
background
:
url(images/spinner.gif)
no-repeat
center
;
width
:
22px
;
height
:
22px
;
padding
:
0
2px
0
2px
;
display
:
block
;}
span
.spinner.hor_centered
{
left
:
40%
;
position
:
absolute
;}
img
.spinner
{
width
:
auto
;
border
:
none
;
box-shadow
:
none
;
-moz-box-shadow
:
none
;
-webkit-box-shadow
:
none
;
margin
:
0
;
padding
:
0
5px
0
5px
;}
img
.centered
{
position
:
absolute
;
top
:
30%
;
left
:
50%
;
margin
:
0
0
0
-25%
;}
#chatpanel
{
z-index
:
99
;
position
:
fixed
;
bottom
:
0
;
right
:
0
;
height
:
332px
;
width
:
auto
;}
#toggle-controlbox
{
position
:
fixed
;
font-size
:
80%
;
bottom
:
0
;
right
:
0
;
border-top-right-radius
:
4px
;
border-top-left-radius
:
4px
;
background
:
#e3e2e2
;
border
:
1px
solid
#c3c3c3
;
border-bottom
:
none
;
padding
:
.25em
.5em
;
margin-right
:
1em
;
height
:
1.1em
;}
#connecting-to-chat
{
background
:
url(images/spinner.gif)
no-repeat
left
;
padding-left
:
1.4em
;}
.chat-head
{
color
:
#fff
;
margin
:
0
;
font-size
:
100%
;
border-top-right-radius
:
4px
;
border-top-left-radius
:
4px
;
padding
:
3px
0
3px
7px
;}
.chat-head-chatbox
{
background-color
:
#596a72
;
background-color
:
rgba
(
89
,
106
,
114
,
1
);}
.chat-head-chatroom
{
background-color
:
#2D617A
;}
.chatroom
.chat-body
{
height
:
272px
;
background-color
:
white
;
border-bottom-right-radius
:
4px
;
border-bottom-left-radius
:
4px
;}
.chatroom
.chat-area
{
float
:
left
;
width
:
200px
;}
.chatroom
.chat
{
overflow
:
auto
;
height
:
400px
;
border
:
solid
1px
#ccc
;}
.chatroom
.participants
{
float
:
left
;
width
:
99px
;
height
:
272px
;
background-color
:
white
;
overflow
:
auto
;
border-right
:
1px
solid
#999
;
border-bottom
:
1px
solid
#999
;
border-bottom-right-radius
:
4px
;}
.participants
ul
.participant-list
li
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
display
:
block
;
font-size
:
12px
;
padding
:
.5em
0
0
.5em
;
cursor
:
default
;}
ul
.participant-list
li
.moderator
{
color
:
#FE0007
;}
.chatroom
form
.sendXMPPMessage
{
-webkit-border-bottom-right-radius
:
0
;
border-bottom-right-radius
:
0
;}
.chatroom
.participant-list
{
list-style
:
none
;}
.chat-blink
{
background-color
:
#176689
;
border-right
:
1px
solid
#176689
;
border-left
:
1px
solid
#176689
;}
.chat-content
{
padding
:
.3em
;
font-size
:
13px
;
color
:
#333
;
height
:
193px
;
overflow-y
:
auto
;
border
:
1px
solid
#999
;
border-bottom
:
0
;
border-top
:
0
;
background-color
:
#fff
;
line-height
:
1.3em
;}
.chat-textarea
{
border
:
0
;
height
:
50px
;}
.chat-textarea-chatbox-selected
{
border
:
1px
solid
#578308
;
margin
:
0
;}
.chat-textarea-chatroom-selected
{
border
:
2px
solid
#2D617A
;
margin
:
0
;}
.chat-info
{
color
:
#666
;}
.chat-message-me
{
font-weight
:
bold
;
color
:
#436976
;}
.chat-message-room
{
font-weight
:
bold
;
color
:
#4B7003
;}
.chat-message-them
{
font-weight
:
bold
;
color
:
#F62817
;
white-space
:
nowrap
;
max-width
:
100px
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
display
:
inline-block
;}
.chat-event
,
.chat-date
,
.chat-info
{
color
:
#808080
;}
li
.chat-info
{
padding-left
:
10px
;}
.chat-date
{
display
:
inline-block
;
padding-top
:
10px
;}
div
#settings
,
div
#chatrooms
,
div
#login-dialog
{
height
:
272px
;}
p
.not-implemented
{
margin-top
:
3em
;
margin-left
:
.3em
;
color
:
#808080
;}
div
.delayed
.chat-message-them
{
color
:
#FB5D50
;}
div
.delayed
.chat-message-me
{
color
:
#7EABBB
;}
input
.error
{
border
:
1px
solid
red
;}
.conn-feedback.error
{
color
:
red
;}
.chat-message-error
{
color
:
#76797C
;
font-size
:
90%
;
font-weight
:
normal
;}
.chat-head
.avatar
{
float
:
left
;
margin-right
:
6px
;}
div
.chat-title
{
color
:
white
;
font-weight
:
bold
;
line-height
:
15px
;
display
:
block
;
margin-top
:
2px
;
margin-right
:
20px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
text-shadow
:
rgba
(
0
,
0
,
0
,
0.51
)
0
-1px
0
;
height
:
1em
;}
.chat-head-chatbox
,
.chat-head-chatroom
{
background
:
linear-gradient
(
top
,
rgba
(
206
,
220
,
231
,
1
)
0
,
rgba
(
89
,
106
,
114
,
1
)
100%
);
height
:
33px
;
position
:
relative
;}
p
.user-custom-message
,
p
.chatroom-topic
{
font-size
:
80%
;
font-style
:
italic
;
height
:
1.3em
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
margin
:
0
;}
.activated
{
display
:
block
!important
;}
a
.subscribe-to-user
{
padding-left
:
2em
;
font-weight
:
bold
;}
dl
.add-converse-contact
{
margin
:
0
0
0
.5em
;}
.fancy-dropdown
{
border
:
1px
solid
#ddd
;
height
:
22px
;}
.fancy-dropdown
a
.choose-xmpp-status
,
.fancy-dropdown
a
.toggle-xmpp-contact-form
{
text-shadow
:
0
1px
0
rgba
(
255
,
255
,
255
,
1
);
padding-left
:
2em
;
display
:
block
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
float
:
left
;
width
:
130px
;}
#fancy-xmpp-status-select
a
.change-xmpp-status-message
{
background
:
url('images/pencil_icon.png')
no-repeat
right
3px
;
float
:
right
;
clear
:
right
;
height
:
22px
;}
ul
#found-users
{
padding
:
10px
0
5px
5px
;
border
:
0
;}
form
.search-xmpp-contact
{
margin
:
0
;
padding-left
:
5px
;
padding
:
0
0
5px
5px
;}
form
.search-xmpp-contact
input
{
width
:
8em
;}
.oc-chat-head
{
margin
:
0
;
color
:
#FFF
;
border-top-right-radius
:
4px
;
border-top-left-radius
:
4px
;
height
:
35px
;
clear
:
right
;
background-color
:
#5390C8
;
padding
:
3px
0
0
0
;}
a
.configure-chatroom-button
,
a
.close-chatbox-button
{
margin-top
:
.2em
;
margin-right
:
.5em
;
cursor
:
pointer
;
float
:
right
;
width
:
12px
;
-moz-box-shadow
:
inset
0
1px
0
0
#fff
;
-webkit-box-shadow
:
inset
0
1px
0
0
#fff
;
box-shadow
:
inset
0
1px
0
0
#fff
;
background
:
-webkit-gradient
(
linear
,
left
top
,
left
bottom
,
color-stop
(
0.05
,
#fff
),
color-stop
(
1
,
#f6f6f6
));
background
:
-moz-linear-gradient
(
center
top
,
#fff
5%
,
#f6f6f6
100%
);
filter
:
progid
:
DXImageTransform
.
Microsoft
.
gradient
(
startColorstr
=
'#ffffff'
,
endColorstr
=
'#f6f6f6'
);
-moz-border-radius
:
6px
;
-webkit-border-radius
:
6px
;
border-radius
:
6px
;
border
:
1px
solid
#888
;
display
:
inline-block
;
color
:
#666
!important
;
font-family
:
arial
;
font-size
:
12px
;
font-weight
:
bold
;
text-decoration
:
none
;
text-shadow
:
1px
1px
0
#fff
;}
a
.configure-chatroom-button
{
padding
:
0
4px
;
background
:
#fff
url('images/preferences-system.png')
no-repeat
center
center
;}
.close-chatbox-button
{
padding
:
0
2px
0
6px
;}
.close-chatbox-button
:hover
{
background
:
-webkit-gradient
(
linear
,
left
top
,
left
bottom
,
color-stop
(
0.05
,
#f6f6f6
),
color-stop
(
1
,
#fff
));
background
:
-moz-linear-gradient
(
center
top
,
#f6f6f6
5%
,
#fff
100%
);
filter
:
progid
:
DXImageTransform
.
Microsoft
.
gradient
(
startColorstr
=
'#f6f6f6'
,
endColorstr
=
'#ffffff'
);
background-color
:
#f6f6f6
;}
.close-chatbox-button
:active
{
position
:
relative
;
top
:
1px
;}
.oc-chat-content
dt
{
margin
:
0
;
padding-top
:
.5em
;}
.chatroom-form-container
{
color
:
#666
;
padding
:
5px
;
height
:
262px
;
overflow-y
:
auto
;
border-bottom-right-radius
:
4px
;
border-bottom-left-radius
:
4px
;}
.chatroom-form
{
background
:
white
;
font-size
:
12px
;
padding
:
0
;}
.chat-body
p
{
font-size
:
14px
;
color
:
#666
;
padding
:
5px
;
margin
:
0
;}
.chatroom-form
legend
{
font-size
:
14px
;
font-weight
:
bold
;
margin-bottom
:
5px
;}
.chatroom-form
label
{
font-weight
:
bold
;
display
:
block
;
clear
:
both
;}
.chatroom-form
label
input
,
.chatroom-form
label
select
{
float
:
right
;}
#converse-roster
dd
.odd
{
background-color
:
#DCEAC5
;}
#converse-roster
dd
.current-xmpp-contact
{
clear
:
both
;}
#converse-roster
dd
.current-xmpp-contact
,
#converse-roster
dd
.current-xmpp-contact
:hover
{
background
:
url(images/user_online_panel.png)
no-repeat
5px
2px
;}
#converse-roster
dd
.current-xmpp-contact.offline
:hover
,
#converse-roster
dd
.current-xmpp-contact.unavailable
:hover
,
#converse-roster
dd
.current-xmpp-contact.offline
,
#converse-roster
dd
.current-xmpp-contact.unavailable
{
background
:
url(images/user_offline_panel.png)
no-repeat
5px
2px
;}
#converse-roster
dd
.current-xmpp-contact.dnd
,
#converse-roster
dd
.current-xmpp-contact.dnd
:hover
{
background
:
url(images/user_busy_panel.png)
no-repeat
5px
2px
;}
#converse-roster
dd
.current-xmpp-contact.xa
,
#converse-roster
dd
.current-xmpp-contact.xa
:hover
,
#converse-roster
dd
.current-xmpp-contact.away
,
#converse-roster
dd
.current-xmpp-contact.away
:hover
{
background
:
url(images/user_away_panel.png)
no-repeat
5px
2px
;}
#converse-roster
dd
.requesting-xmpp-contact
button
{
margin-left
:
.5em
;}
#converse-roster
dd
a
,
#converse-roster
dd
span
{
text-shadow
:
0
1px
0
rgba
(
250
,
250
,
250
,
1
);
display
:
inline-block
;
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;}
#converse-roster
dd
a
{
margin-left
:
1.3em
;}
#converse-roster
dd
span
{
width
:
125px
;}
.remove-xmpp-contact-dialog
.ui-dialog-buttonpane
{
border
:
none
;}
#converse-roster
{
height
:
200px
;
overflow-y
:
auto
;
overflow-x
:
hidden
;
width
:
100%
;
margin
:
0
;
position
:
relative
;
top
:
0
;
border
:
none
;
margin-top
:
.5em
;}
#available-chatrooms
dd
{
overflow-x
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
display
:
inline-block
;
width
:
165px
;}
#available-chatrooms
dt
,
#converse-roster
dt
{
font-weight
:
normal
;
font-size
:
13px
;
color
:
#666
;
border
:
none
;
padding
:
0
0
.3em
.5em
;
text-shadow
:
0
1px
0
rgba
(
250
,
250
,
250
,
1
);}
#converse-roster
dt
{
display
:
none
;}
dd
.available-chatroom
,
#converse-roster
dd
{
font-weight
:
bold
;
border
:
none
;
display
:
block
;
padding
:
0
0
0
.5em
;
color
:
#666
;
text-shadow
:
0
1px
0
rgba
(
250
,
250
,
250
,
1
);}
.room-info
{
font-size
:
11px
;
font-style
:
normal
;
font-weight
:
normal
;}
li
.room-info
{
display
:
block
;
margin-left
:
5px
;}
div
.room-info
{
clear
:
left
;}
p
.room-info
{
margin
:
0
;
padding
:
0
;
display
:
block
;
white-space
:
normal
;}
a
.room-info
{
background
:
url('images/information.png')
no-repeat
right
top
;
width
:
22px
;
float
:
right
;
display
:
none
;
clear
:
right
;}
a
.open-room
{
float
:
left
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
overflow-x
:
hidden
;}
dd
.available-chatroom
:hover
a
.room-info
{
display
:
inline-block
;}
dd
.available-chatroom
:hover
a
.open-room
{
width
:
75%
;}
#converse-roster
dd
a
.remove-xmpp-contact
{
background
:
url('images/delete_icon.png')
no-repeat
right
top
;
padding
:
0
0
1em
0
;
float
:
right
;
width
:
22px
;
margin
:
0
;
display
:
none
;}
#converse-roster
dd
:hover
a
.remove-xmpp-contact
{
display
:
inline-block
;}
#converse-roster
dd
:hover
a
.open-chat
{
width
:
75%
;}
.chatbox
,
.chatroom
{
box-shadow
:
1px
1px
5px
1px
rgba
(
0
,
0
,
0
,
0.4
);
display
:
none
;
float
:
right
;
margin-right
:
15px
;
z-index
:
20
;
border-radius
:
4px
;}
.chatbox
{
width
:
201px
;}
.chatroom
{
width
:
300px
;
height
:
311px
;}
.oc-chat-content
{
height
:
272px
;
width
:
199px
;
padding
:
0
;
border-bottom-right-radius
:
4px
;
border-bottom-left-radius
:
4px
;}
.oc-chat-content
dd
{
margin-left
:
0
;
margin-bottom
:
0
;
padding
:
1em
;}
.oc-chat-content
dd
.odd
{
background-color
:
#DCEAC5
;}
div
#controlbox-panes
{
background
:
-moz-linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
1
)
0
,
rgba
(
240
,
240
,
240
,
1
)
100%
);
background
:
-ms-linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
1
)
0
,
rgba
(
240
,
240
,
240
,
1
)
100%
);
background
:
-o-linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
1
)
0
,
rgba
(
240
,
240
,
240
,
1
)
100%
);
background
:
-webkit-gradient
(
linear
,
left
top
,
left
bottom
,
color-stop
(
0%
,
rgba
(
255
,
255
,
255
,
1
)),
color-stop
(
100%
,
rgba
(
240
,
240
,
240
,
1
)));
background
:
-webkit-linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
1
)
0
,
rgba
(
240
,
240
,
240
,
1
)
100%
);
background
:
linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
1
)
0
,
rgba
(
240
,
240
,
240
,
1
)
100%
);
background-color
:
white
;
border-bottom-left-radius
:
4px
;
border-bottom-right-radius
:
4px
;
border
:
1px
solid
#999
;
width
:
199px
;}
form
#converse-login
{
background
:
white
;
padding
:
2em
0
.3em
.5em
;}
form
#converse-login
input
{
display
:
block
;
width
:
90%
;}
form
#converse-login
.login-submit
{
margin-top
:
1em
;
width
:
auto
;}
form
.set-xmpp-status
{
background
:
none
;
padding
:
.5em
0
.5em
.5em
;}
form
.add-chatroom
{
background
:
none
;
padding
:
3px
;}
form
.add-chatroom
input
[
type
=
text
]
{
width
:
95%
;
margin
:
3px
;}
form
.add-chatroom
input
[
type
=
button
],
form
.add-chatroom
input
[
type
=
submit
]
{
width
:
50%
;}
select
#select-xmpp-status
{
float
:
right
;
margin-right
:
.5em
;}
.chat-head
#controlbox-tabs
{
text-align
:
center
;
display
:
inline
;
overflow
:
hidden
;
font-size
:
12px
;
list-style-type
:
none
;}
.chat-head
#controlbox-tabs
li
{
float
:
left
;
list-style
:
none
;
padding-left
:
0
;
text-shadow
:
white
0
1px
0
;
width
:
40%
;}
ul
#controlbox-tabs
li
a
{
display
:
block
;
font-size
:
12px
;
height
:
34px
;
line-height
:
34px
;
margin
:
0
;
text-align
:
center
;
text-decoration
:
none
;
border
:
1px
solid
#999
;
border-top-right-radius
:
4px
;
border-top-left-radius
:
4px
;
color
:
#666
;
text-shadow
:
0
1px
0
rgba
(
250
,
250
,
250
,
1
);}
.chat-head
#controlbox-tabs
li
a
:hover
{
color
:
black
;}
.chat-head
#controlbox-tabs
li
a
{
background-color
:
white
;
box-shadow
:
inset
0
0
8px
rgba
(
0
,
0
,
0
,
0.2
);}
ul
#controlbox-tabs
a
.current
,
ul
#controlbox-tabs
a
.current
:hover
{
box-shadow
:
none
;
color
:
#000
;
border-bottom
:
0
;
height
:
35px
;}
div
#users
,
div
#chatrooms
,
div
#login-dialog
,
div
#settings
{
border
:
0
;
font-size
:
14px
;
width
:
199px
;
background-color
:
white
;
border-bottom-right-radius
:
4px
;
border-bottom-left-radius
:
4px
;}
div
#chatrooms
{
overflow-y
:
auto
;}
form
.sendXMPPMessage
{
background
:
white
;
border
:
1px
solid
#999
;
padding
:
.5em
;
margin
:
0
;
position
:
relative
;
-webkit-border-radius
:
4px
;
-moz-border-radius
:
4px
;
border-radius
:
4px
;
-moz-background-clip
:
padding
;
-webkit-background-clip
:
padding-box
;
background-clip
:
padding-box
;
border-top-left-radius
:
0
;
border-top-right-radius
:
0
;
height
:
54px
;}
form
#set-custom-xmpp-status
{
float
:
left
;
padding
:
0
;}
#set-custom-xmpp-status
button
{
padding
:
1px
2px
1px
1px
;}
.chatbox
dl
.dropdown
{
margin-right
:
.5em
;
margin-bottom
:
0
;
background-color
:
#f0f0f0
;}
.chatbox
.dropdown
dd
,
.dropdown
dt
,
.dropdown
ul
{
margin
:
0
;
padding
:
0
;}
.chatbox
.dropdown
dd
{
position
:
relative
;}
input
.custom-xmpp-status
{
width
:
138px
;}
form
.add-xmpp-contact
{
background
:
none
;
padding
:
5px
;}
form
.add-xmpp-contact
input
{
width
:
125px
;}
.chatbox
.dropdown
dt
a
span
{
cursor
:
pointer
;
display
:
block
;
padding
:
5px
;}
.chatbox
.dropdown
dd
ul
{
padding
:
5px
0
5px
0
;
list-style
:
none
;
position
:
absolute
;
left
:
0
;
top
:
0
;
border
:
1px
solid
#ddd
;
border-top
:
0
;
width
:
99%
;
z-index
:
21
;
background-color
:
#f0f0f0
;}
.chatbox
.dropdown
li
{
list-style
:
none
;
padding-left
:
0
;}
.set-xmpp-status
.dropdown
dd
ul
{
z-index
:
22
;}
.chatbox
.dropdown
a
{
padding
:
3px
0
0
25px
;
display
:
block
;
height
:
22px
;}
.chatbox
.dropdown
a
.toggle-xmpp-contact-form
{
background
:
url('images/add_icon.png')
no-repeat
4px
2px
;}
.chatbox
.dropdown
a
.online
{
background
:
url(images/user_online_panel.png)
no-repeat
3px
4px
;}
.chatbox
.dropdown
a
.offline
{
background
:
url(images/user_offline_panel.png)
no-repeat
3px
4px
;}
.chatbox
.dropdown
a
.dnd
{
background
:
url(images/user_busy_panel.png)
no-repeat
3px
4px
;}
.chatbox
.dropdown
a
.away
{
background
:
url(images/user_away_panel.png)
no-repeat
3px
4px
;}
.chatbox
.dropdown
dd
ul
a
:hover
{
background-color
:
#bed6e5
;}
\ No newline at end of file
\ No newline at end of file
converse.min.js
View file @
4f3d34eb
This source diff could not be displayed because it is too large. You can
view the blob
instead.
mock.js
View file @
4f3d34eb
...
@@ -10,7 +10,8 @@
...
@@ -10,7 +10,8 @@
'
listRooms
'
:
function
()
{},
'
listRooms
'
:
function
()
{},
'
join
'
:
function
()
{},
'
join
'
:
function
()
{},
'
leave
'
:
function
()
{},
'
leave
'
:
function
()
{},
'
removeRoom
'
:
function
()
{}
'
removeRoom
'
:
function
()
{},
'
rooms
'
:
{}
},
},
'
jid
'
:
'
dummy@localhost
'
,
'
jid
'
:
'
dummy@localhost
'
,
'
addHandler
'
:
function
(
handler
,
ns
,
name
,
type
,
id
,
from
,
options
)
{
'
addHandler
'
:
function
(
handler
,
ns
,
name
,
type
,
id
,
from
,
options
)
{
...
...
spec/ChatRoomSpec.js
View file @
4f3d34eb
...
@@ -162,7 +162,7 @@
...
@@ -162,7 +162,7 @@
.
c
(
'
registration-required
'
).
attrs
({
xmlns
:
'
urn:ietf:params:xml:ns:xmpp-stanzas
'
}).
nodeTree
;
.
c
(
'
registration-required
'
).
attrs
({
xmlns
:
'
urn:ietf:params:xml:ns:xmpp-stanzas
'
}).
nodeTree
;
var
view
=
this
.
chatboxesview
.
views
[
'
problematic@muc.localhost
'
];
var
view
=
this
.
chatboxesview
.
views
[
'
problematic@muc.localhost
'
];
spyOn
(
converse
.
connection
.
muc
,
'
removeRoom
'
);
spyOn
(
converse
.
connection
.
muc
,
'
removeRoom
'
);
spyOn
(
view
,
'
render
ErrorMessage
'
).
andCallThrough
();
spyOn
(
view
,
'
show
ErrorMessage
'
).
andCallThrough
();
view
.
onChatRoomPresence
(
presence
,
{
'
nick
'
:
'
dummy
'
});
view
.
onChatRoomPresence
(
presence
,
{
'
nick
'
:
'
dummy
'
});
expect
(
converse
.
connection
.
muc
.
removeRoom
).
toHaveBeenCalled
();
expect
(
converse
.
connection
.
muc
.
removeRoom
).
toHaveBeenCalled
();
expect
(
view
.
$el
.
find
(
'
.chat-body p
'
).
text
()).
toBe
(
'
You are not on the member list of this room
'
);
expect
(
view
.
$el
.
find
(
'
.chat-body p
'
).
text
()).
toBe
(
'
You are not on the member list of this room
'
);
...
@@ -179,7 +179,7 @@
...
@@ -179,7 +179,7 @@
.
c
(
'
forbidden
'
).
attrs
({
xmlns
:
'
urn:ietf:params:xml:ns:xmpp-stanzas
'
}).
nodeTree
;
.
c
(
'
forbidden
'
).
attrs
({
xmlns
:
'
urn:ietf:params:xml:ns:xmpp-stanzas
'
}).
nodeTree
;
var
view
=
this
.
chatboxesview
.
views
[
'
problematic@muc.localhost
'
];
var
view
=
this
.
chatboxesview
.
views
[
'
problematic@muc.localhost
'
];
spyOn
(
converse
.
connection
.
muc
,
'
removeRoom
'
);
spyOn
(
converse
.
connection
.
muc
,
'
removeRoom
'
);
spyOn
(
view
,
'
render
ErrorMessage
'
).
andCallThrough
();
spyOn
(
view
,
'
show
ErrorMessage
'
).
andCallThrough
();
view
.
onChatRoomPresence
(
presence
,
{
'
nick
'
:
'
dummy
'
});
view
.
onChatRoomPresence
(
presence
,
{
'
nick
'
:
'
dummy
'
});
expect
(
converse
.
connection
.
muc
.
removeRoom
).
toHaveBeenCalled
();
expect
(
converse
.
connection
.
muc
.
removeRoom
).
toHaveBeenCalled
();
expect
(
view
.
$el
.
find
(
'
.chat-body p
'
).
text
()).
toBe
(
'
You have been banned from this room
'
);
expect
(
view
.
$el
.
find
(
'
.chat-body p
'
).
text
()).
toBe
(
'
You have been banned from this room
'
);
...
@@ -196,7 +196,7 @@
...
@@ -196,7 +196,7 @@
.
c
(
'
jid-malformed
'
).
attrs
({
xmlns
:
'
urn:ietf:params:xml:ns:xmpp-stanzas
'
}).
nodeTree
;
.
c
(
'
jid-malformed
'
).
attrs
({
xmlns
:
'
urn:ietf:params:xml:ns:xmpp-stanzas
'
}).
nodeTree
;
var
view
=
this
.
chatboxesview
.
views
[
'
problematic@muc.localhost
'
];
var
view
=
this
.
chatboxesview
.
views
[
'
problematic@muc.localhost
'
];
spyOn
(
converse
.
connection
.
muc
,
'
removeRoom
'
);
spyOn
(
converse
.
connection
.
muc
,
'
removeRoom
'
);
spyOn
(
view
,
'
render
ErrorMessage
'
).
andCallThrough
();
spyOn
(
view
,
'
show
ErrorMessage
'
).
andCallThrough
();
view
.
onChatRoomPresence
(
presence
,
{
'
nick
'
:
'
dummy
'
});
view
.
onChatRoomPresence
(
presence
,
{
'
nick
'
:
'
dummy
'
});
expect
(
converse
.
connection
.
muc
.
removeRoom
).
toHaveBeenCalled
();
expect
(
converse
.
connection
.
muc
.
removeRoom
).
toHaveBeenCalled
();
expect
(
view
.
$el
.
find
(
'
.chat-body p
'
).
text
()).
toBe
(
'
No nickname was specified
'
);
expect
(
view
.
$el
.
find
(
'
.chat-body p
'
).
text
()).
toBe
(
'
No nickname was specified
'
);
...
@@ -213,7 +213,7 @@
...
@@ -213,7 +213,7 @@
.
c
(
'
not-allowed
'
).
attrs
({
xmlns
:
'
urn:ietf:params:xml:ns:xmpp-stanzas
'
}).
nodeTree
;
.
c
(
'
not-allowed
'
).
attrs
({
xmlns
:
'
urn:ietf:params:xml:ns:xmpp-stanzas
'
}).
nodeTree
;
var
view
=
this
.
chatboxesview
.
views
[
'
problematic@muc.localhost
'
];
var
view
=
this
.
chatboxesview
.
views
[
'
problematic@muc.localhost
'
];
spyOn
(
converse
.
connection
.
muc
,
'
removeRoom
'
);
spyOn
(
converse
.
connection
.
muc
,
'
removeRoom
'
);
spyOn
(
view
,
'
render
ErrorMessage
'
).
andCallThrough
();
spyOn
(
view
,
'
show
ErrorMessage
'
).
andCallThrough
();
view
.
onChatRoomPresence
(
presence
,
{
'
nick
'
:
'
dummy
'
});
view
.
onChatRoomPresence
(
presence
,
{
'
nick
'
:
'
dummy
'
});
expect
(
converse
.
connection
.
muc
.
removeRoom
).
toHaveBeenCalled
();
expect
(
converse
.
connection
.
muc
.
removeRoom
).
toHaveBeenCalled
();
expect
(
view
.
$el
.
find
(
'
.chat-body p
'
).
text
()).
toBe
(
'
You are not allowed to create new rooms
'
);
expect
(
view
.
$el
.
find
(
'
.chat-body p
'
).
text
()).
toBe
(
'
You are not allowed to create new rooms
'
);
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
.
c
(
'
not-acceptable
'
).
attrs
({
xmlns
:
'
urn:ietf:params:xml:ns:xmpp-stanzas
'
}).
nodeTree
;
.
c
(
'
not-acceptable
'
).
attrs
({
xmlns
:
'
urn:ietf:params:xml:ns:xmpp-stanzas
'
}).
nodeTree
;
var
view
=
this
.
chatboxesview
.
views
[
'
problematic@muc.localhost
'
];
var
view
=
this
.
chatboxesview
.
views
[
'
problematic@muc.localhost
'
];
spyOn
(
converse
.
connection
.
muc
,
'
removeRoom
'
);
spyOn
(
converse
.
connection
.
muc
,
'
removeRoom
'
);
spyOn
(
view
,
'
render
ErrorMessage
'
).
andCallThrough
();
spyOn
(
view
,
'
show
ErrorMessage
'
).
andCallThrough
();
view
.
onChatRoomPresence
(
presence
,
{
'
nick
'
:
'
dummy
'
});
view
.
onChatRoomPresence
(
presence
,
{
'
nick
'
:
'
dummy
'
});
expect
(
converse
.
connection
.
muc
.
removeRoom
).
toHaveBeenCalled
();
expect
(
converse
.
connection
.
muc
.
removeRoom
).
toHaveBeenCalled
();
expect
(
view
.
$el
.
find
(
'
.chat-body p
'
).
text
()).
toBe
(
"
Your nickname doesn't conform to this room's policies
"
);
expect
(
view
.
$el
.
find
(
'
.chat-body p
'
).
text
()).
toBe
(
"
Your nickname doesn't conform to this room's policies
"
);
...
@@ -247,7 +247,7 @@
...
@@ -247,7 +247,7 @@
.
c
(
'
conflict
'
).
attrs
({
xmlns
:
'
urn:ietf:params:xml:ns:xmpp-stanzas
'
}).
nodeTree
;
.
c
(
'
conflict
'
).
attrs
({
xmlns
:
'
urn:ietf:params:xml:ns:xmpp-stanzas
'
}).
nodeTree
;
var
view
=
this
.
chatboxesview
.
views
[
'
problematic@muc.localhost
'
];
var
view
=
this
.
chatboxesview
.
views
[
'
problematic@muc.localhost
'
];
spyOn
(
converse
.
connection
.
muc
,
'
removeRoom
'
);
spyOn
(
converse
.
connection
.
muc
,
'
removeRoom
'
);
spyOn
(
view
,
'
render
ErrorMessage
'
).
andCallThrough
();
spyOn
(
view
,
'
show
ErrorMessage
'
).
andCallThrough
();
view
.
onChatRoomPresence
(
presence
,
{
'
nick
'
:
'
dummy
'
});
view
.
onChatRoomPresence
(
presence
,
{
'
nick
'
:
'
dummy
'
});
expect
(
converse
.
connection
.
muc
.
removeRoom
).
toHaveBeenCalled
();
expect
(
converse
.
connection
.
muc
.
removeRoom
).
toHaveBeenCalled
();
expect
(
view
.
$el
.
find
(
'
.chat-body p
'
).
text
()).
toBe
(
"
Your nickname is already taken
"
);
expect
(
view
.
$el
.
find
(
'
.chat-body p
'
).
text
()).
toBe
(
"
Your nickname is already taken
"
);
...
@@ -264,7 +264,7 @@
...
@@ -264,7 +264,7 @@
.
c
(
'
item-not-found
'
).
attrs
({
xmlns
:
'
urn:ietf:params:xml:ns:xmpp-stanzas
'
}).
nodeTree
;
.
c
(
'
item-not-found
'
).
attrs
({
xmlns
:
'
urn:ietf:params:xml:ns:xmpp-stanzas
'
}).
nodeTree
;
var
view
=
this
.
chatboxesview
.
views
[
'
problematic@muc.localhost
'
];
var
view
=
this
.
chatboxesview
.
views
[
'
problematic@muc.localhost
'
];
spyOn
(
converse
.
connection
.
muc
,
'
removeRoom
'
);
spyOn
(
converse
.
connection
.
muc
,
'
removeRoom
'
);
spyOn
(
view
,
'
render
ErrorMessage
'
).
andCallThrough
();
spyOn
(
view
,
'
show
ErrorMessage
'
).
andCallThrough
();
view
.
onChatRoomPresence
(
presence
,
{
'
nick
'
:
'
dummy
'
});
view
.
onChatRoomPresence
(
presence
,
{
'
nick
'
:
'
dummy
'
});
expect
(
converse
.
connection
.
muc
.
removeRoom
).
toHaveBeenCalled
();
expect
(
converse
.
connection
.
muc
.
removeRoom
).
toHaveBeenCalled
();
expect
(
view
.
$el
.
find
(
'
.chat-body p
'
).
text
()).
toBe
(
"
This room does not (yet) exist
"
);
expect
(
view
.
$el
.
find
(
'
.chat-body p
'
).
text
()).
toBe
(
"
This room does not (yet) exist
"
);
...
@@ -281,7 +281,7 @@
...
@@ -281,7 +281,7 @@
.
c
(
'
service-unavailable
'
).
attrs
({
xmlns
:
'
urn:ietf:params:xml:ns:xmpp-stanzas
'
}).
nodeTree
;
.
c
(
'
service-unavailable
'
).
attrs
({
xmlns
:
'
urn:ietf:params:xml:ns:xmpp-stanzas
'
}).
nodeTree
;
var
view
=
this
.
chatboxesview
.
views
[
'
problematic@muc.localhost
'
];
var
view
=
this
.
chatboxesview
.
views
[
'
problematic@muc.localhost
'
];
spyOn
(
converse
.
connection
.
muc
,
'
removeRoom
'
);
spyOn
(
converse
.
connection
.
muc
,
'
removeRoom
'
);
spyOn
(
view
,
'
render
ErrorMessage
'
).
andCallThrough
();
spyOn
(
view
,
'
show
ErrorMessage
'
).
andCallThrough
();
view
.
onChatRoomPresence
(
presence
,
{
'
nick
'
:
'
dummy
'
});
view
.
onChatRoomPresence
(
presence
,
{
'
nick
'
:
'
dummy
'
});
expect
(
converse
.
connection
.
muc
.
removeRoom
).
toHaveBeenCalled
();
expect
(
converse
.
connection
.
muc
.
removeRoom
).
toHaveBeenCalled
();
expect
(
view
.
$el
.
find
(
'
.chat-body p
'
).
text
()).
toBe
(
"
This room has reached it's maximum number of occupants
"
);
expect
(
view
.
$el
.
find
(
'
.chat-body p
'
).
text
()).
toBe
(
"
This room has reached it's maximum number of occupants
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment