includes/clientside/static/misc.js
changeset 304 e2cb5f1432c8
parent 227 0eca1498a77b
parent 295 f948557af068
child 326 ab66d6d1f1f4
equal deleted inserted replaced
280:dc08c70ca550 304:e2cb5f1432c8
   390   ajaxAuthLoginInnerSetup();
   390   ajaxAuthLoginInnerSetup();
   391 }
   391 }
   392 
   392 
   393 function ajaxAuthLoginInnerSetup()
   393 function ajaxAuthLoginInnerSetup()
   394 {
   394 {
       
   395   // let's hope this gets the image cached
       
   396   var _ = new Image(32, 32); 
       
   397   _.src = scriptPath + "/images/good.gif";
       
   398   
   395   ajaxGet(makeUrlNS('Special', 'Login', 'act=getkey'), function() {
   399   ajaxGet(makeUrlNS('Special', 'Login', 'act=getkey'), function() {
   396       if ( ajax.readyState == 4 )
   400       if ( ajax.readyState == 4 )
   397       {
   401       {
   398         var response = String(ajax.responseText);
   402         var response = String(ajax.responseText);
   399         if ( response.substr(0,1) != '{' )
   403         if ( response.substr(0,1) != '{' )
   617         }
   621         }
   618         response = parseJSON(response);
   622         response = parseJSON(response);
   619         switch(response.result)
   623         switch(response.result)
   620         {
   624         {
   621           case 'success':
   625           case 'success':
       
   626             var success_win = '<div align="center" style="text-align: center;"> \
       
   627                   <p>' + $lang.get('user_login_success_short') + '</p> \
       
   628                   <p><img alt=" " src="'+scriptPath+'/images/good.gif" /></p> \
       
   629                 </div>';
       
   630             ajax_auth_mb_cache.updateContent(success_win);
   622             if ( typeof(ajax_auth_prompt_cache) == 'function' )
   631             if ( typeof(ajax_auth_prompt_cache) == 'function' )
   623             {
   632             {
   624               ajax_auth_prompt_cache(response.key);
   633               ajax_auth_prompt_cache(response.key);
   625             }
   634             }
   626             break;
   635             break;
   756  * @return bool
   765  * @return bool
   757  */
   766  */
   758 
   767 
   759 function validateEmail(email)
   768 function validateEmail(email)
   760 {
   769 {
   761   return ( email.match(/^(?:[\w\d]+\.?)+@((?:(?:[\w\d]\-?)+\.)+\w{2,4}|localhost)$/) ) ? true : false;
   770   return ( email.match(/^(?:[\w\d_-]+\.?)+@((?:(?:[\w\d_-]\-?)+\.)+\w{2,4}|localhost)$/) ) ? true : false;
   762 }
   771 }
   763 
   772