Ace Collaborative Extensions
Enhances the Ace Editor by adding the ability to render cues about
what remote users are doing in the system.
Installation
Install package with NPM and add it to your development dependencies:
npm install --save-dev ace-collab-ext
Usage
Multi Cursor Manager
The multi cursor manager allows you to easily render the cursors of other users
working in the same document. The cursor position can be represented as either
a single linear index or as a 2-dimensional position in the form of
{row: 0, column: 10}
.
var editor = ace.edit("editor");
var curMgr = new AceCollabExt.AceMultiSelectionManager(editor);
curMgr.addCursor("uid1", "User 1", "orange", position);
curMgr.setCursor("uid1", 10);
curMgr.clearCursor("uid1");
curMgr.removeCursor("uid1");
Multi Selection Manager
The multi selection manager allows you to easily render the selection of other
users working in the same document. Selection is represented by an array of
AceRanges. A single range is common for normal selection, but multiple ranges
are needed to support block selection.
var editor = ace.edit("editor");
var selMgr = new AceCollabExt.AceMultiSelectionManager(editor);
selMgr.addSelection("uid1", "User 1", "orange", ranges);
selMgr.setSelection("uid1", range);
selMgr.clearSelection("uid1");
selMgr.removeSelection("uid1");
Radar View
A radar view indicates where in a document another user is looking and allows
you to easily go to the location in the document.
var editor = ace.edit("editor");
var radarView = new AceCollabExt.RadarView("radarView", editor);
radarView.addView("uid1", "user1", "orange", 0, 20, 0);
radarView.setViewRows("uid1", 10, 40);
radarView.setCursoRow("uid1", 10);
radarView.removeView("uid1");