etherpad-lite icon indicating copy to clipboard operation
etherpad-lite copied to clipboard

Make addText and delText on API

Open tjrana opened this issue 14 years ago • 10 comments

There's a getText and setText but there are no addText and delText functions on the API.

tjrana avatar Feb 10 '12 13:02 tjrana

You can do that on your own by just getting the text, transform it the way you want and set it again

Pita avatar Feb 10 '12 13:02 Pita

Then there's uselessly extra amounts of data transfer... Imagine large amounts of text...

tjrana avatar Feb 10 '12 13:02 tjrana

How hard is it to implement addText(padID, text, location) and delText(padID, fromLocation, toLocation)?

tjrana avatar Feb 10 '12 14:02 tjrana

Not too difficult. But its such an edge case that its not worth to implement an api call for that imho

Pita avatar Feb 10 '12 14:02 Pita

You need two api calls anyway, cause before you can manipulate the text you need to know the text. And the text can be changed on the server side between two api calls

Pita avatar Feb 10 '12 14:02 Pita

The reason why this is very important is so that other people can develop an app that can use the api and minimize data transfer between the device and the server.

tjrana avatar Feb 10 '12 14:02 tjrana

I honestly believe it is very important to add functionality to the api. currently, not much can be done outside the website

tjrana avatar Feb 10 '12 14:02 tjrana

But to build an app based on etherpad the api is the wrong way You need a socket.io connection and send changesets over it, thats the only way to do that. Everything else it too heavy

Pita avatar Feb 10 '12 14:02 Pita

The idea of the api is to let another application manage pads, not to build an editor on top of it

Pita avatar Feb 10 '12 15:02 Pita

close?

marcelklehr avatar Apr 24 '12 10:04 marcelklehr