From 5a5d0431dc41c6eb1adf10c134331d8f44c91277 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sat, 3 May 2008 23:51:14 +0200 Subject: [PATCH] More configuration. * can change the submit button name * auto-disable the submit button at startup Signed-off-by: Florent Bruneau --- htdocs/javascript/xorg.js | 4 ++-- plugins/compiler.checkpasswd.php | 14 +++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/htdocs/javascript/xorg.js b/htdocs/javascript/xorg.js index 7cb2fe3..84ace48 100644 --- a/htdocs/javascript/xorg.js +++ b/htdocs/javascript/xorg.js @@ -326,9 +326,9 @@ function checkPassword(box) { ok = (prop >= 60); $("#passwords_measure").width(prop + "%").css("background-color", ok ? "green" : "red"); if (ok) { - $(":submit").removeAttr("disabled"); + $(":submit[@name='" + passwordprompt_submit + "']").removeAttr("disabled"); } else { - $(":submit").attr("disabled", "disabled"); + $(":submit[@name='" + passwordprompt_submit + "']").attr("disabled", "disabled"); } } diff --git a/plugins/compiler.checkpasswd.php b/plugins/compiler.checkpasswd.php index dbfbc71..1f90d09 100644 --- a/plugins/compiler.checkpasswd.php +++ b/plugins/compiler.checkpasswd.php @@ -26,13 +26,21 @@ function smarty_compiler_checkpasswd($tag_attrs, &$compiler) if (!isset($width)) { $width = '250px'; } - if (!isset($id)) { - $id = "newpassword"; + if (!isset($prompt)) { + $prompt = "'nouveau'"; + } + if (!isset($submit)) { + $submit = "'submitn'"; } return '?>
-- 2.1.4