[Seaside] Weird problem with libraries
Mariano Martinez Peck
marianopeck at gmail.com
Wed Jul 15 00:25:54 UTC 2009
Hi folks,
I have a problem with a library. I am using a Pier Gallery addon that uses
Prototype.js, scriptaculus, builder, effects, etc. My application DOESN'T
have SULibrary added. It has it's own library called DestinoMochilaLibrary
with this method:
DestinoMochilaLibrary>>selectorsToInclude
^ #(destinoMochilaCss)
Now, to be able to use that plugin I override the method updateRoot: like
this:
DestinoMochilaLibrary>>updateRoot: aHtmlRoot
super updateRoot: aHtmlRoot.
aHtmlRoot javascript url: '
http://www.roard.com/lightbox2/js/prototype.js'.
aHtmlRoot javascript url: '
http://www.roard.com/lightbox2/js/scriptaculous.js?load=effects,builder'.
aHtmlRoot javascript url: 'http://www.roard.com/lightbox2/js/lightbox.js
'.
aHtmlRoot stylesheet url: '
http://www.roard.com/lightbox2/css/lightbox.css'
Obviously this is not good because I am requesting another website. Thus, I
wanted to have it locally. Then I did this:
- Add SULibrary to my application
- Downloaded the http://www.roard.com/lightbox2/js/lightbox.js and
http://www.roard.com/lightbox2/css/lightbox.css because they are not in
SULibrary.
- Then I uploaded both files to SULibrary and I could perfectly see the new
methods lightboxJs and lightboxCss in SULibrary.
- I can also see all links in http://localhost:8888/seaside/files/SULibrary/
- Removed DestinoMochilaLibrary>>updateRoot:
The problem is that if I remove the DestinoMochilaLibrary>>updateRoot:
(which should be not used now), the plugin doesn't work. It is like if
cannot find the javascript libraries.
Let's take the example of protoype. In the first version, my html rendered
shows:
<script type="text/javascript" src="
http://www.roard.com/lightbox2/js/prototype.js"></script>
which is correct. After my changes, I see:
<script type="text/javascript"
src="/seaside/files/SULibrary/prototype.js"></script>
which I think it is also correct.
Now...what can be the problem that the plugin doesn't work ???
More information. If I change my code to this:
updateRoot: aHtmlRoot
super updateRoot: aHtmlRoot.
aHtmlRoot javascript url: '
http://localhost:8888/seaside/files/SULibrary/prototype.js'.
aHtmlRoot javascript url: '
http://localhost:8888/seaside/files/SULibrary/builder.js'.
aHtmlRoot javascript url: '
http://localhost:8888/seaside/files/SULibrary/effects.js'.
aHtmlRoot javascript url: '
http://localhost:8888/seaside/files/SULibrary/lightbox.js'.
aHtmlRoot stylesheet url: '
http://localhost:8888/seaside/files/SULibrary/lightbox.css'
It works perfect!! But I don't think I have to do this...I must be doing
something wrong.
Thanks a lot for the help in advance.
Mariano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20090714/0d3ad901/attachment.htm
More information about the seaside
mailing list