Scriptaculous OO API

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Scriptaculous OO API

Boris Popov, DeepCove Labs (SNN)
Just trying to poke my way through simplifying some of the coded
JavaScript here and could use a couple of hints, for instance how would
I come up with something like,

html script: ((html javascript)
 add: (SUStream on: '$(''mydiv'').style.width="50%"');
 yourself)

all this to come up with simple,

<script type="text/javascript">$('mydiv').style.width="50%"</script>

Thanks,

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Scriptaculous OO API

Lukas Renggli
> html script: ((html javascript)
>  add: (SUStream on: '$(''mydiv'').style.width="50%"');
>  yourself)

Scriptaculous does not define a protocol to edit style but one to
add/remove/enumerate classes. So I suggest that you define in your
style-sheet

        .half { width: 50% }

and then you do in Seaside:

        html script: (html element id: 'mydif'; addClassNamed: 'half')

And this is it.

However if you really want to mess around with styles you can do that
of course. Grab the latest version of Scriptaculous, I've added tree
new methods: #styleAt:, #styleAt:put: and #style:.

        html script: (html element id: 'mydif'; styleAt: 'width' put: '50%')

Hope this helps,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Scriptaculous OO API

Boris Popov, DeepCove Labs (SNN)
In reply to this post by Boris Popov, DeepCove Labs (SNN)
Re: [Seaside] Scriptaculous OO API

Cool thanks!

Cheers!

-Boris
(Sent from a BlackBerry)

----- Original Message -----
From: [hidden email] <[hidden email]>
To: The Squeak Enterprise Aubergines Server - general discussion. <[hidden email]>
Sent: Wed Nov 22 11:22:52 2006
Subject: Re: [Seaside] Scriptaculous OO API

> html script: ((html javascript)
>  add: (SUStream on: '$(''mydiv'').style.width="50%"');
>  yourself)

Scriptaculous does not define a protocol to edit style but one to
add/remove/enumerate classes. So I suggest that you define in your
style-sheet

        .half { width: 50% }

and then you do in Seaside:

        html script: (html element id: 'mydif'; addClassNamed: 'half')

And this is it.

However if you really want to mess around with styles you can do that
of course. Grab the latest version of Scriptaculous, I've added tree
new methods: #styleAt:, #styleAt:put: and #style:.

        html script: (html element id: 'mydif'; styleAt: 'width' put: '50%')

Hope this helps,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Scriptaculous OO API

Lukas Renggli
In reply to this post by Lukas Renggli
> Scriptaculous does not define a protocol to edit style but one to
> add/remove/enumerate classes. So I suggest that you define in your
> style-sheet

I was confused: script.aculo.us provides one, but so up to an hour ago
Scriptaculous for Seaside did not.

Btw, I published yet another fix that was introduced with this
enhancement and the encoding of dictionaries.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside