Closed gregglind closed 10 years ago
To get the an editor object:
var editor;
padeditor.ace.callWithAce(function (x) {
editor = x;
});
function getLineLength() {
return editor.ace_getRep().lines.length();
}
function insertAtEnd(text) {
var lastLine = getLineLength() - 1;
padeditor.ace.replaceRange([lastLine, 0], [lastLine, 0], text + "\n");
}
Things might get funny if the last line isn't empty, but Etherpad seems to attempt to create an empty last line automatically.
Several bits:
Quite a bit of progress in a41a286b002cca22b054efa3cab13939b11372b3 – it's basically working now. Getting one and only one etherpad link open is hard, and the solution I have is nasty (cullOtherTabs
). processMessage
in data/activitylog/etherpad-helper.js
is what takes our messages and turns them into updates to the document.
Getting the tab opening right would be nice. Closing it goes "off the record" (for yourself – every client adds its own activity), but is hardly intuitive. Tweaking what actually goes in it would also be good (and is the fun part).
Etherpad has moving parts
Idea:
write to etherpad:
This approach feels super gross though! Ideas welcome.