pereorga / minimalist-web-notepad

Minimalist Web Notepad
https://notes.orga.cat
1.01k stars 276 forks source link

What about if 2 users write at the same time? #16

Closed spartrekus closed 6 years ago

spartrekus commented 6 years ago

Hello, I would be interested by having a collab editing possibility based on this excellent min editor. Collaborative would be the goal. I added a html refreshing of 1 min, on the page, but it does not help much.

Any idea how to make the PHP/Script work to write and see realtime what changes? (impossible maybe).

Thank you and best regards

pereorga commented 6 years ago

It can be done, but it's a bit more complicated than the current file-based implementation. A first, easier step would be to stop overwriting the file, and then warn the user if another editor updated it first

qex commented 6 years ago

It really can be done, every client update send a location in extra. and server using fopen()/fseek()/fwrite() to handle file.

However that will not minimalist any more, I'd rather build a new project to build a collab version of this.

pereorga commented 6 years ago

I agree. A fork can be done for this if desired.