Re: live section hacks



On Wed, 2005-07-27 at 21:14 -0400, Colin Walters wrote:
> Hi,
> 
> I got a lot farther on the live section work - it now can suck in the
> content of a section into a new yarrr live comment when you click edit.

Hi,

I don't think using anchors names as comment identifiers is a good idea.
They are regenerated every time and they can change when you insert a
new comment etc. Also ideally we should keep the id constant when the
section title changes (but this is minor)...

I think the only solution for this is to extend wiki text format a bit
to allow specify an identifier, that we could add when we edit a
comment. For example something like:

== Title [ID] ===

It would be good to be able to do without this but I think we need a
real identifier (one that doesnt change when the wiki text is edited,
sections added/removed etc..) and I dont see another way to do it then
explicitly specify one.

Something else that could be improved is live comment creation. It would
be much nicer if we could do it without reloading the whole pages (which
is annoying for users). Not an high priority though.

> But then ran into what Brion was talking about (now I understand) - we
> can't replace the HTML with the live comment as the wiki section isn't
> easily mapped to DOM.

For this specific case the editsection hack doesnt seem to have the
issues Brion mentioned for the more complex updating case.

I imagine we could have some js that iterate the dom tree, find the
various sections, and for each of them query the yarrr server to see if
there is an associated live comment. Obviously we also need to listen
for changes.
Then make the <p> hidden and insert an entry with the text.

> I'm attaching the patches I have so far for reference though....if we
> can come up with a solution for this (maybe the hack of looking for the
> next section edit link), then the last step is to make the "close"
> button take the user to the edit page and dump the live comment content
> in there.

Yeah that should do it. With the dynamic reloading stuff I committed,
the page should automatically be updated with the changes for the other
clients...

Marco





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]