{include file="left.tpl"}

<div class="content float-right">
	<link href="{site_host}templates/SquareLine/css/_small.css" rel="stylesheet">

	<script src="../modules/editors/tinymce/tinymce.min.js"></script>
	<script>
		jQuery(document).ready(function($)
		{
			init_tinymce('text', 'forum', '{file_manager_theme}', '{file_manager}', '<? echo md5($conf->code); ?>');

			$('#msgsmile').popover({html: true, animation: true, trigger: 'click'});
			$('#msgsmile').on('show.bs.popover', function()
			{
				$(document).mouseup(function(e)
				{
					var container = $('.popover-content');

					if(container.has(e.target).length === 0)
					{
						$('#msgsmile').popover('hide');

						selected = 'gcms_smiles';
					}
				});
			});

			get_smiles('#msgsmile', 1);

			load_new_comments('{id}');
		});

		function set_smile(elem)
		{
			var smile = '<img src="'+$(elem).attr('src')+'" class="g_smile" height="20px" width="20px"> ';

			tinymce.activeEditor.insertContent(smile);

			selected = 'gcms_smiles';
		}
	</script>

	<div class="block">
		<div class="header">Редактирование сообщения</div>
		<div class="block-content">
			<textarea id="text">{text}</textarea>

			<div class="message-send">
				<i class="fa fa-smile-o" data-container="body" data-content="empty" data-placement="top" data-toggle="popover" id="msgsmile"></i>

				<div class="btn float-right" onclick="edit_message('{id}')">Сохранить</div>
			</div>
		</div>
	</div>

	<div class="clear"></div>
</div>