Location: PHPKode > projects > Talkboard Forum > tbf-2.1.6/template/tbfV2/board_chat.tpl
:###- TEMPLATE FILE V2.1 -###:
@author Archilles (http://tbforum.sourceforge.net/)
@id tbfV2.board_chat
:###- BEGIN TEMPLATE DATA -###:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{@LANGUAGE}" lang="{@LANGUAGE}">

<head>
<meta name="content-type" content="text/html; charset=iso-8859-1" />
<meta name="content-language" content="{@LANGUAGE}" />
<meta name="content-script-type" content="text/javascript" />
<meta name="content-style-type" content="text/css" />
<meta name="robots" content="index,follow" />
<title lang="{@LANGUAGE}">{LANG:CHAT} - {@SITE_BOARD_NAME}</title>
<link rel="stylesheet" href="{@CSS_PATH}" />
{@XAJAX_HEADER}
</head>

<body>
<h2>{LANG:CHAT}</h2>

<!--@IF_BLOCK:CHAT_DEBUG_MODE#hide@address.com>
<div class="error_block"><div class="error_block_head">CHAT DEBUGGING INFORMATION
<input type="text" class="input_field" id="tbf_chat_debug" style="width: 100%;" /></div></div>
<!--@IF_BLOCK:CHAT_DEBUG_MODE#hide@address.com>

<table class="tbl_with_border" style="width: 100%;">
<tr>
<td class="tbl_head" width="75%">{LANG:CHAT_MESSAGE_QUEUE}</td>
<td class="tbl_head" width="25%">{LANG:CHAT_USER_LISTING}</td>
</tr>
<tr>
<td valign="top">
  <div class="box_normal_inline" style="height: 300px; overflow: auto;" id="tbf_chat_message_list">
  <noscript><div class="format_big_bold format_warning">{LANG:CHAT_NO_JAVASCRIPT_ENABLED}</div><hr /></noscript>
  {LANG:CHAT_PLEASE_WAIT_WHILE_UPDATE_WINDOW}
  </div>
  <div class="box_progress_bar" id="tbf_chat_refresh_progress"></div>
</td>
<td valign="top">
  <div class="box_normal_inline" style="height: 300px; overflow: hidden;" id="tbf_chat_user_list">
  {LANG:CHAT_PLEASE_WAIT_WHILE_UPDATE_WINDOW}
  </div>
</td>
</tr>
<tr>
<td>
<textarea class="input_field" id="tbf_chat_message" cols="60" rows="1" style="overflow: auto;" onkeyup="tbf_chat_message_options();"></textarea><br />
<input type="checkbox" class="input_check" id="tbf_chat_skip_reload" value="1" /> {LANG:CHAT_SKIP_RELOAD} |
<input type="checkbox" class="input_check" id="tbf_chat_away_mode" value="1" onclick="tbf_chat_client_command('away');" /> {LANG:CHAT_ENTER_AWAY_MODE}
</td>
<td><a href="#" onclick="xajax_TBF_Chat__Logout();">{LANG:CHAT_LOGOUT}</a></td>
</tr>
</table>

<script language="javascript" type="text/javascript">
var TBF_CHAT_HAS_LOAD_MESSAGES = false;
var TBF_CHAT_RELOAD_POINTER = 0;
var TBF_CHAT_REFRESH_INTERVAL = 12;
var TBF_CHAT_MAXIMUM_MESSAGE_LENGTH = 300;
var TBF_CHAT_AWAY_MODE = false;

function tbf_chat_client_command(ccmd,carg){
  if ( ccmd == "profile" ){
  window.open("{VAR:FILE_MEMBERS}?action=profile&uid="+carg,"TBF_CHAT_PROFILE");
  }
  else if ( ccmd == "whisper" ){
  document.getElementById("tbf_chat_message").value = '@'+carg+'@ ';
  document.getElementById("tbf_chat_message").focus();
  }
  else if ( ccmd == "away" ){
  var away = document.getElementById("tbf_chat_away_mode").checked;
    if ( away == true ){
    document.getElementById("tbf_chat_message").disabled = true;
    document.getElementById("tbf_chat_message").style.opacity = '0.2';
    xajax_TBF_Chat__Away_Mode(1);
    }
    else{
    document.getElementById("tbf_chat_message").disabled = false;
    document.getElementById("tbf_chat_message").style.opacity = '1.0';
    xajax_TBF_Chat__Away_Mode(0);
    }
  }
  else if ( ccmd == "kick" ){
  xajax_TBF_Chat__Kick_User(carg);
  }
}

function tbf_chat_message_options(){
message = document.getElementById("tbf_chat_message").value;
mlength = message.length;
last = message.charCodeAt(mlength-1);
threshold_error = TBF_CHAT_MAXIMUM_MESSAGE_LENGTH;
threshold_warning = 0.8*TBF_CHAT_MAXIMUM_MESSAGE_LENGTH;

  if ( mlength > threshold_error ) // Ist der Text länger als das Limit, wird das Feld eingefärbt...
  document.getElementById("tbf_chat_message").className = "input_field_error";
  else if ( mlength > threshold_warning ) // Kurz vor dem Limit wird es angedeutet...
  document.getElementById("tbf_chat_message").className = "input_field_warning";
  else
  document.getElementById("tbf_chat_message").className = "input_field";

  if ( ( mlength >= 3 && mlength < threshold_error ) && ( last == 10 || last == 13 ) ){ // Ein Return sendet die Nachricht...
  document.getElementById("tbf_chat_message").disabled = true;
  document.getElementById("tbf_chat_message").value = "{LANG:CHAT_SENDING}";
  document.getElementById("tbf_chat_message").className = "input_field";
  xajax_TBF_Chat__Put_Message(message);
  }

}

function tbf_chat_refresh_user_list(){ // Benutzerliste jede Minute erneuern...
  if ( document.getElementById("tbf_chat_skip_reload").checked == false ){
  xajax_TBF_Chat__Get_User_List();
  window.setTimeout("tbf_chat_refresh_user_list()",60000);
  }
}

function tbf_chat_refresh_message_list(){ // Wird jede Sekunde aufgerufen...
  if ( document.getElementById("tbf_chat_skip_reload").checked == false ){
  TBF_CHAT_RELOAD_POINTER++;
  progress_bar_width = ((TBF_CHAT_RELOAD_POINTER/TBF_CHAT_REFRESH_INTERVAL)*100);
  document.getElementById("tbf_chat_refresh_progress").style.width = progress_bar_width+"%";
    if ( TBF_CHAT_RELOAD_POINTER == TBF_CHAT_REFRESH_INTERVAL ){ // ... und alle x Sekunden neu geladen ;)
      if ( TBF_CHAT_HAS_LOAD_MESSAGES ){
      utc_date = new Date();
      utc_now = Date.UTC(utc_date.getUTCFullYear(),utc_date.getUTCMonth(),utc_date.getUTCDate(),utc_date.getUTCHours(),utc_date.getUTCMinutes(),utc_date.getUTCSeconds());
      utc_now /= 1000;
      xajax_TBF_Chat__Get_Message_Queue(utc_now-TBF_CHAT_REFRESH_INTERVAL);
      }
      else{
      xajax_TBF_Chat__Get_Message_Queue(0);
      TBF_CHAT_HAS_LOAD_MESSAGES = true;
      }
    TBF_CHAT_RELOAD_POINTER = 0;
    document.getElementById("tbf_chat_refresh_progress").style.width = "1px";
    }
  }
window.setTimeout("tbf_chat_refresh_message_list()",1000);
}

window.setTimeout("xajax_TBF_Chat__Login()",1500);
window.setTimeout("tbf_chat_refresh_user_list()",5000); // Zeitversetzt nach dem Login die Daten holen
tbf_chat_refresh_message_list();
</script>
</body>
</html>
Return current item: Talkboard Forum