[imp] Compose Window Javascript issues

Jim Buitt jbuitt at siue.edu
Wed Oct 29 11:16:52 PST 2003


Hello,
I'm running the following:

Server:

Apache 2.0.47
Horde: 2.2.4
IMP: 3.2.2
Turba: 1.2.1


Clients:

Internet Explorer 6.0
Netscape 7.1
Mozilla 1.x

When a user opens up the compose window, the default behavior is that they will be warned 5 minutes and 1 minute before their session will end.  I've modified the Javascript a little to notify the user at 5 minutes and 1 minute, but it will then automatically save the message to the user's Drafts folder right before their session will end. However, for some reason IE 6.x does not act the same as Netscape/Mozilla.  If a user using IE does not respond to the first warning then they will never get the second warning nor will it get to the point of the automatic save.  In Netscape and Mozilla, users will get the first notification, then if they don't respond they will still get the second notifcation.  Then the final alert message will appear and it will do the automatic save.  Is there something in IE's Javascript implementation that causes the window.setTimeout function to behave differently?  Has anybody else ran across this "feature"?

Heres the code that I added/modified to the end of imp/templates/compose/javascript.inc


function timeoutReminder(first_reminder)
{
   if (first_reminder) {
       var msg = '<?php echo addslashes(_("Your session will expire in 5 minutes.  Click OK to reload the page and continue composing your message.")) ?>';
   } else {
       var msg = '<?php echo addslashes(_("Your session will expire in 1 minute.  Click OK to reload the page and continue composing your message.")) ?>';
   }
   if (window.confirm(msg)) {
       document.compose.actionID.value = '<?php echo REFRESH_COMPOSE ?>';
       uniqSubmit();
   }
}

function saveDraftMessage()
{
   alert("Your session has expired however your message was automatically saved in your Drafts folder.");
   document.compose.actionID.value='<?php echo SAVE_DRAFT ?>';
   uniqSubmit();
   return;
}

window.setTimeout('saveDraftMessage()', <?php echo $timeout ?> * 1000);
window.setTimeout('timeoutReminder(true)', (<?php echo $timeout ?> - 60) * 1000);
window.setTimeout('timeoutReminder(false)', (<?php echo $timeout ?> - 300) * 1000);





-- 
Jim Buitt
UNIX Server Admin.
SIUE - Office of Information Technology
Room: DH 0224
Edwardsville, IL 62026
Voice: 618-650-3447
Fax: 618-650-3599
E-Mail: jbuitt at siue.edu








More information about the imp mailing list