includes/clientside/static/misc.js
changeset 335 67bd3121a12e
parent 334 c72b545f1304
child 340 993fb077944f
equal deleted inserted replaced
334:c72b545f1304 335:67bd3121a12e
   121 }
   121 }
   122 
   122 
   123 function disableUnload(message)
   123 function disableUnload(message)
   124 {
   124 {
   125   if(typeof message != 'string') message = 'You may want to save your changes first.';
   125   if(typeof message != 'string') message = 'You may want to save your changes first.';
   126   var body = document.getElementsByTagName('body');
   126   window._unloadmsg = message;
   127   body = body[0];
   127   window.onbeforeunload = function(e)
   128   body.onbeforeunload='return unescape(\''+escape(message)+'\')';
   128   {
       
   129     if ( !e )
       
   130       e = window.event;
       
   131     e.returnValue = window._unloadmsg;
       
   132   }
   129 }
   133 }
   130 
   134 
   131 function enableUnload()
   135 function enableUnload()
   132 {
   136 {
   133   var body = document.getElementsByTagName('body');
   137   window._unloadmsg = null;
   134   body = body[0];
   138   window.onbeforeunload = null;
   135   body.onbeforeunload = null;
       
   136 }
   139 }
   137 
   140 
   138 /**
   141 /**
   139  * Gets the highest z-index of all divs in the document
   142  * Gets the highest z-index of all divs in the document
   140  * @return integer
   143  * @return integer
   654             {
   657             {
   655               ajax_auth_prompt_cache(response.key);
   658               ajax_auth_prompt_cache(response.key);
   656             }
   659             }
   657             break;
   660             break;
   658           case 'success_reset':
   661           case 'success_reset':
   659             var conf = confirm('You have logged in using a temporary password. Before you can log in, you must finish resetting your password. Do you want to reset your real password now?');
   662             var conf = confirm($lang.get('user_login_ajax_msg_used_temp_pass'));
   660             if ( conf )
   663             if ( conf )
   661             {
   664             {
   662               var url = makeUrlNS('Special', 'PasswordReset/stage2/' + response.user_id + '/' + response.temppass);
   665               var url = makeUrlNS('Special', 'PasswordReset/stage2/' + response.user_id + '/' + response.temppass);
   663               window.location = url;
   666               window.location = url;
   664             }
   667             }