Hi all,



Is(are) there any conventional way(s) to keep track of position of text
dragged from the page?

I'll try to summarize in brief the final objective, so that you will be able
to provide the best answer: my colleagues and me are building a semantic
annotation extension for FF; currently, when the user drags text from the
page to the ontology on the sidebar, the system keeps track of the url of
the page where the text has been annotated by the user and associates it to
the new instance (think of it like a kind of bookmark). When the user gets
back on the same page, the system informs him that there is some annotation
in this page. All of the above has already been implemented. Now I would
like to add more specific information, which will enable the system to find
back the specific annotated string inside the same page. How is it possible
to do that? and which kind of information (byte offset, char offset, any
other - even completely different - reference?) should be extracted for
doing that?

Premise 1: in this specific scenario, we can assume that the annotated pages
will not change over time

Premise 2: with respect to the already implemented functionality, which just
launches a search of stored annotations over the page in the browser, it is
important to be able to re-extract just the specific occurrence of the
annotated string; for example, if "foo" is present in the body of the page
two times, and the annotator just annotates the first occurrence, then the
system should only highlight the first occurrence when it comes back on the
same page.



Thanks in advance for any help,



Armando