Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ For more information on contributing to this repository visit [Contributing to a
* *Forgot password microflow* - Microflow being triggered in case of 'forgot password' onclick
* *Focus username input field* - Move focus to username field when the form is showed (only use this if it is not done automatically)
* *Login Failure Text* - Warning message to show when login fails twice
* *Auto complete* - Enables/disables autocomplete functionality on username and password input field

### Mobile
* *Auto capitalize* - Enables/disables auto capitalize functionality on username input field for mobile devices
Expand Down
5 changes: 5 additions & 0 deletions src/LoginForm/LoginForm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@
<category>Behavior</category>
<description>When the login fails, clear the username field</description>
</property>
<property key="autoComplete" type="boolean" defaultValue="false">
<caption>Auto-complete</caption>
<category>Behavior</category>
<description>Enables/disables auto-complete functionality on username and pasword input fields</description>
</property>
<property key="showPasswordView" type="boolean" defaultValue="false">
<caption>Show/Mask Password Toggle</caption>
<category>Password</category>
Expand Down
5 changes: 5 additions & 0 deletions src/LoginForm/widget/LoginForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ define([
dofocus: false,
showLoginFailureWarning: false,
loginFailureText: "Your account will be blocked for 5 minutes if login with the same username fails thrice!",
autoComplete: false,
/**
* Password
*/
Expand Down Expand Up @@ -178,6 +179,10 @@ define([
if (this.autoCapitalize && this.convertCase !== "none") {
domAttr.set(this.usernameInputNode, "autocapitalize", "on");
}
if (this.autoComplete) {
domAttr.set(this.usernameInputNode, "autocomplete", "on");
domAttr.set(this.passwordInputNode, "autocomplete", "on");
}

if (this.convertCase === "toLowerCase") {
domStyle.set(this.usernameInputNode, "text-transform", "lowercase");
Expand Down
4 changes: 2 additions & 2 deletions src/LoginForm/widget/templates/LoginForm.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
</div>
<div class="form-group">
<label data-dojo-attach-point="usernameLabelNode" class="hidden">${usernameLabel}</label>
<input type="text" class="form-control username" autocapitalize="off" autocorrect="off" data-dojo-attach-point="usernameInputNode" autocomplete="on" name="username" placeholder="${userexample}" />
<input type="text" class="form-control username" autocapitalize="off" autocorrect="off" data-dojo-attach-point="usernameInputNode" autocomplete="off" name="username" placeholder="${userexample}" />
</div>
<div class="form-group" data-dojo-attach-point="passwordContainerNode">
<div class="input-group" data-dojo-attach-point="passwordInputGroupNode">
<label data-dojo-attach-point="passwordLabelNode" class="hidden">${passwordLabel}</label>
<input type="password" data-dojo-attach-point="passwordInputNode" class="form-control password" autocomplete="on" name="password" placeholder="${passexample}">
<input type="password" data-dojo-attach-point="passwordInputNode" class="form-control password" autocomplete="off" name="password" placeholder="${passexample}">
<div data-dojo-attach-point="passwordVisibilityToggleButtonNode" class="input-group-addon toggle"></div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
</div>
<div class="form-group">
<label data-dojo-attach-point="usernameLabelNode" class="hidden">${usernameLabel}</label>
<input type="text" class="form-control username" autocapitalize="off" autocorrect="off" data-dojo-attach-point="usernameInputNode" autocomplete="on" name="username" placeholder="${userexample}" />
<input type="text" class="form-control username" autocapitalize="off" autocorrect="off" data-dojo-attach-point="usernameInputNode" autocomplete="off" name="username" placeholder="${userexample}" />
</div>
<div class="form-group" data-dojo-attach-point="passwordContainerNode">
<label data-dojo-attach-point="passwordLabelNode" class="hidden">${passwordLabel}</label>
<input type="password" data-dojo-attach-point="passwordInputNode" class="form-control password" autocomplete="on" name="password" placeholder="${passexample}" />
<input type="password" data-dojo-attach-point="passwordInputNode" class="form-control password" autocomplete="off" name="password" placeholder="${passexample}" />
</div>
<input type="submit" class="btn btn-default submit" data-dojo-attach-point="submitButtonNode" value="${logintext}" />
<span class="forgotPwd" data-dojo-attach-point="forgotPasswordNode">
Expand Down