[Adium-devl] [kopete-devel] Kopete Message styles and Adium
David Smith
catfish.man at gmail.com
Sat Sep 2 05:52:35 UTC 2006
Some thoughts I've had on message view issues:
1) Google groups is nice; we should set up one for this.
2) There is currently no way to refer to any particular element of a
chat in the webview. A custom template.html can override the outer
structure, and the various Content.html files can specify any
arbitrary html they want for messages. This makes any sort of
advanced manipulation of the DOM impossible.
3) Some of the Kopete extensions are, imo, taking the customizability
a bit too far. We also need a centralized way of documenting
extensions (I suggest posts to the google group).
4) Kopete currently doesn't support message style versioning, due to
not reading Info.plist. This could cause problems.
5) It turns out that saving images to a temporary folder and
specifying them as the src to images is not as nasty as it seems. It
allows for the images to be opened in other apps/dragged to the
desktop, and the webkit cache can't have items "locked" into it, so
we would still need to write the file out to repopulate the cache
when needed even if we directly loaded images into the webview from
memory.
6) Although CSS and JS allow for quite complex manipulations of the
message structure, doing so is significantly less commonly understood
than editing the html.
7) People find the message view code scary, and don't really
understand how it works. I need to write some docs describing its
structure, 'cause it's really not that bad.
8) Good copy and paste is hard. That sucks, and we should figure out
what to do about it.
9) Searchability is coming in webkit. With any luck they won't leave
it 10.5-only.
Ideas:
Introduce a new mostly-compatible version, as we have done in the
past, with the following changes:
1) All message elements are wrapped in <div class="message"
id="message: 1" style="margin:0px; padding:0px;"></div> (where 1 is
replaced by some integer representing the index of the message)
This will let us refer to messages directly so that we can do things
like removing, reordering, or modifying messages after they're in the
view. Possibly we should look into attaching classes/ids to other
elements as well so that (for example) we could set %message% to be
<img src="loading.gif" id="messagecontent: 5">, and then once it was
done loading we could swap in the newly loaded content. I'm a little
unsure on how exactly this should be structured, so I welcome comments.
The style on the div is designed to minimize the layout impact of
it. In the ideal case, current styles should be upgradable without
even being aware that their messages are being wrapped, but this may
not be feasible.
2) Use classes more effectively. We could perfectly easily just add
class="history" instead of using AIContentContext. Same goes for
actions.
3 [implementation detail. Kopete folks feel free to ignore this one])
We can probably keep an invisible DOM node of the content template
ready and waiting to go, then just do .cloneNode() on it, set the
content, and insert it. The downside of this is that we lose custom
js behaviors like Renkoo... so some way of accommodating them could
be in order.
4) Optional files works surprisingly well. I don't think most people
have even *noticed* that they can provide FileTransfer.html yet. It
Just Works®, and if they need the customizability it's there. We
could literally make every html file in the message view optional.
Styles that felt like going all CSS on it could just style a *well
documented* standard message html. I don't know if this is a good idea.
David Smith
More information about the devel
mailing list