includes/clientside/static/misc.js
changeset 40 723bb7acf914
parent 9 1e61232606d6
child 60 71b50f8c8f85
equal deleted inserted replaced
39:c83ff194977a 40:723bb7acf914
    82   dim = fetch_dimensions(thediv);
    82   dim = fetch_dimensions(thediv);
    83   thediv.style.display = 'none';
    83   thediv.style.display = 'none';
    84   bdim = { 'w' : getWidth(), 'h' : getHeight() };
    84   bdim = { 'w' : getWidth(), 'h' : getHeight() };
    85   so = getScrollOffset();
    85   so = getScrollOffset();
    86   
    86   
    87   left = (bdim['w'] / 2) - ( dim['w'] / 2 );
    87   var left = (bdim['w'] / 2) - ( dim['w'] / 2 );
    88   top  = (bdim['h'] / 2) - ( dim['h'] / 2 ) + so;
    88   
       
    89   var top  = (bdim['h'] / 2);
       
    90   top  = top - ( dim['h'] / 2 );
       
    91   
       
    92   top = top + so;
    89   
    93   
    90   thediv.style.top  = top  + 'px';
    94   thediv.style.top  = top  + 'px';
    91   thediv.style.left = left + 'px';
    95   thediv.style.left = left + 'px';
    92   
    96   
    93   thediv.style.display = 'block';
    97   thediv.style.display = 'block';
   311 function ajaxAuthLoginInnerSetup()
   315 function ajaxAuthLoginInnerSetup()
   312 {
   316 {
   313   ajaxGet(makeUrlNS('Special', 'Login', 'act=getkey'), function() {
   317   ajaxGet(makeUrlNS('Special', 'Login', 'act=getkey'), function() {
   314       if ( ajax.readyState == 4 )
   318       if ( ajax.readyState == 4 )
   315       {
   319       {
   316         var response = ajax.responseText;
   320         var response = String(ajax.responseText);
   317         if ( response.substr(0,1) != '{' )
   321         if ( response.substr(0,1) != '{' )
   318         {
   322         {
   319           alert('Invalid JSON response from server: ' + response);
   323           alert('Invalid JSON response from server: ' + response);
   320           return false;
   324           return false;
   321         }
   325         }
   341         </form>';
   345         </form>';
   342         ajax_auth_mb_cache.updateContent(form_html);
   346         ajax_auth_mb_cache.updateContent(form_html);
   343         $('messageBox').object.nextSibling.firstChild.tabindex = '3';
   347         $('messageBox').object.nextSibling.firstChild.tabindex = '3';
   344         $('ajaxlogin_user').object.focus();
   348         $('ajaxlogin_user').object.focus();
   345         $('ajaxlogin_pass').object.onblur = function(e) { if ( !shift ) $('messageBox').object.nextSibling.firstChild.focus(); };
   349         $('ajaxlogin_pass').object.onblur = function(e) { if ( !shift ) $('messageBox').object.nextSibling.firstChild.focus(); };
   346         $('ajaxlogin_pass').object.onkeypress = function(e) { if ( e.keyCode == 13 ) $('messageBox').object.nextSibling.firstChild.click(); };
   350         $('ajaxlogin_pass').object.onkeypress = function(e) { if ( !e && IE ) return true; if ( e.keyCode == 13 ) $('messageBox').object.nextSibling.firstChild.click(); };
   347       }
   351       }
   348     });
   352     });
   349 }
   353 }
   350 
   354 
   351 function ajaxValidateLogin()
   355 function ajaxValidateLogin()