You can directly include the files instead of using the
scriptaculous.js loader file.
So instead of (with the latest version from SVN):
<script src="some_dir/scriptaculous.js" type="text/javascript"></script>
do
<script src="some_dir/effects.js" type="text/javascript"></script>
<script src="some_dir/dragdrop.js" type="text/javascript"></script>
If you want effects and drag and drop functionality (of course, you
always need
to include prototype.js, too).
There's only one dependency, that is that effects.js is required
to use all the other .js files, so it needs to be always included.
The next version of script.aculo.us (that is, post 1.5) will include are
more advanced mechanism to do this.
btw, personally I would not rely on JavaScript compressors, because:
1) it gets really difficult to debug when something bad happens
2) they can introduce new bugs
3) compression should be done by the webserver (transparent g-zipping)
Thomas
Am 23.10.2005 um 05:29 schrieb Joe Black:
I was curious what the rest of you are doing to keep the size of using
scriptaculous manageable. It seems for just using drag and drop with a
few effects you're looking at loading quite a lot of javascript.
Does anyone know an automated way of seperating just the functions
that
will be used in the site from the rest? I wouldn't want to have to do
that every time scriptaculous is patched so I'm thinking there has
to be
a better way.
Joe
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs