added checkbox and corrected fall back for the other labels

This commit is contained in:
Rene Zubcevic 2019-03-30 12:10:19 +01:00 committed by Nanne Baars
parent 2b2e267594
commit e57c9d05b6
4 changed files with 22 additions and 3 deletions

View File

@ -131,6 +131,7 @@ public class MvcConfiguration extends WebMvcConfigurerAdapter {
PluginMessages pluginMessages = new PluginMessages(messages, language);
pluginMessages.setDefaultEncoding("UTF-8");
pluginMessages.setBasenames("i18n/WebGoatLabels");
pluginMessages.setFallbackToSystemLocale(false);
return pluginMessages;
}

View File

@ -26,7 +26,8 @@
<table>
<tr>
<td><label>Password</label></td>
<td><input name="password" value="" type="password" placeholder="Enter a secure password"/></td>
<td><input id="myInput" name="password" value="" type="password" placeholder="Enter a secure password"/></td>
<td><input type="checkbox" onclick="javascript:myFunction()"/>Show password</td>
</tr>
<tr>
<td><button type="SUBMIT">Submit</button></td>
@ -46,4 +47,16 @@
<div class="adoc-content" th:replace="doc:SecurePasswords_4.adoc"></div>
</div>
<script>
function myFunction() {
var x = document.getElementById("myInput");
if (x.type === "password") {
x.type = "text";
} else {
x.type = "password";
}
}
</script>
</html>

View File

@ -1,3 +1,4 @@
secure-passwords.title=Secure Passwords
securepassword-success=You have succeded! The password is secure enough.
securepassword-failed=You have failed! Try to enter a secure password.
securepassword-success=You have succeeded! The password is secure enough.
securepassword-failed=You have failed! Try to enter a secure password.
show-password=Show Password

View File

@ -0,0 +1,4 @@
secure-passwords.title=Veilige wachtwoorden
securepassword-success=Het is gelukt. Het wachtwoord is sterk genoeg.
securepassword-failed=Helaas, probeer een sterker wachtwoord!
show-password=Toon wachtwoord