I've run into a bit of dilemma with unifying the
account-signup process
with faux-modal-dialog box from the Snarf server bundle.
We want to us it in Cosmo as well -- both from the login
page and from
the anon access page for viewing shared collections. The
idea was to
take the plain ol' JS/DOM/CSS code from the original dialog
and merge it
into the nifty Dojo widget we now have for modal dialogs.
The wee
problem I've run into is that along with the convenience we
get out of
using the Dojo widget framework for UI elements, we also get
a
dependency -- Dojo itself.
If we want to use the same Dojo-widgetized component both in
Cosmo
itself as well as in Snarf, It seems like we'll have to do
one of two
things:
1. Clue Snarf in to the location of the dojo library and our
widget code
in Cosmo (That might be making assumptions about port
numbers that we
don't want to make -- remember any synchronous XHR calls
used by
dojo.require don't work cross-domain.)
2. Ship a copy of our widget code -- and Dojo too, yay! --
in Snarf
Are there other ways to skin this cat? Maybe ship Snarf with
just the
compressed dojo.js file, and the pieces/parts of our code
that we need
for the dialog box?
The other option (which isn't really my preference actually)
would be to
blow off Dojo widgets and just use straight JS/DOM/CSS
(currently two JS
files 19K and 9.7K respectively for the original fake dialog
box). That
would avoid the big ol' Dojo dependency, but would be kind
of missing
the whole point of "plug and playness" and
reusability that's one of the
main reason we're going down the widget path in the first
place.
Anybody have any ideas on how to solve this in a way that
doesn't make
configuration really annoying/brittle, and also doesn't
duplicate a
bunch of code?
Matthew
_______________________________________________
cosmo-dev mailing list
cosmo-dev lists.osafoundation.org
http://lists.osafoundation.org/mailman/listinfo/cosmo-d
ev
|