[ZendTo] Re: RFE: Detect navigating away from page

Jules Jules at Zend.To
Thu Sep 22 14:22:26 BST 2011



On 22/09/2011 13:23, --[ UxBoD ]-- wrote:
> Perhaps as an alternative idea, Jules.
>
> When a user clicks on the Dropoff Files button could it open up the 
> upload Window in a separate browser screen akin. to a popup but using 
> _self as the target.
Wouldn't that look horrid in tabbed browsers? If not, then I've 
misunderstood you (remember I'm not much good at this 
JavaScript/HTML/CSS lark. I have a guy who does all of that stuff for 
me. :-)
> Potentially a cancel button could also be added to it. This has the 
> possibility to lead to allowing multiple files to be uploaded or in 
> fact multiple drop off sessions ? Sorry, just speaking out loud from 
> what a client had asked whether was possible or not.
> -- 
> Thanks, Phil
>
> ------------------------------------------------------------------------
>
>     I just tried it in Safari and it had no effect. :(
>
>     On 22/09/2011 08:58, --[ UxBoD ]-- wrote:
>
>         Jules, I have this working by adding into the top of
>         new_dropoff.tpl:
>
>         var unload_msg = "You will cancel your upload!";
>         var ignore_unload = true;
>
>         $(document).ready(function(){
>
>                 function doBeforeUnload() {
>                        if(ignore_unload) return; // Let the page unload
>
>                        if(window.event)
>                               window.event.returnValue = unload_msg; // IE
>                        else
>                               return unload_msg; // FF
>                 }
>
>                 if(window.body)
>                        window.body.onbeforeunload = doBeforeUnload; // IE
>                 else
>                        window.onbeforeunload = doBeforeUnload; // FF
>
>         and then in the submitform() function, around line 330, the
>         following code:
>
>             document.dropoff.submit();
>             ignore_unload = false;
>
>         Now once a user clicks Dropoff Files and they attempt to
>         navigate away a popup will ask them if they are sure.
>         -- 
>         Thanks, Phil
>
>         ------------------------------------------------------------------------
>
>             Hi Jules, A test user informed us that if you are
>             performing a dropoff and navigate away from the page the
>             upload is cancelled. Would it be feasible to add some JS
>             code for using onbeforeunload() to warn the user ?
>             -- 
>             Thanks, Phil
>
>
>             _______________________________________________
>             ZendTo mailing list
>             ZendTo at zend.to
>             http://mailman.ecs.soton.ac.uk/mailman/listinfo/zendto
>
>
>
>
>         _______________________________________________
>         ZendTo mailing list
>         ZendTo at zend.to
>         http://mailman.ecs.soton.ac.uk/mailman/listinfo/zendto
>
>
>     Jules
>
>     -- 
>     Julian Field MEng CITP CEng
>     www.Zend.To
>
>     Follow me at twitter.com/JulesFM
>     PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
>
>     'It's okay to live without all the answers' - Charlie Eppes, 2011
>     'All programs have a desire to be useful' - Tron, 1982
>     'That is the land of lost content,
>       I see it shining plain,
>       The happy highways where I went,
>       And cannot come again.' - A.E. Houseman
>
>
>     _______________________________________________
>     ZendTo mailing list
>     ZendTo at zend.to
>     http://mailman.ecs.soton.ac.uk/mailman/listinfo/zendto
>
>
>
>
> _______________________________________________
> ZendTo mailing list
> ZendTo at zend.to
> http://mailman.ecs.soton.ac.uk/mailman/listinfo/zendto

Jules

-- 
Julian Field MEng CITP CEng
www.Zend.To

Follow me at twitter.com/JulesFM
PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654

'It's okay to live without all the answers' - Charlie Eppes, 2011
'All programs have a desire to be useful' - Tron, 1982
'That is the land of lost content,
  I see it shining plain,
  The happy highways where I went,
  And cannot come again.' - A.E. Houseman

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/zendto/attachments/20110922/b256bc0e/attachment.html 


More information about the ZendTo mailing list