Add content to certain point in pad

82 views Asked by At

I'm working on a plugin to add external navigation in a parent website with an embedded iframe where Etherpad is running. The navigation to a certain point works fine via vanilla JavaScript and window.postmessage, but I have no idea how to get new navigation points into the pad.

I'm using the Etherpad API for Java to prepopulate the pad with the existing navigationpoints/anchors, which works fine.

1

There are 1 answers

0
Zumpfiii On

After reviewing 24 other plugins, I finally found those lines which solved my problem

context.ace.callWithAce((ace) => {
    // New Line gets created
    ace.ace_doReturnKey();
}, 'addNewLine', true);

It's a call via ace and the context but could be done in every hook with context and ace access