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

--[ UxBoD ]-- uxbod at splatnix.net
Thu Sep 22 13:23:39 BST 2011


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. 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 

----- Original Message -----

> 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
> 

> > ----- Original Message -----
> 

> > > 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/zendto/attachments/20110922/97a8abfd/attachment-0001.html 


More information about the ZendTo mailing list