Hi,
On Wed, Nov 4, 2009 at 3:22 PM, Marius Dumitru Florea <
mariusdumitru.florea(a)xwiki.com> wrote:
Hi Guillaume,
Guillaume Lerouge wrote:
Hi Marius,
On Wed, Nov 4, 2009 at 2:20 PM, Marius Dumitru Florea <
mariusdumitru.florea(a)xwiki.com> wrote:
Embed HTML elements pose some problems:
* they are loaded asynchronously and any attempt to access even the
simplest DOM property like nodeType through JavaScript raises an
exception if the object is not fully loaded (closed to
https://bugzilla.mozilla.org/show_bug.cgi?id=331672 ).
* they can't be fully controlled from JavaScript. The specific plugin
that handles each of them decides the display and behavior (e.g.
https://bugzilla.mozilla.org/show_bug.cgi?id=250855 a flash movie might
auto start in edit mode and, unless you want to see a movie while
editing, that's not nice).
* they aren't reloaded after they are detached and reattached to the DOM
tree using JavaScript which means that any DOM manipulation involving
one of the ancestors of a embed node can lead to the disappearance of
the embedded object. Sadly, appendChild, insertBefore and replaceChild
detach the target node before attaching it to the new location. As a
consequence there's no way to move an embed node inside the DOM tree
without detaching it.
So I propose we replace the embed HTML elements with static image
placeholders just after the edited document finishes loading. The
placeholder will have the same size as the embedded object in view mode.
Note, ckeditor already does this. You can check by copying the HTML from
http://jira.xwiki.org/jira/browse/XWIKI-3975 to the source of
http://ckeditor.com/demo .
I'm +1.
Sounds good. It will also make the page easier to edit since it will be
less
heavy.
Only question: where do we display text for that image? The information
text
we put with the image has to be easy to
internationalize.
Indeed that's something to think about. One option is to use
a generic
icon that stands for "Embedded Object" in the center of the placeholder
(which also has a border) and use a translatable text as the tool tip of
the placeholder. WDYT?