<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:#20124d">It worked for me too.</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:#20124d"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:#20124d">Thank you so much.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 25, 2014 at 9:22 PM, Andrew Martin <span dir="ltr"><<a href="mailto:amartin@xes-inc.com" target="_blank">amartin@xes-inc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">----- Original Message -----<br>
> From: "Gray D. McCord" <<a href="mailto:gdm@sangabriel.com">gdm@sangabriel.com</a>><br>
> To: "ZendTo Users" <<a href="mailto:zendto@zend.to">zendto@zend.to</a>><br>
</span><span class="">> Sent: Tuesday, November 25, 2014 4:40:55 PM<br>
> Subject: [ZendTo] Re: "Leave This Page" warning when dropping off a file<br>
><br>
</span><div><div class="h5">> I ran into this quite a while back. I have two possible things you can try.<br>
> Both involve edits to the new_dropoff.tpl file:<br>
> SOLUTION 1:<br>
> First, my solution, which works for me is to edit the submitform() script in<br>
> the new_dropoff.tpl file by setting "ignore_upload = true;” in the submit<br>
> form script and my problem went away. Now, my Zendto is highly customized<br>
> with a JS file uploader and php5.5, so this may not work for you. Also be<br>
> sure to make sure it doesn ’ t break something on other browsers.<br>
> < script type= "text/javascript" ><br>
> function submitform () {<br>
> if ( validateForm ()) {<br>
> document . fileupload . submit ();<br>
> ignore_unload = true ; //TODO: Changed to true to get rid of Chrome error.<br>
> Need to figure out why the error occurs.<br>
> }<br>
> }<br>
> </ script ><br>
><br>
><br>
> SOLUTION 2, from Jules, who is the Zendto owner and actually knows what he’s<br>
> doing:<br>
><br>
><br>
> From: Jules [ mailto:<a href="mailto:Jules@Zend.To">Jules@Zend.To</a> ]<br>
> Sent: 02 January 2014 11:15<br>
> To: John Webber (NBI)<br>
> Cc: ZendTo Users<br>
> Subject: Re: FW: Issue with Chrome browser - "Leave this Page"<br>
><br>
><br>
><br>
><br>
> I've got a quick fix for this. Unfortunately it means you can navigate away<br>
> from (and hence abort) a running upload, but it stops the Chrome warning, so<br>
> is better than nothing.<br>
><br>
> You want to edit /opt/zendto/templates/new_dropoff.tpl file:<br>
><br>
> Find the start of the "submitform" function, and add the last line of this<br>
> little code snippet:<br>
><br>
> <script type="text/javascript"><br>
> function submitform() {<br>
> if (validateForm()) {<br>
> window.onbeforeunload=function(){}<br>
><br>
> Jules.<br>
> ————————————————————————<br>
> Good Luck!<br>
> Gray McCord<br>
> Adapt, Mutate, Migrate, or Die<br>
> -C. Darwin<br>
><br>
</div></div>Gray,<br>
<br>
Thanks for the help. It looks like both of these solutions achieve the same effect.<br>
The first solution makes the doBeforeUnload function return immediately (rather<br>
than doing anything):<br>
function doBeforeUnload() {<br>
if(ignore_unload) return; // Let the page unload<br>
<br>
if(window.event)<br>
window.event.returnValue = unload_msg; // IE<br>
else<br>
return unload_msg; // FF<br>
}<br>
<br>
This function is set as the target for onbeforeunload just below where it is defined:<br>
if(window.body)<br>
window.body.onbeforeunload = doBeforeUnload; // IE<br>
else<br>
window.onbeforeunload = doBeforeUnload; // FF<br>
<br>
<br>
The solution that Jules posted changes the function that is called for onbeforeunload<br>
to be an empty function, rather than doBeforeUnload:<br>
<span class=""><script type="text/javascript"><br>
function submitform() {<br>
if (validateForm()) {<br>
window.onbeforeunload=function(){}<br>
<br>
</span>Again thanks for the help!<br>
<span class="HOEnZb"><font color="#888888"><br>
Andrew<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
ZendTo mailing list<br>
<a href="mailto:ZendTo@zend.to">ZendTo@zend.to</a><br>
<a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/zendto" target="_blank">http://mailman.ecs.soton.ac.uk/mailman/listinfo/zendto</a></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><font face="georgia, serif"><i><a href="http://google.com/+EvertonBrunoBernardi" target="_blank">Everton Bruno Bernardi</a></i></font><br><br><br></div></div>
</div>