Commit feb3695e authored by JC Brand's avatar JC Brand

Tweak the error message styling

parent 39ef1b81
...@@ -402,6 +402,12 @@ a.configure-chatroom-button { ...@@ -402,6 +402,12 @@ a.configure-chatroom-button {
padding: 0; padding: 0;
} }
.chat-body p {
font-size: 14px;
color: #666;
margin: 5px;
}
.chatroom-form legend { .chatroom-form legend {
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;
......
...@@ -1317,7 +1317,7 @@ ...@@ -1317,7 +1317,7 @@
if ($error.find('not-allowed').length) { if ($error.find('not-allowed').length) {
this.renderErrorMessage('You are not allowed to create new rooms'); this.renderErrorMessage('You are not allowed to create new rooms');
} else if ($error.find('not-acceptable').length) { } else if ($error.find('not-acceptable').length) {
this.renderErrorMessage("Your nickname doesn't conform to the room's policies"); this.renderErrorMessage("Your nickname doesn't conform to this room's policies");
} else if ($error.find('conflict').length) { } else if ($error.find('conflict').length) {
this.renderErrorMessage("Your nickname is already taken"); this.renderErrorMessage("Your nickname is already taken");
} else if ($error.find('item-not-found').length) { } else if ($error.find('item-not-found').length) {
...@@ -2314,7 +2314,7 @@ ...@@ -2314,7 +2314,7 @@
connect: function (jid, password) { connect: function (jid, password) {
var connection = new Strophe.Connection(converse.bosh_service_url); 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) { if (status === Strophe.Status.CONNECTED) {
console.log('Connected'); console.log('Connected');
converse.onConnected(connection); converse.onConnected(connection);
......
...@@ -26,14 +26,14 @@ ...@@ -26,14 +26,14 @@
}, converse)); }, converse));
it("shows users currently present in the room", $.proxy(function () { it("shows users currently present in the room", $.proxy(function () {
var chatroomview = this.chatboxesview.views['lounge@muc.localhost']; var chatroomview = this.chatboxesview.views['lounge@muc.localhost'],
chatroomview.renderChatArea(); $participant_list;
var $participant_list = chatroomview.$el.find('.participant-list');
var roster = {}, room = {}, i; var roster = {}, room = {}, i;
for (i=0; i<chatroom_names.length-1; i++) { for (i=0; i<chatroom_names.length-1; i++) {
roster[chatroom_names[i]] = {}; roster[chatroom_names[i]] = {};
chatroomview.onChatRoomRoster(roster, room); 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').length).toBe(1+i);
expect($($participant_list.find('li')[i]).text()).toBe(chatroom_names[i]); expect($($participant_list.find('li')[i]).text()).toBe(chatroom_names[i]);
} }
...@@ -43,12 +43,11 @@ ...@@ -43,12 +43,11 @@
it("indicates moderators by means of a special css class and tooltip", $.proxy(function () { it("indicates moderators by means of a special css class and tooltip", $.proxy(function () {
var chatroomview = this.chatboxesview.views['lounge@muc.localhost']; var chatroomview = this.chatboxesview.views['lounge@muc.localhost'];
var $participant_list = chatroomview.$el.find('.participant-list');
var roster = {}, idx = chatroom_names.length-1; var roster = {}, idx = chatroom_names.length-1;
roster[chatroom_names[idx]] = {}; roster[chatroom_names[idx]] = {};
roster[chatroom_names[idx]].role = 'moderator'; roster[chatroom_names[idx]].role = 'moderator';
chatroomview.onChatRoomRoster(roster, {}); chatroomview.onChatRoomRoster(roster, {});
occupant = $participant_list.find('li'); var occupant = chatroomview.$el.find('.participant-list').find('li');
expect(occupant.length).toBe(1); expect(occupant.length).toBe(1);
expect($(occupant).text()).toBe(chatroom_names[idx]); expect($(occupant).text()).toBe(chatroom_names[idx]);
expect($(occupant).attr('class')).toBe('moderator'); expect($(occupant).attr('class')).toBe('moderator');
...@@ -209,7 +208,7 @@ ...@@ -209,7 +208,7 @@
spyOn(view, 'renderErrorMessage').andCallThrough(); spyOn(view, 'renderErrorMessage').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 the room's policies"); expect(view.$el.find('.chat-body p').text()).toBe("Your nickname doesn't conform to this room's policies");
}, converse)); }, converse));
it("will show an error message if the user's nickname is already taken", $.proxy(function () { it("will show an error message if the user's nickname is already taken", $.proxy(function () {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment