From: Florent Bruneau Date: Wed, 3 Sep 2008 19:09:05 +0000 (+0200) Subject: Change the text of the submit button when the password is not valid. X-Git-Tag: xorg/0.9.17~15 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=7b7d097083ea303980311887eedd6e65d9e30880;hp=387bc2c956ac6190635104732d091b6584112e14;p=platal.git Change the text of the submit button when the password is not valid. Signed-off-by: Florent Bruneau --- diff --git a/htdocs/javascript/xorg.js b/htdocs/javascript/xorg.js index f82cc9f..e8b7952 100644 --- a/htdocs/javascript/xorg.js +++ b/htdocs/javascript/xorg.js @@ -299,7 +299,7 @@ function getType(char) { } } -function checkPassword(box) { +function checkPassword(box, okLabel) { var prev = 0; var prop = 0; var pass = box.value; @@ -349,8 +349,10 @@ function checkPassword(box) { .animate({ backgroundColor: bgcolor }, 750); var submitButton = $(":submit[@name='" + passwordprompt_submit + "']"); if (ok && pass.length >= 6) { + submitButton.attr("value", okLabel); submitButton.removeAttr("disabled"); } else { + submitButton.attr("value", "Mot de passe trop faible"); submitButton.attr("disabled", "disabled"); } } diff --git a/plugins/compiler.checkpasswd.php b/plugins/compiler.checkpasswd.php index 5c10a2a..599aedc 100644 --- a/plugins/compiler.checkpasswd.php +++ b/plugins/compiler.checkpasswd.php @@ -32,15 +32,18 @@ function smarty_compiler_checkpasswd($tag_attrs, &$compiler) if (!isset($submit)) { $submit = "'submitn'"; } + if (!isset($text)) { + $text = "'Changer'"; + } return '?>
diff --git a/templates/googleapps/index.tpl b/templates/googleapps/index.tpl index 9292be0..061cc0e 100644 --- a/templates/googleapps/index.tpl +++ b/templates/googleapps/index.tpl @@ -111,7 +111,7 @@ Sécurité - {checkpasswd prompt="nouveau" submit="create_account"} + {checkpasswd prompt="nouveau" submit="create_account" text="Créer mon compte !"} @@ -380,7 +380,7 @@ Sécurité - {checkpasswd prompt="nouveau" submit="create_account"} + {checkpasswd prompt="nouveau" submit="create_account" text="Créer mon compte !"} diff --git a/templates/platal/acces_smtp.tpl b/templates/platal/acces_smtp.tpl index 7e21a31..995d133 100644 --- a/templates/platal/acces_smtp.tpl +++ b/templates/platal/acces_smtp.tpl @@ -82,7 +82,7 @@ Sécurité - {checkpasswd prompt="smtppass1" submit="valid"} + {checkpasswd prompt="smtppass1" submit="valid" text="Valider"}