roojs-bootstrap.js
authoredward <edward@roojs.com>
Wed, 22 Jun 2016 02:52:54 +0000 (10:52 +0800)
committeredward <edward@roojs.com>
Wed, 22 Jun 2016 02:52:54 +0000 (10:52 +0800)
roojs-bootstrap-debug.js

roojs-bootstrap-debug.js
roojs-bootstrap.js

index 7853725..9670431 100644 (file)
@@ -7976,7 +7976,7 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
             }
             if (this.before && typeof(this.before) == 'object') {
                 this.before = Roo.factory(this.before);
-                Roo.log(this.before);
+                
                 inputblock.cn.push({
                     tag :'span',
                     cls : 'roo-input-before input-group-' +
@@ -7995,7 +7995,7 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
             }
             if (this.after && typeof(this.after) == 'object') {
                 this.after = Roo.factory(this.after);
-                Roo.log(this.after);
+                
                 inputblock.cn.push({
                     tag :'span',
                     cls : 'roo-input-after input-group-' +
@@ -8010,7 +8010,7 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
         };
         
         if (align ==='left' && this.fieldLabel.length) {
-                Roo.log("left and has label");
+                
                 cfg.cn = [
                     
                     {
@@ -8029,7 +8029,7 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
                     
                 ];
         } else if ( this.fieldLabel.length) {
-                Roo.log(" label");
+                
                  cfg.cn = [
                    
                     {
@@ -8045,7 +8045,6 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
 
         } else {
             
-                Roo.log(" no label && no align");
                 cfg.cn = [
                     
                         inputblock
@@ -8054,11 +8053,9 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
                 
                 
         };
-        Roo.log('input-parentType: ' + this.parentType);
         
         if (this.parentType === 'Navbar' &&  this.parent().bar) {
            cfg.cls += ' navbar-form';
-           Roo.log(cfg);
         }
         
         return cfg;
index 8641420..063f49d 100644 (file)
@@ -308,26 +308,26 @@ while(A.parent()){A=A.parent();if(typeof(A.labelAlign)!='undefined'){return A.la
 var C={tag:'input',id:id,type:this.inputType,value:this.value,cls:'form-control',placeholder:this.placeholder||'',autocomplete:this.autocomplete||'new-password'};if(this.align){C.style=(typeof(C.style)=='undefined')?('text-align:'+this.align):(C.style+'text-align:'+this.align);
 }if(this.maxLength&&this.maxLength!=Number.MAX_VALUE){C.maxLength=this.maxLength;}if(this.disabled){C.disabled=true;}if(this.readOnly){C.readonly=true;}if(this.name){C.name=this.name;}if(this.size){C.cls+=' input-'+this.size;}var D=this;['xs','sm','md','lg'].map(function(G){if(D[G]){B.cls+=' col-'+G+'-'+D[G];
 }});var E=C;var F={tag:'span',cls:'glyphicon form-control-feedback'};if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){E={cls:'has-feedback',cn:[C,F]};}if(this.before||this.after){E={cls:'input-group',cn:[]};if(this.before&&typeof(this.before)=='string'){E.cn.push({tag:'span',cls:'roo-input-before input-group-addon',html:this.before}
-);}if(this.before&&typeof(this.before)=='object'){this.before=Roo.factory(this.before);Roo.log(this.before);E.cn.push({tag:'span',cls:'roo-input-before input-group-'+(this.before.xtype=='Button'?'btn':'addon')});}E.cn.push(C);if(this.after&&typeof(this.after)=='string'){E.cn.push({tag:'span',cls:'roo-input-after input-group-addon',html:this.after}
-);}if(this.after&&typeof(this.after)=='object'){this.after=Roo.factory(this.after);Roo.log(this.after);E.cn.push({tag:'span',cls:'roo-input-after input-group-'+(this.after.xtype=='Button'?'btn':'addon')});}if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){E.cls+=' has-feedback';
-E.cn.push(F);}};if(A==='left'&&this.fieldLabel.length){Roo.log("left and has label");B.cn=[{tag:'label','for':id,cls:'control-label col-sm-'+this.labelWidth,html:this.fieldLabel},{cls:"col-sm-"+(12-this.labelWidth),cn:[E]}];}else if(this.fieldLabel.length){Roo.log(" label");
-B.cn=[{tag:'label',html:this.fieldLabel},E];}else{Roo.log(" no label && no align");B.cn=[E];};Roo.log('input-parentType: '+this.parentType);if(this.parentType==='Navbar'&&this.parent().bar){B.cls+=' navbar-form';Roo.log(B);}return B;},inputEl:function(){return this.el.select('input.form-control',true).first();
-},tooltipEl:function(){return this.inputEl();},setDisabled:function(v){var i=this.inputEl().dom;if(!v){i.removeAttribute('disabled');return;}i.setAttribute('disabled','true');},initEvents:function(){this.inputEl().on("keydown",this.fireKey,this);this.inputEl().on("focus",this.onFocus,this);
-this.inputEl().on("blur",this.onBlur,this);this.inputEl().relayEvent('keyup',this);this.originalValue=this.getValue();if(this.validationEvent=='keyup'){this.validationTask=new Roo.util.DelayedTask(this.validate,this);this.inputEl().on('keyup',this.filterValidation,this);
-}else if(this.validationEvent!==false){this.inputEl().on(this.validationEvent,this.validate,this,{buffer:this.validationDelay});}if(this.selectOnFocus){this.on("focus",this.preFocus,this);}if(this.maskRe||(this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Roo.form.VTypes[this.vtype+'Mask']))){this.inputEl().on("keypress",this.filterKeys,this);
-}if(this.inputEl().is('input[type=password]')&&Roo.isSafari){this.inputEl().on('keydown',this.SafariOnKeyDown,this);}if(typeof(this.before)=='object'){this.before.render(this.el.select('.roo-input-before',true).first());}if(typeof(this.after)=='object'){this.after.render(this.el.select('.roo-input-after',true).first());
-}},filterValidation:function(e){if(!e.isNavKeyPress()){this.validationTask.delay(this.validationDelay);}},validate:function(){if(this.disabled||this.validateValue(this.getRawValue())){this.markValid();return true;}this.markInvalid();return false;},validateValue:function(A){if(A.length<1){if(this.allowBlank){return true;
-}return false;}if(A.length<this.minLength){return false;}if(A.length>this.maxLength){return false;}if(this.vtype){var vt=Roo.form.VTypes;if(!vt[this.vtype](A,this)){return false;}}if(typeof this.validator=="function"){var B=this.validator(A);if(B!==true){return false;
-}}if(this.regex&&!this.regex.test(A)){return false;}return true;},fireKey:function(e){if(e.isNavKeyPress()){this.fireEvent("specialkey",this,e);}},focus:function(A){if(this.rendered){this.inputEl().focus();if(A===true){this.inputEl().dom.select();}}return this;
-},onFocus:function(){if(!Roo.isOpera&&this.focusClass){}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this);}},beforeBlur:Roo.emptyFn,onBlur:function(){this.beforeBlur();if(!Roo.isOpera&&this.focusClass){}this.hasFocus=false;
-if(this.validationEvent!==false&&this.validateOnBlur&&this.validationEvent!="blur"){this.validate();}var v=this.getValue();if(String(v)!==String(this.startValue)){this.fireEvent('change',this,v,this.startValue);}this.fireEvent("blur",this);},reset:function(){this.setValue(this.originalValue);
-this.validate();},getName:function(){return this.name;},getValue:function(){var v=this.inputEl().getValue();return v;},getRawValue:function(){var v=this.inputEl().getValue();return v;},setRawValue:function(v){return this.inputEl().dom.value=(v===null||v===undefined?'':v);
-},selectText:function(A,B){var v=this.getRawValue();if(v.length>0){A=A===undefined?0:A;B=B===undefined?v.length:B;var d=this.inputEl().dom;if(d.setSelectionRange){d.setSelectionRange(A,B);}else if(d.createTextRange){var C=d.createTextRange();C.moveStart("character",A);
-C.moveEnd("character",v.length-B);C.select();}}},setValue:function(v){this.value=v;if(this.rendered){this.inputEl().dom.value=(v===null||v===undefined?'':v);this.validate();}},preFocus:function(){if(this.selectOnFocus){this.inputEl().dom.select();}},filterKeys:function(e){var k=e.getKey();
-if(!Roo.isIE&&(e.isNavKeyPress()||k==e.BACKSPACE||(k==e.DELETE&&e.button==-1))){return;}var c=e.getCharCode(),cc=String.fromCharCode(c);if(Roo.isIE&&(e.isSpecialKey()||!cc)){return;}if(!this.maskRe.test(cc)){e.stopEvent();}},clearInvalid:function(){if(!this.el||this.preventMark){return;
-}this.el.removeClass(this.invalidClass);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){var A=this.el.select('.form-control-feedback',true).first();if(A){this.el.select('.form-control-feedback',true).first().removeClass(this.invalidFeedbackClass);
-}}this.fireEvent('valid',this);},markValid:function(){if(!this.el||this.preventMark){return;}this.el.removeClass([this.invalidClass,this.validClass]);var A=this.el.select('.form-control-feedback',true).first();if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);
-}if(this.disabled||this.allowBlank){return;}var B=this.el.findParent('.form-group',false,true);if(B){var C=B.select('label',true).first();var D=B.select('i.fa-star',true).first();if(C&&D){D.remove();}}this.el.addClass(this.validClass);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank&&(this.getValue().length||this.forceFeedback)){var A=this.el.select('.form-control-feedback',true).first();
+);}if(this.before&&typeof(this.before)=='object'){this.before=Roo.factory(this.before);E.cn.push({tag:'span',cls:'roo-input-before input-group-'+(this.before.xtype=='Button'?'btn':'addon')});}E.cn.push(C);if(this.after&&typeof(this.after)=='string'){E.cn.push({tag:'span',cls:'roo-input-after input-group-addon',html:this.after}
+);}if(this.after&&typeof(this.after)=='object'){this.after=Roo.factory(this.after);E.cn.push({tag:'span',cls:'roo-input-after input-group-'+(this.after.xtype=='Button'?'btn':'addon')});}if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){E.cls+=' has-feedback';
+E.cn.push(F);}};if(A==='left'&&this.fieldLabel.length){B.cn=[{tag:'label','for':id,cls:'control-label col-sm-'+this.labelWidth,html:this.fieldLabel},{cls:"col-sm-"+(12-this.labelWidth),cn:[E]}];}else if(this.fieldLabel.length){B.cn=[{tag:'label',html:this.fieldLabel}
+,E];}else{B.cn=[E];};if(this.parentType==='Navbar'&&this.parent().bar){B.cls+=' navbar-form';}return B;},inputEl:function(){return this.el.select('input.form-control',true).first();},tooltipEl:function(){return this.inputEl();},setDisabled:function(v){var i=this.inputEl().dom;
+if(!v){i.removeAttribute('disabled');return;}i.setAttribute('disabled','true');},initEvents:function(){this.inputEl().on("keydown",this.fireKey,this);this.inputEl().on("focus",this.onFocus,this);this.inputEl().on("blur",this.onBlur,this);this.inputEl().relayEvent('keyup',this);
+this.originalValue=this.getValue();if(this.validationEvent=='keyup'){this.validationTask=new Roo.util.DelayedTask(this.validate,this);this.inputEl().on('keyup',this.filterValidation,this);}else if(this.validationEvent!==false){this.inputEl().on(this.validationEvent,this.validate,this,{buffer:this.validationDelay}
+);}if(this.selectOnFocus){this.on("focus",this.preFocus,this);}if(this.maskRe||(this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Roo.form.VTypes[this.vtype+'Mask']))){this.inputEl().on("keypress",this.filterKeys,this);}if(this.inputEl().is('input[type=password]')&&Roo.isSafari){this.inputEl().on('keydown',this.SafariOnKeyDown,this);
+}if(typeof(this.before)=='object'){this.before.render(this.el.select('.roo-input-before',true).first());}if(typeof(this.after)=='object'){this.after.render(this.el.select('.roo-input-after',true).first());}},filterValidation:function(e){if(!e.isNavKeyPress()){this.validationTask.delay(this.validationDelay);
+}},validate:function(){if(this.disabled||this.validateValue(this.getRawValue())){this.markValid();return true;}this.markInvalid();return false;},validateValue:function(A){if(A.length<1){if(this.allowBlank){return true;}return false;}if(A.length<this.minLength){return false;
+}if(A.length>this.maxLength){return false;}if(this.vtype){var vt=Roo.form.VTypes;if(!vt[this.vtype](A,this)){return false;}}if(typeof this.validator=="function"){var B=this.validator(A);if(B!==true){return false;}}if(this.regex&&!this.regex.test(A)){return false;
+}return true;},fireKey:function(e){if(e.isNavKeyPress()){this.fireEvent("specialkey",this,e);}},focus:function(A){if(this.rendered){this.inputEl().focus();if(A===true){this.inputEl().dom.select();}}return this;},onFocus:function(){if(!Roo.isOpera&&this.focusClass){}
+if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this);}},beforeBlur:Roo.emptyFn,onBlur:function(){this.beforeBlur();if(!Roo.isOpera&&this.focusClass){}this.hasFocus=false;if(this.validationEvent!==false&&this.validateOnBlur&&this.validationEvent!="blur"){this.validate();
+}var v=this.getValue();if(String(v)!==String(this.startValue)){this.fireEvent('change',this,v,this.startValue);}this.fireEvent("blur",this);},reset:function(){this.setValue(this.originalValue);this.validate();},getName:function(){return this.name;},getValue:function(){var v=this.inputEl().getValue();
+return v;},getRawValue:function(){var v=this.inputEl().getValue();return v;},setRawValue:function(v){return this.inputEl().dom.value=(v===null||v===undefined?'':v);},selectText:function(A,B){var v=this.getRawValue();if(v.length>0){A=A===undefined?0:A;B=B===undefined?v.length:B;
+var d=this.inputEl().dom;if(d.setSelectionRange){d.setSelectionRange(A,B);}else if(d.createTextRange){var C=d.createTextRange();C.moveStart("character",A);C.moveEnd("character",v.length-B);C.select();}}},setValue:function(v){this.value=v;if(this.rendered){this.inputEl().dom.value=(v===null||v===undefined?'':v);
+this.validate();}},preFocus:function(){if(this.selectOnFocus){this.inputEl().dom.select();}},filterKeys:function(e){var k=e.getKey();if(!Roo.isIE&&(e.isNavKeyPress()||k==e.BACKSPACE||(k==e.DELETE&&e.button==-1))){return;}var c=e.getCharCode(),cc=String.fromCharCode(c);
+if(Roo.isIE&&(e.isSpecialKey()||!cc)){return;}if(!this.maskRe.test(cc)){e.stopEvent();}},clearInvalid:function(){if(!this.el||this.preventMark){return;}this.el.removeClass(this.invalidClass);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){var A=this.el.select('.form-control-feedback',true).first();
+if(A){this.el.select('.form-control-feedback',true).first().removeClass(this.invalidFeedbackClass);}}this.fireEvent('valid',this);},markValid:function(){if(!this.el||this.preventMark){return;}this.el.removeClass([this.invalidClass,this.validClass]);var A=this.el.select('.form-control-feedback',true).first();
+if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);}if(this.disabled||this.allowBlank){return;}var B=this.el.findParent('.form-group',false,true);if(B){var C=B.select('label',true).first();
+var D=B.select('i.fa-star',true).first();if(C&&D){D.remove();}}this.el.addClass(this.validClass);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank&&(this.getValue().length||this.forceFeedback)){var A=this.el.select('.form-control-feedback',true).first();
 if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);this.el.select('.form-control-feedback',true).first().addClass([this.validFeedbackClass]);}}this.fireEvent('valid',this);},markInvalid:function(A){if(!this.el||this.preventMark){return;
 }this.el.removeClass([this.invalidClass,this.validClass]);var B=this.el.select('.form-control-feedback',true).first();if(B){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);}if(this.disabled||this.allowBlank){return;
 }var C=this.el.findParent('.form-group',false,true);if(C){var D=C.select('label',true).first();var E=C.select('i.fa-star',true).first();if(!this.getValue().length&&D&&!E){this.el.findParent('.form-group',false,true).createChild({tag:'i',cls:'text-danger fa fa-lg fa-star',tooltip:'This field is required',style:'margin-right:5px;'}