How to display a busy.gif ?

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

How to display a busy.gif ?

cbeler
Hi

I'd like to know how it's possible to display an animated gif when the
server is busy ?
(like in seasidehosting when uploading files ;) )
I tried with a combination of onLoad: and onClick but didn't succeed.

Thanks

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

Re: How to display a busy.gif ?

Pavel Krivanek-2
Get inspiration from the spinner
http://shorecomponents.seasidehosting.st/seaside/ShoreDemo4

-- Pavel

On 8/30/06, Cédrick Béler <[hidden email]> wrote:

> Hi
>
> I'd like to know how it's possible to display an animated gif when the
> server is busy ?
> (like in seasidehosting when uploading files ;) )
> I tried with a combination of onLoad: and onClick but didn't succeed.
>
> Thanks
>
> Cédrick
> _______________________________________________
> 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: How to display a busy.gif ?

Lukas Renggli
> > (like in seasidehosting when uploading files ;) )
> > I tried with a combination of onLoad: and onClick but didn't succeed.

The code on seasidehosting.st looks like this:

renderButtonsOn: html
        html div
                class: 'buttons';
                with: [
                        html submitButton
                                disabled: self isQuotaExeeded;
                                onClick: (html element
                                        id: 'spinner';
                                        show);
                                onClick: 'return true';
                                on: #upload of: self.
                        html submitButton
                                on: #close of: self.
                        html image
                                id: 'spinner';
                                style: 'margin-left: 5px; display: none;';
                                extent: 16 @ 16;
                                url: '/resources/pics/spinner.gif' ].

Since this does a full page refresh it is automatically disabled after
the refresh of the page. If you combine it with an AJAX action simply
add a hide effect to the onComplete: event.

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: How to display a busy.gif ?

cbeler

>
> The code on seasidehosting.st looks like this:
>
> renderButtonsOn: html
>     html div
>         class: 'buttons';
>         with: [
>             html submitButton
>                 disabled: self isQuotaExeeded;
>                 onClick: (html element
>                     id: 'spinner';
>                     show);
>                 onClick: 'return true';
>                 on: #upload of: self.
>             html submitButton
>                 on: #close of: self.
>             html image
>                 id: 'spinner';
>                 style: 'margin-left: 5px; display: none;';
>                 extent: 16 @ 16;
>                 url: '/resources/pics/spinner.gif' ].
>
> Since this does a full page refresh it is automatically disabled after
> the refresh of the page. If you combine it with an AJAX action simply
> add a hide effect to the onComplete: event.
>
> Hope this helps,
>
sure it is ;)

I just don't understand
onClick: 'return true';

is it:   return: true   instead ... ?

and anyway, can you explain a bit what this message does ?


thanks

Cédrick


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

Re: How to display a busy.gif ?

cbeler
In reply to this post by Pavel Krivanek-2


Pavel Krivanek a écrit :
> Get inspiration from the spinner
> http://shorecomponents.seasidehosting.st/seaside/ShoreDemo4
nice ;)

but I don't have shoreComponent right now in my image to see the code...
I'll have a look soon ...

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

Re: Re: How to display a busy.gif ?

Lukas Renggli
In reply to this post by cbeler
> > renderButtonsOn: html
> >     html div
> >         class: 'buttons';
> >         with: [
> >             html submitButton
> >                 disabled: self isQuotaExeeded;
> >                 onClick: (html element
> >                     id: 'spinner';
> >                     show);
> >                 onClick: 'return true';
> >                 on: #upload of: self.

Yes, this is done with an older version of Scriptaculous, you should better use:

        html submitButton
                disabled: self isQuotaExeeded;
                onClick: (html element
                        id: 'spinner';
                        show;
                        return: true);
                on: #upload of: self.

The "return: true" makes sure that the web-browser commits the form,
else it just executes the JavaScript and the submit does not happen.

Cheers,
Lukas

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