Commit 4397e32c authored by Gabriel Monnerat's avatar Gabriel Monnerat

- Add message to display that the creation of user is in progressing

- Refactor function to be possible handle the time of delay of message

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45477 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5a2e2b11
...@@ -136,9 +136,9 @@ function waitCreateUNGUser(paramStr){\n ...@@ -136,9 +136,9 @@ function waitCreateUNGUser(paramStr){\n
});\n });\n
}\n }\n
\n \n
function displayFormMessage(message){\n function displayFormMessage(message, delay){\n
$("td#form-message").text(message);\n $("td#form-message").text(message);\n
$("td#form-message").fadeIn(300).delay(800).fadeOut(3000);\n $("td#form-message").fadeIn(300).delay(delay).fadeOut(1000);\n
}\n }\n
\n \n
function displayLoginForm(){\n function displayLoginForm(){\n
...@@ -167,15 +167,16 @@ function displayLoginForm(){\n ...@@ -167,15 +167,16 @@ function displayLoginForm(){\n
formHash[paramList[i].name] = paramList[i].value;\n formHash[paramList[i].name] = paramList[i].value;\n
}\n }\n
if (formHash.password != formHash.confirm){\n if (formHash.password != formHash.confirm){\n
displayFormMessage("Please confirm your password correctly..");\n displayFormMessage("Please confirm your password correctly..", 3500);\n
return false;\n return false;\n
}\n }\n
$.getJSON(\'ERPSite_createUNGUser?\' + $("form#create-user").serialize(), function(response){\n $.getJSON(\'ERPSite_createUNGUser?\' + $("form#create-user").serialize(), function(response){\n
if (response == null){\n if (response == null){\n
displayFormMessage(formHash.login_name + " is not available, please try another...");\n displayFormMessage(formHash.login_name + " is not available, please try another...", 3500);\n
return false;\n return false;\n
}\n }\n
else {\n else {\n
displayFormMessage("The user " + formHash.login_name + " will be created in few seconds...", 8000);\n
var paramStr = "reference=" + formHash.login_name;\n var paramStr = "reference=" + formHash.login_name;\n
setTimeout(waitCreateUNGUser(paramStr), 2000); \n setTimeout(waitCreateUNGUser(paramStr), 2000); \n
}\n }\n
......
356 357
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment