On Wed, 2008-06-18 at 16:08 +0200, Art Lowel wrote:
> I've been recreating some of our custom jsp addons for 1.4 dspaces as
> aspects in Manakin, and I have some questions concerning javascript. I
> was unable to find documentation addressing following issues and so
> far, I have only found examples of dspace installations using
> javascript as part of a theme.
> 
> 
> That's fine for javascript that does something mainly visual e.g. a
> sliding animation to show/hide the contents of a div, or a script
> emphasising a menu item when the mouse hovers over it. It's a good
> thing that these scripts are part of the theme layer because that way
> they can differ from theme to theme.
> 
> 
> However, there are ways of using javascript where can it be considered
> to be functional rather than visual and thus preferably not part of a
> theme. Consider the problem of alerting a user of unsaved changes on a
> settings page. This requires an onblur action for every setting (form
> field) to trigger a javascript function that verifies whether that
> setting has changed. If the setting has changed a warning should be
> shown at the top of the page.
> 
> 
> I believe the manner in which that the warning will be shown, and the
> way it looks should be part of the theme. But the onblur actions, and
> the verify function should be part of the aspect, as they don't do
> anything visual whatsoever.

Even for functions that do nothing visual, do they not still have a
dependency on the theme?

These functions presumably run within the context of the web page (the
HTML form). They would need to interrogate the HTML form, presumably
accessing nodes in a DOM by id, etc, and presumably using a browser
method to pop up a dialog box or something. That would assume a DOM with
a particular structure, and a standard web browser host.

But consider that a different theme might not render the DRI form as an
HTML form in quite the same way. The DRI form might even be rendered in
some other format: altogether; for the sake of argument it could be PDF,
SVG, VRML, Flash, XUL, etc.

If you are after modularity and want to reuse the javascript then you
might instead follow the pattern of the "dri2xhtml" theme in the
"themes" folder. This isn't really a theme at all, but a theme library
which is included from various other themes. 

Con

-- 
Conal Tuohy
New Zealand Electronic Text Centre
www.nzetc.org


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to