The Comments Plugin provides comprehensive commenting functionality for the on-CodeMerge editor, allowing users to add, edit, and manage comments on selected text with visual markers and tooltips.
A WYSIWYG editor for on-codemerge is a user-friendly interface that allows users to edit and view their code in real time, exactly as it will appear in the final product. This intuitive tool for developers of all skill levels.
// Add comment to selected texteditor.executeCommand('comment');// Get all commentsconst comments = commentManager.getAllComments();// Get specific commentconst comment = commentManager.getComment(commentId);// Update commentcommentManager.updateComment(commentId, newContent);// Delete commentcommentManager.deleteComment(commentId);
<!-- Text with comment --><span class="commented-text"> This text has a comment</span><span class="comment-marker" data-comment-id="comment-123"> 💬</span>
<p> This is a paragraph with <span class="commented-text">multiple comments</span> <span class="comment-marker" data-comment-id="comment-1">💬</span> and <span class="commented-text">another comment</span> <span class="comment-marker" data-comment-id="comment-2">💬</span> on different parts.</p>
<div class="comment-container"> <span class="commented-text highlighted"> This text is highlighted and commented </span> <span class="comment-marker" data-comment-id="comment-456"> 💬 </span></div>
{ id: "comment-uuid-123", content: "This is a comment about the selected text", createdAt: 1640995200000, // Timestamp updatedAt: 1640995200000 // Timestamp}
Comments Plugin
The Comments Plugin provides comprehensive commenting functionality for the on-CodeMerge editor, allowing users to add, edit, and manage comments on selected text with visual markers and tooltips.
Features
Installation
Basic Usage
Demo
on-CodeMerge
API Reference
Comment Management
Comment Interface
Keyboard Shortcuts
Ctrl+Alt+M
comment
Comment Workflow
Adding Comments
Editing Comments
Deleting Comments
Events
Examples
Basic Comment Usage
Multiple Comments
Comment with Styling
Integration Examples
React Integration
Vue Integration
Styling
Default Styles
Custom Comment Themes
Responsive Comment Styles
Comment Data Structure
Comment Object
Comment Marker HTML
Commented Text HTML
Troubleshooting
Common Issues
Comment not adding
Comment marker not showing
Tooltip not appearing
Comment not editing
Debug Mode
Enable debug logging:
Browser Support
Performance Considerations
Accessibility
License
MIT License - see LICENSE file for details.