It would be nice if the keepalive was generic so that it could be used
in your own controller:

In a controller function:
response.keepalive=60000

In web2py_ajax.html $(document).read function:
{{if response.keepalive:}}
setInterval("$.post(document.forms[0].action);",
{{=response.keepalive}});
{{pass}}

Something like that...

On Feb 22, 4:32 pm, mdipierro <[email protected]> wrote:
> If you tell me this is the only missing feature I can easily add an
> ajax ping to keep alive the session.
>
> Massimo
>
> On Feb 22, 4:06 pm, Boris Manojlovic <[email protected]>
> wrote:
>
> > In current form it does not do that :)
> > Not in real sense of it, as I still did not fixed "issue" with session
> > expiration (it is currently just avoidance of reload - and "loss of code"
> > because of re-login process ;)) and as such it is still not a finished
> > product :\
> > Will try to see where to patch in check for "from_ajax" in login or exact
> > code that check if session is still valid.
> > Idea is to always have open editor with maybe "flash" part of screen showing
> > up "Session Expired\nEnter Password here: ______", when expired and then be
> > able to continue working after login
> > So if you don't close browser window it should keep your code safe.
> > So that is idea :)
>
> > On Sun, Feb 22, 2009 at 9:18 PM, mdipierro <[email protected]> wrote:
>
> > > Nice patch. Can you explain how does it solve the "loss of code
> > > issue"?
>
> > > Massimo
>
> > > On Feb 22, 12:16 pm, Boris Manojlovic <[email protected]>
> > > wrote:
> > > > Hello to All,
>
> > > > i have started to work on something called "ajax" code editor.
> > > > What exactly does it mean?
>
> > > >    1. No need for reloads on editor page (just think about undo redo in
> > > >    editor window)
> > > >    2. No "terrible loss of code" if you are logged out (application
> > > >    timeout... with that "great" redirect to login page...)
> > > >    3. speed gain
>
> > > > Current implementation has "save" functionality only and it works just
> > > from
> > > > firefox (konqueror ignores my jquery code and same for opera...).
> > > > Most coding as it would be expected should (and is) done on client side
> > > and
> > > > will degrade depending if user use javascript at all - no script no ajax
> > > > anyway.
> > > > All messages in current stage are json passed to client.
> > > > Patch against latest SVN from google code
>
> > > > P.S. Comments welcome and needed (to continue on this idea or not)
> > > > --
> > > > "Only two things are infinite, the universe and human stupidity, and I'm
> > > not
> > > > sure about the former."-Albert Einstein
>
> > > >  ajax_editor.patch
> > > > 7KViewDownload
>
> > --
> > "Only two things are infinite, the universe and human stupidity, and I'm not
> > sure about the former."-Albert Einstein
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to