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
feb3695e
Commit
feb3695e
authored
May 14, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweak the error message styling
parent
39ef1b81
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
+13
-8
converse.css
converse.css
+6
-0
converse.js
converse.js
+2
-2
spec/ChatRoomSpec.js
spec/ChatRoomSpec.js
+5
-6
No files found.
converse.css
View file @
feb3695e
...
...
@@ -402,6 +402,12 @@ a.configure-chatroom-button {
padding
:
0
;
}
.chat-body
p
{
font-size
:
14px
;
color
:
#666
;
margin
:
5px
;
}
.chatroom-form
legend
{
font-size
:
14px
;
font-weight
:
bold
;
...
...
converse.js
View file @
feb3695e
...
...
@@ -1317,7 +1317,7 @@
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 th
e
room's policies
"
);
this
.
renderErrorMessage
(
"
Your nickname doesn't conform to th
is
room's policies
"
);
}
else
if
(
$error
.
find
(
'
conflict
'
).
length
)
{
this
.
renderErrorMessage
(
"
Your nickname is already taken
"
);
}
else
if
(
$error
.
find
(
'
item-not-found
'
).
length
)
{
...
...
@@ -2314,7 +2314,7 @@
connect
:
function
(
jid
,
password
)
{
var
connection
=
new
Strophe
.
Connection
(
converse
.
bosh_service_url
);
connection
.
connect
(
jid
,
password
,
$
.
proxy
(
function
(
status
)
{
connection
.
connect
(
jid
,
password
,
$
.
proxy
(
function
(
status
,
message
)
{
if
(
status
===
Strophe
.
Status
.
CONNECTED
)
{
console
.
log
(
'
Connected
'
);
converse
.
onConnected
(
connection
);
...
...
spec/ChatRoomSpec.js
View file @
feb3695e
...
...
@@ -26,14 +26,14 @@
},
converse
));
it
(
"
shows users currently present in the room
"
,
$
.
proxy
(
function
()
{
var
chatroomview
=
this
.
chatboxesview
.
views
[
'
lounge@muc.localhost
'
];
chatroomview
.
renderChatArea
();
var
$participant_list
=
chatroomview
.
$el
.
find
(
'
.participant-list
'
);
var
chatroomview
=
this
.
chatboxesview
.
views
[
'
lounge@muc.localhost
'
],
$participant_list
;
var
roster
=
{},
room
=
{},
i
;
for
(
i
=
0
;
i
<
chatroom_names
.
length
-
1
;
i
++
)
{
roster
[
chatroom_names
[
i
]]
=
{};
chatroomview
.
onChatRoomRoster
(
roster
,
room
);
$participant_list
=
chatroomview
.
$el
.
find
(
'
.participant-list
'
);
expect
(
$participant_list
.
find
(
'
li
'
).
length
).
toBe
(
1
+
i
);
expect
(
$
(
$participant_list
.
find
(
'
li
'
)[
i
]).
text
()).
toBe
(
chatroom_names
[
i
]);
}
...
...
@@ -43,12 +43,11 @@
it
(
"
indicates moderators by means of a special css class and tooltip
"
,
$
.
proxy
(
function
()
{
var
chatroomview
=
this
.
chatboxesview
.
views
[
'
lounge@muc.localhost
'
];
var
$participant_list
=
chatroomview
.
$el
.
find
(
'
.participant-list
'
);
var
roster
=
{},
idx
=
chatroom_names
.
length
-
1
;
roster
[
chatroom_names
[
idx
]]
=
{};
roster
[
chatroom_names
[
idx
]].
role
=
'
moderator
'
;
chatroomview
.
onChatRoomRoster
(
roster
,
{});
occupant
=
$participant_list
.
find
(
'
li
'
);
var
occupant
=
chatroomview
.
$el
.
find
(
'
.participant-list
'
)
.
find
(
'
li
'
);
expect
(
occupant
.
length
).
toBe
(
1
);
expect
(
$
(
occupant
).
text
()).
toBe
(
chatroom_names
[
idx
]);
expect
(
$
(
occupant
).
attr
(
'
class
'
)).
toBe
(
'
moderator
'
);
...
...
@@ -209,7 +208,7 @@
spyOn
(
view
,
'
renderErrorMessage
'
).
andCallThrough
();
view
.
onChatRoomPresence
(
presence
,
{
'
nick
'
:
'
dummy
'
});
expect
(
converse
.
connection
.
muc
.
removeRoom
).
toHaveBeenCalled
();
expect
(
view
.
$el
.
find
(
'
.chat-body p
'
).
text
()).
toBe
(
"
Your nickname doesn't conform to th
e
room's policies
"
);
expect
(
view
.
$el
.
find
(
'
.chat-body p
'
).
text
()).
toBe
(
"
Your nickname doesn't conform to th
is
room's policies
"
);
},
converse
));
it
(
"
will show an error message if the user's nickname is already taken
"
,
$
.
proxy
(
function
()
{
...
...
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