[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squirrelmail-cvs
Subject:    [SM-CVS] SF.net SVN: squirrelmail: [12909]
From:       pdontthink () users ! sourceforge ! net
Date:       2008-01-30 20:08:24
Message-ID: E1JKJEN-0008O5-VW () sc8-pr-svn2 ! sourceforge ! net
[Download RAW message or body]

Revision: 12909
          http://squirrelmail.svn.sourceforge.net/squirrelmail/?rev=12909&view=rev
Author:   pdontthink
Date:     2008-01-30 12:08:23 -0800 (Wed, 30 Jan 2008)

Log Message:
-----------
Add "alreadyFocused" functionality to login page

Modified Paths:
--------------
    branches/SM-1_4-STABLE/squirrelmail/functions/forms.php
    branches/SM-1_4-STABLE/squirrelmail/src/login.php

Modified: branches/SM-1_4-STABLE/squirrelmail/functions/forms.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/functions/forms.php	2008-01-30 08:42:31 UTC \
                (rev 12908)
+++ branches/SM-1_4-STABLE/squirrelmail/functions/forms.php	2008-01-30 20:08:23 UTC \
(rev 12909) @@ -31,8 +31,8 @@
 /**
  * Password input field
  */
-function addPwField($name , $value = null) {
-    return addInputField('password', $name , $value);
+function addPwField($name , $value = null, $extra_attributes='') {
+    return addInputField('password', $name , $value, $extra_attributes);
 }
 
 
@@ -62,17 +62,16 @@
 /**
  * An input textbox.
  */
-function addInput($name, $value = '', $size = 0, $maxlength = 0) {
+function addInput($name, $value = '', $size = 0, $maxlength = 0, \
$extra_attributes='') {  
-    $attr = '';
     if ($size) {
-        $attr.= ' size="'.(int)$size.'"';
+        $extra_attributes .= ' size="'.(int)$size.'"';
     }
     if ($maxlength) {
-        $attr.= ' maxlength="'.(int)$maxlength .'"';
+        $extra_attributes .= ' maxlength="'.(int)$maxlength .'"';
     }
 
-    return addInputField('text', $name, $value, $attr);
+    return addInputField('text', $name, $value, $extra_attributes);
 }
 
 
@@ -148,4 +147,4 @@
         $enctype . $name . $charset . ">\n";
 }
 
-?>
\ No newline at end of file
+?>

Modified: branches/SM-1_4-STABLE/squirrelmail/src/login.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/src/login.php	2008-01-30 08:42:31 UTC (rev \
                12908)
+++ branches/SM-1_4-STABLE/squirrelmail/src/login.php	2008-01-30 20:08:23 UTC (rev \
12909) @@ -122,8 +122,10 @@
 
 $header = "<script language=\"JavaScript\" type=\"text/javascript\">\n" .
           "<!--\n".
+          "  var alreadyFocused = false;\n".
           "  function squirrelmail_loginpage_onload() {\n".
           "    document.forms[0].js_autodetect_results.value = '" . SMPREF_JS_ON . \
"';\n". +          "    if (alreadyFocused) return;\n".
           "    var textElements = 0;\n".
           "    for (i = 0; i < document.forms[0].elements.length; i++) {\n".
           "      if (document.forms[0].elements[i].type == \"text\" || \
document.forms[0].elements[i].type == \"password\") {\n". @@ -210,7 +212,7 @@
                                     _("Name:") ,
                                 'right', '', 'width="30%"' ) .
                                 html_tag( 'td',
-				    addInput($username_form_name, $loginname_value),
+				    addInput($username_form_name, $loginname_value, 0, 0, ' \
onfocus="alreadyFocused=true;"'),  'left', '', 'width="70%"' )
                                 ) . "\n" .
                             html_tag( 'tr',
@@ -218,7 +220,7 @@
                                     _("Password:") ,
                                 'right', '', 'width="30%"' ) .
                                 html_tag( 'td',
-				    addPwField($password_form_name).
+				    addPwField($password_form_name, null, ' onfocus="alreadyFocused=true;"').
 				    addHidden('js_autodetect_results', SMPREF_JS_OFF).
                     $mailtofield . 
 				    addHidden('just_logged_in', '1'),


This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
-----
squirrelmail-cvs mailing list
List address: squirrelmail-cvs@lists.sourceforge.net
List info (subscribe/unsubscribe/change options): \
                https://lists.sourceforge.net/lists/listinfo/squirrelmail-cvs
Repository: http://squirrelmail.org/svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic