Some changes to AJAX login interface, made it a bit more compact with less language, with some Enanium specific modifications to the same.
authorDan
Tue, 04 Aug 2009 17:32:09 -0400
changeset 1075 f4b89aa4226d
parent 1074 1a4f13626f76
child 1076 9c364fded738
Some changes to AJAX login interface, made it a bit more compact with less language, with some Enanium specific modifications to the same.
includes/clientside/static/login.js
language/english/user.json
themes/enanium/css/babygrand.css
--- a/includes/clientside/static/login.js	Tue Aug 04 15:06:50 2009 -0400
+++ b/includes/clientside/static/login.js	Tue Aug 04 17:32:09 2009 -0400
@@ -620,12 +620,16 @@
   // Done building the main part of the form
   form.appendChild(table);
   
+  // Checkbox container
+  var boxen = document.createElement('div');
+  boxen.style.textAlign = 'center';
+  boxen.style.padding = '7px 0';
+  
   // Field: remember login
   if ( logindata.user_level <= USER_LEVEL_MEMBER )
   {
     var lbl_remember = document.createElement('label');
     lbl_remember.style.fontSize = 'smaller';
-    lbl_remember.style.display = 'block';
     lbl_remember.style.textAlign = 'center';
     
     // figure out what text to put in the "remember me" checkbox
@@ -670,18 +674,24 @@
     lbl_remember.appendChild(check_remember);
     lbl_remember.innerHTML += ' ' + txt_remember;
     
-    form.appendChild(lbl_remember);
+    boxen.appendChild(lbl_remember);
   }
   
+  var bullet = document.createElement('span');
+  bullet.innerHTML = '&nbsp;';
+  bullet.style.fontSize = '12pt';
+  bullet.style.borderRight = '1px solid #aaa';
+  bullet.style.margin = '0 6px 0 4px';
+  
   // Field: enable Diffie Hellman
   if ( ajax_login_prevent_dh )
   {
+    boxen.appendChild(bullet);
     var lbl_dh = document.createElement('span');
     lbl_dh.style.fontSize = 'smaller';
-    lbl_dh.style.display = 'block';
     lbl_dh.style.textAlign = 'center';
     lbl_dh.innerHTML = $lang.get('user_login_ajax_check_dh_ie');
-    form.appendChild(lbl_dh);
+    boxen.appendChild(lbl_dh);
   }
   else if ( !data.allow_diffiehellman )
   {
@@ -689,13 +699,14 @@
     var check_dh = document.createElement('input');
     check_dh.type = 'hidden';
     check_dh.id = 'ajax_login_field_dh';
-    form.appendChild(check_dh);
+    boxen.appendChild(check_dh);
   }
   else
   {
+    boxen.appendChild(bullet);
+    
     var lbl_dh = document.createElement('label');
     lbl_dh.style.fontSize = 'smaller';
-    lbl_dh.style.display = 'block';
     lbl_dh.style.textAlign = 'center';
     var check_dh = document.createElement('input');
     check_dh.type = 'checkbox';
@@ -706,9 +717,11 @@
     check_dh.id = 'ajax_login_field_dh';
     lbl_dh.appendChild(check_dh);
     lbl_dh.innerHTML += ' ' + $lang.get('user_login_ajax_check_dh');
-    form.appendChild(lbl_dh);
+    boxen.appendChild(lbl_dh);
   }
   
+  form.appendChild(boxen);
+  
   if ( IE )
   {
     div.innerHTML += form.outerHTML;
@@ -722,17 +735,16 @@
   // (only displayed in login, not in re-auth)
   if ( logindata.user_level == USER_LEVEL_MEMBER )
   {
-    form.style.marginBottom = '10px';
     var links = document.createElement('small');
     links.style.display = 'block';
     links.style.textAlign = 'center';
     links.innerHTML = '';
     if ( !show_captcha )
-      links.innerHTML += $lang.get('user_login_ajax_link_fullform', { link_full_form: makeUrlNS('Special', 'Login/' + title) }) + '<br />';
+      links.innerHTML += $lang.get('user_login_ajax_link_fullform', { link_full_form: makeUrlNS('Special', 'Login/' + title) }) + ' &bull; ';
     // Always shown
-    links.innerHTML += $lang.get('user_login_ajax_link_forgotpass', { forgotpass_link: makeUrlNS('Special', 'PasswordReset') }) + '<br />';
+    links.innerHTML += $lang.get('user_login_ajax_link_forgotpass', { forgotpass_link: makeUrlNS('Special', 'PasswordReset') }) + ' &bull; ';
     if ( !show_captcha )
-      links.innerHTML += $lang.get('user_login_createaccount_blurb', { reg_link: makeUrlNS('Special', 'Register') });
+      links.innerHTML += $lang.get('user_login_ajax_createaccount_blurb', { reg_link: makeUrlNS('Special', 'Register') });
     div.appendChild(links);
   }
   
--- a/language/english/user.json	Tue Aug 04 15:06:50 2009 -0400
+++ b/language/english/user.json	Tue Aug 04 17:32:09 2009 -0400
@@ -66,18 +66,19 @@
       login_ajax_prompt_title: 'Please enter your username and password to continue.',
       login_ajax_prompt_title_elev: 'You are requesting a sensitive operation.',
       login_ajax_prompt_body_elev: 'Please re-enter your login details to verify your identity.',
-      login_ajax_link_fullform: 'Trouble logging in? Try the <a href="%link_full_form%">full login form</a>.',
+      login_ajax_link_fullform: '<a href="%link_full_form%">HTML login</a>',
       login_ajax_link_fullform_dh: 'Don\'t stop this process even if your browser asks you to. If this takes more than 10 seconds, you might want to try the <a href="%link_full_form%">full login form</a>.',
-      login_ajax_link_forgotpass: 'Did you <a href="%forgotpass_link%">forget your password</a>?',
+      login_ajax_link_forgotpass: '<a href="%forgotpass_link%">Forgot password</a>',
+      login_ajax_createaccount_blurb: '<a href="%reg_link%">Register</a>',
       login_ajax_loggingin: 'Logging in...',
       login_ajax_msg_used_temp_pass: '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?',
-      login_ajax_check_dh: 'Enable strong encryption during logon? <a href="http://docs.enanocms.org/Help:Appendix_B#dh" onclick="window.open(this.href); return false;">Learn more</a>',
-      login_ajax_check_dh_ie: 'Use a standards-compliant browser to help protect your password. <a href="http://docs.enanocms.org/Help:Appendix_B#dh" onclick="window.open(this.href); return false;">Learn more</a>',
-      login_ajax_check_remember: 'Keep me logged in on this computer for %session_length% %length_units% unless I log out',
-      login_ajax_check_remember_infinite: 'Keep me logged in on this computer until I log out',
+      login_ajax_check_remember: 'Stay logged in (%session_length% %length_units%)',
+      login_ajax_check_remember_infinite: 'Stay logged in',
+      login_ajax_check_dh: 'Encrypt my details (<a class="no_external" href="http://docs.enanocms.org/Help:Appendix_B#dh" onclick="window.open(this.href); return false;">What?</a>)',
+      login_ajax_check_dh_ie: 'Browser doesn\'t support encryption (<a class="no_external" href="http://docs.enanocms.org/Help:Appendix_B#dh" onclick="window.open(this.href); return false;">What?</a>)',
       login_ajax_err_crypto: 'Encryption failed.',
-      login_ajax_err_crypto_details: 'Details available on console.',
-      login_ajax_err_crypto_link: 'Use full login form',
+      login_ajax_err_crypto_details: 'If you have a Javascript debugger, details are available on the console.',
+      login_ajax_err_crypto_link: 'Use HTML login interface',
       
       err_login_generic_title: 'There was an error in the login process',
       err_key_not_found: 'Enano couldn\'t look up the encryption key used to encrypt your password. This most often happens if a cache rotation occurred during your login attempt, or if you refreshed the login page.',
--- a/themes/enanium/css/babygrand.css	Tue Aug 04 15:06:50 2009 -0400
+++ b/themes/enanium/css/babygrand.css	Tue Aug 04 17:32:09 2009 -0400
@@ -367,6 +367,11 @@
   color: #6488ad;
 }
 
+div.content a.no_external, div#messageBox a.no_external {
+  background-image: none;
+  padding-right: 0px;
+}
+
 /* Form controls */
 input {
   border: 1px solid #353535;
@@ -377,6 +382,17 @@
   padding: 2px;
 }
 
+div#messageBox input[type ^="text"], div#messageBox input[type ^="password"] {
+  background-color: #f4f4f4;
+  color: #202020;
+  border: 1px solid #aaa;
+}
+
+div#messageBox input[type ^="text"]:focus, div#messageBox input[type ^="password"]:focus {
+  background-color: #fff;
+  border-color: #888;
+}
+
 /* Footer */
 div#footer {
   margin: 7px 0 0 0;