<%
/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
%>

<aui:input cssClass="lfr-textarea message-edit" label="" name="textArea" type="textarea" value="<%= GetterUtil.getString(body) %>" />

<aui:script>
	var <portlet:namespace />bbCode = null;

	function <portlet:namespace />getHTML() {
		return <portlet:namespace />bbCode.getHTML();
	}
</aui:script>

<aui:script use="liferay-bbcode-editor">
	<portlet:namespace />bbCode = new Liferay.Editor.bbCode(
		{
			textarea: '#<portlet:namespace />textArea'
		}
	);

	<c:if test="<%= quote && Validator.isNull(body) && (curParentMessage != null) %>">
		var respondee = "<%= UnicodeFormatter.toString(parentAuthor) %>";
		var quote = "<%= UnicodeFormatter.toString(curParentMessage.getBody(false)) %>";

		<portlet:namespace />bbCode.insertTag("quote", respondee, quote);
	</c:if>
</aui:script>