Improvements based on txm's comments.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Wed, 7 May 2008 09:53:51 +0000 (11:53 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Wed, 7 May 2008 13:30:09 +0000 (15:30 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
htdocs/javascript/xorg.js
plugins/compiler.checkpasswd.php
templates/platal/motdepasse.tpl

index cd6d253..c013d19 100644 (file)
@@ -328,24 +328,25 @@ function checkPassword(box) {
         prop = 0;
     }
     if (prop >= 60) {
-        if (prop == 100) {
-            color = "#47f";
-        } else {
-            color = "#4f4";
-        }
+        color = "#4f4";
+        bgcolor = "#050";
         ok = true;
     } else if (prop >= 40) {
         color = "#ff4";
+        bgcolor = "#750";
         ok = false;
     } else {
         color = "#f20";
+        bgcolor = "#700";
         ok = false;
     }
     $("#passwords_measure")
-        .stop()
-        .animate({ width: prop + "%",
-                   backgroundColor: color
-                 }, 750);
+           .stop()
+           .animate({ width: prop + "%",
+                      backgroundColor: color
+                    }, 750)
+           .parent().stop()
+                    .animate({ backgroundColor: bgcolor }, 750);
     var submitButton = $(":submit[@name='" + passwordprompt_submit + "']");
     if (ok) {
         submitButton.removeAttr("disabled");
index 0861e45..5c10a2a 100644 (file)
@@ -40,7 +40,7 @@ function smarty_compiler_checkpasswd($tag_attrs, &$compiler)
                 var passwordprompt_submit = ' . $submit . ';
                 $(":input[@name=' . $prompt . ']").keyup(function(event) { checkPassword(event.target); });
                 $(document).ready(function() {
-                  $(":submit[@name=' . $submit . ']").attr("disabled", "disabled");
+                  checkPassword($(":input[@name=' . $prompt . ']").get(0));
                 });
               //]]></script>
               <div>
index d26dafe..10ec28f 100644 (file)
@@ -44,7 +44,7 @@
     </tr>
     <tr>
       <td class="titre">
-        Nouveau mot de passe&nbsp;:
+        Mot de passe&nbsp;:
       </td>
       <td>
         <input type="password" size="10" maxlength="10" name="nouveau" />