Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6134999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:25:33+00:00 2026-05-23T17:25:33+00:00

I am very curious to hear input from others on a problem I’ve been

  • 0

I am very curious to hear input from others on a problem I’ve been contemplating for some time now.

Essentially I would like to present a user with a text document and allow him/her to make selections of text and annotate it. Specific to the annotations I aim to achieve the following:

  1. Allow users to make a text selection, annotate it, then save the selection and annotation for reference later
  2. (UI) Support representing overlapped annotations. For example if the string where: “This is the test sentence for my example test sentence”, user1 might have an annotation on “is the test sentence for my example” and user2 might have an annotation on “for my example”.
  3. Account for a situations where the document’s text changes. The annotations would to be updated, if possible.

How would you tackle this from a technical perspective?

Some ideas I’ve had are:

  • Use javascript ranges and store an annotation as a pair of integers something like: (document_start_char, document_end_char). Save this pair in the db.
  • Alternatively, using JS get the text selected and actually save the full text in the db. (not sure how i would then do overlapping annotations)
  • Represent overlapped annotations by applying a css style to highlight the text then darken the “stack” of annotations where they overlap. Smallest annotation would always have to be on the top of the “stack”.

What are your thoughts or areas of improvement? How the heck could i support a document’s text being updated without breaking all the annotations?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:25:33+00:00Added an answer on May 23, 2026 at 5:25 pm

    http://mark.koli.ch/2009/09/use-javascript-and-jquery-to-get-user-selected-text.html (404 response)

    http://mark.koli.ch/2009/09/05/get-selected-text-javascript.html– (404 response)

    Getting the selected text is really easy. Storing it (or its starting/ending points) is also a joke. But what about your point number 3? What if the text changes?

    If the text changes, both the original text and the original selection coordinates you stored won’t equal the current modified text. You should be aware of the annotations present in the text document, so that everytime it changes, the annotations referencing to that particular piece of changed text should be updated, or deleted (maybe after a quick comparison between the before and after text: are some words missing? or just some words have been corrected?), but this seems really a struggling task.

    I think storing the entire text annotation in a db is essential, to avoid it being changed and the annotation lost. This way you will still have the complete text you annotated. Then you should also use a sort of flag to indicate the start character of the annotation, and if the text changes, you could calculate the difference in characters from the document text before the change, and the one after it, and find this way the new starting point of the original annotation (assuming the annotation part of the document text has’t changed).

    Dividing the text document in as many paragraphs as possible should also help, this way you could separate different pieces of the document and work on one by one.

    Now I would really like to see it done! 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just very curious if somebody has same problem as me. Every time I
We're having a very curious problem with hsqldb. We are running some tests which
I've been developing iOS & Android apps for some time now. When planning a
I've always been curious: how can I perform arithmetic operations on very long decimals--for
I noticed a very curious behavior that, if standard, I would be very happy
I'm a newbie to Asp.net,learning from the Apress's Begining Asp.net...book.While very curious to see
Just very curious about this, from my own experience , all the graphic programming
I am very curious about this thing Int32 int addmonths_int = 10; DateTime.Now.AddMonths(addmonths_int); Int16
I am very curious because I would like to be able to check this
This is mostly a theoretical question I'm just very curious about. (I'm not trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.