From 006819700381ba35f121b83b1c55828dd7b4d66e Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Wed, 7 May 2008 11:53:51 +0200 Subject: [PATCH] Improvements based on txm's comments. Signed-off-by: Florent Bruneau --- htdocs/javascript/xorg.js | 19 ++++++++++--------- plugins/compiler.checkpasswd.php | 2 +- templates/platal/motdepasse.tpl | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/htdocs/javascript/xorg.js b/htdocs/javascript/xorg.js index cd6d253..c013d19 100644 --- a/htdocs/javascript/xorg.js +++ b/htdocs/javascript/xorg.js @@ -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"); diff --git a/plugins/compiler.checkpasswd.php b/plugins/compiler.checkpasswd.php index 0861e45..5c10a2a 100644 --- a/plugins/compiler.checkpasswd.php +++ b/plugins/compiler.checkpasswd.php @@ -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)); }); //]]>
diff --git a/templates/platal/motdepasse.tpl b/templates/platal/motdepasse.tpl index d26dafe..10ec28f 100644 --- a/templates/platal/motdepasse.tpl +++ b/templates/platal/motdepasse.tpl @@ -44,7 +44,7 @@ - Nouveau mot de passe : + Mot de passe : -- 2.1.4