includes/clientside/static/misc.js
changeset 172 1bc7e849a264
parent 171 1465f48faba0
child 188 63fddf1335d9
equal deleted inserted replaced
171:1465f48faba0 172:1bc7e849a264
   335           return false;
   335           return false;
   336         }
   336         }
   337         response = parseJSON(response);
   337         response = parseJSON(response);
   338         var level = ajax_auth_level_cache;
   338         var level = ajax_auth_level_cache;
   339         var form_html = '';
   339         var form_html = '';
       
   340         var shown_error = false;
   340         if ( ajax_auth_error_string )
   341         if ( ajax_auth_error_string )
   341         {
   342         {
   342           form_html += '<span style="color: #D84308;">' + ajax_auth_error_string + '</span><br /><br />';
   343           shown_error = true;
       
   344           form_html += '<div class="error-box-mini" id="ajax_auth_error">' + ajax_auth_error_string + '</div>';
   343           ajax_auth_error_string = false;
   345           ajax_auth_error_string = false;
   344         }
   346         }
   345         else if ( level > USER_LEVEL_MEMBER )
   347         else if ( level > USER_LEVEL_MEMBER )
   346         {
   348         {
   347           form_html += 'Please re-enter your login details, to verify your identity.<br /><br />';
   349           form_html += 'Please re-enter your login details, to verify your identity.<br /><br />';
   354             <tr> \
   356             <tr> \
   355               <td>Password:</td><td><input tabindex="2" id="ajaxlogin_pass" type="password" size="25" /> \
   357               <td>Password:</td><td><input tabindex="2" id="ajaxlogin_pass" type="password" size="25" /> \
   356             </tr> \
   358             </tr> \
   357             <tr> \
   359             <tr> \
   358               <td colspan="2" style="text-align: center;"> \
   360               <td colspan="2" style="text-align: center;"> \
   359                 <br /><small>Trouble logging in? Try the <a href="'+makeUrlNS('Special', 'Login/' + title)+'">full login form</a>.<br />';
   361                 <br /><small>Trouble logging in? Try the <a href="'+makeUrlNS('Special', 'Login/' + title, 'level=' + level)+'">full login form</a>.<br />';
   360        if ( level <= USER_LEVEL_MEMBER )
   362        if ( level <= USER_LEVEL_MEMBER )
   361        {
   363        {
   362          form_html += ' \
   364          form_html += ' \
   363                 Did you <a href="'+makeUrlNS('Special', 'PasswordReset')+'">forget your password</a>?<br /> \
   365                 Did you <a href="'+makeUrlNS('Special', 'PasswordReset')+'">forget your password</a>?<br /> \
   364                 Maybe you need to <a href="'+makeUrlNS('Special', 'Register')+'">create an account</a>.</small>';
   366                 Maybe you need to <a href="'+makeUrlNS('Special', 'Register')+'">create an account</a>.</small>';
   381         {
   383         {
   382           $('ajaxlogin_user').object.focus();
   384           $('ajaxlogin_user').object.focus();
   383         }
   385         }
   384         $('ajaxlogin_pass').object.onblur = function(e) { if ( !shift ) $('messageBox').object.nextSibling.firstChild.focus(); };
   386         $('ajaxlogin_pass').object.onblur = function(e) { if ( !shift ) $('messageBox').object.nextSibling.firstChild.focus(); };
   385         $('ajaxlogin_pass').object.onkeypress = function(e) { if ( !e && IE ) return true; if ( e.keyCode == 13 ) $('messageBox').object.nextSibling.firstChild.click(); };
   387         $('ajaxlogin_pass').object.onkeypress = function(e) { if ( !e && IE ) return true; if ( e.keyCode == 13 ) $('messageBox').object.nextSibling.firstChild.click(); };
       
   388         /*
       
   389         ## This causes the background image to disappear under Fx 2
       
   390         if ( shown_error )
       
   391         {
       
   392           // fade to #FFF4F4
       
   393           var fader = new Spry.Effect.Highlight('ajax_auth_error', {duration: 1000, from: '#FFF4F4', to: '#805600', restoreColor: '#805600', finish: function()
       
   394               {
       
   395                 var fader = new Spry.Effect.Highlight('ajax_auth_error', {duration: 3000, from: '#805600', to: '#FFF4F4', restoreColor: '#FFF4F4'});
       
   396                 fader.start();
       
   397           }});
       
   398           fader.start();
       
   399         }
       
   400         */
   386       }
   401       }
   387     });
   402     });
   388 }
   403 }
   389 
   404 
   390 function ajaxValidateLogin()
   405 function ajaxValidateLogin()