Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editing notes #58

Closed
joshp23 opened this issue May 4, 2018 · 7 comments
Closed

Editing notes #58

joshp23 opened this issue May 4, 2018 · 7 comments

Comments

@joshp23
Copy link
Contributor

joshp23 commented May 4, 2018

I understand that you have little to no interest in working on this, but this is a feature that I would love to have, and I don't mind putting in some time on it!

I was hoping this issue could act as a place for some guidance to help speed the process along(?).


It appears as if you just pull the note data out of the database and throw it out into HTML. This suggests that a simple WYSIWYG javascript editor might only have to get a hold of the text from the database, edit it as html, and then convert the tags to the tomboy format when saving. I assume there is already a mechanism to handle conversions(?).

does this sound like I am on the right track here?

@joshp23
Copy link
Contributor Author

joshp23 commented May 5, 2018

I have been working with the highly customizable QuillJS and I have a nice looking note editor interface:

screenshot from 2018-05-05 00-51-47

This would be nice as an overlay popup, like the basic text editor or markdown editor in NextCloud, but I will be happy to have it merely open a new page within NextCloud, replacing the current note display page with the above.

This code should be able to save as you type, which is nice. Clearly I need to add the add, edit and delete buttons to the grauphel note display page, add triggers to populate the editor with appropriate data, and configure endpoints to save the data.

Any input is appreciated.

@cweiske
Copy link
Collaborator

cweiske commented May 5, 2018

Yes, for nextcloud integration the editor "just" needs to get hold of the HTML/markup, display it and then for saving, convert it back to the tomboy markup format.

What needs to be kept in mind is that the synchronization revisions need to be incremented when a note is added/saved/deleted.

There is already code to convert tomboy markup to HTML, but no code to convert it back:

  • lib/converter/html.php
  • lib/converter/cleanhtml.php

My initial idea was to have a complete javascript tomboy rest api client that could then be used without any changes to the current code (because the API is complete) - but this is really much work, compared to the points outlined above.

@joshp23
Copy link
Contributor Author

joshp23 commented May 5, 2018

For clarity: the note revision needs to be updated, this is no problem, but does the user revision counter need to be incremented as well, or should that only happen on external sync calls?

I'm happy to reverse engineer some conversion code :) thanks for pointing out their loc.

EDIT It appears as if every change to the DB will require the latest-sync-revision to be incremented.

@cweiske
Copy link
Collaborator

cweiske commented May 5, 2018

Yes, the latest-sync-revision needs to be updated. Not sure about syncdata_current_sync_guid, I think it would also need to be changed.

Local changes need to be treated the same way as remote client changes in terms of sync variables.

@joshp23
Copy link
Contributor Author

joshp23 commented May 7, 2018

I have made headway with the delta rendering from quilljs. Here is the tool.

@cweiske
Copy link
Collaborator

cweiske commented Sep 23, 2018

Did you make any progress on the note editing tool? If not, then I'd close this issue.

@joshp23
Copy link
Contributor Author

joshp23 commented Sep 23, 2018

I had to put this down and have not had an opportunity to pick it up in some time.

@cweiske cweiske closed this as completed Sep 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants