Commit 308b4c6b authored by JC Brand's avatar JC Brand

Show error messages in red

parent 4b69a890
...@@ -182,6 +182,10 @@ input.error { ...@@ -182,6 +182,10 @@ input.error {
border: 1px solid red; border: 1px solid red;
} }
.conn-feedback.error {
color: red;
}
.chat-message-error { .chat-message-error {
color:#76797C; color:#76797C;
font-size:90%; font-size:90%;
......
...@@ -321,10 +321,6 @@ ...@@ -321,10 +321,6 @@
})); }));
} }
} }
if (converse.xmppstatus.get('status') === 'offline') {
// only update the UI if the user is not offline
return;
}
if (message.get('composing')) { if (message.get('composing')) {
this.insertStatusNotification(message.get('fullname')+' '+'is typing'); this.insertStatusNotification(message.get('fullname')+' '+'is typing');
return; return;
...@@ -2006,17 +2002,17 @@ ...@@ -2006,17 +2002,17 @@
console.log('Connected'); console.log('Connected');
this.onConnected(connection); this.onConnected(connection);
} else if (status === Strophe.Status.DISCONNECTED) { } else if (status === Strophe.Status.DISCONNECTED) {
this.giveFeedback('Disconnected').css('background-image', "url(images/error_icon.png)"); this.giveFeedback('Disconnected', 'error');
} else if (status === Strophe.Status.Error) { } else if (status === Strophe.Status.Error) {
this.giveFeedback('Error'); this.giveFeedback('Error', 'error');
} else if (status === Strophe.Status.CONNECTING) { } else if (status === Strophe.Status.CONNECTING) {
this.giveFeedback('Connecting'); this.giveFeedback('Connecting');
} else if (status === Strophe.Status.CONNFAIL) { } else if (status === Strophe.Status.CONNFAIL) {
this.giveFeedback('Connection Failed'); this.giveFeedback('Connection Failed', 'error');
} else if (status === Strophe.Status.AUTHENTICATING) { } else if (status === Strophe.Status.AUTHENTICATING) {
this.giveFeedback('Authenticating'); this.giveFeedback('Authenticating');
} else if (status === Strophe.Status.AUTHFAIL) { } else if (status === Strophe.Status.AUTHFAIL) {
this.giveFeedback('Authentication Failed'); this.giveFeedback('Authentication Failed', 'error');
} else if (status === Strophe.Status.DISCONNECTING) { } else if (status === Strophe.Status.DISCONNECTING) {
this.giveFeedback('Disconnecting'); this.giveFeedback('Disconnecting');
} else if (status === Strophe.Status.ATTACHED) { } else if (status === Strophe.Status.ATTACHED) {
...@@ -2071,8 +2067,12 @@ ...@@ -2071,8 +2067,12 @@
} }
}; };
converse.giveFeedback = function (message) { converse.giveFeedback = function (message, klass) {
return $('.conn-feedback').text(message); $('.conn-feedback').text(message);
$('.conn-feedback').attr('class', 'conn-feedback');
if (klass) {
$('.conn-feedback').addClass(klass);
}
} }
converse.onConnected = function (connection) { converse.onConnected = function (connection) {
......
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