Re: bookmarklet: resubmission

At 10:50 AM 4/16/2001 -0700, Laurent Denoue wrote:
>Hello,
>I sent this bookmarklet example last week but the mail came back...
>So here is a repost.
>Laurent.
>
>With a bookmarklet, you can get the current selection in the browser window.
>So you can attach the annotation to any string.
>
>You will also need to browse frames in the document to find the frame where
>the selection came from and then pick up the URL of this frame.
>
>Here is an example with Internet Explorer (you can adapt this for netscape
>also, replacing document.selection by document.getSelection; note that with
>Netscape, I do not know DHTML enought to dynamically change the color of the
>highlighted text... whereas it's easy with IE):
>javascript:rng=null;loc=location.href;if(this.length==0){sel=document.select
>ion}else{encore=true;for(i=0;encore&&(i<this.length);i++){sel =
>this.frames[i].document.selection;if (sel.createRange().text!="")
>{encore=false}}};sel.createRange().execCommand("BackColor","","yellow");txt=
>sel.createRange().text;sel.empty();if (txt=="")txt="<whole
>document>";comment=prompt("New annotation for\n"+txt,"");alert("Attached
>to="+txt+"\nComment="+comment);
>
>You might improve this example by getting some context to the selection or
>make sure the string you've selected is unique in the document, or get the
>ID of the nearest element in the document, etc.
>
>Talking about XPointers to anchor annotations, I'm not sure that using IDs
>is a good idea: users do not expect annotations to remain on the document if
>the CONTENT has changed! Imagine you highlight a title in the CNN home page.
>The next day, the title will be different, but you will still get your OLD
>annotation.

I agree that using same ID for different news does not help much. In W3C 
page we now use ID's that are based on time so they are different for each 
news item to prevent this happening. The same problem exists also without 
ID's so it is not a specific ID problem. On the contrary ID's usually make 
the pointers more reliable and that's why we use them when we can. You have 
the same problem when pointing to the 3rd H2 element on the page or 3rd H2 
element and 2nd paragraph and 5 word, which you can also do with XPointer.

The Annotea team did discuss quite a lot about different ways of making the 
pointing more robust and some of the same ideas are in the paper you 
referred to. We haven't had time to concentrate more on that aspect yet, 
but what we have done so far does not prevent adding more robustness later. 
For instance, we could add a schema that captures some part of the (textual 
or mark-up) context to annotations that need to be extremely robust. These 
annotations might be handled, for instance, as different annotation 
subtypes with some extra properties. I rather would not use them everywhere 
as they are not always necessary  e.g. in cases when the social process 
already prevents users from making annotations to changing documents.

The first thing I would like to add is getting info that the document has 
or has not changed after the annotation was made.

Marja

>Of course, there might be cases when people want to explicitely attach
>annotations to the structure of the document, although I cannot find
>compelling examples. But in the general case, people attach annotations to
>the CONTENT.
>
>So you may use IDs in the document to help the algorithm locate those
>annotations, but you should also use CONTENT (and in my opinion, CONTENT
>should remain the main heuristic).
>You could also read the paper from Microsoft "Robust Annotation Positioning
>in Digital Documents." available at
>http://www.research.microsoft.com/coet/
>
>Laurent.

Received on Friday, 20 April 2001 15:59:03 UTC