Просмотр файла globalchat/view/globalchat/templates/web_quick_msg_form.tpl

Размер файла: 3.73Kb
{* Smarty *}

<script type='text/javascript'>

function load_smiles ()
{
	if ($("#smiles_window").text ())
	return;
$("#smiles_window").text ('Загрузка смайлов...');
	$.ajax(
    {
    url: 'ajax_chat_router.php',
    type: 'POST',
        data:
        {
		'get_smiles': 1
        },
    dataType: 'text',
        success: function (result)
		{
		$("#smiles_window").val ('');
        $('#smiles_window').html (result);
        }
    });
}

function smiles_window_toggle ()
{
$('#bb_codes_window').hide ();
load_smiles ();
$("#smiles_window").toggle ();
text_input_coordinates = $('#text_input').offset ();

<!-- Высота окна смайлов 152px + padding 2 * 6px + 2px отступ от формы ввода -->
$('#smiles_window').height (152);
$('#smiles_window').offset ({ top: text_input_coordinates.top + $('#text_input').height () + 8, left: text_input_coordinates.left + 56});
}

function bbcodes_window_toggle ()
{
$('#smiles_window').hide ();
$("#bb_codes_window").toggle ();
text_input_coordinates = $('#text_input').offset ();
<!-- Высота окна BB-кодов 96px -->
$('#bb_codes_window').height (96);
$('#bb_codes_window').offset ({ top: text_input_coordinates.top + $('#text_input').height () + 8, left: text_input_coordinates.left + 56});
}

$(document).ready(
function ()
{
<!-- Автофокус на форму ввода -->
$('#text_input').focus ();
});

</script>

<div class="{$smarty.const.DIV_C_QUICK_MSG_FORM}">
<form method="post" action="?user_id={$userId}{if !empty($smarty.get.answer_msg_id)}&amp;read_quick_msg={$smarty.get.answer_msg_id}{/if}">
<div class='{$smarty.const.DIV_M_USER_MENU_TITLE}'>
{user_nick attrs="href='user_menu.php?user_id={$userId}'" user=$usersInfo.{$userId} icon='1'} Был в чате {text_timer text=1 time="`$smarty.now -  {$usersInfo.{$userId}.time_of_last_request}`"}</div>
<table>
<tr>
	<td rowspan='3'><textarea id='text_input' name='quick_msg' style='width: 400px; height: 100px;'></textarea></td>
</tr>
<tr>
	<td style='height: 50px'><input style='cursor: pointer;' type='submit' value='Отправить' /></td>
</tr>
<tr>
<td style='height: 50px'><a style='padding: 8px 8px 8px 3px;' href='ajax_chat.php'>Назад в чат</a></td>
</tr>
<tr>
	<td>
		<span id="accelerator_panel" onmousedown="return false;" style="cursor: pointer; margin: 0px;">
			<img id='smiles_toggle' src='icons/smile.png' alt='' title='Показать смайлы (нажмите TAB для быстрого доступа)' onclick='smiles_window_toggle ();' />
			<img id='bb_codes_toggle' src='icons/text_underlined.png' alt='Показать BB-коды' title='Показать BB-коды' onclick='bbcodes_window_toggle ();' />
		</span>
		<a href='#' onclick='insert_quick_phrase ("hellow");return false;'>Приветствия,</a>
		<a href='#' onclick='insert_quick_phrase ("how");return false;'>как,</a>
		<a href='#' onclick='insert_quick_phrase ("what");return false;'>что,</a>
		<a href='#' onclick='insert_quick_phrase ("bye");return false;'>прощания</a>
	</td>
</tr>
<tr>
<td>
	<div id='smiles_window' style="border-radius: 5px;padding: 6px;position: absolute; display: none; background: rgba(255, 255, 255, 0.9); box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.275);"></div>
	<div id='bb_codes_window' style="border-radius: 5px;padding: 3px; position: absolute; display: none; color: #666; background: rgba(255, 255, 255, 0.9); box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.275);">
	{include file='ajax_chat_bbcodes_list.tpl'}
	</div>
</td>
</tr>
</table>
</form>
</div>

<div class='{$smarty.const.DIV_M_NAVIGATION_FOOT}'><a href='user_menu.php?user_id={$userId}'>&laquo; Меню пользователя</a></div>