📄 passwordstrengthextenderbehavior.js
字号:
if (this._styleArray.length > 0 && this._styleArray.length != this._levelArray.length)
{
Sys.Debug.assert(false, AjaxControlToolkit.Resources.PasswordStrength_InvalidStrengthDescriptionStyles);
}
// Check to see that there were enough text descriptions specified and that it didn't exceed our maximum
if (this._levelArray.length < this._MIN_TXT_LEVEL_COUNT || this._levelArray > this._MAX_TXT_LEVEL_COUNT)
{
Sys.Debug.assert(false, AjaxControlToolkit.Resources.PasswordStrength_InvalidStrengthDescriptions);
// Do we need to do more here? Should we jsut be relying on the server side validation to pick up any inconsistencies?
}
// Everything is ok
},
_onKeyPress : function() {
this._showStrength();
},
_onBlur : function() {
if (this._strengthIndicator == AjaxControlToolkit.StrengthIndicatorTypes.BarIndicator)
{
$common.setVisible(this._barOuterDiv, false);
$common.setVisible(this._barInnerDiv, false);
} else
{
$common.setVisible(this._displayDiv, false);
}
},
_onHelpClick : function() {
if (this._helpText == '')
alert(AjaxControlToolkit.Resources.PasswordStrength_Satisfied);
else
alert(this._helpText);
},
dispose : function() {
var e = this.get_element();
// Detach events
if (this._keyPressHandler) {
$removeHandler(e,'keyup', this._keyPressHandler);
this._keyPressHandler = null;
}
if (this._blurHandler) {
$removeHandler(e,'blur', this._blurHandler);
this._blurHandler = null;
}
if (this._helpClickHandler) {
$removeHandler(this._helpDiv, 'click', this._helpClickHandler);
this._helpClickHandler = null;
}
// Clear text display if applicable
if(this._displayDiv)
$common.setVisible(this._displayDiv, false);
// Clear Bar display if applicable
if (this._barOuterDiv)
$common.setVisible(this._barOuterDiv,false);
if (this._barInnerDiv)
$common.setVisible(this._barInnerDiv, false);
if (this._helpHandleCssClass != '' && this._helpDiv)
$common.setVisible(this._helpDiv ,false);
AjaxControlToolkit.PasswordStrengthExtenderBehavior.callBaseMethod(this, 'dispose');
},
get_PreferredPasswordLength : function() {
return this._preferredPasswordLength;
},
set_PreferredPasswordLength : function(value) {
if (this._preferredPasswordLength != value) {
this._preferredPasswordLength = value;
this.raisePropertyChanged('PreferredPasswordLength');
}
},
get_MinimumNumericCharacters : function() {
return this._minimumNumericCharacters;
},
set_MinimumNumericCharacters : function(value) {
if (this._minimumNumericCharacters != value) {
this._minimumNumericCharacters = value;
this.raisePropertyChanged('MinimumNumericCharacters');
}
},
get_MinimumSymbolCharacters : function() {
return this._minimumSymbolCharacters;
},
set_MinimumSymbolCharacters : function(value) {
if (this._minimumSymbolCharacters != value) {
this._minimumSymbolCharacters = value;
this.raisePropertyChanged('MinimumSymbolCharacters');
}
},
get_RequiresUpperAndLowerCaseCharacters : function() {
return this._requiresUpperAndLowerCaseCharacters;
},
set_RequiresUpperAndLowerCaseCharacters : function(value) {
if (this._requiresUpperAndLowerCaseCharacters != value) {
this._requiresUpperAndLowerCaseCharacters = value;
this.raisePropertyChanged('RequiresUpperAndLowerCaseCharacters');
}
},
get_TextCssClass : function() {
return this._txtPwdStrengthCssClass;
},
set_TextCssClass : function(value) {
if (this._txtPwdStrengthCssClass != value) {
this._txtPwdStrengthCssClass = value;
this.raisePropertyChanged('TextCssClass');
}
},
get_BarBorderCssClass : function() {
return this._barBorderCssClass;
},
set_BarBorderCssClass : function(value) {
if (this._barBorderCssClass != value) {
this._barBorderCssClass = value;
this.raisePropertyChanged('BarBorderCssClass');
}
},
get_BarIndicatorCssClass : function() {
return this._barIndicatorCssClass;
},
set_BarIndicatorCssClass : function(value) {
if (this._barIndicatorCssClass != value) {
this._barIndicatorCssClass = value;
this.raisePropertyChanged('BarIndicatorCssClass');
}
},
get_DisplayPosition : function() {
return this._displayPosition;
},
set_DisplayPosition : function(value) {
if (this._displayPosition != value) {
this._displayPosition = value;
this.raisePropertyChanged('DisplayPosition');
}
},
get_PrefixText : function() {
return this._prefixText;
},
set_PrefixText : function(value) {
if (this._prefixText != value) {
this._prefixText = value;
this.raisePropertyChanged('PrefixText');
}
},
get_StrengthIndicatorType : function() {
return this._strengthIndicator;
},
set_StrengthIndicatorType : function(value) {
if (this._strengthIndicator != value) {
this._strengthIndicator = value;
this.raisePropertyChanged('StrengthIndicatorType');
}
},
get_TextStrengthDescriptions : function() {
return this._txtStrengthDescriptions;
},
set_TextStrengthDescriptions : function(value) {
if (value != null && value != '' && value != this._txtStrengthDescriptions) {
this._txtStrengthDescriptions = value;
this.raisePropertyChanged('TextStrengthDescriptions');
}
},
get_StrengthStyles : function() {
return this._strengthStyles;
},
set_StrengthStyles : function(value) {
if (value != null && value != '' && value != this._strengthStyles) {
this._strengthStyles = value;
this.raisePropertyChanged('StrengthStyles');
}
},
//*********************************************
// NOTE: The TextStrengthDescriptionStyles properties
// have been deprecated in faour of the StrengthStyles properties
get_TextStrengthDescriptionStyles : function() {
return this.get_StrengthStyles();
},
//*********************************************
// NOTE: The TextStrengthDescriptionStyles properties
// have been deprecated in faour of the StrengthStyles properties
set_TextStrengthDescriptionStyles : function(value) {
this.set_StrengthStyles(value);
},
get_HelpHandleCssClass : function() {
return this._helpHandleCssClass;
},
set_HelpHandleCssClass : function(value) {
if (this._helpHandleCssClass != value) {
this._helpHandleCssClass = value;
this.raisePropertyChanged('HelpHandleCssClass');
}
},
get_HelpHandlePosition : function() {
return this._helpHandlePosition;
},
set_HelpHandlePosition : function(value) {
if (this._helpHandlePosition != value) {
this._helpHandlePosition = value;
this.raisePropertyChanged('HelpHandlePosition');
}
},
get_HelpText : function() {
return this._helpText;
},
get_CalculationWeightings : function() {
return this._calcWeightings;
},
set_CalculationWeightings : function(value) {
if (this._calcWeightings != value) {
this._calcWeightings = value;
this.raisePropertyChanged('CalculationWeightings');
}
},
set_HelpText : function(value) {
if (this._helpStatusLabelID) {
var label = $get(this._helpStatusLabelID);
if (label) {
if (AjaxControlToolkit.TextBoxWrapper.get_Wrapper(this.get_element()).get_Value().length > 0) {
label.innerHTML = value;
}
else {
label.innerHTML = "";
}
}
}
if (this._helpText != value) {
this._helpText = value;
this.raisePropertyChanged('HelpText');
}
},
get_MinimumLowerCaseCharacters : function() {
return this._minLowerCaseChars;
},
set_MinimumLowerCaseCharacters : function(value) {
this._minLowerCaseChars = value;
},
get_MinimumUpperCaseCharacters : function() {
return this._minUpperCaseChars;
},
set_MinimumUpperCaseCharacters : function(value) {
this._minUpperCaseChars = value;
},
get_HelpStatusLabelID : function() {
return this._helpStatusLabelID;
},
set_HelpStatusLabelID : function(value) {
if (this._helpStatusLabelID != value) {
this._helpStatusLabelID = value;
this.raisePropertyChanged('HelpStatusLabelID');
}
}
}
AjaxControlToolkit.PasswordStrengthExtenderBehavior.registerClass('AjaxControlToolkit.PasswordStrengthExtenderBehavior', AjaxControlToolkit.BehaviorBase);
// Register enumerations
AjaxControlToolkit.StrengthIndicatorTypes = function() {
throw Error.invalidOperation();
}
AjaxControlToolkit.DisplayPosition = function() {
throw Error.invalidOperation();
}
AjaxControlToolkit.StrengthIndicatorTypes.prototype = {
Text: 0,
BarIndicator: 1
}
AjaxControlToolkit.DisplayPosition.prototype = {
RightSide: 0,
AboveRight: 1,
AboveLeft: 2,
LeftSide: 3,
BelowRight: 4,
BelowLeft: 5
}
AjaxControlToolkit.DisplayPosition.registerEnum('AjaxControlToolkit.DisplayPosition');
AjaxControlToolkit.StrengthIndicatorTypes.registerEnum('AjaxControlToolkit.StrengthIndicatorTypes');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -