|
|
@ -310,18 +310,24 @@ define([
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
framework.setContentGetter(function () {
|
|
|
|
framework.setContentGetter(function () {
|
|
|
|
|
|
|
|
CodeMirror.removeCursors();
|
|
|
|
var content = CodeMirror.getContent();
|
|
|
|
var content = CodeMirror.getContent();
|
|
|
|
content.highlightMode = CodeMirror.highlightMode;
|
|
|
|
content.highlightMode = CodeMirror.highlightMode;
|
|
|
|
previewPane.draw();
|
|
|
|
previewPane.draw();
|
|
|
|
return content;
|
|
|
|
return content;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var cursorTo;
|
|
|
|
|
|
|
|
var updateCursor = function () {
|
|
|
|
|
|
|
|
if (cursorTo) { clearTimeout(cursorTo); }
|
|
|
|
|
|
|
|
if (editor._noCursorUpdate) { return; }
|
|
|
|
|
|
|
|
cursorTo = setTimeout(function () {
|
|
|
|
|
|
|
|
framework.updateCursor();
|
|
|
|
|
|
|
|
}, 500); // 500ms to make sure it is sent after chainpad sync
|
|
|
|
|
|
|
|
};
|
|
|
|
framework.onCursorUpdate(CodeMirror.setRemoteCursor);
|
|
|
|
framework.onCursorUpdate(CodeMirror.setRemoteCursor);
|
|
|
|
framework.setCursorGetter(CodeMirror.getCursor);
|
|
|
|
framework.setCursorGetter(CodeMirror.getCursor);
|
|
|
|
editor.on('cursorActivity', function () {
|
|
|
|
editor.on('cursorActivity', updateCursor);
|
|
|
|
if (editor._noCursorUpdate) { return; }
|
|
|
|
|
|
|
|
framework.updateCursor();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
framework.onEditableChange(function () {
|
|
|
|
framework.onEditableChange(function () {
|
|
|
|
editor.setOption('readOnly', framework.isLocked() || framework.isReadOnly());
|
|
|
|
editor.setOption('readOnly', framework.isLocked() || framework.isReadOnly());
|
|
|
|