[Proto-Scripty] Re: PeriodicalExecuter vs. Ajax.PeriodicalUpdater: use cases and advice?

2008-10-22 Thread Walter Lee Davis


On Oct 21, 2008, at 4:59 PM, Justin Perkins wrote:


 Hey man, you wanted an example and you got it.

 I gave you an example of a typical Rails RJS response, which are
 auto-generated from ruby-like code rather than written to leverage a
 particular framework's callbacks, etc.

 -justin

No worries. Thanks again.

Walter

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: PeriodicalExecuter vs. Ajax.PeriodicalUpdater: use cases and advice?

2008-10-21 Thread Baglan

I would imagine that Ajax.PeriodicalUpdater was conceived with a
different intention in mind - something like showing online/offline
status, maybe. All the chat-like examples I've seen (primarily for the
RoR), used javascript generated on the server to re-start updating and
sessions to keep track of updates - never a PeriodicalUpdater or
PeriodicalExecuter. I guess it makes sense to keep that functionality
on the server side.

- Baglan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: PeriodicalExecuter vs. Ajax.PeriodicalUpdater: use cases and advice?

2008-10-21 Thread Justin Perkins

Why aren't you just using the Ajax.PeriodicalUpdater, which supports
the decay option?

var poller = new Ajax.PeriodicalUpdater('some-element-id', '/foo/bar',
{decay:10});

Also, if you pass an empty string as the first parameter, then you can
pass pure JavaScript to be executed as opposed to just replacing the
contents of a page element.

-justin

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: PeriodicalExecuter vs. Ajax.PeriodicalUpdater: use cases and advice?

2008-10-21 Thread Justin Perkins

Well since the Ajax requests in Prototype will auto-eval the response,
you can modify the page without updating just one div. It's the route
I take most of the time.

Say you set it up like this:

new Ajax.PeriodicalUpdater('', '/some/url');

Then the response from /some/url could be:

$('some-element').blindUp({duration:0.5);
// wait for the blind up to complete before replacing the content
Element.update.delay(0.5, 'some-element', 'pmy new content/p');
// wait for the blind up to complete, then wait a 10th of a second longer
Element.blindDown.delay(0.6, 'some-element', {duration:0.5});

You get the idea. I find it more flexible and convenient than updating
just a single element. You could alternatively call into some
predefined object/method to do this work.

Some people might be opposed to this approach, but it works.

-justin

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---