The annotate function is similar to the annotate function of Word, you can select a text alignment to comment, as shown in the following figure:
PS: This feature is only available in the Pro version (commercial version) and not in the open source version. Pro version preview address: http://pro.aieditor.com.cn
new AiEditor({ element: "#aiEditor", comment: { enable: true, onCommentActivated: (commentIds) => { //When a comment is activated, the mouse selects (or clicks) on a piece of flagged content }, onCommentCreate: (commentId, content, callback) => { //When a comment is created, the data should be stored in the database via an http request //After saving successfully, callback is called to make the comment valid }, onCommentDelete: (commentId, callback) => { //When comments are deleted }, onCommentQuery: (commentId, callback) => { //Query the comment content based on the comment id when first loaded } },})
enable: indicates whether to enable the comment function
onCommentActivated: When a comment is created, we should save the comment content to the database and return the full comment information
onCommentCreate: Listen for a comment to be created, at which point we should save the comment to the database and return the full comment
onCommentDelete: The listening comment was deleted, and the comments in the database should be deleted simultaneously
onCommentQuery: When first loaded, query the comments
Comment
The annotate function is similar to the annotate function of Word, you can select a text alignment to comment, as shown in the following figure:
How to Use
Sample code
The following example code uses LocalStorage to save the comment content
CommentInfo Description of the comment information