From 5c1dfd04442ee67b5d5eb4dc3bed1d28f9e66cdc Mon Sep 17 00:00:00 2001 From: Adam Zammit Date: Wed, 17 Jul 2013 09:56:49 +1000 Subject: [PATCH] Make tab appear when chat message is sent from supervisor --- index.php | 2 +- js/supervisorchat.js | 17 ++++++++++++++++- supervisorchat.php | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index ad90e38f..9dc893e0 100644 --- a/index.php +++ b/index.php @@ -274,7 +274,7 @@ xhtml_object($data,"main-content");
"> + print "tabbertabdefault"; ?>" id="tab-chat">

diff --git a/js/supervisorchat.js b/js/supervisorchat.js index 1946e886..b1d25960 100644 --- a/js/supervisorchat.js +++ b/js/supervisorchat.js @@ -33,11 +33,26 @@ function OnMessageStanza(stanza) //alert(sFrom + ':' + sType + ':' + sBody + ':' + sBareJid); // do something, e.g. show sBody with jQuer - //make sure the chat tab is in focus when an incoming messages appears //display message as new row in message table if it is from the supervisor if (sBareJid == SUPERVISOR_XMPP) { + //make sure the chat tab is in focus when an incoming messages appears + + //find the index of div-supervisorchat (children of tab-main) + var tm = parent.document.getElementById('tab-main') + var i = 0; + + for (i=0;i' + sBody + ''; $('#chattable > tbody > tr').eq(0).after(html); } diff --git a/supervisorchat.php b/supervisorchat.php index 8539a6eb..f62653ca 100644 --- a/supervisorchat.php +++ b/supervisorchat.php @@ -84,7 +84,7 @@ if ($chatenabled && operator_chat_enabled($operator_id)) print ""; print "
" . T_("Supervisor not available") . "
"; - print "
" . T_("Send") . "
"; + print "
"; //table for chat messages print "
" . T_("From") . "" . T_("Message") . "
";