parallel example

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

parallel example

Jens Pall
Hi

Does anyone have an example on how to use the Scriptaculous parallel:
message?

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

Re: parallel example

Lukas Renggli
> Does anyone have an example on how to use the Scriptaculous parallel:
> message?

Try something like:

html anchor
   id: 'anchor';
   onClick: (html effect parallel: {
      html effect id: 'anchor'; highlight.
      html effect id: 'anchor'; move: 100 @ 200.
      html effect id: 'anchor'; scale: 4 };
   with: 'Parallelize Me'

The 3 effects will be executed in parallel. I don't exactly know why
script.aculo.us provides the parallel effect, after all simply
concatenating the effects would execute them in parallel as well as
they are processed asynchronously.

Cheers,
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: parallel example

Lukas Renggli
> html anchor
>    id: 'anchor';
>    onClick: (html effect parallel: {
>       html effect id: 'anchor'; highlight.
>       html effect id: 'anchor'; move: 100 @ 200.
>       html effect id: 'anchor'; scale: 4 };
>    with: 'Parallelize Me'
>
> The 3 effects will be executed in parallel. I don't exactly know why
> script.aculo.us provides the parallel effect, after all simply
> concatenating the effects would execute them in parallel as well as
> they are processed asynchronously.

Btw, the script.aculo.us wiki usually has a bunch of good examples and
documentation. Of course all in JavaScript, but I am sure it is easy
to engineer it back to Smalltalk code ;-)

   http://wiki.script.aculo.us/scriptaculous/show/Effect.Parallel

--
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: parallel example

Jens Pall
In reply to this post by Lukas Renggli
Lukas Renggli wrote:

>> Does anyone have an example on how to use the Scriptaculous parallel:
>> message?
>
> Try something like:
>
> html anchor
>   id: 'anchor';
>   onClick: (html effect parallel: {
>      html effect id: 'anchor'; highlight.
>      html effect id: 'anchor'; move: 100 @ 200.
>      html effect id: 'anchor'; scale: 4 };
>   with: 'Parallelize Me'
>
> The 3 effects will be executed in parallel. I don't exactly know why
> script.aculo.us provides the parallel effect, after all simply
> concatenating the effects would execute them in parallel as well as
> they are processed asynchronously.
>
> Cheers,
> Lukas
>

Thanks Lukas.

Would you concatenate the effects like this?:

html anchor
   onClick: (html effect
     id: 'theid';
     toggleAppear);
   onClick: (html effect
     id: 'theid';
     highlight);
   with: 'appear and highlight'.

At least this works too.

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

Re: parallel example

Lukas Renggli
> Would you concatenate the effects like this?:
>
> html anchor
>    onClick: (html effect
>      id: 'theid';
>      toggleAppear);
>    onClick: (html effect
>      id: 'theid';
>      highlight);
>    with: 'appear and highlight'.

Yes exactly. Another possibility would be to write it using the #, operator:

html anchor
   onClick: (html effect
      id: 'theid';
      toggleAppear) , (html effect
      id: 'theid';
      highlight);
   with: 'appear and highlight'.

Both versions should produce exactly the same JavaScript code.

Cheers,
Lukas

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