Made login window focus the controls earlier if animations are disabled.
authorDan Fuhry <dan@enanocms.org>
Sun, 25 Jul 2010 11:15:53 -0400
changeset 1264 28c82f292a52
parent 1263 eb717f5c283f
child 1265 7091cff2ca01
Made login window focus the controls earlier if animations are disabled.
includes/clientside/static/login.js
includes/paths.php
includes/sessions.php
language/english/core.json
--- a/includes/clientside/static/login.js	Tue Jul 06 00:59:06 2010 -0400
+++ b/includes/clientside/static/login.js	Sun Jul 25 11:15:53 2010 -0400
@@ -101,6 +101,13 @@
 var ajax_login_prevent_dh = ( IE && !IE_8 ) || ( is_iPhone && !is_iPhone_3 );
 
 /**
+ * Time to wait to focus the controls.
+ * @var int
+ */
+
+var AJAX_LOGIN_FOCUS_WAIT = aclDisableTransitionFX ? 0 : 750;
+
+/**
  * Performs the AJAX request to get an encryption key and from there spawns the login form.
  * @param function The function that will be called once authentication completes successfully.
  * @param int The security level to authenticate at - see http://docs.enanocms.org/Help:Appendix_B
@@ -154,6 +161,7 @@
 	logindata.showing_status = false;
 	logindata.user_level = user_level;
 	logindata.successfunc = call_on_finish;
+	logindata.start_time = (new Date()).getTime();
 	
 	// Build the "loading" window
 	ajaxLoginSetStatus(AJAX_STATUS_LOADING_KEY);
@@ -756,6 +764,8 @@
 	logindata.mb_inner.appendChild(div);
 	
 	// Post operations: field focus
+	var wait_time = AJAX_LOGIN_FOCUS_WAIT - ((new Date()).getTime() - logindata.start_time);
+	wait_time = Math.max(0, wait_time);
 	setTimeout(
 		function()
 		{
@@ -763,7 +773,7 @@
 				document.getElementById('ajax_login_field_password').focus();
 			else
 				document.getElementById('ajax_login_field_username').focus();
-		}, 750);        
+		}, wait_time);
 	
 	// Post operations: show captcha window
 	if ( show_captcha )
--- a/includes/paths.php	Tue Jul 06 00:59:06 2010 -0400
+++ b/includes/paths.php	Sun Jul 25 11:15:53 2010 -0400
@@ -15,7 +15,7 @@
  * @subpackage PathManager
  * @see http://enanocms.org/Help:API_Documentation
  */
- 
+
 class pathManager
 {
 	public $title, $pages, $custom_page, $cpage, $page, $fullpage, $page_exists, $page_id, $namespace, $nslist, $admin_tree, $wiki_mode, $page_protected, $template_cache, $external_api_page;
--- a/includes/sessions.php	Tue Jul 06 00:59:06 2010 -0400
+++ b/includes/sessions.php	Sun Jul 25 11:15:53 2010 -0400
@@ -3383,7 +3383,7 @@
 				{
 					// Action $type depends on action $deps[$i] which cannot be satisfied because $deps[$i] is out of scope.
 					// echo '<pre>' . enano_debug_print_backtrace(true) . '</pre>';
-					trigger_error("acl_check_deps: $type depends on {$deps[$i]} which is not within scope of $paths->namespace; this indicats a bug in ACL rule specification", E_USER_WARNING);
+					trigger_error("acl_check_deps: $type depends on {$deps[$i]} which is not within scope of $paths->namespace; this indicates a bug in ACL rule specification", E_USER_WARNING);
 					return false;
 				}
 				$deps = array_merge($deps, $this->acl_deps[$deps[$i]]);
--- a/language/english/core.json	Tue Jul 06 00:59:06 2010 -0400
+++ b/language/english/core.json	Sun Jul 25 11:15:53 2010 -0400
@@ -179,7 +179,7 @@
 															<p>If you\'re trying to use a plugin\'s administration page, contact the developer of the plugin. If you\'re trying to use a function that is built into Enano (not added by a plugin), then please contact the Enano development team.</p>',
 			
 			msg_general_error: 'General error in page fetcher',
-										
+			
 			autosuggest_heading: 'Page name matches',
 			autosuggest_col_name: 'Page title',
 			autosuggest_col_page_id: 'Page ID'