widgets/SecurePass.js
authorEdward <edward@roojs.com>
Mon, 22 Apr 2013 08:37:35 +0000 (16:37 +0800)
committerEdward <edward@roojs.com>
Mon, 22 Apr 2013 08:37:35 +0000 (16:37 +0800)
widgets/SecurePass.js

index 6d91c8e..62cbd16 100644 (file)
@@ -71,12 +71,14 @@ Ext.extend(Ext.form.SecurePass, Ext.form.TextField, {
 
     // private
     initEvents : function(){
+        Roo.log('initEvents');
         Ext.form.SecurePass.superclass.initEvents.call(this);
                this.el.on('keyup', this.checkStrength, this, {buffer:50});
        },
 
        // private
        onRender : function(ct, position){
+             Roo.log('onRender');
                Ext.form.SecurePass.superclass.onRender.call(this, ct, position);
                this.wrap = this.el.wrap({cls: 'x-form-field-wrap'});
                this.trigger = this.wrap.createChild({tag: 'div', cls: 'StrengthMeter '+this.triggerClass});
@@ -118,6 +120,7 @@ Ext.extend(Ext.form.SecurePass, Ext.form.TextField, {
 
        // private
        onDestroy : function(){
+            Roo.log('onDestroy');
                if(this.trigger){
                        this.trigger.removeAllListeners();
                        this.trigger.remove();
@@ -130,9 +133,8 @@ Ext.extend(Ext.form.SecurePass, Ext.form.TextField, {
     
        // private
        checkStrength : function(){
+            Roo.log('checkStrength');
                var pwd = this.el.getValue();
-                Roo.log('run');
-                Roo.log(this._lastPwd);
                if (pwd == this._lastPwd) {
                        return;
                }
@@ -159,6 +161,7 @@ Ext.extend(Ext.form.SecurePass, Ext.form.TextField, {
                this._lastPwd = pwd;
        },
     reset : function(){
+        Roo.log('reset');
         Ext.form.SecurePass.superclass.reset.call(this);
         this._lastPwd = '';
         var pm = this.trigger.child('div/div/div').dom;
@@ -167,6 +170,7 @@ Ext.extend(Ext.form.SecurePass, Ext.form.TextField, {
     },
     // private
        validateValue : function(value){
+            Roo.log('validateValue');
                if (!Ext.form.TextField.superclass.validateValue.call(this, value)){
             return false;
         }
@@ -223,12 +227,14 @@ Ext.extend(Ext.form.SecurePass, Ext.form.TextField, {
 
     // private
        CharacterSetChecks : function(type){
+            Roo.log('CharacterSetChecks');
                this.type = type;
                this.fResult = false;
        },
 
     // private
        isctype : function(character, type){
+            Roo.log('isctype');
                switch (type) { //why needed break after return in js ? very odd bug
                        case this.kCapitalLetter: if (character >= 'A' && character <= 'Z') { return true; } break;
                        case this.kSmallLetter: if (character >= 'a' && character <= 'z') { return true; } break;
@@ -241,11 +247,13 @@ Ext.extend(Ext.form.SecurePass, Ext.form.TextField, {
 
     // private
        IsLongEnough : function(pwd, size){
+            Roo.log('IsLongEnough');
                return !(pwd == null || isNaN(size) || pwd.length < size);
        },
 
     // private
        SpansEnoughCharacterSets : function(word, nb){
+            Roo.log('SpansEnoughCharacterSets');
                if (!this.IsLongEnough(word, nb))
                {
                        return false;
@@ -278,16 +286,19 @@ Ext.extend(Ext.form.SecurePass, Ext.form.TextField, {
 
     // private
        ClientSideStrongPassword : function(pwd){
+            Roo.log('ClientSideStrongPassword');
                return this.IsLongEnough(pwd, 8) && this.SpansEnoughCharacterSets(pwd, 3);
        },
 
     // private
        ClientSideMediumPassword : function(pwd){
+            Roo.log('ClientSideMediumPassword');
                return this.IsLongEnough(pwd, 7) && this.SpansEnoughCharacterSets(pwd, 2);
        },
 
     // private
        ClientSideWeakPassword : function(pwd){
+            Roo.log('ClientSideWeakPassword');
                return this.IsLongEnough(pwd, 6) || !this.IsLongEnough(pwd, 0);
        }
 })
\ No newline at end of file