Observing Ajax Requests?

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

Observing Ajax Requests?

Michael Roper
Is it possible using scriptaculous/prototype to watch out for any
happening Ajax activity, and do something like show/hide a spinner gif
to indicate to the user that there is activity taking place in the
backgound?

Regards,

Michael
------------------------------------------
Michael Roper - Web Developer
WORLDWIDE ONLINE PRINTING AUST/NZ
[T 08 9350 2300] [F 08 9451 6048]
[E [hidden email]]
[W http://www.worldwide.com.au]
------------------------------------------

_______________________________________________
Rails-spinoffs mailing list
[hidden email]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Reply | Threaded
Open this post in threaded view
|

RE: Observing Ajax Requests?

Tom Fakes

I think I first saw this code on this list, and I think the
Ajax.Responders code is fairly new in Prototype:

Ajax.Responders.register({
  onCreate: function() {
    if($('busy') && Ajax.activeRequestCount>0)
      Effect.Appear('busy',{duration:0.5,queue:'end'});
  },
  onComplete: function() {
    if($('busy') && Ajax.activeRequestCount==0)
      Effect.Fade('busy',{duration:0.5,queue:'end'});
  }
});


-----Original Message-----
From: Michael Roper [mailto:[hidden email]]
Sent: Sunday, December 18, 2005 8:47 PM
To: [hidden email]
Subject: [Rails-spinoffs] Observing Ajax Requests?

Is it possible using scriptaculous/prototype to watch out for any
happening Ajax activity, and do something like show/hide a spinner gif
to indicate to the user that there is activity taking place in the
backgound?

Regards,

Michael
------------------------------------------
Michael Roper - Web Developer
WORLDWIDE ONLINE PRINTING AUST/NZ
[T 08 9350 2300] [F 08 9451 6048]
[E [hidden email]]
[W http://www.worldwide.com.au]
------------------------------------------

_______________________________________________
Rails-spinoffs mailing list
[hidden email]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

_______________________________________________
Rails-spinoffs mailing list
[hidden email]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Reply | Threaded
Open this post in threaded view
|

Re: Observing Ajax Requests?

Michael Roper
Thanks Tom, that's exactly what I was after!

I didn't think that I would have been the first to want to do this...

Regards,

Michael


On 19/12/2005, at 1:03 PM, Tom Fakes wrote:

>
> I think I first saw this code on this list, and I think the
> Ajax.Responders code is fairly new in Prototype:
>
> Ajax.Responders.register({
>   onCreate: function() {
>     if($('busy') && Ajax.activeRequestCount>0)
>       Effect.Appear('busy',{duration:0.5,queue:'end'});
>   },
>   onComplete: function() {
>     if($('busy') && Ajax.activeRequestCount==0)
>       Effect.Fade('busy',{duration:0.5,queue:'end'});
>   }
> });
>
>
> -----Original Message-----
> From: Michael Roper [mailto:[hidden email]]
> Sent: Sunday, December 18, 2005 8:47 PM
> To: [hidden email]
> Subject: [Rails-spinoffs] Observing Ajax Requests?
>
> Is it possible using scriptaculous/prototype to watch out for any
> happening Ajax activity, and do something like show/hide a spinner gif
> to indicate to the user that there is activity taking place in the
> backgound?
>
> Regards,
>
> Michael
> ------------------------------------------
> Michael Roper - Web Developer
> WORLDWIDE ONLINE PRINTING AUST/NZ
> [T 08 9350 2300] [F 08 9451 6048]
> [E [hidden email]]
> [W http://www.worldwide.com.au]
> ------------------------------------------
>
> _______________________________________________
> Rails-spinoffs mailing list
> [hidden email]
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
> _______________________________________________
> Rails-spinoffs mailing list
> [hidden email]
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>

_______________________________________________
Rails-spinoffs mailing list
[hidden email]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Reply | Threaded
Open this post in threaded view
|

Re: Observing Ajax Requests?

Thomas Fuchs
Here's the article on that:
http://mir.aculo.us/articles/2005/11/14/ajax-activity-indicators-with- 
rails-0-14-3

(a bit rails specific, but can be used elsewhere, too).

-Thomas

Am 19.12.2005 um 06:20 schrieb Michael Roper:

> Thanks Tom, that's exactly what I was after!
>
> I didn't think that I would have been the first to want to do this...
>
> Regards,
>
> Michael
>
>
> On 19/12/2005, at 1:03 PM, Tom Fakes wrote:
>
>>
>> I think I first saw this code on this list, and I think the
>> Ajax.Responders code is fairly new in Prototype:
>>
>> Ajax.Responders.register({
>>   onCreate: function() {
>>     if($('busy') && Ajax.activeRequestCount>0)
>>       Effect.Appear('busy',{duration:0.5,queue:'end'});
>>   },
>>   onComplete: function() {
>>     if($('busy') && Ajax.activeRequestCount==0)
>>       Effect.Fade('busy',{duration:0.5,queue:'end'});
>>   }
>> });
>>
>>
>> -----Original Message-----
>> From: Michael Roper [mailto:[hidden email]]
>> Sent: Sunday, December 18, 2005 8:47 PM
>> To: [hidden email]
>> Subject: [Rails-spinoffs] Observing Ajax Requests?
>>
>> Is it possible using scriptaculous/prototype to watch out for any
>> happening Ajax activity, and do something like show/hide a spinner  
>> gif
>> to indicate to the user that there is activity taking place in the
>> backgound?
>>
>> Regards,
>>
>> Michael
>> ------------------------------------------
>> Michael Roper - Web Developer
>> WORLDWIDE ONLINE PRINTING AUST/NZ
>> [T 08 9350 2300] [F 08 9451 6048]
>> [E [hidden email]]
>> [W http://www.worldwide.com.au]
>> ------------------------------------------
>>
>> _______________________________________________
>> Rails-spinoffs mailing list
>> [hidden email]
>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>>
>> _______________________________________________
>> Rails-spinoffs mailing list
>> [hidden email]
>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>>
>
> _______________________________________________
> Rails-spinoffs mailing list
> [hidden email]
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

_______________________________________________
Rails-spinoffs mailing list
[hidden email]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Reply | Threaded
Open this post in threaded view
|

RE: Observing Ajax Requests?

Rahul Bhargava
In reply to this post by Michael Roper
Oh neat, I hadn't noticed that either... I'd implemented something
similar, as I'm sure many others have, but as my own wrapper around the
Ajax.Request and Ajax.Updater calls.  

The only interaction issue I wanted to raise was that for Ajax.Updater
calls it might make sense to be able to get the name of the div to the
responder.  For example, when I have some link that fires an ajax call
to update an area of the screen, I put a slightly transparent overlay on
top of that div while the request is happening (like the In-Place-Editor
does).  

That seemed to me to be an enhancement on the notification to the user -
as it shows exactly what area of content is being changed during the
process (an Effect.Highlight afterwards didn't seem to cover the cases I
needed it too).

Anyway, it looks like the responder callback doesn't handle that (since
it's at a lower level):
  responder[callback].apply(responder, [request, transport, json]);

Thoughts?

Rahul

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of
Thomas Fuchs
Sent: Monday, December 19, 2005 4:05 AM
To: [hidden email]
Subject: Re: [Rails-spinoffs] Observing Ajax Requests?

Here's the article on that:
http://mir.aculo.us/articles/2005/11/14/ajax-activity-indicators-with- 
rails-0-14-3

(a bit rails specific, but can be used elsewhere, too).

-Thomas

Am 19.12.2005 um 06:20 schrieb Michael Roper:

> Thanks Tom, that's exactly what I was after!
>
> I didn't think that I would have been the first to want to do this...
>
> Regards,
>
> Michael
>
>
> On 19/12/2005, at 1:03 PM, Tom Fakes wrote:
>
>>
>> I think I first saw this code on this list, and I think the
>> Ajax.Responders code is fairly new in Prototype:
>>
>> Ajax.Responders.register({
>>   onCreate: function() {
>>     if($('busy') && Ajax.activeRequestCount>0)
>>       Effect.Appear('busy',{duration:0.5,queue:'end'});
>>   },
>>   onComplete: function() {
>>     if($('busy') && Ajax.activeRequestCount==0)
>>       Effect.Fade('busy',{duration:0.5,queue:'end'});
>>   }
>> });
>>
>>
>> -----Original Message-----
>> From: Michael Roper [mailto:[hidden email]]
>> Sent: Sunday, December 18, 2005 8:47 PM
>> To: [hidden email]
>> Subject: [Rails-spinoffs] Observing Ajax Requests?
>>
>> Is it possible using scriptaculous/prototype to watch out for any
>> happening Ajax activity, and do something like show/hide a spinner  
>> gif
>> to indicate to the user that there is activity taking place in the
>> backgound?
>>
>> Regards,
>>
>> Michael
>> ------------------------------------------
>> Michael Roper - Web Developer
>> WORLDWIDE ONLINE PRINTING AUST/NZ
>> [T 08 9350 2300] [F 08 9451 6048]
>> [E [hidden email]]
>> [W http://www.worldwide.com.au]
>> ------------------------------------------
>>
>> _______________________________________________
>> Rails-spinoffs mailing list
>> [hidden email]
>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>>
>> _______________________________________________
>> Rails-spinoffs mailing list
>> [hidden email]
>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>>
>
> _______________________________________________
> Rails-spinoffs mailing list
> [hidden email]
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

_______________________________________________
Rails-spinoffs mailing list
[hidden email]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________
Rails-spinoffs mailing list
[hidden email]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs