I need to display a document (like in a Google Docs style view) and provide the ability for a user to make comments on that document.
Here's how it needs to work:
- When the user views the document, they can use their mouse to highlight any amount of text they want (as they would within any other webpage)
- Upon release of the highlight, some sort of modal dialog box appears asking them what they would like to comment on that portion of the text they selected
- After clicking save in the modal box, their comment is saved in a MySQL database along with information about the section of the text they highlighted
- Another user can view this document and see their comments on the different parts of the text.
I don't know how to tell the database what section of the text is highlighted so it can reference that and show the comment on that section of the text.