> The main issue with the silverlight implementation is probably the
> lack of events and integration with the rest of your page.
Could you elaborate on what you mean by these two points? I didn't
see anything about that in the headers of the excanvas.js files. Are
there tickets filed about these issues that I could look at for more
info?
> The plan is to merge the VML and the Silverlight version into one file
> and have some compile time constants for people that do not want one
> ore the other.
For my project, which uses ExplorerCanvas, I had planned to use
Microsoft's silverlight.js script to detect whether Silverlight was
present, and, based on that, load either the VML or Silverlight
version of excanvas.js, because while the Silverlight version fixes
two issues I have with the VML version, I don't want to require users
to install Silverlight.
http://code.google.com/p/canviz/issues/detail?id=43
But based on your above comment, the VML and Silverlight versions of
excanvas.js will be merged into a single script, which sounds like a
great idea to me. Should I assume that there still will be a
mechanism to select whether one wants the VML or Silverlight
implementation? Will you be including code to detect whether
Silverlight is installed and auto-select the best version of
ExCanvas, or would that still be up to my project to implement? Do
you need any help with combining the two versions, or are there still
other tasks you want to finish before combining them?
Events
SilverLight is a plugin and therefore it is a black box where events
inside the plugin are not exposed to the outside of the plugin. I
think the simplest way to describe this is with an example. Assume
that you add a listener to the click event on the canvas element, or
any of the ancestors of the canvas element. When the user clicks on
the canvas the listener is supposed to be called.
To solve that we should listen to "all" events inside SilverLight and
redispatch them on the canvas element (I'll file a bug).
Integration:
Once again the ugly nature of plugins is raising its head. Since
SilverLight is a plugin you cannot apply CSS layering and effects to
it. For example the -ms-filter CSS property will not work on it and
things like displaying other content on top of it is is troublesome.
There are also issues with focus.
There are things we can do to make it less ugly. We can use a
windowless plugin and we can make I think that setting tabIndex to -1
might work but it might also require other hacks to prevent focus from
getting stuck in the plugin.
>> The plan is to merge the VML and the Silverlight version into one file
>> and have some compile time constants for people that do not want one
>> ore the other.
>
> For my project, which uses ExplorerCanvas, I had planned to use
> Microsoft's silverlight.js script to detect whether Silverlight was
> present, and, based on that, load either the VML or Silverlight
> version of excanvas.js, because while the Silverlight version fixes
> two issues I have with the VML version, I don't want to require users
> to install Silverlight.
>
> http://code.google.com/p/canviz/issues/detail?id=43
>
> But based on your above comment, the VML and Silverlight versions of
> excanvas.js will be merged into a single script, which sounds like a
> great idea to me. Should I assume that there still will be a
> mechanism to select whether one wants the VML or Silverlight
> implementation? Will you be including code to detect whether
> Silverlight is installed and auto-select the best version of
> ExCanvas, or would that still be up to my project to implement? Do
> you need any help with combining the two versions, or are there still
> other tasks you want to finish before combining them?
The goal is to detect SilverLight and use that if available. I
recommend you to not use the silverlight.js file provided by
Microsoft. It is bloated as hell and you only need a few lines (not
thousand) to get SilverLight working in IE.
We also want to have 3 "compilation" targets. SilverLight+VML, VML and
SilverLight. The code will contain both SilverLight and VML but
wrapped in constant if statements so we can preprocess the code to
generate versions with VML and SilverLight respectively.
Before merging the files I think we should at least solve the event
issue in the SilverLight version. Once that is done we can go ahead
and create a branch and work on the branch for a while.
--
erik