setup.js
上传用户:wenllgg125
上传日期:2020-04-09
资源大小:7277k
文件大小:2k
源码类别:

SCSI/ASPI

开发平台:

Others

  1. function disableOtherSubmit()
  2. {           var objs = document.getElementsByTagName('INPUT');
  3.             for(var i=0; i<objs.length; i++)
  4.             {
  5.                 if(objs[i].type.toLowerCase() == 'submit')
  6.                 {
  7.                     objs[i].disabled = true;
  8.                 }
  9.             } 
  10. }
  11.             
  12.       
  13. var n = 0;
  14. function HighlightAll(obj) {
  15. obj.focus();
  16. obj.select();
  17. if (document.getElementById("TextBox1")) {
  18. obj.createTextRange().execCommand("Copy");
  19. window.status = "将模板内容复制到剪贴板";
  20. setTimeout("window.status=''", 1800);
  21. }
  22. }
  23. var PasswordStrength ={
  24. Level : ["极佳","一般","较弱","太短"],
  25. LevelValue : [15,10,5,0],//强度值
  26. Factor : [1,2,5],//字符加数,分别为字母,数字,其它
  27. KindFactor : [0,0,10,20],//密码含几种组成的加数 
  28. Regex : [/[a-zA-Z]/g,/d/g,/[^a-zA-Z0-9]/g] //字符正则数字正则其它正则
  29. }
  30.             
  31. PasswordStrength.StrengthValue = function(pwd)
  32. {
  33.     var strengthValue = 0;
  34.     var ComposedKind = 0;
  35.     for(var i = 0 ; i < this.Regex.length;i++)
  36.     {
  37.         var chars = pwd.match(this.Regex[i]);
  38.         if(chars != null)
  39.         {
  40.             strengthValue += chars.length * this.Factor[i];
  41.             ComposedKind ++;
  42.         }
  43.     }
  44.     strengthValue += this.KindFactor[ComposedKind];
  45.     return strengthValue;
  46.         
  47. PasswordStrength.StrengthLevel = function(pwd)
  48. {
  49.     var value = this.StrengthValue(pwd);
  50.     for(var i = 0 ; i < this.LevelValue.length ; i ++)
  51.     {
  52.         if(value >= this.LevelValue[i] )
  53.              return this.Level[i];
  54.     }
  55. }
  56.      
  57. function loadinputcontext(o)
  58. {
  59.     var showmsg=PasswordStrength.StrengthLevel(o.value);
  60.     switch(showmsg)
  61.     {
  62.          case "太短": showmsg+=" <img src=../images/level/1.gif width=88 height=10>";break;
  63.          case "较弱": showmsg+=" <img src=../images/level/2.gif width=88 height=10>";break;
  64.          case "一般": showmsg+=" <img src=../images/level/3.gif width=88 height=10>";break;
  65.          case "极佳": showmsg+=" <img src=../images/level/4.gif width=88 height=10>";break;
  66.     }
  67.            
  68.     document.getElementById('showmsg').innerHTML =showmsg;
  69. }