mirror of
https://github.com/google/nomulus.git
synced 2025-06-20 19:30:47 +02:00
Allow users the option of seeing their registry lock password (#663)
* Allow users the option of seeing their registry lock password Only when entering it for the first time, of course.
This commit is contained in:
parent
683af3fa6e
commit
57d1d1697a
7 changed files with 47 additions and 3 deletions
|
@ -106,6 +106,7 @@ registry.registrar.ContactSettings.prototype.renderItem = function(rspObj) {
|
|||
registryLockAllowedForRegistrar: rspObj.registryLockAllowed
|
||||
});
|
||||
this.setupAppbar();
|
||||
this.setupPasswordElemIfNecessary_(targetContactNdx);
|
||||
} else {
|
||||
var contactsByType = {};
|
||||
for (var c in contacts) {
|
||||
|
@ -251,3 +252,26 @@ registry.registrar.ContactSettings.prototype.handleDeleteResponse =
|
|||
}
|
||||
return rsp;
|
||||
};
|
||||
|
||||
// Show or hide the password based on what the user chooses
|
||||
registry.registrar.ContactSettings.prototype.setupPasswordElemIfNecessary_ =
|
||||
function(contactIndex) {
|
||||
var showOrHidePasswordButton = goog.dom.getElement('showOrHideRegistryLockPassword')
|
||||
var showOrHidePassword = function() {
|
||||
var inputElement = goog.dom.getRequiredElement(
|
||||
'contacts[' + contactIndex + '].registryLockPassword')
|
||||
var type = inputElement.getAttribute('type')
|
||||
if (type === 'password') {
|
||||
showOrHidePasswordButton.text = 'Hide password';
|
||||
inputElement.setAttribute('type', 'text');
|
||||
} else {
|
||||
showOrHidePasswordButton.text = 'Show password';
|
||||
inputElement.setAttribute('type', 'password');
|
||||
}
|
||||
};
|
||||
|
||||
if (showOrHidePasswordButton != null) {
|
||||
goog.events.listen(showOrHidePasswordButton,
|
||||
goog.events.EventType.CLICK, showOrHidePassword, false, this);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue