Merge pull request #1 from alecghica/master

Feature: added "Connecting to chat ..." info
This commit is contained in:
JC Brand 2013-02-21 04:26:40 -08:00
commit 1c7ef1917c
3 changed files with 219 additions and 205 deletions

View File

@ -25,6 +25,15 @@
height: 1.1em; height: 1.1em;
} }
#toggle-online-users {
display: none;
}
#connecting-to-chat {
background: url('/spinner.gif') no-repeat;
padding-left: 1.4em;
}
.chat-head { .chat-head {
color: #ffffff; color: #ffffff;
margin: 0; margin: 0;

View File

@ -1759,6 +1759,7 @@
// -------------- // --------------
$(document).ready($.proxy(function () { $(document).ready($.proxy(function () {
var chatdata = jQuery('div#collective-xmpp-chat-data'), var chatdata = jQuery('div#collective-xmpp-chat-data'),
$connecting = $('span#connecting-to-chat'),
$toggle = $('a#toggle-online-users'); $toggle = $('a#toggle-online-users');
$toggle.unbind('click'); $toggle.unbind('click');
@ -1771,6 +1772,8 @@
}).render(); }).render();
$(document).bind('jarnxmpp.disconnected', $.proxy(function (ev, conn) { $(document).bind('jarnxmpp.disconnected', $.proxy(function (ev, conn) {
$connecting.show();
$toggle.hide();
console.log("Connection Failed :("); console.log("Connection Failed :(");
}, this)); }, this));
@ -1818,6 +1821,8 @@
// Controlbox toggler // Controlbox toggler
if ($toggle.length) { if ($toggle.length) {
$connecting.hide();
$toggle.show();
$toggle.bind('click', $.proxy(function (e) { $toggle.bind('click', $.proxy(function (e) {
e.preventDefault(); e.preventDefault();
if ($("div#controlbox").is(':visible')) { if ($("div#controlbox").is(':visible')) {