1// Name: PasswordStrength.PasswordStrengthExtenderBehavior.debug.js 2// Assembly: AjaxControlToolkit 3// Version: 4.1.7.1213 4// FileVersion: 4.1.7.1213 5// (c) 2010 CodePlex Foundation 6 7 8 9/// <reference name="MicrosoftAjax.debug.js" /> 10/// <reference path="../ExtenderBase/BaseScripts.js" /> 11/// <reference path="../Common/Common.js" /> 12 13(function() { 14var scriptName = "ExtendedPasswordStrength"; 15 16function execute() { 17 18Type.registerNamespace('Sys.Extended.UI'); 19 20Sys.Extended.UI.PasswordStrengthExtenderBehavior = function(element) { 21 Sys.Extended.UI.PasswordStrengthExtenderBehavior.initializeBase(this, [element]); 22 23 this._levelArray = new Array(); 24 this._styleArray = new Array(); 25 26 this._txtPwdStrengthCssClass = null; 27 this._barBorderCssClass = null; 28 this._barIndicatorCssClass = null; 29 this._displayPosition = Sys.Extended.UI.DisplayPosition.RightSide; 30 this._strengthIndicator = Sys.Extended.UI.StrengthIndicatorTypes.Text; 31 32 this._preferredPasswordLength = 0; 33 this._minimumNumericCharacters = 0; 34 this._minimumSymbolCharacters = 0; 35 this._requiresUpperAndLowerCaseCharacters = false; 36 this._helpHandleCssClass = ''; 37 this._helpHandlePosition = Sys.Extended.UI.DisplayPosition.AboveRight; 38 this._helpText = ''; 39 this._helpStatusLabelID = null; 40 41 this._displayDiv = null; // The DIV for displaying the textual indicator 42 this._helpDiv = null; // The DIV that the user can click on to display the password requirements 43 44 this._barOuterDiv = null; // The outer DIV for the bar indicator 45 this._barInnerDiv = null; // The Inner DIV for the bar indicator 46 47 this._keyPressHandler = null; 48 this._blurHandler = null; 49 this._helpClickHandler = null; 50 this._prefixText = Sys.Extended.UI.Resources.PasswordStrength_StrengthPrompt; 51 52 this._txtStrengthDescriptions = Sys.Extended.UI.Resources.PasswordStrength_DefaultStrengthDescriptions; 53 this._strengthStyles = ''; 54 this._barIndicatorStyles = ''; 55 this._txtseparator = ';'; 56 this._MIN_TXT_LEVEL_COUNT = 2; 57 this._MAX_TXT_LEVEL_COUNT = 10; 58 59 this._calcWeightings = "50;15;15;20"; 60 61 this._minLowerCaseChars = 0; 62 this._minUpperCaseChars = 0; 63} 64 65Sys.Extended.UI.PasswordStrengthExtenderBehavior.prototype = { 66 67 68 initialize : function() { 69 Sys.Extended.UI.PasswordStrengthExtenderBehavior.callBaseMethod(this, 'initialize'); 70 71 this._createIndicatorDisplayElement(); 72 73 var e = this.get_element(); 74 75 this._keyPressHandler = Function.createDelegate(this, this._onKeyPress); 76 this._blurHandler = Function.createDelegate(this, this._onBlur); 77 78 79 $addHandler(e,'keyup', this._keyPressHandler); 80 $addHandler(e,'blur', this._blurHandler); 81 82 if (this._preferredPasswordLength == null || this._preferredPasswordLength == '' || this._preferredPasswordLength <= 0) { 83 this._preferredPasswordLength = 10; // Set to at least 10 chars as a preferred pwd length, even though this is very small. 84 this.raisePropertyChanged('PreferredPasswordLength'); 85 } 86 if (this._calcWeightings == null || this._calcWeightings == "") { 87 this._calcWeightings = "50;15;15;20"; 88 this.raisePropertyChanged('CalculationWeightings'); 89 } 90 91 this._getPasswordStrength(); 92 93 }, 94 95 _createIndicatorDisplayElement : function() { 96 97 if (this._strengthIndicator == Sys.Extended.UI.StrengthIndicatorTypes.BarIndicator) 98 this._createBarIndicatorDisplayElement(); 99 else 100 this._createTextDisplayElement(); 101 102 if (this._createHelpDisplayElement() == true) 103 { 104 $common.setVisible(this._helpDiv,true); 105 106 107 var bounds = $common.getBounds(this.get_element()); 108 109 var helpBounds = $common.getBounds(this._helpDiv); 110 var posY; 111 var posX; 112 var offset = 3; // 3 pixels for a very small amount of overlap to "connect" the help icon to the textbox 113 114 if (this._helpHandlePosition == "LeftSide") 115 { 116 posY = bounds.y + ((bounds.height / 2) - (helpBounds.height / 2)); 117 posX = bounds.x - helpBounds.width; 118 } else if (this._helpHandlePosition == "BelowRight") 119 { 120 posY = bounds.y + bounds.height - offset; // Just one pixel for a small overlap 121 posX = bounds.x + bounds.width - offset; 122 } else if (this._helpHandlePosition == "BelowLeft") 123 { 124 posY = bounds.y + bounds.height - offset; 125 posX = bounds.x - helpBounds.width + offset; 126 } else if (this._helpHandlePosition == "RightSide") 127 { 128 posY = bounds.y + ((bounds.height / 2) - (helpBounds.height / 2)); 129 posX = bounds.x + bounds.width; 130 } else if (this._helpHandlePosition == "AboveLeft") 131 { 132 posY = bounds.y - helpBounds.height + offset; 133 posX = bounds.x - helpBounds.width + offset; 134 135 }
135 else // This fall through logic gets called if the Help position is "AboveRight" or anything else for that matter 136 { 137 posY = bounds.y - helpBounds.height + offset; 138 posX = bounds.x + bounds.width - offset; 139 } 140 141 this._helpDiv.style.top = posY + 'px'; 142 this._helpDiv.style.left = posX + 'px'; 143 144 } 145 146 }, 147 148 _createTextDisplayElement : function() { 149 var p = document.createElement("label"); 150 p.style.position= "absolute"; 151 p.style.visibility="hidden"; 152 p.style.display = "none"; 153 154 if (this.get_element().id) { 155 p.id = this.get_element().id + "_PasswordStrength"; 156 } 157 158 this._displayDiv = p; 159 160 161 this._setTextDisplayLocation(p); 162 163 document.body.appendChild(p); 164 165 this._setTextDisplayStyle(0); 166 167 }, 168 169 _setTextDisplayStyle : function(index) { 170 if (this._styleArray.length == 0) 171 { 172 if (this._txtPwdStrengthCssClass) 173 this._displayDiv.className = this._txtPwdStrengthCssClass; 174 else 175 this._displayDiv.style.backgroundColor = "yellow"; 176 } else 177 { 178 this._displayDiv.style.backgroundColor = ""; 179 if (this._txtPwdStrengthCssClass && 180 Sys.UI.DomElement.containsCssClass(this._displayDiv,this._txtPwdStrengthCssClass)) 181 { 182 Sys.UI.DomElement.removeCssClass(this._displayDiv,this._txtPwdStrengthCssClass) 183 } 184 this._displayDiv.className = this._styleArray[index]; 185 } 186 187 }, 188 189 _setBarDisplayStyle : function(index) { 190 if (this._barBorderCssClass != '') 191 this._barOuterDiv.className = this._barBorderCssClass; 192 else 193 { 194 d1.style.width="200px"; 195 d1.style.borderStyle="solid"; 196 d1.style.borderWidth="1px"; 197 } 198 199 if (this._styleArray.length == 0) 200 { 201 if (this._barIndicatorCssClass != '') 202 this._barInnerDiv.className = this._barIndicatorCssClass; 203 else 204 this._barInnerDiv.style.backgroundColor = "red"; 205 } else 206 { 207 if (this._barIndicatorCssClass && 208 Sys.UI.DomElement.containsCssClass(this._barInnerDiv,this._barIndicatorCssClass)) 209 { 210 Sys.UI.DomElement.removeCssClass(this._barInnerDiv,this._barIndicatorCssClass) 211 } 212 this._barInnerDiv.className = this._styleArray[index]; 213 214 } 215 216 }, 217 218 _createBarIndicatorDisplayElement : function() { 219 var d1 = document.createElement("div"); // outer div 220 d1.style.position= "absolute"; 221 d1.style.visibility="hidden"; 222 d1.style.display = "none"; 223 224 var d2 = document.createElement("div"); // inner div, the bar itself 225 d2.style.position= "absolute"; 226 d2.style.visibility="hidden"; 227 d2.style.display = "none"; 228 229 d1.style.height = this.get_element().offsetHeight+4 + "px"; 230 231 if (this.get_element().id) { 232 d1.id = this.get_element().id + "_PasswordStrengthBar1"; 233 d2.id = this.get_element().id + "_PasswordStrengthBar2"; 234 } 235 236 this._barOuterDiv = d1; 237 this._barInnerDiv = d2; 238 239 this._extractStyles(); 240 241 this._setBarDisplayStyle(0); 242 243 document.body.appendChild(d1);
244 document.body.appendChild(d2); 245 246 this._setBarDisplayLocation(d1,d2); 247 248 }, 249 250 _createHelpDisplayElement : function() { 251 if (this._helpHandleCssClass != '') 252 { 253 var req = document.createElement("a"); 254 255 req.style.position= "absolute"; 256 req.style.visibility="hidden"; 257 req.style.display = "none"; 258 req.href = "#"; // fix for work item #8217 259 req.title = Sys.Extended.UI.Resources.PasswordStrength_GetHelpRequirements; 260 261 if (this.get_element().id) { 262 req.id = this.get_element().id + "_PasswordStrengthReqDisplay"; 263 } 264 265 this._helpClickHandler = Function.createDelegate(this,this._onHelpClick); 266 $addHandler(req,'click',this._helpClickHandler); 267 268 this._helpDiv = req; 269 270 271 this._helpDiv.className = this._helpHandleCssClass; 272 if (this.get_element().parentElement != null && this.get_element().parentElement.canHaveChildren) 273 this.get_element().parentElement.appendChild(req); 274 else 275 document.body.appendChild(req); 276 277 return true; 278 } else 279 return false; 280 }, 281 282 _setTextDisplayLocation : function(htmlElement) { 283 var location = $common.getLocation(this.get_element()); 284 var bounds = $common.getBounds(this.get_element()); 285 var offsetAmount = 15; 286 287 if (this._displayPosition == Sys.Extended.UI.DisplayPosition.LeftSide) 288 { 289 htmlElement.style.top = location.y + "px"; 290 htmlElement.style.left = location.x - bounds.width - offsetAmount + "px"; 291 } else if (this._displayPosition == "BelowRight") 292 { 293 htmlElement.style.top = location.y + this.get_element().offsetHeight + "px"; 294 htmlElement.style.left = location.x + this.get_element().offsetWidth - (this.get_element().offsetWidth/4) + "px"; 295 } else if (this._displayPosition == Sys.Extended.UI.DisplayPosition.BelowLeft) 296 { 297 htmlElement.style.top = location.y + this.get_element().offsetHeight + "px"; 298 htmlElement.style.left = location.x - offsetAmount + "px"; 299 } else if (this._displayPosition == Sys.Extended.UI.DisplayPosition.AboveRight) 300 { 301 htmlElement.style.top = location.y - this.get_element().offsetHeight + "px"; 302 htmlElement.style.left = location.x + this.get_element().offsetWidth - (this.get_element().offsetWidth/4) + "px"; 303 } else if (this._displayPosition == Sys.Extended.UI.DisplayPosition.AboveLeft) 304 { 305 htmlElement.style.top = location.y - this.get_element().offsetHeight + "px"; 306 htmlElement.style.left = location.x - offsetAmount + "px"; 307 } else // This fall through logic gets called if the DisplayPositon is "RightSide" or anything else for that matter 308 { 309 htmlElement.style.top = location.y + "px"; 310 htmlElement.style.left = location.x + this.get_element().offsetWidth + offsetAmount + "px"; 311 } 312 }, 313 314 _setBarDisplayLocation : function(outerElement, innerElement) { 315 316 if (this.get_element().offsetHeight > 0) { 317 318 var outerBorder = $common.getBorderBox(outerElement); 319 var outerPadding = $common.getPaddingBox(outerElement); 320 var leftIndent = outerBorder.left + outerPadding.left; 321 var topIndent = outerBorder.top + outerPadding.top; 322 323 innerElement.style.height = this.get_element().offsetHeight + "px"; // why does IE only do a minimum height???? 324 outerElement.style.height = this.get_element().offsetHeight + "px"; 325 326 327 var location = $common.getLocation(this.get_element()); 328 329 var offsetAmount = 15; 330 331 if (this._displayPosition == Sys.Extended.UI.DisplayPosition.LeftSide) 332 { 333 334 var initialVisibleState = $common.getVisible(this._barOuterDiv); 335 336 $common.setVisible(this._barOuterDiv,true); 337 var barBounds = $common.getContentSize(outerElement); 338 $common.setVisible(this._barOuterDiv, initialVisibleState); 339 340 var _barIndicatorWidth = barBounds.width; 341 342 outerElement.style.top = location.y + "px"; 343 outerElement.style.left = location.x - parseInt(_barIndicatorWidth) - offsetAmount + "px"; 344 345 innerElement.style.top = location.y + topIndent + "px"; 346 innerElement.style.left = location.x - parseInt(_barIndicatorWidth) - offsetAmount + leftIndent + "px"; 347 } else if (this._displayPosition == Sys.Extended.UI.DisplayPosition.BelowRight) 348 { 349 outerElement.style.top = location.y + this.get_element
349().offsetHeight + "px"; 350 outerElement.style.left = location.x + this.get_element().offsetWidth + "px"; 351 352 innerElement.style.top = location.y + this.get_element().offsetHeight + topIndent + "px"; 353 innerElement.style.left = location.x + this.get_element().offsetWidth + leftIndent + "px"; 354 } else if (this._displayPosition == Sys.Extended.UI.DisplayPosition.BelowLeft) 355 { 356 outerElement.style.top = location.y + this.get_element().offsetHeight + "px"; 357 outerElement.style.left = location.x + "px"; 358 359 innerElement.style.top = location.y + this.get_element().offsetHeight + topIndent + "px"; 360 innerElement.style.left = location.x + leftIndent + "px"; 361 } else if (this._displayPosition == Sys.Extended.UI.DisplayPosition.AboveRight) 362 { 363 outerElement.style.top = location.y-this.get_element().offsetHeight + "px"; 364 outerElement.style.left = location.x + this.get_element().offsetWidth + "px"; 365 366 innerElement.style.top = location.y-this.get_element().offsetHeight + topIndent + "px"; 367 innerElement.style.left = location.x + this.get_element().offsetWidth + leftIndent + "px"; 368 369 } else if (this._displayPosition == Sys.Extended.UI.DisplayPosition.AboveLeft) 370 { 371 outerElement.style.top = location.y-this.get_element().offsetHeight + "px"; 372 outerElement.style.left = location.x + "px"; 373 374 innerElement.style.top = location.y-this.get_element().offsetHeight + topIndent + "px"; 375 innerElement.style.left = location.x + leftIndent + "px"; 376 } else // This fall through logic gets called if the DisplayPositon is "RightSide" or anything else for that matter 377 { 378 outerElement.style.top = location.y + "px"; 379 outerElement.style.left = location.x + this.get_element().offsetWidth + offsetAmount + "px"; 380 381 innerElement.style.top = location.y + topIndent + "px"; 382 innerElement.style.left = location.x + this.get_element().offsetWidth + offsetAmount + leftIndent + "px"; 383 } 384 } 385 }, 386 387 _showStrength : function() { 388 389 var e = this.get_element(); 390 391 if (e.readOnly == true) 392 return; 393 394 var pwdStrength = this._getPasswordStrength(); 395 396 if (this._strengthIndicator == Sys.Extended.UI.StrengthIndicatorTypes.BarIndicator) 397 { 398 399 $common.setVisible(this._barOuterDiv , true); 400 $common.setVisible(this._barInnerDiv, true); 401 402 var index = 0; 403 if (this._styleArray != null && this._styleArray.length > 0) 404 { 405 index = parseInt(pwdStrength/100 * (this._styleArray.length-1)); 406 } 407 this._setBarDisplayStyle(index); 408 409 this._setBarDisplayLocation(this._barOuterDiv,this._barInnerDiv); 410 411 this._showStrengthAsBarValue(pwdStrength); 412 413 414 } else 415 { 416 this._createTextDescriptions(this._txtStrengthDescriptions); 417 418 $common.setVisible(this._displayDiv, true); 419 420 var index = parseInt(pwdStrength/100 * (this._levelArray.length-1)); 421 var pwdStrengthText = this._levelArray[index]; 422 423 this._setTextDisplayStyle(index); 424 425 this._setTextDisplayLocation(this._displayDiv); 426 427 this._showStrengthAsText(pwdStrengthText); 428 429 } 430 431 }, 432 433 _showStrengthAsText : function(pwdStrengthVal) { 434 this._displayDiv.innerHTML = this._prefixText + pwdStrengthVal; 435 }, 436 437 _showStrengthAsBarValue : function(strengthValue) { 438 var bounds = $common.getContentSize(this._barOuterDiv); 439 var outerPadding = $common.getPaddingBox(this._barOuterDiv); 440 var barLength = parseInt( bounds.width * (strengthValue / 100)); 441 this._barInnerDiv.style.width = barLength + "px"; 442 }, 443 444 _getPasswordStrength : function() { 445 446 var pwd = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element
446()).get_Value(); 447 448 var pwdRequirements = ''; // This will contain what is required to make this password a 'strong' password. 449 450 var percentTotal = 0; 451 452 var weights = this._calcWeightings.split(';'); 453 if (weights.length != 4) 454 Sys.Debug.assert(null, Sys.Extended.UI.Resources.PasswordStrength_InvalidWeightingRatios); 455 456 var _ratioLen = parseInt(weights[0]); 457 var _ratioNum = parseInt(weights[1]); 458 var _ratioCas = parseInt(weights[2]); 459 var _ratioSym = parseInt(weights[3]); 460 461 var ratio = pwd.length / this._preferredPasswordLength; 462 if (ratio > 1) 463 ratio = 1; 464 465 var lengthStrength = (ratio * _ratioLen); 466 467 percentTotal += lengthStrength; 468 469 if (ratio < 1) 470 pwdRequirements = String.format(Sys.Extended.UI.Resources.PasswordStrength_RemainingCharacters, this._preferredPasswordLength - pwd.length); 471 472 if (this._minimumNumericCharacters > 0) 473 { 474 var numbersRegex = new RegExp("[0-9]", "g"); 475 var numCount = this._getRegexCount(numbersRegex,pwd); 476 if ( numCount >= this._minimumNumericCharacters) 477 percentTotal += _ratioNum; 478 479 if (numCount < this._minimumNumericCharacters) 480 { 481 if (pwdRequirements != '') 482 pwdRequirements += ', '; 483 pwdRequirements += String.format(Sys.Extended.UI.Resources.PasswordStrength_RemainingNumbers, this._minimumNumericCharacters - numCount); 484 } 485 } else 486 { 487 percentTotal += (ratio * _ratioNum); 488 } 489 490 if (this._requiresUpperAndLowerCaseCharacters == true || 491 (typeof(this._requiresUpperAndLowerCaseCharacters) == 'String' && Boolean.parse(this._requiresUpperAndLowerCaseCharacters) == true) ) 492 { 493 var lowercaseRegex = new RegExp("[a-z]", "g"); 494 var uppercaseRegex = new RegExp("[A-Z]", "g"); 495 496 var numLower = this._getRegexCount(lowercaseRegex,pwd); 497 var numUpper = this._getRegexCount(uppercaseRegex,pwd); 498 499 if (numLower > 0 || numUpper > 0) 500 { 501 if (numLower >= this._minLowerCaseChars && numUpper >= this._minUpperCaseChars) 502 percentTotal += _ratioCas; 503 else 504 { 505 if (this._minLowerCaseChars > 0 && (this._minLowerCaseChars - numLower) > 0) 506 { 507 if (pwdRequirements != '') 508 pwdRequirements += ', '; 509 pwdRequirements += String.format(Sys.Extended.UI.Resources.PasswordStrength_RemainingLowerCase, this._minLowerCaseChars - numLower); 510 } 511 if (this._minUpperCaseChars > 0 && (this._minUpperCaseChars - numUpper) > 0) 512 { 513 if (pwdRequirements != '') 514 pwdRequirements += ', '; 515 pwdRequirements += String.format(Sys.Extended.UI.Resources.PasswordStrength_RemainingUpperCase, this._minUpperCaseChars - numUpper); 516 } 517 } 518 519 } 520 else 521 { 522 if (pwdRequirements != '') 523 pwdRequirements += ', '; 524 pwdRequirements += Sys.Extended.UI.Resources.PasswordStrength_RemainingMixedCase; 525 526 } 527 } else 528 { 529 percentTotal += (ratio * _ratioCas); 530 } 531 532 533 if (this._minimumSymbolCharacters > 0) 534 { 535 var symbolRegex = new RegExp("[^a-z,A-Z,0-9,\x20]", "g"); // related to work item 1034 536 var numCount = this._getRegexCount(symbolRegex,pwd); 537 if (numCount >= this._minimumSymbolCharacters) 538 percentTotal += _ratioSym; 539 540 if (numCount < this._minimumSymbolCharacters) 541 { 542 if (pwdRequirements != '') 543 pwdRequirements += ', '; 544 pwdRequirements += String.format(Sys.Extended.UI.Resources.PasswordStrength_RemainingSymbols, this._minimumSymbolCharacters - numCount); 545 } 546 547 } else 548 { 549 percentTotal += (ratio * _ratioSym); 550 } 551 552 this.set_HelpText(pwdRequirements); 553 554 return percentTotal; 555 556 }, 557 558 _getRegexCount : function(regex,testString) { 559 var cnt = 0; 560 if (testString != null && testString != "") 561 { 562 var results = testString.match(regex); 563 if (results != null) 564 cnt = results.length; 565 } 566 return cnt; 567 }, 568 569 _extractStyles : function() { 570 if (this._strengthStyles != null && this._strengthStyles != "" ) 571 this._styleArray = this._strengthStyles.split(this._txtseparator); 572 573 }, 574 575 _createTextDescriptions : function(descriptions) { 576 this._levelArray = this._txtStrengthDescriptions.split(this._txtseparator); 577 578 this._extractStyles(); 579 580 if (this._styleArray.length > 0 && this._styleArray.length != this._levelArray.length) 581 { 582 Sys.Debug.assert(false, Sys.Extended.UI.Resources.PasswordStrength_InvalidStrengthDescriptionStyles); 583 } 584 585 if (this._levelArray.length < this._MIN_TXT_LEVEL_COUNT || this._levelArray > this._MAX_TXT_LEVEL_COUNT) 586 { 587 Sys.Debug.assert(false, Sys.Extended.UI.Resources.PasswordStrength_InvalidStrengthDescriptions); 588 } 589 }, 590 591 _onKeyPress : function() { 592 593 this._showStrength(); 594 }, 595 596 _onBlur : function() { 597 if (this._strengthIndicator == Sys.Extended.UI.StrengthIndicatorTypes.BarIndicator) 598 { 599 $common.setVisible(this._barOuterDiv, false); 600 $common.setVisible(this._barInnerDiv, false); 601 } else 602 { 603 $common.setVisible(this._displayDiv, false); 604 } 605 }, 606 607 _onHelpClick : function() { 608 if (this._helpText == '') 609 alert(Sys.Extended.UI.Resources.PasswordStrength_Satisfied);
610 else 611 alert(this._helpText); 612 }, 613 614 dispose : function() { 615 var e = this.get_element(); 616 617 if (this._keyPressHandler) { 618 $removeHandler(e,'keyup', this._keyPressHandler); 619 this._keyPressHandler = null; 620 } 621 if (this._blurHandler) { 622 $removeHandler(e,'blur', this._blurHandler); 623 this._blurHandler = null; 624 } 625 if (this._helpClickHandler) { 626 $removeHandler(this._helpDiv, 'click', this._helpClickHandler); 627 this._helpClickHandler = null; 628 } 629 630 if(this._displayDiv) 631 $common.setVisible(this._displayDiv, false); 632 633 if (this._barOuterDiv) 634 $common.setVisible(this._barOuterDiv,false); 635 if (this._barInnerDiv) 636 $common.setVisible(this._barInnerDiv, false); 637 638 639 if (this._helpHandleCssClass != '' && this._helpDiv) 640 $common.setVisible(this._helpDiv ,false); 641 642 Sys.Extended.UI.PasswordStrengthExtenderBehavior.callBaseMethod(this, 'dispose'); 643 }, 644 645 get_PreferredPasswordLength : function() { 646 return this._preferredPasswordLength; 647 }, 648 649 set_PreferredPasswordLength : function(value) { 650 if (this._preferredPasswordLength != value) { 651 this._preferredPasswordLength = value; 652 this.raisePropertyChanged('PreferredPasswordLength'); 653 } 654 }, 655 656 get_MinimumNumericCharacters : function() { 657 return this._minimumNumericCharacters; 658 }, 659 660 set_MinimumNumericCharacters : function(value) { 661 if (this._minimumNumericCharacters != value) { 662 this._minimumNumericCharacters = value; 663 this.raisePropertyChanged('MinimumNumericCharacters'); 664 } 665 }, 666 667 get_MinimumSymbolCharacters : function() { 668 return this._minimumSymbolCharacters; 669 }, 670 671 set_MinimumSymbolCharacters : function(value) { 672 if (this._minimumSymbolCharacters != value) { 673 this._minimumSymbolCharacters = value; 674 this.raisePropertyChanged('MinimumSymbolCharacters'); 675 } 676 }, 677 get_RequiresUpperAndLowerCaseCharacters : function() { 678 return this._requiresUpperAndLowerCaseCharacters; 679 }, 680 681 set_RequiresUpperAndLowerCaseCharacters : function(value) { 682 if (this._requiresUpperAndLowerCaseCharacters != value) { 683 this._requiresUpperAndLowerCaseCharacters = value; 684 this.raisePropertyChanged('RequiresUpperAndLowerCaseCharacters'); 685 } 686 }, 687 688 get_TextCssClass : function() { 689 return this._txtPwdStrengthCssClass; 690 }, 691 692 set_TextCssClass : function(value) { 693 if (this._txtPwdStrengthCssClass != value) { 694 this._txtPwdStrengthCssClass = value; 695 this.raisePropertyChanged('TextCssClass'); 696 } 697 }, 698 699 get_BarBorderCssClass : function() { 700 return this._barBorderCssClass; 701 }, 702 703 set_BarBorderCssClass : function(value) { 704 if (this._barBorderCssClass != value) { 705 this._barBorderCssClass = value; 706 this.raisePropertyChanged('BarBorderCssClass'); 707 } 708 }, 709 get_BarIndicatorCssClass : function() { 710 return this._barIndicatorCssClass; 711 }, 712 713 set_BarIndicatorCssClass : function(value) { 714 if (this._barIndicatorCssClass != value) { 715 this._barIndicatorCssClass = value; 716 this.raisePropertyChanged('BarIndicatorCssClass'); 717 } 718 }, 719 720 721 get_DisplayPosition : function() { 722 return this._displayPosition; 723 }, 724 725 set_DisplayPosition : function(value) { 726 if (this._displayPosition != value) { 727 this._displayPosition = value; 728 this.raisePropertyChanged('DisplayPosition'); 729 } 730 }, 731 732 733 get_PrefixText : function() { 734 return this._prefixText; 735 }, 736 737 set_PrefixText : function(value) { 738 if (this._prefixText != value) { 739 this._prefixText = value; 740 this.raisePropertyChanged('PrefixText'); 741 } 742 }, 743 744 get_StrengthIndicatorType : function() { 745 return this._strengthIndicator; 746 }, 747 748 set_StrengthIndicatorType : function(value) { 749 if (this._strengthIndicator != value) { 750 this._strengthIndicator = value; 751 this.raisePropertyChanged('StrengthIndicatorType'); 752 } 753 }, 754 755 get_TextStrengthDescriptions : function() { 756 return this._txtStrengthDescriptions; 757 }, 758 759 set_TextStrengthDescriptions : function(value) { 760 if (value != null && value != '' && value != this._txtStrengthDescriptions) { 761 this._txtStrengthDescriptions = value; 762 this.raisePropertyChanged('TextStrengthDescriptions'); 763 } 764 }, 765 766 get_StrengthStyles : function() { 767 return this._strengthStyles; 768 }, 769 770 set_StrengthStyles : function(value) { 771 if (value != null && value != '' && value != this._strengthStyles) { 772 this._strengthStyles = value; 773 this.raisePropertyChanged('StrengthStyles'); 774 } 775 }, 776 777 get_TextStrengthDescriptionStyles : function() { 778 return this.get_StrengthStyles(); 779 }, 780 781 set_TextStrengthDescriptionStyles : function(value) { 782 this.set_StrengthStyles(value); 783 }, 784 785 786 get_HelpHandleCssClass : function() { 787 return this._helpHandleCssClass; 788 }, 789 790 set_HelpHandleCssClass : function(value) { 791 if (this._helpHandleCssClass != value) { 792 this._helpHandleCssClass = value; 793 this.raisePropertyChanged('HelpHandleCssClass'); 794 } 795 }, 796 797 get_HelpHandlePosition : function() { 798 return this._helpHandlePosition; 799 }, 800 801 set_HelpHandlePosition : function(value) { 802 if (this._helpHandlePosition != value) { 803 this._helpHandlePosition = value; 804 this.raisePropertyChanged('HelpHandlePosition'); 805 } 806 }, 807 808 get_HelpText : function() { 809 return this._helpText; 810 }, 811 812 get_CalculationWeightings : function() { 813 return this._calcWeightings; 814 }, 815 816 set_CalculationWeightings : function(value) { 817 if (this._calcWeightings != value) { 818 this._calcWeightings = value; 819 this.raisePropertyChanged('CalculationWeightings'); 820 } 821 }, 822 823 set_HelpText : function(value) { 824 if (this._helpStatusLabelID) { 825 var label = $get(this._helpStatusLabelID); 826 if (label) { 827 if (Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element
827()).get_Value().length > 0) { 828 label.innerHTML = value; 829 } 830 else { 831 label.innerHTML = ""; 832 } 833 } 834 } 835 if (this._helpText != value) { 836 this._helpText = value; 837 this.raisePropertyChanged('HelpText'); 838 } 839 }, 840 841 get_MinimumLowerCaseCharacters : function() { 842 return this._minLowerCaseChars; 843 }, 844 845 set_MinimumLowerCaseCharacters : function(value) { 846 this._minLowerCaseChars = value; 847 }, 848 849 get_MinimumUpperCaseCharacters : function() { 850 return this._minUpperCaseChars; 851 }, 852 853 set_MinimumUpperCaseCharacters : function(value) { 854 this._minUpperCaseChars = value; 855 }, 856 857 get_HelpStatusLabelID : function() { 858 return this._helpStatusLabelID; 859 }, 860 861 set_HelpStatusLabelID : function(value) { 862 if (this._helpStatusLabelID != value) { 863 this._helpStatusLabelID = value; 864 this.raisePropertyChanged('HelpStatusLabelID'); 865 } 866 } 867} 868 869 870Sys.Extended.UI.PasswordStrengthExtenderBehavior.registerClass('Sys.Extended.UI.PasswordStrengthExtenderBehavior', Sys.Extended.UI.BehaviorBase); 871Sys.registerComponent(Sys.Extended.UI.PasswordStrengthExtenderBehavior, { name: "passwordStrength" }); 872 873 874Sys.Extended.UI.StrengthIndicatorTypes = function() { 875 throw Error.invalidOperation(); 876} 877Sys.Extended.UI.DisplayPosition = function() { 878 throw Error.invalidOperation(); 879} 880 881Sys.Extended.UI.StrengthIndicatorTypes.prototype = { 882 Text: 0, 883 BarIndicator: 1 884} 885 886Sys.Extended.UI.DisplayPosition.prototype = { 887 RightSide: 0, 888 AboveRight: 1, 889 AboveLeft: 2, 890 LeftSide: 3, 891 BelowRight: 4, 892 BelowLeft: 5 893} 894 895Sys.Extended.UI.DisplayPosition.registerEnum('Sys.Extended.UI.DisplayPosition'); 896Sys.Extended.UI.StrengthIndicatorTypes.registerEnum('Sys.Extended.UI.StrengthIndicatorTypes'); 897 898} // execute 899 900if (window.Sys && Sys.loader) { 901 Sys.loader.registerScript(scriptName, ["ExtendedBase", "ExtendedCommon"], execute); 902} 903else { 904 execute(); 905} 906 907})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.