<name>com.woltlab.wcf.user.signature</name>
<definitionname>com.woltlab.wcf.message</definitionname>
</type>
+ <type>
+ <name>com.woltlab.wcf.comment</name>
+ <definitionname>com.woltlab.wcf.message</definitionname>
+ </type>
<type>
<name>com.woltlab.wcf.bbcode.smiley</name>
--- /dev/null
+<li class="box48 jsCommentAdd jsOnly">
+ {@$__wcf->getUserProfileHandler()->getAvatar()->getImageTag(48)}
+ <div class="commentListAddComment">
+ <textarea id="text" name="text" class="wysiwygTextarea"
+ data-disable-attachments="true"
+ data-support-mention="true"
+ ></textarea>
+ {include file='wysiwyg' userProfileCommentList=$commentListContainerID}
+
+ <div class="formSubmit">
+ <button class="buttonPrimary" data-type="save" accesskey="s">{lang}wcf.global.button.submit{/lang}</button>
+
+ {include file='messageFormPreviewButton' previewMessageObjectType='com.woltlab.wcf.comment' previewMessageObjectID=0}
+ </div>
+ </div>
+</li>
+
{if $commentCanAdd}
<ul id="userProfileCommentList" class="commentList containerList" data-can-add="true" data-object-id="{@$userID}" data-object-type-id="{@$commentObjectTypeID}" data-comments="{@$commentList->countObjects()}" data-last-comment-time="{@$lastCommentTime}">
+ {include file='commentListAddComment' commentListContainerID='userProfileCommentList'}
{include file='commentList'}
</ul>
{else}
* Initializes the UI components to add a comment.
*/
_initAddComment: function() {
- // create UI
- this._commentAdd = $('<li class="box48 jsCommentAdd">' + this._userAvatar + '<div /></li>').prependTo(this._container);
- var $inputContainer = this._commentAdd.children('div');
- var $input = $('<textarea placeholder="' + WCF.Language.get('wcf.comment.add') + '" maxlength="65535" class="long" />').appendTo($inputContainer).flexible();
- $('<button class="small">' + WCF.Language.get('wcf.global.button.submit') + '</button>').click($.proxy(this._save, this)).appendTo($inputContainer);
-
- $input.keyup($.proxy(this._keyUp, this));
+ var button = elBySel('.jsCommentAdd .formSubmit button[data-type="save"]', this._commentAdd[0]);
+ if (button) button.addEventListener(WCF_CLICK_EVENT, this._save.bind(this));
},
/**
* @property-read string $message comment message
* @property-read integer $responses number of responses on the comment
* @property-read string $responseIDs serialized array with the ids of the five latest comment responses
+ * @property-read integer $enableHtml is 1 if HTML will rendered in the comment, otherwise 0
*/
class Comment extends DatabaseObject implements IMessage {
use TUserContent;
message TEXT NOT NULL,
responses MEDIUMINT(7) NOT NULL DEFAULT '0',
responseIDs VARCHAR(255) NOT NULL DEFAULT '',
+ enableHtml TINYINT(1) NOT NULL DEFAULT 0,
KEY (objectTypeID, objectID, time),
KEY lastCommentTime (userID, time)