X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=roojs-bootstrap.js;h=692ae872a171a3045c8bf5a82987dd52e1cf200e;hp=cf57021b7900ccc16d3a22352ef049a5fb68d2a8;hb=a79418f2d639838995134f03eb135328a1039665;hpb=8946284bad10596673ce59afe8ef1ea49ba0b790 diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index cf57021b79..692ae872a1 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -1,9 +1,21 @@ +// Roo/bootstrap/namespace.js +Roo.bootstrap={}; // Roo/bootstrap/version.js Roo.bootstrap.version=(function(){var A=3;Roo.each(document.styleSheets,function(s){if(s.href&&s.href.match(/css-bootstrap4/)){A=4;}});if(A>3){Roo.Element.prototype.visibilityMode=Roo.Element.DISPLAY;}return A;})(); +// Roo/bootstrap/menu/namespace.js +Roo.bootstrap.menu=Roo.bootstrap.menu||{}; +// Roo/bootstrap/nav/namespace.js +Roo.bootstrap.nav={}; +// Roo/bootstrap/form/namespace.js +Roo.bootstrap.form={}; +// Roo/bootstrap/panel/namespace.js +Roo.bootstrap.panel={}; +// Roo/bootstrap/layout/namespace.js +Roo.bootstrap.layout={}; // Roo/Shadow.js Roo.Shadow=function(A){Roo.apply(this,A);if(typeof this.mode!="string"){this.mode=this.defaultMode;}var o=this.offset,a={h:0};var B=Math.floor(this.offset/2);switch(this.mode.toLowerCase()){case "drop":a.w=0;a.l=a.t=o;a.t-=1;if(Roo.isIE){a.l-=this.offset+B; a.t-=this.offset+B;a.w-=B;a.h-=B;a.t+=1;}break;case "sides":a.w=(o*2);a.l=-o;a.t=o-1;if(Roo.isIE){a.l-=(this.offset-B);a.t-=this.offset+B;a.l+=1;a.w-=(this.offset-B)*2;a.w-=B+1;a.h-=1;}break;case "frame":a.w=a.h=(o*2);a.l=a.t=-o;a.t+=1;a.h-=2;if(Roo.isIE){a.l-=(this.offset-B); -a.t-=(this.offset-B);a.l+=1;a.w-=(this.offset+B+1);a.h-=(this.offset+B);a.h+=1;}break;};this.adjusts=a;};Roo.Shadow.prototype={offset:4,defaultMode:"drop",show:function(A){A=Roo.get(A);if(!this.el){this.el=Roo.Shadow.Pool.pull();if(this.el.dom.nextSibling!=A.dom){this.el.insertBefore(A); +a.t-=(this.offset-B);a.l+=1;a.w-=(this.offset+B+1);a.h-=(this.offset+B);a.h+=1;}break;};this.adjusts=a;};Roo.Shadow.prototype={mode:false,offset:4,defaultMode:"drop",show:function(A){A=Roo.get(A);if(!this.el){this.el=Roo.Shadow.Pool.pull();if(this.el.dom.nextSibling!=A.dom){this.el.insertBefore(A); }}this.el.setStyle("z-index",this.zIndex||parseInt(A.getStyle("z-index"),10)-1);if(Roo.isIE){this.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="+(this.offset)+")";}this.realign(A.getLeft(true),A.getTop(true),A.getWidth(),A.getHeight()); this.el.dom.style.display="block";},isVisible:function(){return this.el?true:false;},realign:function(l,t,w,h){if(!this.el){return;}var a=this.adjusts,d=this.el.dom,s=d.style;var A=0;s.left=(l+a.l)+"px";s.top=(t+a.t)+"px";var sw=(w+a.w),sh=(h+a.h),B=sw+"px",C=sh+"px"; if(s.width!=B||s.height!=C){s.width=B;s.height=C;if(!Roo.isIE){var cn=d.childNodes;var D=Math.max(0,(sw-12))+"px";cn[0].childNodes[1].style.width=D;cn[1].childNodes[1].style.width=D;cn[2].childNodes[1].style.width=D;cn[1].style.height=Math.max(0,(sh-12))+"px"; @@ -13,10 +25,10 @@ return {pull:function(){var sh=p.shift();if(!sh){sh=Roo.get(Roo.DomHelper.insert Roo.bootstrap=Roo.bootstrap||{};Roo.bootstrap.Component=function(A){Roo.bootstrap.Component.superclass.constructor.call(this,A);this.addEvents({"childrenrendered":true});};Roo.extend(Roo.bootstrap.Component,Roo.BoxComponent,{allowDomMove:false,cls:false,style:false,autoCreate:false,tooltip:null,initEvents:function(){} ,xattr:false,parentId:false,can_build_overlaid:true,container_method:false,dataId:false,name:false,parent:function(){return Roo.ComponentMgr.get(this.parentId)},onRender:function(ct,A){Roo.bootstrap.Component.superclass.onRender.call(this,ct,A);if(this.el){if(this.el.attr('xtype')){this.el.attr('xtypex',this.el.attr('xtype')); this.el.dom.removeAttribute('xtype');this.initEvents();}return;}var B=Roo.apply({},this.getAutoCreate());B.id=this.id||Roo.id();if(this.xattr&&typeof(this.xattr)=='object'){for(var i in this.xattr){B[i]=this.xattr[i];}}if(this.dataId){B.dataId=this.dataId; -}if(this.cls){B.cls=(typeof(B.cls)=='undefined')?this.cls:B.cls+' '+this.cls;}if(this.style){B.style=this.style;}if(this.name){B.name=this.name;}this.el=ct.createChild(B,A);if(this.tooltip){this.tooltipEl().attr('tooltip',this.tooltip);}if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex); -}this.initEvents();},getChildContainer:function(){return this.el;},getDocumentBody:function(){return Roo.get(document.body);},tooltipEl:function(){return this.el;},addxtype:function(A,B){var cn=this;cn=Roo.factory(A);cn.parentType=this.xtype;cn.parentId=this.id; -B=(typeof(B)=='undefined')?'getChildContainer':B;if(typeof(cn.container_method)=='string'){B=cn.container_method;}var C=(typeof(A['flexy:foreach'])!='undefined');var D=(typeof(A['flexy:if'])!='undefined');var E=Roo.XComponent.build_from_html;var F=(A.xtype=='Body'); -var G=(Roo.get(document.body).attr('xtype')=='Roo.bootstrap.Body');var H=Roo.get(this[B](false));if((C||D||this.can_build_overlaid==false)&&E){return false;}if(!C||!E||F||!G){if(!D||typeof(A.name)=='undefined'||!E||F||!G){return this.addxtypeChild(A,B,F); +}if(this.cls){B.cls=(typeof(B.cls)=='undefined'?this.cls:B.cls)+' '+this.cls;}if(this.style){B.style=(typeof(B.style)=='undefined'?this.style:B.style)+'; '+this.style;}if(this.name){B.name=this.name;}this.el=ct.createChild(B,A);if(this.tooltip){this.tooltipEl().attr('tooltip',this.tooltip); +}if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex);}this.initEvents();},getChildContainer:function(){return this.el;},getDocumentBody:function(){return Roo.get(document.body);},tooltipEl:function(){return this.el;},addxtype:function(A,B){var cn=this; +cn=Roo.factory(A);cn.parentType=this.xtype;cn.parentId=this.id;B=(typeof(B)=='undefined')?'getChildContainer':B;if(typeof(cn.container_method)=='string'){B=cn.container_method;}var C=(typeof(A['flexy:foreach'])!='undefined');var D=(typeof(A['flexy:if'])!='undefined'); +var E=Roo.XComponent.build_from_html;var F=(A.xtype=='Body');var G=(Roo.get(document.body).attr('xtype')=='Roo.bootstrap.Body');var H=Roo.get(this[B](false));if((C||D||this.can_build_overlaid==false)&&E){return false;}if(!C||!E||F||!G){if(!D||typeof(A.name)=='undefined'||!E||F||!G){return this.addxtypeChild(A,B,F); }var I=H?H.child('>*[name='+A.name+']'):false;if(I){return this.addxtypeChild(Roo.apply({},A),B);}Roo.log('skipping render');return cn;}var J=false;if(!E){return false;}while(true){var I=H?H.child('>*[xtype]'):false;if(!I){break;}if(I&&I.attr('xtype').split('.').pop()!=cn.xtype){break; }J=this.addxtypeChild(Roo.apply({},A),B);}return J;},addxtypeChild:function(A,B,C){Roo.debug&&Roo.log('addxtypeChild:'+B);var cn=this;B=(typeof(B)=='undefined')?'getChildContainer':B;var D=(typeof(A['flexy:if'])!='undefined')||(typeof(A['flexy:foreach'])!='undefined'); skip_children=false;if(!C){if(!this[B](true)){A.items=[];return A;}cn=Roo.factory(A);cn.parentType=this.xtype;cn.parentId=this.id;var E=Roo.XComponent.build_from_html;if(E&&Roo.get(document.body).attr('xtype')=='Roo.bootstrap.Body'){var F=Roo.get(this[B](false)); @@ -54,7 +66,7 @@ A.tag='ul';this.glyphicon='caret';if(Roo.bootstrap.version==4){this.fa='caret-do }if(A.tag!=='a'&&this.href!==''){throw "Tag must be a to set href.";}else if(this.href.length>0){A.href=this.href;}if(this.removeClass){A.cls='';}if(this.target){A.target=this.target;}return A;},initEvents:function(){if(typeof(this.menu)!='undefined'){this.menu.parentType=this.xtype; this.menu.triggerEl=this.el;this.addxtype(Roo.apply({},this.menu));}if(this.el.hasClass('roo-button')){this.el.on('click',this.onClick,this);this.el.on('dblclick',this.onDblClick,this);}else{this.el.select('.roo-button').on('click',this.onClick,this);this.el.select('.roo-button').on('dblclick',this.onDblClick,this); }if(this.removeClass){this.el.on('click',this.onClick,this);}if(this.group===true){if(this.pressed===false||this.pressed===true){}else{this.pressed=false;this.setActive(this.pressed);}}this.el.enableDisplayMode();},onClick:function(e){if(this.disabled){return; -}Roo.log('button on click ');if(this.preventDefault){e.preventDefault();}if(this.group){if(this.pressed){return;}this.setActive(true);var pi=this.parent().items;for(var i=0;i-1){A.cls+=' img-'+B.border;}if(B.alt){A.alt=B.alt;}if(B.href){var a={tag:'a',href:B.href,cn:[D]};if(this.target){a.target=B.target; -}}A.cn.push((B.href)?a:D);});return A;},createSingleImg:function(){var A={tag:'img',cls:(this.imgResponsive)?'img-responsive':'',html:null,src:'about:blank'};A.html=this.html||A.html;A.src=this.src||A.src;if(['rounded','circle','thumbnail'].indexOf(this.border)>-1){A.cls+=' img-'+this.border; -}if(this.alt){A.alt=this.alt;}if(this.href){var a={tag:'a',href:this.href,cn:[A]};if(this.target){a.target=this.target;}}return (this.href)?a:A;},initEvents:function(){if(!this.href){this.el.on('click',this.onClick,this);}},onClick:function(e){Roo.log('img onclick'); -this.fireEvent('click',this,e);},setSrc:function(A){this.src=A;if(this.src||(!this.xsUrl&&!this.smUrl&&!this.mdUrl&&!this.lgUrl)){this.el.dom.src=A;return;}this.el.select('img',true).first().dom.src=A;}}); +}}A.cn.push((B.href)?a:D);});return A;},createSingleImg:function(){var A={tag:'img',cls:(this.imgResponsive)?'img-responsive':'',html:null,src:Roo.BLANK_IMAGE_URL};if(this.backgroundContain){A.cls+=' background-contain';}A.html=this.html||A.html;if(this.backgroundContain){A.style="background-image: url("+this.src+')'; +}else{A.src=this.src||A.src;}if(['rounded','circle','thumbnail'].indexOf(this.border)>-1){A.cls+=' img-'+this.border;}if(this.alt){A.alt=this.alt;}if(this.href){var a={tag:'a',href:this.href,cn:[A]};if(this.target){a.target=this.target;}}return (this.href)?a:A; +},initEvents:function(){if(!this.href){this.el.on('click',this.onClick,this);}if(this.src||(!this.xsUrl&&!this.smUrl&&!this.mdUrl&&!this.lgUrl)){this.el.on('load',this.onImageLoad,this);}else{this.el.select('img',true).on('load',this.onImageLoad,this);}},onClick:function(e){Roo.log('img onclick'); +this.fireEvent('click',this,e);},onImageLoad:function(e){Roo.log('img load');this.fireEvent('load',this,e);},setSrc:function(A){this.src=A;if(this.src||(!this.xsUrl&&!this.smUrl&&!this.mdUrl&&!this.lgUrl)){if(this.backgroundContain){this.el.dom.style.backgroundImage='url('+A+')'; +}else{this.el.dom.src=A;}return;}this.el.select('img',true).first().dom.src=A;}}); // Roo/bootstrap/Link.js Roo.bootstrap.Link=function(A){Roo.bootstrap.Link.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.Link,Roo.bootstrap.Component,{href:false,target:false,preventDefault:false,anchor:false,alt:false,fa:false,getAutoCreate:function(){var A=this.html||''; if(this.fa!==false){A='';}var B={tag:'a'};if(this.anchor===false){B.html=A;B.href=this.href||'#';}else{B.name=this.anchor;if(this.html!==false||this.fa!==false){B.html=A;}if(this.href!==false){B.href=this.href;}}if(this.alt!==false){B.alt=this.alt; @@ -142,67 +156,68 @@ if(this.fa!==false){A='';}var B={tag:'a'};if(th // Roo/bootstrap/Header.js Roo.bootstrap.Header=function(A){Roo.bootstrap.Header.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Header,Roo.bootstrap.Component,{html:false,level:1,getAutoCreate:function(){var A={tag:'h'+(1*this.level),html:this.html||''};return A;}}); -// Roo/bootstrap/MenuMgr.js -Roo.bootstrap.MenuMgr=function(){var A,B,C={},D=false,E=new Date();function init(){A={};B=new Roo.util.MixedCollection();Roo.get(document).addKeyListener(27,function(){if(B.length>0){hideAll();}});}function hideAll(){if(B&&B.length>0){var c=B.clone();c.each(function(m){m.hide(); -});}}function onHide(m){B.remove(m);if(B.length<1){Roo.get(document).un("mouseup",onMouseDown);D=false;}}function onShow(m){var F=B.last();E=new Date();B.add(m);if(!D){Roo.get(document).on("mouseup",onMouseDown);D=true;}if(m.parentMenu){m.parentMenu.activeChild=m; +// Roo/bootstrap/menu/Manager.js +Roo.bootstrap.menu.Manager=function(){var A,B,C={},D=false,E=new Date();function init(){A={};B=new Roo.util.MixedCollection();Roo.get(document).addKeyListener(27,function(){if(B.length>0){hideAll();}});}function hideAll(){if(B&&B.length>0){var c=B.clone(); +c.each(function(m){m.hide();});}}function onHide(m){B.remove(m);if(B.length<1){Roo.get(document).un("mouseup",onMouseDown);D=false;}}function onShow(m){var F=B.last();E=new Date();B.add(m);if(!D){Roo.get(document).on("mouseup",onMouseDown);D=true;}if(m.parentMenu){m.parentMenu.activeChild=m; }else if(F&&F.isVisible()){}}function onBeforeHide(m){if(m.activeChild){m.activeChild.hide();}if(m.autoHideTimer){clearTimeout(m.autoHideTimer);delete m.autoHideTimer;}}function onBeforeShow(m){var pm=m.parentMenu;if(!pm&&!m.allowOtherMenus){hideAll();}else if(pm&&pm.activeChild&&B!=m){pm.activeChild.hide(); }}function onMouseDown(e){Roo.log("on Mouse Up");if(E.getElapsed()>50&&B.length>0&&!e.getTarget(".dropdown-menu")&&!e.getTarget('.user-menu')){Roo.log("MenuManager hideAll");hideAll();e.stopEvent();}}function onBeforeCheck(mi,F){if(F){var g=C[mi.group];for(var i=0,l=g.length; i=Roo.lib.Dom.getViewWidth()){xy=this.el.getAlignToXY(el,this.align.replace('/l/g','r'))}if(xy[0]<0){xy=this.el.getAlignToXY(el,this.align.replace('/r/g','l'))}if(this.el.getHeight()+xy[1]>=Roo.lib.Dom.getViewHeight()||xy[1]<0){var a=this.align.replace('?','').split('-'); -xy=this.el.getAlignToXY(el,a[1]+'-'+a[0]+'?')}this.showAt(xy,B,false);},showAt:function(xy,A,_e){this.parentMenu=A;if(!this.el){this.render();}if(_e!==false){this.fireEvent("beforeshow",this);}this.hideMenuItems();this.hidden=false;this.triggerEl.addClass('open'); -this.el.addClass('show');if(this.el.getStyle('top')!='auto'&&this.el.getStyle('top').slice(-1)!="%"){this.el.setXY(xy);}this.focus();this.fireEvent("show",this);},focus:function(){return;if(!this.hidden){this.doFocus.defer(50,this);}},doFocus:function(){if(!this.hidden){this.focusEl.focus(); -}},hide:function(A){if(false===this.fireEvent("beforehide",this)){Roo.log("hide canceled");return;}this.hideMenuItems();if(this.el&&this.isVisible()){if(this.activeItem){this.activeItem.deactivate();this.activeItem=null;}this.triggerEl.removeClass('open'); -;this.el.removeClass('show');this.hidden=true;this.fireEvent("hide",this);}if(A===true&&this.parentMenu){this.parentMenu.hide(true);}},onTriggerClick:function(e){Roo.log('trigger click');var A=e.getTarget();Roo.log(A.nodeName.toLowerCase());if(A.nodeName.toLowerCase()==='i'){e.preventDefault(); +xy=this.el.getAlignToXY(el,a[1]+'-'+a[0]+'?')}this.showAt(xy,B,false);},showAt:function(xy,A,_e){this.parentMenu=A;if(!this.el){this.render();}if(_e!==false){this.fireEvent("beforeshow",this);}this.hideMenuItems();this.hidden=false;if(this.triggerEl){this.triggerEl.addClass('open'); +}this.el.addClass('show');if(this.el.getStyle('top')!='auto'&&this.el.getStyle('top').slice(-1)!="%"){this.el.setXY(xy);}this.focus();this.fireEvent("show",this);},focus:function(){return;if(!this.hidden){this.doFocus.defer(50,this);}},doFocus:function(){if(!this.hidden){this.focusEl.focus(); +}},hide:function(A){if(false===this.fireEvent("beforehide",this)){Roo.log("hide canceled");return;}this.hideMenuItems();if(this.el&&this.isVisible()){if(this.activeItem){this.activeItem.deactivate();this.activeItem=null;}if(this.triggerEl){this.triggerEl.removeClass('open'); +}this.el.removeClass('show');this.hidden=true;this.fireEvent("hide",this);}if(A===true&&this.parentMenu){this.parentMenu.hide(true);}},onTriggerClick:function(e){Roo.log('trigger click');var A=e.getTarget();Roo.log(A.nodeName.toLowerCase());if(A.nodeName.toLowerCase()==='i'){e.preventDefault(); }},onTriggerPress:function(e){Roo.log('trigger press');var A=Roo.get(e.getTarget());if(A.findParent('.dropdown-menu')||A.findParent('.treeview-menu')){Roo.log('is treeview or dropdown?');return;}if(e.getTarget().nodeName.toLowerCase()!=='i'&&this.isLink){return; }if(this.isVisible()){Roo.log('hide');this.hide();}else{Roo.log('show');this.show(this.triggerEl,this.align,false);}if(this.stopEvent||e.getTarget().nodeName.toLowerCase()==='i'){e.stopEvent();}},hideMenuItems:function(){Roo.log("hide Menu Items");if(!this.el){return; -}this.el.select('.open',true).each(function(aa){aa.removeClass('open');});},addxtypeChild:function(A,B){var C=Roo.bootstrap.Menu.superclass.addxtypeChild.call(this,A,B);this.menuitems.add(C);return C;},getEl:function(){Roo.log(this.el);return this.el;},clear:function(){this.getEl().dom.innerHTML=''; -this.menuitems.clear();}}); -// Roo/bootstrap/MenuItem.js -Roo.bootstrap.MenuItem=function(A){Roo.bootstrap.MenuItem.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.MenuItem,Roo.bootstrap.Component,{href:false,html:false,preventDefault:false,isContainer:false,active:false,fa:false,getAutoCreate:function(){if(this.isContainer){return {tag:'li',cls:'dropdown-menu-item '} +}this.el.select('.open',true).each(function(aa){aa.removeClass('open');});},addxtypeChild:function(A,B){var C=Roo.bootstrap.menu.Menu.superclass.addxtypeChild.call(this,A,B);this.menuitems.add(C);return C;},getEl:function(){Roo.log(this.el);return this.el; +},clear:function(){this.getEl().dom.innerHTML='';this.menuitems.clear();}}); +// Roo/bootstrap/menu/Item.js +Roo.bootstrap.menu.Item=function(A){Roo.bootstrap.menu.Item.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.menu.Item,Roo.bootstrap.Component,{href:false,html:false,preventDefault:false,isContainer:false,active:false,fa:false,getAutoCreate:function(){if(this.isContainer){return {tag:'li',cls:'dropdown-menu-item '} ;}var A={tag:'span',html:'Link'};var B={tag:'a',cls:'dropdown-item',href:'#',cn:[]};if(this.fa!==false){B.cn.push({tag:'i',cls:'fa fa-'+this.fa});}B.cn.push(A);var C={tag:'li',cls:'dropdown-menu-item',cn:[B]};if(this.parent().type=='treeview'){C.cls='treeview-menu'; }if(this.active){C.cls+=' active';}B.href=this.href||C.cn[0].href;A.html=this.html||C.cn[0].html;return C;},initEvents:function(){if(this.parent().type=='treeview'){this.el.select('a').on('click',this.onClick,this);}if(this.menu){this.menu.parentType=this.xtype; -this.menu.triggerEl=this.el;this.menu=this.addxtype(Roo.apply({},this.menu));}},onClick:function(e){Roo.log('item on click ');if(this.preventDefault){e.preventDefault();}this.fireEvent('click',this,e);},getEl:function(){return this.el;}}); -// Roo/bootstrap/MenuSeparator.js -Roo.bootstrap.MenuSeparator=function(A){Roo.bootstrap.MenuSeparator.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.MenuSeparator,Roo.bootstrap.Component,{getAutoCreate:function(){var A={cls:'divider',tag:'li'};return A;}}); +this.menu.triggerEl=this.el;this.menu=this.addxtype(Roo.apply({},this.menu));}},onClick:function(e){if(this.href===false||this.preventDefault){e.preventDefault();}this.fireEvent('click',this,e);},getEl:function(){return this.el;}}); +// Roo/bootstrap/menu/Separator.js +Roo.bootstrap.menu.Separator=function(A){Roo.bootstrap.menu.Separator.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.menu.Separator,Roo.bootstrap.Component,{getAutoCreate:function(){var A={tag:'li',cls:'dropdown-divider divider'};return A;} +}); // Roo/bootstrap/Modal.js Roo.bootstrap.Modal=function(A){Roo.bootstrap.Modal.superclass.constructor.call(this,A);this.addEvents({"btnclick":true,"resize":true,"titlechanged":true});this.buttons=this.buttons||[];if(this.tmpl){this.tmpl=Roo.factory(this.tmpl);}};Roo.extend(Roo.bootstrap.Modal,Roo.bootstrap.Component,{title:'test dialog',buttons:false,html:false,tmp:false,specificTitle:false,buttonPosition:'right',allow_close:true,animate:true,fitwindow:false,dialogEl:false,bodyEl:false,footerEl:false,titleEl:false,closeEl:false,size:'',max_width:0,max_height:0,fit_content:false,editableTitle:false,onRender:function(ct,A){Roo.bootstrap.Component.superclass.onRender.call(this,ct,A); if(!this.el){var B=Roo.apply({},this.getAutoCreate());B.id=Roo.id();if(this.cls){B.cls+=' '+this.cls;}if(this.style){B.style=this.style;}this.el=Roo.get(document.body).createChild(B,A);}if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex); }this.dialogEl=this.el.select('.modal-dialog',true).first();this.bodyEl=this.el.select('.modal-body',true).first();this.closeEl=this.el.select('.modal-header .close',true).first();this.headerEl=this.el.select('.modal-header',true).first();this.titleEl=this.el.select('.modal-title',true).first(); this.footerEl=this.el.select('.modal-footer',true).first();this.maskEl=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-dlg-mask"},true);if(this.buttons.length){Roo.each(this.buttons,function(bb){var b=Roo.apply({},bb);b.xns=b.xns||Roo.bootstrap;b.xtype=b.xtype||'Button'; if(typeof(b.listeners)=='undefined'){b.listeners={click:this.onButtonClick.createDelegate(this)};}var E=Roo.factory(b);E.render(this.getButtonContainer());},this);}var C=[];if(typeof(this.items)!='undefined'){var D=this.items;delete this.items;for(var i=0; -i-1){this.toggleHeaderInput(false)}},this);this.headerEditEl.on('blur',function(e){this.toggleHeaderInput(false)},this);}},resize:function(){this.maskEl.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true)); if(this.fitwindow){this.dialogEl.setStyle({'max-width':'100%'});this.setSize(this.width||Roo.lib.Dom.getViewportWidth(true)-30,this.height||Roo.lib.Dom.getViewportHeight(true));return;}if(this.max_width!==0){var w=Math.min(this.max_width,Roo.lib.Dom.getViewportWidth(true)-30); if(this.height){this.setSize(w,this.height);return;}if(this.max_height){this.setSize(w,Math.min(this.max_height,Roo.lib.Dom.getViewportHeight(true)-60));return;}if(!this.fit_content){this.setSize(w,Roo.lib.Dom.getViewportHeight(true)-60);return;}this.setSize(w,Math.min(60+this.headerEl.getHeight()+this.footerEl.getHeight()+this.getChildHeight(this.bodyEl.dom.childNodes),Roo.lib.Dom.getViewportHeight(true)-60)); -}},setSize:function(w,h){if(!w&&!h){return;}this.resizeTo(w,h);},show:function(){if(!this.rendered){this.render();}this.toggleHeaderInput(false);this.el.removeClass('hideing');this.el.dom.style.display='block';Roo.get(document.body).addClass('modal-open'); -if(this.animate){(function(){this.el.addClass('show');this.el.addClass('in');}).defer(50,this);}else{this.el.addClass('show');this.el.addClass('in');}Roo.get(document.body).addClass("x-body-masked");this.maskEl.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true)); -this.maskEl.setStyle('z-index',Roo.bootstrap.Modal.zIndex++);this.maskEl.dom.style.display='block';this.maskEl.addClass('show');this.resize();this.fireEvent('show',this);this.el.setStyle('z-index',Roo.bootstrap.Modal.zIndex++);(function(){this.items.forEach(function(e){e.layout?e.layout():false; -});}).defer(100,this);},hide:function(){if(this.fireEvent("beforehide",this)!==false){this.maskEl.removeClass('show');this.maskEl.dom.style.display='';Roo.get(document.body).removeClass("x-body-masked");this.el.removeClass('in');this.el.select('.modal-dialog',true).first().setStyle('transform',''); -if(this.animate){this.el.addClass('hideing');this.el.removeClass('show');(function(){if(!this.el.hasClass('hideing')){return;}this.el.dom.style.display='';Roo.get(document.body).removeClass('modal-open');this.el.removeClass('hideing');}).defer(150,this);} -else{this.el.removeClass('show');this.el.dom.style.display='';Roo.get(document.body).removeClass('modal-open');}this.fireEvent('hide',this);}},isVisible:function(){return this.el.hasClass('show')&&!this.el.hasClass('hideing');},addButton:function(A,cb){var b=Roo.apply({} -,{html:A});b.xns=b.xns||Roo.bootstrap;b.xtype=b.xtype||'Button';if(typeof(b.listeners)=='undefined'){b.listeners={click:cb.createDelegate(this)};}var B=Roo.factory(b);B.render(this.getButtonContainer());return B;},setDefaultButton:function(A){},resizeTo:function(w,h){this.dialogEl.setWidth(w); -var A=this.headerEl.getHeight()+this.footerEl.getHeight()+60;this.bodyEl.setHeight(h-A);this.fireEvent('resize',this);},setContentSize:function(w,h){},onButtonClick:function(A,e){this.fireEvent('btnclick',A.name,e);},setTitle:function(A){this.titleEl.dom.innerHTML=A; -this.title=A;},setBody:function(A){this.bodyEl.dom.innerHTML=A;},applyBody:function(A){if(!this.tmpl){Roo.log("Error - using apply Body without a template");}this.tmpl.overwrite(this.bodyEl,A);},getChildHeight:function(A){if(!A||A.length==0){return 0;}var B=0; -for(var i=0;i-1){A.cls+=['light','white'].indexOf(this.weight)>-1?' navbar-light':' navbar-dark';}A.cls+=' bg-'+this.weight;if(this.inverse){A.cls+=' navbar-inverse';}if(Roo.bootstrap.version==4&&this.xtype=='NavSimplebar'){return A; }A.cn=[{cls:'nav nav-'+this.xtype,tag:'ul'}];this.type=this.type||'nav';if(['tabs','pills'].indexOf(this.type)!=-1){A.cn[0].cls+=' nav-'+this.type}else{if(this.type!=='nav'){Roo.log('nav type must be nav/tabs/pills')}A.cn[0].cls+=' navbar-nav'}if(['stacked','justified'].indexOf(this.arrangement)!=-1){A.cn[0].cls+=' nav-'+this.arrangement; }if(this.align==='right'){A.cn[0].cls+=' navbar-right';}return A;}}); -// Roo/bootstrap/NavHeaderbar.js -Roo.bootstrap.NavHeaderbar=function(A){Roo.bootstrap.NavHeaderbar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.NavHeaderbar,Roo.bootstrap.NavSimplebar,{position:'',brand:'',brand_href:false,srButton:true,autohide:false,desktopCenter:false,getAutoCreate:function(){var A={tag:this.nav||'nav',cls:'navbar navbar-expand-md',role:'navigation',cn:[]} +// Roo/bootstrap/nav/Headerbar.js +Roo.bootstrap.nav.Headerbar=function(A){Roo.bootstrap.nav.Headerbar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.nav.Headerbar,Roo.bootstrap.nav.Simplebar,{position:'',brand:'',brand_href:false,srButton:true,autohide:false,desktopCenter:false,getAutoCreate:function(){var A={tag:this.nav||'nav',cls:'navbar navbar-expand-md',role:'navigation',cn:[]} ;var cn=A.cn;if(this.desktopCenter){cn.push({cls:'container',cn:[]});cn=cn[0].cn;}if(this.srButton){var B={tag:'button',type:'button',cls:'navbar-toggle navbar-toggler','data-toggle':'collapse',cn:[{tag:'span',cls:'sr-only',html:'Toggle navigation'},{tag:'span',cls:'icon-bar navbar-toggler-icon'} ,{tag:'span',cls:'icon-bar'},{tag:'span',cls:'icon-bar'}]};cn.push(Roo.bootstrap.version==4?B:{tag:'div',cls:'navbar-header',cn:[B]});}cn.push({tag:'div',cls:Roo.bootstrap.version==4?'nav flex-row roo-navbar-collapse collapse navbar-collapse':'collapse navbar-collapse roo-navbar-collapse',cn:[]} );A.cls+=this.inverse?' navbar-inverse navbar-dark bg-dark':' navbar-default';if(['light','white'].indexOf(this.weight)>-1){A.cls+=['light','white'].indexOf(this.weight)>-1?' navbar-light':' navbar-dark';}A.cls+=' bg-'+this.weight;if(['fixed-top','fixed-bottom','static-top'].indexOf(this.position)>-1){A.cls+=' navbar-'+this.position+' '+this.position; A.tag=this.tag||(this.position=='fixed-bottom'?'footer':'header');}if(this.brand!==''){var cp=Roo.bootstrap.version==4?cn:cn[0].cn;cp.unshift({tag:'a',href:this.brand_href?this.brand_href:'#',cls:'navbar-brand',cn:[this.brand]});}if(this.main){A.cls+=' main-nav'; }return A;},getHeaderChildContainer:function(){if(this.srButton&&this.el.select('.navbar-header').getCount()){return this.el.select('.navbar-header',true).first();}return this.getChildContainer();},getChildContainer:function(){return this.el.select('.roo-navbar-collapse',true).first(); -},initEvents:function(){Roo.bootstrap.NavHeaderbar.superclass.initEvents.call(this);if(this.autohide){var A=0;var ft=this.el;Roo.get(document).on('scroll',function(e){var ns=Roo.get(document).getScroll().top;var os=A;A=ns;if(ns>os){ft.removeClass('slideDown'); +},initEvents:function(){Roo.bootstrap.nav.Headerbar.superclass.initEvents.call(this);if(this.autohide){var A=0;var ft=this.el;Roo.get(document).on('scroll',function(e){var ns=Roo.get(document).getScroll().top;var os=A;A=ns;if(ns>os){ft.removeClass('slideDown'); ft.addClass('slideUp');return;}ft.removeClass('slideUp');ft.addClass('slideDown');},this);}}}); -// Roo/bootstrap/NavSidebar.js -Roo.bootstrap.NavSidebar=function(A){Roo.bootstrap.NavSidebar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.NavSidebar,Roo.bootstrap.Navbar,{sidebar:true,getAutoCreate:function(){return {tag:'div',cls:'sidebar sidebar-nav'};}}); -// Roo/bootstrap/NavGroup.js -Roo.bootstrap.NavGroup=function(A){Roo.bootstrap.NavGroup.superclass.constructor.call(this,A);this.navItems=[];Roo.bootstrap.NavGroup.register(this);this.addEvents({'changed':true});};Roo.extend(Roo.bootstrap.NavGroup,Roo.bootstrap.Component,{align:'',inverse:false,form:false,type:'nav',navId:'',pilltype:true,navItems:false,getAutoCreate:function(){var A=Roo.apply({} -,Roo.bootstrap.NavGroup.superclass.getAutoCreate.call(this));A={tag:'ul',cls:'nav'};if(Roo.bootstrap.version==4){if(['tabs','pills'].indexOf(this.type)!=-1){A.cls+=' nav-'+this.type;}else{if(this.parent()&&this.parent().xtype!='NavHeaderbar'){A.cls+=' navbar-nav'; +// Roo/bootstrap/nav/Sidebar.js +Roo.bootstrap.nav.Sidebar=function(A){Roo.bootstrap.nav.Sidebar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.nav.Sidebar,Roo.bootstrap.nav.Bar,{sidebar:true,getAutoCreate:function(){return {tag:'div',cls:'sidebar sidebar-nav'};}}); +// Roo/bootstrap/nav/Group.js +Roo.bootstrap.nav.Group=function(A){Roo.bootstrap.nav.Group.superclass.constructor.call(this,A);this.navItems=[];Roo.bootstrap.nav.Group.register(this);this.addEvents({'changed':true});};Roo.extend(Roo.bootstrap.nav.Group,Roo.bootstrap.Component,{align:'',inverse:false,form:false,type:'nav',navId:'',pilltype:true,navItems:false,getAutoCreate:function(){var A=Roo.apply({} +,Roo.bootstrap.nav.Group.superclass.getAutoCreate.call(this));A={tag:'ul',cls:'nav'};if(Roo.bootstrap.version==4){if(['tabs','pills'].indexOf(this.type)!=-1){A.cls+=' nav-'+this.type;}else{if(this.parent()&&this.parent().xtype!='NavHeaderbar'){A.cls+=' navbar-nav'; }}}else{if(['tabs','pills'].indexOf(this.type)!=-1){A.cls+=' nav-'+this.type}else{if(this.type!=='nav'){Roo.log('nav type must be nav/tabs/pills')}A.cls+=' navbar-nav'}}if(this.parent()&&this.parent().sidebar){A={tag:'ul',cls:'dashboard-menu sidebar-menu'} ;return A;}if(this.form===true){A={tag:'form',cls:'navbar-form form-inline'};if(this.align==='right'){A.cls+=' navbar-right ml-md-auto';}else{A.cls+=' navbar-left';}}if(this.align==='right'){A.cls+=' navbar-right ml-md-auto';}else{A.cls+=' mr-auto';}if(this.inverse){A.cls+=' navbar-inverse'; }return A;},setActiveItem:function(A){var B=false;Roo.each(this.navItems,function(v){if(v==A){return;}if(v.isActive()){v.setActive(false,true);B=v;}});A.setActive(true,true);this.fireEvent('changed',this,A,B);},getActive:function(){var A=false;Roo.each(this.navItems,function(v){if(v.isActive()){A=v; -}});return A;},indexOfNav:function(){var A=false;Roo.each(this.navItems,function(v,i){if(v.isActive()){A=i;}});return A;},addItem:function(A){if(this.form&&Roo.bootstrap.version==4){A.tag='div';}var cn=new Roo.bootstrap.NavItem(A);this.register(cn);cn.parentId=this.id; +}});return A;},indexOfNav:function(){var A=false;Roo.each(this.navItems,function(v,i){if(v.isActive()){A=i;}});return A;},addItem:function(A){if(this.form&&Roo.bootstrap.version==4){A.tag='div';}var cn=new Roo.bootstrap.nav.Item(A);this.register(cn);cn.parentId=this.id; cn.onRender(this.el,null);return cn;},register:function(A){this.navItems.push(A);A.navId=this.navId;},clearAll:function(){this.navItems=[];this.el.dom.innerHTML='';},getNavItem:function(A){var B=false;Roo.each(this.navItems,function(e){if(e.tabId==A){B=e; return false;}return true;});return B;},setActiveNext:function(){var i=this.indexOfNav(this.getActive());if(i>this.navItems.length){return;}this.setActiveItem(this.navItems[i+1]);},setActivePrev:function(){var i=this.indexOfNav(this.getActive());if(i<1){return; }this.setActiveItem(this.navItems[i-1]);},clearWasActive:function(A){Roo.each(this.navItems,function(e){if(e.tabId!=A.tabId&&e.was_active){e.was_active=false;return false;}return true;});},getWasActive:function(){var r=false;Roo.each(this.navItems,function(e){if(e.was_active){r=e; -return false;}return true;});return r;}});Roo.apply(Roo.bootstrap.NavGroup,{groups:{},register:function(A){this.groups[A.navId]=A;},get:function(A){if(typeof(this.groups[A])=='undefined'){return false;}return this.groups[A];}}); -// Roo/bootstrap/NavItem.js -Roo.bootstrap.NavItem=function(A){Roo.bootstrap.NavItem.superclass.constructor.call(this,A);this.addEvents({"click":true,'changed':true,'scrollto':true});};Roo.extend(Roo.bootstrap.NavItem,Roo.bootstrap.Component,{href:false,html:'',badge:'',icon:false,fa:false,glyphicon:false,active:false,preventDefault:false,tabId:false,tagtype:'a',tag:'li',disabled:false,animateRef:false,was_active:false,button_weight:'',button_outline:false,linkcls:'',navLink:false,getAutoCreate:function(){var A={tag:this.tag,cls:'nav-item'} +return false;}return true;});return r;}});Roo.apply(Roo.bootstrap.nav.Group,{groups:{},register:function(A){this.groups[A.navId]=A;},get:function(A){if(typeof(this.groups[A])=='undefined'){return false;}return this.groups[A];}}); +// Roo/bootstrap/nav/Item.js +Roo.bootstrap.nav.Item=function(A){Roo.bootstrap.nav.Item.superclass.constructor.call(this,A);this.addEvents({"click":true,'changed':true,'scrollto':true});};Roo.extend(Roo.bootstrap.nav.Item,Roo.bootstrap.Component,{href:false,html:'',badge:'',icon:false,fa:false,glyphicon:false,active:false,preventDefault:false,tabId:false,tagtype:'a',tag:'li',disabled:false,animateRef:false,was_active:false,button_weight:'',button_outline:false,linkcls:'',navLink:false,getAutoCreate:function(){var A={tag:this.tag,cls:'nav-item'} ;A.cls=typeof(A.cls)=='undefined'?'':A.cls;if(this.active){A.cls+=' active';}if(this.disabled){A.cls+=' disabled';}if(this.button_weight.length){A.tag=this.href?'a':'button';A.html=this.html||'';A.cls+=' btn btn'+(this.button_outline?'-outline':'')+'-'+this.button_weight; if(this.href){A.href=this.href;}if(this.fa){A.html=' '+this.html+'';}else{A.cls+=" nav-html";}if(this.badge!==''){A.html+=' '+this.badge+'';}return A; }if(this.href||this.html||this.glyphicon||this.icon||this.fa){A.cn=[{tag:this.tagtype,href:this.href||"#",html:this.html||'',cls:''}];if(this.tagtype=='a'){A.cn[0].cls='nav-link'+(this.active?' active':'')+' '+this.linkcls;}if(this.icon){A.cn[0].html=' '+A.cn[0].html+''; }else if(this.fa){A.cn[0].html=' '+A.cn[0].html+'';}else if(this.glyphicon){A.cn[0].html=' '+A.cn[0].html;}else{A.cn[0].cls+=" nav-html"; }if(this.menu){A.cn[0].html+=" ";}if(this.badge!==''){A.cn[0].html+=' '+this.badge+'';}}return A;},onRender:function(ct,A){if(Roo.bootstrap.version==4&&ct.dom.type!='ul'){this.tag='div'; -}var B=Roo.bootstrap.NavItem.superclass.onRender.call(this,ct,A);this.navLink=this.el.select('.nav-link',true).first();this.htmlEl=this.el.hasClass('nav-html')?this.el:this.el.select('.nav-html',true).first();return B;},initEvents:function(){if(typeof(this.menu)!='undefined'){this.menu.parentType=this.xtype; -this.menu.triggerEl=this.el;this.menu=this.addxtype(Roo.apply({},this.menu));}this.el.on('click',this.onClick,this);this.parent().register(this);},onClick:function(e){if(e.getTarget('.dropdown-menu-item')){return;}if(this.preventDefault||this.href=='#'){Roo.log("NavItem - prevent Default?"); -e.preventDefault();}if(this.disabled){return;}var tg=Roo.bootstrap.TabGroup.get(this.navId);if(tg&&tg.transition){Roo.log("waiting for the transitionend");return;}if(this.fireEvent('click',this,e)===false){return;};if(this.tagtype=='span'){return;}var A=this.el.select('a',true).first(); +}var B=Roo.bootstrap.nav.Item.superclass.onRender.call(this,ct,A);this.navLink=this.el.select('.nav-link',true).first();this.htmlEl=this.el.hasClass('nav-html')?this.el:this.el.select('.nav-html',true).first();return B;},initEvents:function(){if(typeof(this.menu)!='undefined'){this.menu.parentType=this.xtype; +this.menu.triggerEl=this.el;this.menu=this.addxtype(Roo.apply({},this.menu));}this.el.on('click',this.onClick,this);this.parent().register(this);},onClick:function(e){if(e.getTarget('.dropdown-menu-item')){return;}if(this.preventDefault||this.href===false||this.href==='#'){e.preventDefault(); +}if(this.disabled){return;}var tg=Roo.bootstrap.TabGroup.get(this.navId);if(tg&&tg.transition){Roo.log("waiting for the transitionend");return;}if(this.fireEvent('click',this,e)===false){return;};if(this.tagtype=='span'){return;}var A=this.el.select('a',true).first(); if(A&&this.animateRef&&this.href.indexOf('#')>-1){if(A.dom.href.split("#")[0]!=document.location.toString().split("#")[0]){return;}Roo.log("NavItem - prevent Default?");e.preventDefault();this.scrollToElement(e);}var p=this.parent();if(['tabs','pills'].indexOf(p.type)!==-1&&p.pilltype){if(typeof(p.setActiveItem)!=='undefined'){p.setActiveItem(this); -}}if(p.parentType=='NavHeaderbar'&&!this.menu){p.parent().el.select('.roo-navbar-collapse',true).removeClass('in');}},isActive:function(){return this.active},setActive:function(A,B,C){if(this.active&&!A&&this.navId){this.was_active=true;var nv=Roo.bootstrap.NavGroup.get(this.navId); +}}if(p.parentType=='NavHeaderbar'&&!this.menu){p.parent().el.select('.roo-navbar-collapse',true).removeClass('in');}},isActive:function(){return this.active},setActive:function(A,B,C){if(this.active&&!A&&this.navId){this.was_active=true;var nv=Roo.bootstrap.nav.Group.get(this.navId); if(nv){nv.clearWasActive(this);}}this.active=A;if(!A){this.el.removeClass('active');this.navLink?this.navLink.removeClass('active'):false;}else if(!this.el.hasClass('active')){this.el.addClass('active');if(Roo.bootstrap.version==4&&this.navLink){this.navLink.addClass('active'); -}}if(B){this.fireEvent('changed',this,A);}if(!this.navId||!this.tabId||!A||C){return;}var tg=Roo.bootstrap.TabGroup.get(this.navId);if(!tg){return;}var D=tg.getPanelByName(this.tabId);if(!D){return;}if(false==tg.showPanel(D)){var nv=Roo.bootstrap.NavGroup.get(this.navId); +}}if(B){this.fireEvent('changed',this,A);}if(!this.navId||!this.tabId||!A||C){return;}var tg=Roo.bootstrap.TabGroup.get(this.navId);if(!tg){return;}var D=tg.getPanelByName(this.tabId);if(!D){return;}if(false==tg.showPanel(D)){var nv=Roo.bootstrap.nav.Group.get(this.navId); if(nv){var E=nv.getWasActive();if(E){E.setActive(true,false,true);}}}},setDisabled:function(A){this.disabled=A;if(!A){this.el.removeClass('disabled');}else if(!this.el.hasClass('disabled')){this.el.addClass('disabled');}},tooltipEl:function(){return this.el; },scrollToElement:function(e){var c=document.body;if(Roo.isFirefox||Roo.isIE||Roo.isIE11){c=document.documentElement;}var A=Roo.get(c).select('a[name='+this.href.split('#')[1]+']',true).first();if(!A){return;}var o=A.calcOffsetsTo(c);var B={target:A,value:o[1]} ;this.fireEvent('scrollto',this,B,e);Roo.get(c).scrollTo('top',B.value,true);return;},setHtml:function(A){this.html=A;this.htmlEl.dom.innerHTML=A;}}); -// Roo/bootstrap/NavSidebarItem.js -Roo.bootstrap.NavSidebarItem=function(A){Roo.bootstrap.NavSidebarItem.superclass.constructor.call(this,A);this.addEvents({"click":true,'changed':true});};Roo.extend(Roo.bootstrap.NavSidebarItem,Roo.bootstrap.NavItem,{badgeWeight:'default',open:false,buttonView:false,buttonWeight:'default',buttonSize:'md',showArrow:true,getAutoCreate:function(){var a={tag:'a',href:this.href||'#',cls:'',html:'',cn:[]} +// Roo/bootstrap/nav/SidebarItem.js +Roo.bootstrap.nav.SidebarItem=function(A){Roo.bootstrap.nav.SidebarItem.superclass.constructor.call(this,A);this.addEvents({"click":true,'changed':true});};Roo.extend(Roo.bootstrap.nav.SidebarItem,Roo.bootstrap.nav.Item,{badgeWeight:'default',open:false,buttonView:false,buttonWeight:'default',buttonSize:'md',showArrow:true,getAutoCreate:function(){var a={tag:'a',href:this.href||'#',cls:'',html:'',cn:[]} ;if(this.buttonView){a={tag:'button',href:this.href||'#',cls:'btn btn-'+this.buttonWeight+' btn-'+this.buttonSize+'roo-button-dropdown-toggle',html:this.html,cn:[]};}var A={tag:'li',cls:'',cn:[a]};if(this.active){A.cls+=' active';}if(this.disabled){A.cls+=' disabled'; }if(this.open){A.cls+=' open x-open';}if(this.glyphicon||this.icon){var c=this.glyphicon?('glyphicon glyphicon-'+this.glyphicon):this.icon;a.cn.push({tag:'i',cls:c});}if(!this.buttonView){var B={tag:'span',html:this.html||''};a.cn.push(B);}if(this.badge!==''){a.cn.push({tag:'span',cls:'badge pull-right badge-'+this.badgeWeight,html:this.badge} );}if(this.menu){if(this.showArrow){a.cn.push({tag:'i',cls:'glyphicon glyphicon-chevron-down pull-right'});}a.cls+=' dropdown-toggle treeview';}return A;},initEvents:function(){if(typeof(this.menu)!='undefined'){this.menu.parentType=this.xtype;this.menu.triggerEl=this.el; @@ -284,6 +299,23 @@ this.menu=this.addxtype(Roo.apply({},this.menu));}this.el.on('click',this.onClic return;}if(this.preventDefault){e.preventDefault();}this.fireEvent('click',this,e);},disable:function(){this.setDisabled(true);},enable:function(){this.setDisabled(false);},setDisabled:function(A){if(this.disabled==A){return;}this.disabled=A;if(A){this.el.addClass('disabled'); return;}this.el.removeClass('disabled');return;},setActive:function(A){if(this.active==A){return;}this.active=A;if(A){this.el.addClass('active');return;}this.el.removeClass('active');return;},isActive:function(){return this.active;},setBadge:function(A){if(!this.badgeEl){return; }this.badgeEl.dom.innerHTML=A;}}); +// Roo/bootstrap/nav/ProgressBar.js +Roo.bootstrap.nav.ProgressBar=function(A){Roo.bootstrap.nav.ProgressBar.superclass.constructor.call(this,A);this.bullets=this.bullets||[];this.addEvents({'changed':true});};Roo.extend(Roo.bootstrap.nav.ProgressBar,Roo.bootstrap.Component,{bullets:[],barItems:[],getAutoCreate:function(){var A=Roo.apply({} +,Roo.bootstrap.nav.ProgressBar.superclass.getAutoCreate.call(this));A={tag:'div',cls:'roo-navigation-bar-group',cn:[{tag:'div',cls:'roo-navigation-top-bar'},{tag:'div',cls:'roo-navigation-bullets-bar',cn:[{tag:'ul',cls:'roo-navigation-bar'}]},{tag:'div',cls:'roo-navigation-bottom-bar'} +]};return A;},initEvents:function(){},onRender:function(ct,A){Roo.bootstrap.nav.ProgressBar.superclass.onRender.call(this,ct,A);if(this.bullets.length){Roo.each(this.bullets,function(b){this.addItem(b);},this);}this.format();},addItem:function(A){var B=new Roo.bootstrap.nav.ProgressItem(A); +B.parentId=this.id;B.render(this.el.select('.roo-navigation-bar',true).first(),null);if(A.html){var C=new Roo.bootstrap.Element({tag:'div',cls:'roo-navigation-bar-text'});var D=new Roo.bootstrap.Element({tag:'div',cls:'roo-navigation-bar-text'});C.onRender(this.el.select('.roo-navigation-top-bar',true).first(),null); +D.onRender(this.el.select('.roo-navigation-bottom-bar',true).first(),null);var E=new Roo.bootstrap.Element({tag:'span',html:(typeof(A.position)!='undefined'&&A.position=='top')?A.html:''});var F=new Roo.bootstrap.Element({tag:'span',html:(typeof(A.position)!='undefined'&&A.position=='top')?'':A.html} +);E.onRender(C.el,null);F.onRender(D.el,null);B.topEl=C;B.bottomEl=D;}this.barItems.push(B);return B;},getActive:function(){var A=false;Roo.each(this.barItems,function(v){if(!v.isActive()){return;}A=v;return false;});return A;},setActiveItem:function(A){var B=false; +Roo.each(this.barItems,function(v){if(v.rid==A.rid){return;}if(v.isActive()){v.setActive(false);B=v;}});A.setActive(true);this.fireEvent('changed',this,A,B);},getBarItem:function(A){var B=false;Roo.each(this.barItems,function(e){if(e.rid!=A){return;}B=e;return false; +});return B;},indexOfItem:function(A){var B=false;Roo.each(this.barItems,function(v,i){if(v.rid!=A.rid){return;}B=i;return false});return B;},setActiveNext:function(){var i=this.indexOfItem(this.getActive());if(i>this.barItems.length){return;}this.setActiveItem(this.barItems[i+1]); +},setActivePrev:function(){var i=this.indexOfItem(this.getActive());if(i<1){return;}this.setActiveItem(this.barItems[i-1]);},format:function(){if(!this.barItems.length){return;}var A=100/this.barItems.length;Roo.each(this.barItems,function(i){i.el.setStyle('width',A+'%'); +i.topEl.el.setStyle('width',A+'%');i.bottomEl.el.setStyle('width',A+'%');},this);}}); +// Roo/bootstrap/nav/ProgressBarItem.js +Roo.bootstrap.nav.ProgressBarItem=function(A){Roo.bootstrap.nav.ProgressBarItem.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.nav.ProgressBarItem,Roo.bootstrap.Component,{rid:'',active:false,disabled:false,html:'',position:'bottom',icon:false,getAutoCreate:function(){var A='roo-navigation-bar-item-icon'; +A+=((this.icon)?(' '+this.icon):(' step-number'));var B={tag:'li',cls:'roo-navigation-bar-item',cn:[{tag:'i',cls:A}]};if(this.active){B.cls+=' active';}if(this.disabled){B.cls+=' disabled';}return B;},disable:function(){this.setDisabled(true);},enable:function(){this.setDisabled(false); +},initEvents:function(){this.iconEl=this.el.select('.roo-navigation-bar-item-icon',true).first();this.iconEl.on('click',this.onClick,this);},onClick:function(e){e.preventDefault();if(this.disabled){return;}if(this.fireEvent('click',this,e)===false){return; +};this.parent().setActiveItem(this);},isActive:function(){return this.active;},setActive:function(A){if(this.active==A){return;}this.active=A;if(A){this.el.addClass('active');return;}this.el.removeClass('active');return;},setDisabled:function(A){if(this.disabled==A){return; +}this.disabled=A;if(A){this.el.addClass('disabled');return;}this.el.removeClass('disabled');},tooltipEl:function(){return this.el.select('.roo-navigation-bar-item-icon',true).first();;}}); // Roo/bootstrap/breadcrumb/Nav.js Roo.namespace('Roo.bootstrap.breadcrumb');Roo.bootstrap.breadcrumb.Nav=function(A){Roo.bootstrap.breadcrumb.Nav.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.breadcrumb.Nav,Roo.bootstrap.Component,{getAutoCreate:function(){var A={tag:'nav',cn:[{tag:'ol',cls:'breadcrumb'} ]};return A;},initEvents:function(){this.olEl=this.el.select('ol',true).first();},getChildContainer:function(){return this.olEl;}}); @@ -303,82 +335,126 @@ Roo.bootstrap.PaginationItem=function(A){Roo.bootstrap.PaginationItem.superclass // Roo/bootstrap/Slider.js Roo.bootstrap.Slider=function(A){Roo.bootstrap.Slider.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Slider,Roo.bootstrap.Component,{getAutoCreate:function(){var A={tag:'div',cls:'slider slider-sample1 vertical-handler ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all',cn:[{tag:'a',cls:'ui-slider-handle ui-state-default ui-corner-all'} ]};return A;}}); +// Roo/grid/SplitDragZone.js +Roo.grid.SplitDragZone=function(A,hd,B){this.grid=A;this.view=A.getView();this.proxy=this.view.resizeProxy;Roo.grid.SplitDragZone.superclass.constructor.call(this,hd,"gridSplitters"+this.grid.getGridEl().id,{dragElId:Roo.id(this.proxy.dom),resizeFrame:false} +);this.setHandleElId(Roo.id(hd));if(B!==false){this.setOuterHandleElId(Roo.id(B));}this.scroll=false;};Roo.extend(Roo.grid.SplitDragZone,Roo.dd.DDProxy,{fly:Roo.Element.fly,b4StartDrag:function(x,y){this.view.headersDisabled=true;var h=this.view.mainWrap?this.view.mainWrap.getHeight():(this.view.headEl.getHeight()+this.view.bodyEl.getHeight()); +this.proxy.setHeight(h);var w=this.cm.getColumnWidth(this.cellIndex);if(!this.view.mainWrap){w=this.view.getHeaderIndex(this.cellIndex).getWidth();}var A=Math.max(w-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(A,1000);this.setYConstraint(0,0); +this.minX=x-A;this.maxX=x+1000;this.startPos=x;if(!this.view.mainWrap){this.getDragEl().style.display='block';}Roo.dd.DDProxy.prototype.b4StartDrag.call(this,x,y);},handleMouseDown:function(e){ev=Roo.EventObject.setEvent(e);var t=this.fly(ev.getTarget()); +if(t.hasClass("x-grid-split")){this.cellIndex=this.view.getCellIndex(t.dom);this.split=t.dom;this.cm=this.grid.colModel;if(this.cm.isResizable(this.cellIndex)&&!this.cm.isFixed(this.cellIndex)){Roo.grid.SplitDragZone.superclass.handleMouseDown.apply(this,arguments); +}}},endDrag:function(e){this.view.headersDisabled=false;var A=Math.max(this.minX,Roo.lib.Event.getPageX(e));var B=A-this.startPos;var w=this.cm.getColumnWidth(this.cellIndex);if(!this.view.mainWrap){w=0;}this.view.onColumnSplitterMoved(this.cellIndex,w+B); +},autoOffset:function(){this.setDelta(0,0);}}); +// Roo/grid/AbstractSelectionModel.js +Roo.grid.AbstractSelectionModel=function(){this.locked=false;Roo.grid.AbstractSelectionModel.superclass.constructor.call(this);};Roo.extend(Roo.grid.AbstractSelectionModel,Roo.util.Observable,{init:function(A){this.grid=A;this.initEvents();},lock:function(){this.locked=true; +},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;}}); +// Roo/grid/RowSelectionModel.js +Roo.grid.RowSelectionModel=function(A){Roo.apply(this,A);this.selections=new Roo.util.MixedCollection(false,function(o){return o.id;});this.last=false;this.lastActive=false;this.addEvents({"selectionchange":true,"afterselectionchange":true,"beforerowselect":true,"rowselect":true,"rowdeselect":true} +);Roo.grid.RowSelectionModel.superclass.constructor.call(this);this.locked=false;};Roo.extend(Roo.grid.RowSelectionModel,Roo.grid.AbstractSelectionModel,{singleSelect:false,initEvents:function(){if(!this.grid.enableDragDrop&&!this.grid.enableDrag){this.grid.on("mousedown",this.handleMouseDown,this); +}else{this.grid.on("rowclick",this.handleDragableRowClick,this);}var A=this.grid.view?this.grid.view:this.grid;this.rowNav=new Roo.KeyNav(this.grid.getGridEl(),{"up":function(e){if(!e.shiftKey){this.selectPrevious(e.shiftKey);}else if(this.last!==false&&this.lastActive!==false){var B=this.last; +this.selectRange(this.last,this.lastActive-1);A.focusRow(this.lastActive);if(B!==false){this.last=B;}}else{this.selectFirstRow();}this.fireEvent("afterselectionchange",this);},"down":function(e){if(!e.shiftKey){this.selectNext(e.shiftKey);}else if(this.last!==false&&this.lastActive!==false){var B=this.last; +this.selectRange(this.last,this.lastActive+1);A.focusRow(this.lastActive);if(B!==false){this.last=B;}}else{this.selectFirstRow();}this.fireEvent("afterselectionchange",this);},scope:this});A.on("refresh",this.onRefresh,this);A.on("rowupdated",this.onRowUpdated,this); +A.on("rowremoved",this.onRemove,this);},onRefresh:function(){var ds=this.grid.ds,i,v=this.grid.view;var s=this.selections;s.each(function(r){if((i=ds.indexOfId(r.id))!=-1){v.onRowSelect(i);s.add(ds.getAt(i));}else{s.remove(r);}});},onRemove:function(v,A,r){this.selections.remove(r); +},onRowUpdated:function(v,A,r){if(this.isSelected(r)){v.onRowSelect(A);}},selectRecords:function(A,B){if(!B){this.clearSelections();}var ds=this.grid.ds;for(var i=0,C=A.length;i0;},isSelected:function(A){var r=typeof A=="number"?this.grid.ds.getAt(A):A;return (r&&this.selections.key(r.id)?true:false); +},isIdSelected:function(id){return (this.selections.key(id)?true:false);},handleMouseDown:function(e,t){var A=this.grid.view?this.grid.view:this.grid;var B;if(this.isLocked()||(B=A.findRowIndex(t))===false){return;};if(e.shiftKey&&this.last!==false){var C=this.last; +this.selectRange(C,B,e.ctrlKey);this.last=C;A.focusRow(B);}else{var D=this.isSelected(B);if(e.button!==0&&D){A.focusRow(B);}else if(e.ctrlKey&&D){this.deselectRow(B);}else if(!D){this.selectRow(B,e.button===0&&(e.ctrlKey||e.shiftKey));A.focusRow(B);}}this.fireEvent("afterselectionchange",this); +},handleDragableRowClick:function(A,B,e){if(e.button===0&&!e.shiftKey&&!e.ctrlKey){this.selectRow(B,false);var C=this.grid.view?this.grid.view:this.grid;C.focusRow(B);this.fireEvent("afterselectionchange",this);}},selectRows:function(A,B){if(!B){this.clearSelections(); +}for(var i=0,C=A.length;i=B;i--){this.selectRow(i,true);}}},deselectRange:function(A,B,C){if(this.locked){return; +}for(var i=A;i<=B;i++){this.deselectRow(i,C);}},selectRow:function(A,B,C){if(this.locked||(A<0||A>=this.grid.ds.getCount())){return;}if(this.fireEvent("beforerowselect",this,A,B)!==false){if(!B||this.singleSelect){this.clearSelections();}var r=this.grid.ds.getAt(A); +this.selections.add(r);this.last=this.lastActive=A;if(!C){var D=this.grid.view?this.grid.view:this.grid;D.onRowSelect(A);}this.fireEvent("rowselect",this,A,r);this.fireEvent("selectionchange",this);}},deselectRow:function(A,B){if(this.locked){return;}if(this.last==A){this.last=false; +}if(this.lastActive==A){this.lastActive=false;}var r=this.grid.ds.getAt(A);this.selections.remove(r);if(!B){var C=this.grid.view?this.grid.view:this.grid;C.onRowDeselect(A);}this.fireEvent("rowdeselect",this,A);this.fireEvent("selectionchange",this);},restoreLast:function(){if(this._last){this.last=this._last; +}},acceptsNav:function(A,B,cm){return !cm.isHidden(B)&&cm.isCellEditable(B,A);},onEditorKey:function(A,e){var k=e.getKey(),B,g=this.grid,ed=g.activeEditor;if(k==e.TAB){e.stopEvent();ed.completeEdit();if(e.shiftKey){B=g.walkCells(ed.row,ed.col-1,-1,this.acceptsNav,this); +}else{B=g.walkCells(ed.row,ed.col+1,1,this.acceptsNav,this);}}else if(k==e.ENTER&&!e.ctrlKey){e.stopEvent();ed.completeEdit();if(e.shiftKey){B=g.walkCells(ed.row-1,ed.col,-1,this.acceptsNav,this);}else{B=g.walkCells(ed.row+1,ed.col,1,this.acceptsNav,this); +}}else if(k==e.ESC){ed.cancelEdit();}if(B){g.startEditing(B[0],B[1]);}}}); // Roo/grid/ColumnModel.js -Roo.grid.ColumnModel=function(A){this.config=A;this.lookup={};for(var i=0,B=A.length;i-1?this.config[B]:false;},getIndexById:function(id){for(var i=0,A=this.config.length;i=0&&this.config[A].resizable!==false&&this.config[A].fixed!==true; -},setHidden:function(A,B){this.config[A].hidden=B;this.totalWidth=null;this.fireEvent("hiddenchange",this,A,B);},setEditor:function(A,B){this.config[A].editor=B;}});Roo.grid.ColumnModel.defaultRenderer=function(A){if(typeof A=="object"){return A;}if(typeof A=="string"&&A.length<1){return " "; -}return String.format("{0}",A);};Roo.grid.DefaultColumnModel=Roo.grid.ColumnModel; +}return this.config[A].renderer;},setRenderer:function(A,fn){this.config[A].renderer=fn;},getColumnWidth:function(A,B){var C=this.config[A];if(typeof(B)=='undefined'){return C.width*1||this.defaultWidth;}if(B===false){return C.width||false;}var D=['xl','lg','md','sm','xs']; +for(var i=D.indexOf(B);i=0&&this.config[A].resizable!==false&&this.config[A].fixed!==true; +},setHidden:function(A,B){this.config[A].hidden=B;this.totalWidth=null;this.fireEvent("hiddenchange",this,A,B);},setEditor:function(A,B){this.config[A].editor=B;},addColumn:function(c){var i=this.config.length;this.config[i]=c;if(typeof c.dataIndex=="undefined"){c.dataIndex=i; +}if(typeof c.renderer=="string"){c.renderer=Roo.util.Format[c.renderer];}if(typeof c.id=="undefined"){c.id=Roo.id();}if(c.editor&&c.editor.xtype){c.editor=Roo.factory(c.editor,Roo.grid);}if(c.editor&&c.editor.isFormField){c.editor=new Roo.grid.GridEditor(c.editor); +}this.lookup[c.id]=c;}});Roo.grid.ColumnModel.defaultRenderer=function(A){if(typeof A=="object"){return A;}if(typeof A=="string"&&A.length<1){return " ";}return String.format("{0}",A);};Roo.grid.DefaultColumnModel=Roo.grid.ColumnModel; // Roo/LoadMask.js Roo.LoadMask=function(el,A){this.el=Roo.get(el);Roo.apply(this,A);if(this.store){this.store.on('beforeload',this.onBeforeLoad,this);this.store.on('load',this.onLoad,this);this.store.on('loadexception',this.onLoadException,this);this.removeMask=false;}else{var um=this.el.getUpdateManager(); -um.showLoadIndicator=false;um.on('beforeupdate',this.onBeforeLoad,this);um.on('update',this.onLoad,this);um.on('failure',this.onLoad,this);this.removeMask=true;}};Roo.LoadMask.prototype={msg:'Loading...',msgCls:'x-mask-loading',disabled:false,disable:function(){this.disabled=true; +um.showLoadIndicator=false;um.on('beforeupdate',this.onBeforeLoad,this);um.on('update',this.onLoad,this);um.on('failure',this.onLoad,this);this.removeMask=true;}};Roo.LoadMask.prototype={removeMask:false,msg:'Loading...',msgCls:'x-mask-loading',disabled:false,disable:function(){this.disabled=true; },enable:function(){this.disabled=false;},onLoadException:function(){Roo.log(arguments);if(typeof(arguments[3])!='undefined'){Roo.MessageBox.alert("Error loading",arguments[3]);}(function(){this.el.unmask(this.removeMask);}).defer(50,this);},onLoad:function(){(function(){this.el.unmask(this.removeMask); }).defer(50,this);},onBeforeLoad:function(){if(!this.disabled){(function(){this.el.mask(this.msg,this.msgCls);}).defer(50,this);}},destroy:function(){if(this.store){this.store.un('beforeload',this.onBeforeLoad,this);this.store.un('load',this.onLoad,this); this.store.un('loadexception',this.onLoadException,this);}else{var um=this.el.getUpdateManager();um.un('beforeupdate',this.onBeforeLoad,this);um.un('update',this.onLoad,this);um.un('failure',this.onLoad,this);}}}; // Roo/bootstrap/Table.js Roo.bootstrap.Table=function(A){Roo.bootstrap.Table.superclass.constructor.call(this,A);this.rowSelection=(typeof(A.rowSelection)!='undefined')?A.rowSelection:this.rowSelection;this.cellSelection=(typeof(A.cellSelection)!='undefined')?A.cellSelection:this.cellSelection; -this.headerShow=(typeof(A.thead)!='undefined')?A.thead:this.headerShow;this.footerShow=(typeof(A.tfoot)!='undefined')?A.tfoot:this.footerShow;this.sm=this.sm||{xtype:'RowSelectionModel'};if(this.sm){this.sm.grid=this;this.selModel=Roo.factory(this.sm,Roo.bootstrap.Table); +this.headerShow=(typeof(A.thead)!='undefined')?A.thead:this.headerShow;this.footerShow=(typeof(A.tfoot)!='undefined')?A.tfoot:this.footerShow;this.view=this;this.sm=this.sm||{xtype:'RowSelectionModel'};if(this.sm){this.sm.grid=this;this.selModel=Roo.factory(this.sm,Roo.grid); this.sm=this.selModel;this.sm.xmodule=this.xmodule||false;}if(this.cm&&typeof(this.cm.config)=='undefined'){this.colModel=new Roo.grid.ColumnModel(this.cm);this.cm=this.colModel;this.cm.xmodule=this.xmodule||false;}if(this.store){this.store=Roo.factory(this.store,Roo.data); -this.ds=this.store;this.ds.xmodule=this.xmodule||false;}if(this.footer&&this.store){this.footer.dataSource=this.ds;this.footer=Roo.factory(this.footer);}this.addEvents({"cellclick":true,"celldblclick":true,"rowclick":true,"rowdblclick":true,"mouseover":true,"mouseout":true,'rowclass':true,'rowsrendered':true,"contextmenu":true,"rowcontextmenu":true,"cellcontextmenu":true,"headercontextmenu":true} -);};Roo.extend(Roo.bootstrap.Table,Roo.bootstrap.Component,{cls:false,align:false,bgcolor:false,border:false,cellpadding:false,cellspacing:false,frame:false,rules:false,sortable:false,summary:false,width:false,striped:false,scrollBody:false,bordered:false,hover:false,condensed:false,responsive:false,sm:false,cm:false,store:false,loadMask:false,footerShow:true,headerShow:true,rowSelection:false,cellSelection:false,layout:false,mainBody:false,mainHead:false,container:false,lazyLoad:false,CSS:Roo.util.CSS,auto_hide_footer:false,getAutoCreate:function(){var A=Roo.apply({} +this.ds=this.store;this.ds.xmodule=this.xmodule||false;}if(this.footer&&this.store){this.footer.dataSource=this.ds;this.footer=Roo.factory(this.footer);}this.addEvents({"cellclick":true,"celldblclick":true,"rowclick":true,"rowdblclick":true,"mouseover":true,"mouseout":true,'rowclass':true,'rowsrendered':true,"contextmenu":true,"rowcontextmenu":true,"cellcontextmenu":true,"headercontextmenu":true,"mousedown":true} +);};Roo.extend(Roo.bootstrap.Table,Roo.bootstrap.Component,{cls:false,empty_results:'',striped:false,scrollBody:false,bordered:false,hover:false,condensed:false,responsive:false,sm:false,cm:false,store:false,loadMask:false,footerShow:true,headerShow:true,enableColumnResize:true,rowSelection:false,cellSelection:false,layout:false,minColumnWidth:50,bodyEl:false,headEl:false,resizeProxy:false,container:false,lazyLoad:false,CSS:Roo.util.CSS,auto_hide_footer:false,view:false,getAutoCreate:function(){var A=Roo.apply({} ,Roo.bootstrap.Table.superclass.getAutoCreate.call(this));A={tag:'table',cls:'table',cn:[]};if(this.scrollBody){A.cls+=' table-body-fixed';}if(this.striped){A.cls+=' table-striped';}if(this.hover){A.cls+=' table-hover';}if(this.bordered){A.cls+=' table-bordered'; -}if(this.condensed){A.cls+=' table-condensed';}if(this.responsive){A.cls+=' table-responsive';}if(this.cls){A.cls+=' '+this.cls;}var _t=this;var cp=['align','bgcolor','border','cellpadding','cellspacing','frame','rules','sortable','summary','width'].forEach(function(k){if(_t[k]){A[k]=_t[k]; -}});if(this.layout){A.style=(typeof(A.style)=='undefined')?('table-layout:'+this.layout+';'):(A.style+('table-layout:'+this.layout+';'));}if(this.store||this.cm){if(this.headerShow){A.cn.push(this.renderHeader());}A.cn.push(this.renderBody());if(this.footerShow){A.cn.push(this.renderFooter()); -}}return {cn:[A]};},initEvents:function(){if(!this.store||!this.cm){return;}if(this.selModel){this.selModel.initEvents();}this.mainBody=this.el.select('tbody',true).first();this.mainHead=this.el.select('thead',true).first();this.mainFoot=this.el.select('tfoot',true).first(); -var A=this;Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.on('click',A.sort,A);});this.mainBody.on("click",this.onClick,this);this.mainBody.on("dblclick",this.onDblClick,this);if(this.footer){this.footer.parentId=this.id;this.footer.onRender(this.el.select('tfoot tr td').first(),null); -if(this.lazyLoad){this.el.select('tfoot tr td').first().addClass('hide');}}if(this.loadMask){this.maskEl=new Roo.LoadMask(this.el,{store:this.ds,msgCls:'roo-el-mask-msg'});}this.store.on('load',this.onLoad,this);this.store.on('beforeload',this.onBeforeLoad,this); -this.store.on('update',this.onUpdate,this);this.store.on('add',this.onAdd,this);this.store.on("clear",this.clear,this);this.el.on("contextmenu",this.onContextMenu,this);this.mainBody.on('scroll',this.onBodyScroll,this);this.cm.on("headerchange",this.onHeaderChange,this); -this.cm.on("hiddenchange",this.onHiddenChange,this,arguments);},onContextMenu:function(e,t){this.processEvent("contextmenu",e);},processEvent:function(A,e){if(A!='touchstart'){this.fireEvent(A,e);}var t=e.getTarget();var B=Roo.get(t);if(!B){return;}if(B.findParent('tfoot',false,true)){return; +}if(this.condensed){A.cls+=' table-condensed';}if(this.responsive){A.cls+=' table-responsive';}if(this.cls){A.cls+=' '+this.cls;}if(this.layout){A.style=(typeof(A.style)=='undefined')?('table-layout:'+this.layout+';'):(A.style+('table-layout:'+this.layout+';')); +}if(this.store||this.cm){if(this.headerShow){A.cn.push(this.renderHeader());}A.cn.push(this.renderBody());if(this.footerShow){A.cn.push(this.renderFooter());}}return {cn:[A]};},initEvents:function(){if(!this.store||!this.cm){return;}if(this.selModel){this.selModel.initEvents(); +}this.bodyEl=this.el.select('tbody',true).first();this.headEl=this.el.select('thead',true).first();this.mainFoot=this.el.select('tfoot',true).first();Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.on('click',this.sort,this);},this); +if(this.footer){this.footer.parentId=this.id;this.footer.onRender(this.el.select('tfoot tr td').first(),null);if(this.lazyLoad){this.el.select('tfoot tr td').first().addClass('hide');}}if(this.loadMask){this.maskEl=new Roo.LoadMask(this.el,{store:this.ds,msgCls:'roo-el-mask-msg'} +);}this.store.on('load',this.onLoad,this);this.store.on('beforeload',this.onBeforeLoad,this);this.store.on('update',this.onUpdate,this);this.store.on('add',this.onAdd,this);this.store.on("clear",this.clear,this);this.el.on("contextmenu",this.onContextMenu,this); +this.cm.on("headerchange",this.onHeaderChange,this);this.cm.on("hiddenchange",this.onHiddenChange,this,arguments);this.bodyEl.on("click",this.onClick,this);this.bodyEl.on("dblclick",this.onDblClick,this);this.bodyEl.on('scroll',this.onBodyScroll,this);this.relayEvents(this.bodyEl,["mousedown","mouseup","mouseover","mouseout","keypress"]); +this.resizeProxy=Roo.get(document.body).createChild({cls:"x-grid-resize-proxy",html:' '});if(this.headEl&&this.enableColumnResize!==false&&Roo.grid.SplitDragZone){new Roo.grid.SplitDragZone(this,this.headEl.dom,false);}this.initCSS();},getView:function(){return this; +},initCSS:function(){var cm=this.cm,A=[];this.CSS.removeStyleSheet(this.id+'-cssrules');var B=this.headEl?this.headEl.dom.clientHeight:0;var sz=Roo.getGridSize();var C=0;var D=-1;var E=[];var F=0;for(var i=0,G=cm.getColumnCount();i0){D=i}C+=w;E.push({rel:w,abs:false});}var H=this.bodyEl.dom.clientWidth-F;var I=Math.floor(H/C);var J=H-(I*C); +var K,L,M=0,N,O;for(var i=0,G=cm.getColumnCount();i';}if(typeof(C.mdHeader)!='undefined'){hh+=''; -}if(typeof(C.smHeader)!='undefined'){hh+='';}if(typeof(C.xsHeader)!='undefined'){hh+='';}if(hh.length){c.html=hh;}if(typeof(C.tooltip)!='undefined'){c.tooltip=C.tooltip; -}if(typeof(C.colspan)!='undefined'){c.colspan=C.colspan;}if(typeof(C.hidden)!='undefined'&&C.hidden){c.style+=' display:none;';}if(typeof(C.dataIndex)!='undefined'){c.sort=C.dataIndex;}if(typeof(C.align)!='undefined'&&C.align.length){c.style+=' text-align:'+C.align+';'; -}if(typeof(C.width)!='undefined'){c.style+=' width:'+C.width+'px;';this.totalWidth+=C.width;}else{this.totalWidth+=100;}if(typeof(C.cls)!='undefined'){c.cls=(typeof(c.cls)=='undefined')?C.cls:(c.cls+' '+C.cls);}['xs','sm','md','lg'].map(function(D){if(typeof(C[D])=='undefined'){return; -}if(!C[D]){c.cls+=' hidden-'+D+' hidden'+D+'-down';return;}c.cls+=' col-'+D+'-'+C[D]+(D=='xs'?(' col-'+C[D]):'');});A.cn.push(c)}return A;},renderBody:function(){var A={tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:this.cm.getColumnCount()}]}]};return A; -},renderFooter:function(){var A={tag:'tfoot',cn:[{tag:'tr',cn:[{tag:'td',colspan:this.cm.getColumnCount()}]}]};return A;},onLoad:function(){this.clear();var A=this;var cm=this.cm;var ds=this.store;Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.select('i',true).removeClass(['glyphicon-arrow-up','glyphicon-arrow-down']); -if(A.store.sortInfo){if(e.hasClass('sortable')&&e.attr('sort')==A.store.sortInfo.field&&A.store.sortInfo.direction.toUpperCase()=='ASC'){e.select('i',true).addClass(['glyphicon-arrow-up']);}if(e.hasClass('sortable')&&e.attr('sort')==A.store.sortInfo.field&&A.store.sortInfo.direction.toUpperCase()=='DESC'){e.select('i',true).addClass(['glyphicon-arrow-down']); -}}});var B=this.mainBody;if(ds.getCount()>0){ds.data.each(function(d,E){var F=this.renderRow(cm,ds,E);B.createChild(F);var G=this;if(F.cellObjects.length){Roo.each(F.cellObjects,function(r){G.renderCellObject(r);})}},this);}var C=this.el.select('tfoot',true).first(); -if(this.footerShow&&this.auto_hide_footer&&this.mainFoot){this.mainFoot.setVisibilityMode(Roo.Element.DISPLAY).hide();var D=this.ds.getTotalCount();if(this.footer.pageSize tr',true).elements;if(typeof(D[B])!='undefined'){bt.removeChild(D[B].dom);}if(C!==true){this.fireEvent("rowremoved",this,B,A);}},onAdd:function(ds,A,B){var bt=this.mainBody.dom;for(var i=0;i tr',true).elements;return (typeof(B[A])=='undefined')?false:B[A];},renderRow:function(cm,ds,A){var d=ds.getAt(A);var B={tag:'tr',cls:'x-row-'+A,cn:[]};var C=[]; -for(var i=0,D=cm.getColumnCount();i tr',true).elements;if(typeof(C[A])=='undefined'){return; -}C[A].dom.style.display=B?'':'none';},getSelectionModel:function(){if(!this.selModel){this.selModel=new Roo.bootstrap.Table.RowSelectionModel({grid:this});}return this.selModel;},renderCellObject:function(r){var A=this;r.cfg.parentId=(typeof(r.container)=='string')?r.container:r.container.id; -var t=r.cfg.render(r.container);if(r.cfg.cn){Roo.each(r.cfg.cn,function(c){var B={container:t.getChildContainer(),cfg:c};A.renderCellObject(B);})}},getRowIndex:function(A){var B=-1;Roo.each(this.el.select('tbody > tr',true).elements,function(el,C){if(el!=A){return; -}B=C;});return B;},getGridEl:function(){return this.el;},autoSize:function(){var A=Roo.get(this.el.dom);var B=this.getGridEl().select('thead',true).first();var C=this.getGridEl().select('tbody',true).first();var D=this.getGridEl().select('tfoot',true).first(); -var cw=A.getWidth();this.getGridEl().select('tfoot tr, tfoot td',true).setWidth(cw);if(C){C.setWidth(A.getWidth());var E=(C.dom.offsetWidth-C.dom.clientWidth);cw-=E;}cw=Math.max(cw,this.totalWidth);this.getGridEl().select('tbody tr',true).setWidth(cw);return; -},onBodyScroll:function(){if(this.mainHead){this.mainHead.setStyle({'position':'relative','left':(-1*this.mainBody.dom.scrollLeft)+'px'});}if(this.lazyLoad){var A=this.mainBody.dom.scrollHeight;var B=Math.ceil(this.mainBody.getScroll().top);var C=this.mainBody.getHeight(); -if(A-C==B){var D=this.ds.getTotalCount();if(this.footer.cursor+this.footer.pageSize'; +}if(typeof(C.mdHeader)!='undefined'){hh+='';}if(typeof(C.smHeader)!='undefined'){hh+='';}if(typeof(C.xsHeader)!='undefined'){hh+=''; +}if(hh.length){c.html=hh;}if(typeof(C.tooltip)!='undefined'){c.tooltip=C.tooltip;}if(typeof(C.colspan)!='undefined'){c.colspan=C.colspan;}if(typeof(C.dataIndex)!='undefined'){c.sort=C.dataIndex;}if(typeof(C.align)!='undefined'&&C.align.length){c.style+=' text-align:'+C.align+';'; +}if(typeof(C.cls)!='undefined'){c.cls=(typeof(c.cls)=='undefined')?C.cls:(c.cls+' '+C.cls);}if(this.responsive){['xs','sm','md','lg'].map(function(E){if(typeof(C[E])=='undefined'){return;}if(!C[E]){c.cls+=' hidden-'+E+' hidden'+E+'-down';return;}c.cls+=' col-'+E+'-'+C[E]+(E=='xs'?(' col-'+C[E]):''); +});}c.html+=' ';A.cn.push(c)}return A;},renderBody:function(){var A={tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:this.cm.getColumnCount()}]}]};return A;},renderFooter:function(){var A={tag:'tfoot',cn:[{tag:'tr',cn:[{tag:'td',colspan:this.cm.getColumnCount()} +]}]};return A;},onLoad:function(){this.clear();var A=this;var cm=this.cm;var ds=this.store;Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.select('i',true).removeClass(['fa-arrow-up','fa-arrow-down']);if(A.store.sortInfo){if(e.hasClass('sortable')&&e.attr('sort')==A.store.sortInfo.field&&A.store.sortInfo.direction.toUpperCase()=='ASC'){e.select('i',true).addClass(['fa-arrow-up']); +}if(e.hasClass('sortable')&&e.attr('sort')==A.store.sortInfo.field&&A.store.sortInfo.direction.toUpperCase()=='DESC'){e.select('i',true).addClass(['fa-arrow-down']);}}});var B=this.bodyEl;if(ds.getCount()>0){ds.data.each(function(d,E){var F=this.renderRow(cm,ds,E); +B.createChild(F);var G=this;if(F.cellObjects.length){Roo.each(F.cellObjects,function(r){G.renderCellObject(r);})}},this);}else if(this.empty_results.length){this.el.mask(this.empty_results,'no-spinner');}var C=this.el.select('tfoot',true).first();if(this.footerShow&&this.auto_hide_footer&&this.mainFoot){this.mainFoot.setVisibilityMode(Roo.Element.DISPLAY).hide(); +var D=this.ds.getTotalCount();if(this.footer.pageSize tr',true).elements; +if(typeof(D[B])!='undefined'){bt.removeChild(D[B].dom);}if(C!==true){this.fireEvent("rowremoved",this,B,A);}},onAdd:function(ds,A,B){var bt=this.bodyEl.dom;for(var i=0;i=this.ds.getCount()){return null;}B=(B!==undefined?B:0);var cm=this.cm;while(cm.isHidden(B)){B++;}var el=this.getCellDom(A,B);if(!el){return null;}var c=this.bodyEl.dom;var D=parseInt(el.offsetTop,10); +var E=parseInt(el.offsetLeft,10);var F=D+el.offsetHeight;var G=E+el.offsetWidth;var ch=0;var H=parseInt(c.scrollTop,10);var I=parseInt(c.scrollLeft,10);var J=H+ch;var K=I+c.clientWidth;if(DJ){c.scrollTop=F-ch;}if(C!==false){if(EK){c.scrollLeft=G-c.clientWidth;}}return el;},insertRow:function(dm,A,B){if(!B){this.fireEvent("beforerowsinserted",this,A);}var C=this.renderRow(this.cm,this.store,A);var e=this.bodyEl.createChild(C,this.getRowDom(A));var D=this;if(C.cellObjects.length){Roo.each(C.cellObjects,function(r){D.renderCellObject(r); +})}if(!B){this.fireEvent("rowsinserted",this,A);}},getRowDom:function(A){var B=this.el.select('tbody > tr',true).elements;return (typeof(B[A])=='undefined')?false:B[A];},getCellDom:function(A,B){var C=this.getRowDom(A);if(C===false){return false;}var D=C.select('td',true).elements; +return (typeof(D[B])=='undefined')?false:D[B];},renderRow:function(cm,ds,A){var d=ds.getAt(A);var B={tag:'tr',cls:'x-row-'+A,cn:[]};var C=[];for(var i=0,D=cm.getColumnCount();i tr',true).elements; +if(typeof(C[A])=='undefined'){return;}C[A][B?'removeClass':'addClass']('d-none');},getSelectionModel:function(){if(!this.selModel){this.selModel=new Roo.bootstrap.Table.RowSelectionModel({grid:this});}return this.selModel;},renderCellObject:function(r){var A=this; +r.cfg.parentId=(typeof(r.container)=='string')?r.container:r.container.id;var t=r.cfg.render(r.container);if(r.cfg.cn){Roo.each(r.cfg.cn,function(c){var B={container:t.getChildContainer(),cfg:c};A.renderCellObject(B);})}},getRowIndex:function(A){var B=-1; +Roo.each(this.el.select('tbody > tr',true).elements,function(el,C){if(el!=A){return;}B=C;});return B;},getHeaderIndex:function(A){var B=this.headEl.select('th',true).elements;return B[A];},getCellIndex:function(A){var id=String(A.className).match(Roo.bootstrap.Table.cellRE); +if(id){return parseInt(id[1],10);}return 0;},getGridEl:function(){return this.el;},autoSize:function(){var A=Roo.get(this.el.dom);var B=this.getGridEl().select('thead',true).first();var C=this.getGridEl().select('tbody',true).first();var D=this.getGridEl().select('tfoot',true).first(); +var cw=A.getWidth();this.getGridEl().select('tfoot tr, tfoot td',true).setWidth(cw);if(C){C.setWidth(A.getWidth());var E=(C.dom.offsetWidth-C.dom.clientWidth);cw-=E;}cw=Math.max(cw,this.totalWidth);this.getGridEl().select('tbody tr',true).setWidth(cw);this.initCSS(); +return;},onBodyScroll:function(){if(this.headEl){this.headEl.setStyle({'position':'relative','left':(-1*this.bodyEl.dom.scrollLeft)+'px'});}if(this.lazyLoad){var A=this.bodyEl.dom.scrollHeight;var B=Math.ceil(this.bodyEl.getScroll().top);var C=this.bodyEl.getHeight(); +if(A-C==B){var D=this.ds.getTotalCount();if(this.footer.cursor+this.footer.pageSize span',true);if(ar.elements.length){this.el.select('label > span',true).first().dom.innerHTML=(v===null||v===undefined?'':v);this.fieldLabel=v; return;}var br=this.el.select('label',true);if(br.elements.length){this.el.select('label',true).first().dom.innerHTML=(v===null||v===undefined?'':v);this.fieldLabel=v;return;}Roo.log('Cannot Found any of label > span || label in input');return;}this.el.select('label',true).first().dom.innerHTML=(v===null||v===undefined?'':v); this.fieldLabel=v;}}); -// Roo/bootstrap/TextArea.js -Roo.bootstrap.TextArea=function(A){Roo.bootstrap.TextArea.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.TextArea,Roo.bootstrap.Input,{cols:false,rows:5,readOnly:false,warp:'soft',resize:false,value:false,html:false,getAutoCreate:function(){var A=(!this.labelAlign)?this.parentLabelAlign():this.labelAlign; +// Roo/bootstrap/form/TextArea.js +Roo.bootstrap.form.TextArea=function(A){Roo.bootstrap.form.TextArea.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.form.TextArea,Roo.bootstrap.form.Input,{cols:false,rows:5,readOnly:false,warp:'soft',resize:false,value:false,html:false,getAutoCreate:function(){var A=(!this.labelAlign)?this.parentLabelAlign():this.labelAlign; var id=Roo.id();var B={};if(this.inputType!='hidden'){B.cls='form-group'}var C={tag:'textarea',id:id,warp:this.warp,rows:this.rows,value:this.value||'',html:this.html||'',cls:'form-control',placeholder:this.placeholder||''};if(this.maxLength&&this.maxLength!=Number.MAX_VALUE){C.maxLength=this.maxLength; }if(this.resize){C.style=(typeof(C.style)=='undefined')?'resize:'+this.resize:C.style+'resize:'+this.resize;}if(this.cols){C.cols=this.cols;}if(this.readOnly){C.readonly=true;}if(this.name){C.name=this.name;}if(this.size){C.cls=(typeof(C.cls)=='undefined')?'input-'+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;if(this.hasFeedback&&!this.allowBlank){var F={tag:'span',cls:'glyphicon form-control-feedback'};E={cls:'has-feedback',cn:[C,F]};}if(this.before||this.after){E={cls:'input-group',cn:[]} @@ -509,8 +585,8 @@ if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.in }if(this.disabled||this.allowBlank){return;}var C=this.el.select('label',true).first();var D=this.el.select('i.fa-star',true).first();if(!this.getValue().length&&C&&!D){this.el.createChild({tag:'i',cls:'text-danger fa fa-lg fa-star',tooltip:'This field is required',style:'margin-right:5px;'} ,C,true);}if(Roo.bootstrap.version==3){this.el.addClass(this.invalidClass);}else{this.inputEl().addClass('is-invalid');}if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){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.getValue().length||this.forceFeedback){this.el.select('.form-control-feedback',true).first().addClass([this.invalidFeedbackClass]);}}}this.fireEvent('invalid',this,A);}}); -// Roo/bootstrap/TriggerField.js -Roo.bootstrap.TriggerField=function(A){this.mimicing=false;Roo.bootstrap.TriggerField.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.TriggerField,Roo.bootstrap.Input,{hideTrigger:false,removable:false,autoSize:Roo.emptyFn,monitorTab:true,deferHeight:true,actionMode:'wrap',caret:false,getAutoCreate:function(){var A=this.labelAlign||this.parentLabelAlign(); +// Roo/bootstrap/form/TriggerField.js +Roo.bootstrap.form.TriggerField=function(A){this.mimicing=false;Roo.bootstrap.form.TriggerField.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.form.TriggerField,Roo.bootstrap.form.Input,{hideTrigger:false,removable:false,autoSize:Roo.emptyFn,monitorTab:true,deferHeight:true,actionMode:'wrap',caret:false,getAutoCreate:function(){var A=this.labelAlign||this.parentLabelAlign(); var id=Roo.id();var B={cls:'form-group'};var C={tag:'input',id:id,type:this.inputType,cls:'form-control',autocomplete:'new-password',placeholder:this.placeholder||''};if(this.name){C.name=this.name;}if(this.size){C.cls+=' input-'+this.size;}if(this.disabled){C.disabled=true; }var D=C;if(this.hasFeedback&&!this.allowBlank){var E={tag:'span',cls:'glyphicon form-control-feedback'};if(this.removable&&!this.editable){D={cls:'has-feedback',cn:[D,{tag:'button',html:'x',cls:'roo-combo-removable-btn close'},E]};}else{D={cls:'has-feedback',cn:[D,E]} ;}}else{if(this.removable&&!this.editable){D={cls:'roo-removable',cn:[D,{tag:'button',html:'x',cls:'roo-combo-removable-btn close'}]};}}if(this.before||this.after){D={cls:'input-group',cn:[]};if(this.before){D.cn.push({tag:'span',cls:'input-group-addon input-group-prepend input-group-text',html:this.before} @@ -522,28 +598,28 @@ var id=Roo.id();var B={cls:'form-group'};var C={tag:'input',id:id,type:this.inpu }if(this.labelmd>0){J.cls+=' col-md-'+this.labelmd;K.cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){J.cls+=' col-sm-'+this.labelsm;K.cls+=' col-sm-'+(12-this.labelsm);}if(this.labelxs>0){J.cls+=' col-xs-'+this.labelxs;K.cls+=' col-xs-'+(12-this.labelxs); }}else if(this.fieldLabel.length){B.cn=[I,{tag:'label',html:this.fieldLabel},G];if(this.indicatorpos=='right'){B.cn=[{tag:'label',cn:[{tag:'span',html:this.fieldLabel},I]},G];}}else{B=G}var L=this;['xs','sm','md','lg'].map(function(M){if(L[M]){B.cls+=' col-'+M+'-'+L[M]; }});return B;},onResize:function(w,h){},adjustSize:Roo.BoxComponent.prototype.adjustSize,getResizeEl:function(){return this.inputEl();},getPositionEl:function(){return this.inputEl();},alignErrorIcon:function(){this.errorIcon.alignTo(this.inputEl(),'tl-tr',[2,0]); -},initEvents:function(){this.createList();Roo.bootstrap.TriggerField.superclass.initEvents.call(this);if(!this.multiple&&this.showToggleBtn){this.trigger=this.el.select('span.dropdown-toggle',true).first();if(this.hideTrigger){this.trigger.setDisplayed(false); +},initEvents:function(){this.createList();Roo.bootstrap.form.TriggerField.superclass.initEvents.call(this);if(!this.multiple&&this.showToggleBtn){this.trigger=this.el.select('span.dropdown-toggle',true).first();if(this.hideTrigger){this.trigger.setDisplayed(false); }this.trigger.on("click",this.onTriggerClick,this,{preventDefault:true});}if(this.multiple){this.inputEl().on("click",this.onTriggerClick,this,{preventDefault:true});}if(this.removable&&!this.editable&&!this.tickable){var A=this.closeTriggerEl();if(A){A.setVisibilityMode(Roo.Element.DISPLAY).hide(); A.on('click',this.removeBtnClick,this,A);}}},closeTriggerEl:function(){var A=this.el.select('.roo-combo-removable-btn',true).first();return A?A:false;},removeBtnClick:function(e,h,el){e.preventDefault();if(this.fireEvent("remove",this)!==false){this.reset(); this.fireEvent("afterremove",this)}},createList:function(){this.list=Roo.get(document.body).createChild({tag:Roo.bootstrap.version==4?'div':'ul',cls:'typeahead typeahead-long dropdown-menu shadow',style:'display:none'});this.list.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block'; -;},initTrigger:function(){},onDestroy:function(){if(this.trigger){this.trigger.removeAllListeners();}Roo.bootstrap.TriggerField.superclass.onDestroy.call(this);},onFocus:function(){Roo.bootstrap.TriggerField.superclass.onFocus.call(this);},checkTab:function(e){if(e.getKey()==e.TAB){this.triggerBlur(); -}},onBlur:function(){},mimicBlur:function(e,t){},triggerBlur:function(){this.mimicing=false;Roo.get(Roo.isIE?document.body:document).un("mousedown",this.mimicBlur);if(this.monitorTab){this.el.un("keydown",this.checkTab,this);}Roo.bootstrap.TriggerField.superclass.onBlur.call(this); +;},initTrigger:function(){},onDestroy:function(){if(this.trigger){this.trigger.removeAllListeners();}Roo.bootstrap.form.TriggerField.superclass.onDestroy.call(this);},onFocus:function(){Roo.bootstrap.form.TriggerField.superclass.onFocus.call(this);},checkTab:function(e){if(e.getKey()==e.TAB){this.triggerBlur(); +}},onBlur:function(){},mimicBlur:function(e,t){},triggerBlur:function(){this.mimicing=false;Roo.get(Roo.isIE?document.body:document).un("mousedown",this.mimicBlur);if(this.monitorTab){this.el.un("keydown",this.checkTab,this);}Roo.bootstrap.form.TriggerField.superclass.onBlur.call(this); },validateBlur:function(e,t){return true;},onDisable:function(){this.inputEl().dom.disabled=true;},onEnable:function(){this.inputEl().dom.disabled=false;},onShow:function(){var ae=this.getActionEl();if(ae){ae.dom.style.display='';ae.dom.style.visibility='visible'; }},onHide:function(){var ae=this.getActionEl();ae.dom.style.display='none';},onTriggerClick:Roo.emptyFn}); -// Roo/bootstrap/CardUploader.js -Roo.bootstrap.CardUploader=function(A){Roo.bootstrap.CardUploader.superclass.constructor.call(this,A);this.fileCollection=new Roo.util.MixedCollection(false,function(r){return r.data.id});this.addEvents({'preview':true,'download':true});};Roo.extend(Roo.bootstrap.CardUploader,Roo.bootstrap.Input,{errorTimeout:3000,images:false,fileCollection:false,allowBlank:true,getAutoCreate:function(){var A={cls:'form-group',cn:[{tag:'label',html:this.fieldLabel} +// Roo/bootstrap/form/CardUploader.js +Roo.bootstrap.form.CardUploader=function(A){Roo.bootstrap.form.CardUploader.superclass.constructor.call(this,A);this.fileCollection=new Roo.util.MixedCollection(false,function(r){return r.data.id});this.addEvents({'preview':true,'download':true});};Roo.extend(Roo.bootstrap.form.CardUploader,Roo.bootstrap.form.Input,{errorTimeout:3000,images:false,fileCollection:false,allowBlank:true,getAutoCreate:function(){var A={cls:'form-group',cn:[{tag:'label',html:this.fieldLabel} ,{tag:'input',type:'hidden',name:this.name,value:this.value,cls:'d-none form-control'},{tag:'input',multiple:'multiple',type:'file',cls:'d-none roo-card-upload-selector'},{cls:'roo-card-uploader-button-container w-100 mb-2'},{cls:'card-columns roo-card-uploader-container'} -]};return A;},getChildContainer:function(){return this.containerEl;},getButtonContainer:function(){return this.el.select(".roo-card-uploader-button-container").first();},initEvents:function(){Roo.bootstrap.Input.prototype.initEvents.call(this);var t=this; +]};return A;},getChildContainer:function(){return this.containerEl;},getButtonContainer:function(){return this.el.select(".roo-card-uploader-button-container").first();},initEvents:function(){Roo.bootstrap.form.Input.prototype.initEvents.call(this);var t=this; this.addxtype({xns:Roo.bootstrap,xtype:'Button',container_method:'getButtonContainer',html:this.html,cls:'w-100 ',listeners:{'click':function(A,e){t.onClick(e);}}});this.urlAPI=(window.createObjectURL&&window)||(window.URL&&URL.revokeObjectURL&&URL)||(window.webkitURL&&webkitURL); this.selectorEl=this.el.select('.roo-card-upload-selector',true).first();this.selectorEl.on('change',this.onFileSelected,this);if(this.images){var t=this;this.images.forEach(function(A){t.addCard(A)});this.images=false;}this.containerEl=this.el.select('.roo-card-uploader-container',true).first(); },onClick:function(e){e.preventDefault();this.selectorEl.dom.click();},onFileSelected:function(e){e.preventDefault();if(typeof(this.selectorEl.dom.files)=='undefined'||!this.selectorEl.dom.files.length){return;}Roo.each(this.selectorEl.dom.files,function(A){this.addFile(A); -},this);},addFile:function(A){if(typeof(A)==='string'){throw "Add file by name?";return;}if(!A||!this.urlAPI){return;}var B=this;var C=B.urlAPI.createObjectURL(A);this.addCard({id:Roo.bootstrap.CardUploader.ID--,is_uploaded:false,src:C,srcfile:A,title:A.name,mimetype:A.type,preview:false,is_deleted:0} +},this);},addFile:function(A){if(typeof(A)==='string'){throw "Add file by name?";return;}if(!A||!this.urlAPI){return;}var B=this;var C=B.urlAPI.createObjectURL(A);this.addCard({id:Roo.bootstrap.form.CardUploader.ID--,is_uploaded:false,src:C,srcfile:A,title:A.name,mimetype:A.type,preview:false,is_deleted:0} );},addCard:function(A){var t=this;var B=[{xns:Roo.bootstrap,xtype:'CardFooter',items:[{xns:Roo.bootstrap,xtype:'Element',cls:'d-flex',items:[{xns:Roo.bootstrap,xtype:'Button',html:String.format("{0}",A.title),cls:'col-10 text-left',size:'sm',weight:'link',fa:'download',listeners:{click:function(){t.fireEvent("download",t,A); }}},{xns:Roo.bootstrap,xtype:'Button',style:'max-height: 28px; ',size:'sm',weight:'danger',cls:'col-2',fa:'times',listeners:{click:function(){t.removeCard(A.id)}}}]}]}];var cn=this.addxtype({xns:Roo.bootstrap,xtype:'Card',closeable:true,header:!A.mimetype.match(/image/)&&!A.preview?"Document":false,header_image:A.mimetype.match(/image/)?A.src:A.preview,header_image_fit_square:true,data:A,html:false,items:B,initEvents:function(){Roo.bootstrap.Card.prototype.initEvents.call(this); var D=this;this.imgEl=this.el.select('.card-img-top').first();if(this.imgEl){this.imgEl.on('click',function(){t.fireEvent("preview",t,A);},this);this.imgEl.set({'pointer':'cursor'});}this.getCardFooter().addClass('p-1');}});this.fileCollection.add(cn);if(!A.srcfile){this.updateInput(); return;}var _t=this;var C=new FileReader();C.addEventListener("load",function(){A.srcdata=C.result;_t.updateInput();});C.readAsDataURL(A.srcfile);},removeCard:function(id){var A=this.fileCollection.get(id);A.data.is_deleted=1;A.data.src='';A.el.dom.parentNode.removeChild(A.el.dom); this.updateInput();},reset:function(){this.fileCollection.each(function(A){if(A.el.dom&&A.el.dom.parentNode){A.el.dom.parentNode.removeChild(A.el.dom);}});this.fileCollection.clear();this.updateInput();},updateInput:function(){var A=[];this.fileCollection.each(function(e){A.push(e.data); -});this.inputEl().dom.value=JSON.stringify(A);}});Roo.bootstrap.CardUploader.ID=-1; +});this.inputEl().dom.value=JSON.stringify(A);}});Roo.bootstrap.form.CardUploader.ID=-1; // Roo/data/SortTypes.js Roo.data.SortTypes={none:function(s){return s;},stripTagsRE:/<\/?[^>]+>/gi,asText:function(s){return String(s).replace(this.stripTagsRE,"");},asUCText:function(s){return String(s).toUpperCase().replace(this.stripTagsRE,"");},asUCString:function(s){return String(s).toUpperCase(); },asDate:function(s){if(!s){return 0;}if(s instanceof Date){return s.getTime();}return Date.parse(String(s));},asFloat:function(s){var A=parseFloat(String(s).replace(/,/g,""));if(isNaN(A)){A=0;}return A;},asInt:function(s){var A=parseInt(String(s).replace(/,/g,"")); @@ -566,7 +642,7 @@ for(var i=0,B=A.length;i0){L.cls+=' col-sm-'+this.l ,I];if(this.indicatorpos=='right'){A.cn=[{tag:'label',html:this.fieldLabel},K,I];}}else{A=I}var N=this;['xs','sm','md','lg'].map(function(O){if(N[O]){A.cls+=' col-'+O+'-'+N[O];}});return A;},_initEventsCalled:false,initEvents:function(){if(this._initEventsCalled){return; }this._initEventsCalled=true;if(!this.store){throw "can not find store for combo";}this.indicator=this.indicatorEl();this.store=Roo.factory(this.store,Roo.data);this.store.parent=this;if(Roo.XComponent.build_from_html){var e=this.el.dom,k=0;while(e){e=e.previousSibling; ++k;}this.el.remove();this.el=false;this.rendered=false;this.render(this.parent().getChildContainer(true),k);}if(Roo.isIOS&&this.useNativeIOS){this.initIOSView();return;}if(Roo.isTouch&&this.mobileTouchView){this.initTouchView();return;}if(this.tickable){this.initTickableEvents(); -return;}Roo.bootstrap.ComboBox.superclass.initEvents.call(this);if(this.hiddenName){this.hiddenField=this.el.select('input.form-hidden-field',true).first();this.hiddenField.dom.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:''; +return;}Roo.bootstrap.form.ComboBox.superclass.initEvents.call(this);if(this.hiddenName){this.hiddenField=this.el.select('input.form-hidden-field',true).first();this.hiddenField.dom.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:''; this.el.dom.removeAttribute('name');this.hiddenField.dom.setAttribute('name',this.hiddenName);}var A='x-combo-list';var B=this;(function(){var lw=B.listWidth||Math.max(B.inputEl().getWidth(),B.minListWidth);B.list.setWidth(lw);}).defer(100);this.list.on('mouseover',this.onViewOver,this); this.list.on('mousemove',this.onViewMove,this);this.list.on('scroll',this.onViewScroll,this);if(!this.tpl){this.tpl=Roo.bootstrap.version==4?'{'+this.displayField+'}':'
  • {'+this.displayField+'}
  • '; }this.view=new Roo.View(this.list,this.tpl,{singleSelect:true,store:this.store,selectedClass:this.selectedClass});this.view.on('click',this.onViewClick,this);this.store.on('beforeload',this.onBeforeLoad,this);this.store.on('load',this.onLoad,this);this.store.on('loadexception',this.onLoadException,this); @@ -661,22 +739,22 @@ this.store.on('loadexception',this.onLoadException,this);if(this.editable){this. }return true;},"esc":function(e){this.onTickableFooterButtonClick(e,false,false);},"tab":function(e){this.fireEvent("specialkey",this,e);this.onTickableFooterButtonClick(e,false,false);return true;},scope:this,doRelay:function(e,fn,B){if(this.scope.isExpanded()){return Roo.KeyNav.prototype.doRelay.apply(this,arguments); }return true;},forceKeyDown:true});}this.queryDelay=Math.max(this.queryDelay||10,this.mode=='local'?10:250);this.dqTask=new Roo.util.DelayedTask(this.initQuery,this);if(this.typeAhead){this.taTask=new Roo.util.DelayedTask(this.onTypeAhead,this);}if(this.editable!==false){this.tickableInputEl().on("keyup",this.onKeyUp,this); }this.indicator=this.indicatorEl();if(this.indicator){this.indicator.setVisibilityMode(Roo.Element.DISPLAY);this.indicator.hide();}},onDestroy:function(){if(this.view){this.view.setStore(null);this.view.el.removeAllListeners();this.view.el.remove();this.view.purgeListeners(); -}if(this.list){this.list.dom.innerHTML='';}if(this.store){this.store.un('beforeload',this.onBeforeLoad,this);this.store.un('load',this.onLoad,this);this.store.un('loadexception',this.onLoadException,this);}Roo.bootstrap.ComboBox.superclass.onDestroy.call(this); +}if(this.list){this.list.dom.innerHTML='';}if(this.store){this.store.un('beforeload',this.onBeforeLoad,this);this.store.un('load',this.onLoad,this);this.store.un('loadexception',this.onLoadException,this);}Roo.bootstrap.form.ComboBox.superclass.onDestroy.call(this); },fireKey:function(e){if(e.isNavKeyPress()&&!this.list.isVisible()){this.fireEvent("specialkey",this,e);}},onResize:function(w,h){},setEditable:function(A){if(A==this.editable){return;}this.editable=A;if(!A){this.inputEl().dom.setAttribute('readOnly',true); -this.inputEl().on('mousedown',this.onTriggerClick,this);this.inputEl().addClass('x-combo-noedit');}else{this.inputEl().dom.setAttribute('readOnly',false);this.inputEl().un('mousedown',this.onTriggerClick,this);this.inputEl().removeClass('x-combo-noedit'); -}},onBeforeLoad:function(A,B){if(!this.hasFocus){return;}if(!B.add){this.list.dom.innerHTML='
  • '+(this.loadingText||'loading')+'
  • ';}this.restrictHeight();this.selectedIndex=-1;},onLoad:function(){this.hasQuery=false;if(!this.hasFocus){return; -}if(typeof(this.loading)!=='undefined'&&this.loading!==null){this.loading.hide();}if(this.store.getCount()>0){this.expand();this.restrictHeight();if(this.lastQuery==this.allQuery){if(this.editable&&!this.tickable){this.inputEl().dom.select();}if(!this.selectByValue(this.value,true)&&this.autoFocus&&(!this.store.lastOptions||typeof(this.store.lastOptions.add)=='undefined'||this.store.lastOptions.add!=true)){this.select(0,true); +this.inputEl().on('mousedown',this.onTriggerClick,this);this.inputEl().addClass('x-combo-noedit');}else{this.inputEl().dom.removeAttribute('readOnly');this.inputEl().un('mousedown',this.onTriggerClick,this);this.inputEl().removeClass('x-combo-noedit');}},onBeforeLoad:function(A,B){if(!this.hasFocus){return; +}if(!B.add){this.list.dom.innerHTML='
  • '+(this.loadingText||'loading')+'
  • ';}this.restrictHeight();this.selectedIndex=-1;},onLoad:function(){this.hasQuery=false;if(!this.hasFocus){return;}if(typeof(this.loading)!=='undefined'&&this.loading!==null){this.loading.hide(); +}if(this.store.getCount()>0){this.expand();this.restrictHeight();if(this.lastQuery==this.allQuery){if(this.editable&&!this.tickable){this.inputEl().dom.select();}if(!this.selectByValue(this.value,true)&&this.autoFocus&&(!this.store.lastOptions||typeof(this.store.lastOptions.add)=='undefined'||this.store.lastOptions.add!=true)){this.select(0,true); }}else{if(this.autoFocus){this.selectNext();}if(this.typeAhead&&this.lastKey!=Roo.EventObject.BACKSPACE&&this.lastKey!=Roo.EventObject.DELETE){this.taTask.delay(this.typeAheadDelay);}}}else{this.onEmptyResults();}},onLoadException:function(){this.hasQuery=false; if(typeof(this.loading)!=='undefined'&&this.loading!==null){this.loading.hide();}if(this.tickable&&this.editable){return;}this.collapse();},onTypeAhead:function(){if(this.store.getCount()>0){var r=this.store.getAt(0);var A=r.data[this.displayField];var B=A.length; var C=this.getRawValue().length;if(C!=B){this.setRawValue(A);this.selectText(C,A.length);}}},onSelect:function(A,B){if(this.fireEvent('beforeselect',this,A,B)!==false){this.setFromData(B>-1?A.data:false);this.collapse();this.fireEvent('select',this,A,B);} },getValue:function(){if(Roo.isIOS&&this.useNativeIOS){return this.ios_options[this.inputEl().dom.selectedIndex].data[this.valueField];}if(this.multiple){return (this.hiddenField)?this.hiddenField.dom.value:this.value;}if(this.valueField){return typeof this.value!='undefined'?this.value:''; -}else{return Roo.bootstrap.ComboBox.superclass.getValue.call(this);}},getRawValue:function(){if(Roo.isIOS&&this.useNativeIOS){return this.ios_options[this.inputEl().dom.selectedIndex].data[this.displayField];}var v=this.inputEl().getValue();return v;},clearValue:function(){if(this.hiddenField){this.hiddenField.dom.value=''; -}this.value='';this.setRawValue('');this.lastSelectionText='';this.lastData=false;var A=this.closeTriggerEl();if(A){A.hide();}this.validate();},setValue:function(v){if(Roo.isIOS&&this.useNativeIOS){this.setIOSValue(v);return;}if(this.multiple){this.syncValue(); -return;}var A=v;if(this.valueField){var r=this.findRecord(this.valueField,v);if(r){A=r.data[this.displayField];}else if(this.valueNotFoundText!==undefined){A=this.valueNotFoundText;}}this.lastSelectionText=A;if(this.hiddenField){this.hiddenField.dom.value=v; -}Roo.bootstrap.ComboBox.superclass.setValue.call(this,A);this.value=v;var B=this.closeTriggerEl();if(B){(v&&(v.length||v*1>0))?B.show():B.hide();}this.validate();},lastData:false,setFromData:function(o){if(this.multiple){this.addItem(o);return;}var dv=''; +}else{return Roo.bootstrap.form.ComboBox.superclass.getValue.call(this);}},getRawValue:function(){if(Roo.isIOS&&this.useNativeIOS){return this.ios_options[this.inputEl().dom.selectedIndex].data[this.displayField];}var v=this.inputEl().getValue();return v; +},clearValue:function(){if(this.hiddenField){this.hiddenField.dom.value='';}this.value='';this.setRawValue('');this.lastSelectionText='';this.lastData=false;var A=this.closeTriggerEl();if(A){A.hide();}this.validate();},setValue:function(v){if(Roo.isIOS&&this.useNativeIOS){this.setIOSValue(v); +return;}if(this.multiple){this.syncValue();return;}var A=v;if(this.valueField){var r=this.findRecord(this.valueField,v);if(r){A=r.data[this.displayField];}else if(this.valueNotFoundText!==undefined){A=this.valueNotFoundText;}}this.lastSelectionText=A;if(this.hiddenField){this.hiddenField.dom.value=v; +}Roo.bootstrap.form.ComboBox.superclass.setValue.call(this,A);this.value=v;var B=this.closeTriggerEl();if(B){(v&&(v.length||v*1>0))?B.show():B.hide();}this.validate();},lastData:false,setFromData:function(o){if(this.multiple){this.addItem(o);return;}var dv=''; var vv='';this.lastData=o;if(this.displayField){dv=!o||typeof(o[this.displayField])=='undefined'?'':o[this.displayField];}else{Roo.log('no displayField value set for '+(this.name?this.name:this.id));}if(this.valueField){vv=!o||typeof(o[this.valueField])=='undefined'?dv:o[this.valueField]; -}var A=this.closeTriggerEl();if(A){if(dv.length||vv*1>0){A.show();this.blockFocus=true;}else{A.hide();}}if(this.hiddenField){this.hiddenField.dom.value=vv;this.lastSelectionText=dv;Roo.bootstrap.ComboBox.superclass.setValue.call(this,dv);this.value=vv;return; -}this.lastSelectionText=dv;Roo.bootstrap.ComboBox.superclass.setValue.call(this,dv);this.value=vv;},reset:function(){if(this.multiple){this.clearItem();return;}this.setValue(this.originalValue);this.lastData=false;if(this.view){this.view.clearSelections(); +}var A=this.closeTriggerEl();if(A){if(dv.length||vv*1>0){A.show();this.blockFocus=true;}else{A.hide();}}if(this.hiddenField){this.hiddenField.dom.value=vv;this.lastSelectionText=dv;Roo.bootstrap.form.ComboBox.superclass.setValue.call(this,dv);this.value=vv; +return;}this.lastSelectionText=dv;Roo.bootstrap.form.ComboBox.superclass.setValue.call(this,dv);this.value=vv;},reset:function(){if(this.multiple){this.clearItem();return;}this.setValue(this.originalValue);this.lastData=false;if(this.view){this.view.clearSelections(); }this.validate();},findRecord:function(A,B){var C;if(this.store.getCount()>0){this.store.each(function(r){if(r.data[A]==B){C=r;return false;}return true;});}return C;},getName:function(){if(!this.rendered){return ''};return !this.hiddenName&&this.inputEl().dom.name?this.inputEl().dom.name:(this.hiddenName||''); },onViewMove:function(e,t){this.inKeyMode=false;},onViewOver:function(e,t){if(this.inKeyMode){return;}var A=this.view.findItemFromChild(t);if(A){var B=this.view.indexOf(A);this.select(B,false);}},onViewClick:function(A,B,el,e){var C=this.view.getSelectedIndexes()[0]; var r=this.store.getAt(C);if(this.tickable){if(typeof(e)!='undefined'&&e.getTarget().nodeName.toLowerCase()!='input'){return;}var rm=false;var D=this;Roo.each(this.tickItems,function(v,k){if(typeof(v)!='undefined'&&v[D.valueField]==r.data[D.valueField]){Roo.log(v); @@ -716,34 +794,33 @@ this.lastItem=Roo.apply([],this.item);if(A&&A.name=='cancel'){this.tickItems=Roo );}if(this.removable&&!this.multiple){C.cls+=' roo-removable';C.cn.push({tag:'button',html:'x',cls:'roo-combo-removable-btn close'});}if(this.hasFeedback&&!this.allowBlank){C.cls+=' has-feedback';C.cn.push({tag:'span',cls:'glyphicon form-control-feedback'} );}if(this.after){C.cls+=(this.before)?'':' input-group';C.cn.push({tag:'span',cls:'input-group-addon input-group-append input-group-text',html:this.after});}var D=C;if(this.multiple){D={tag:'ul',cls:'roo-select2-choices',cn:[{tag:'li',cls:'roo-select2-search-field',cn:[C]} ]};}var E={cls:'roo-select2-container input-group roo-touchview-combobox ',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},D]};if(!this.multiple&&this.showToggleBtn){var F={cls:'caret'};if(this.caret!=false){F={tag:'i',cls:'fa fa-'+this.caret};}E.cn.push({tag:'span',cls:'input-group-addon input-group-append input-group-text btn dropdown-toggle',cn:[Roo.bootstrap.version==3?F:'',{tag:'span',cls:'combobox-clear',cn:[{tag:'i',cls:'icon-remove'} -]}]})}if(this.multiple){E.cls+=' roo-select2-container-multi';}var G=this.labelAlign||this.parentLabelAlign();if(G==='left'&&this.fieldLabel.length){A.cn=[{tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'} -,{tag:'label',cls:'control-label col-form-label',html:this.fieldLabel},{cls:'roo-combobox-wrap ',cn:[E]}];var H=A.cn[1];var I=A.cn[2];if(this.indicatorpos=='right'){A.cn=[{tag:'label','for':id,cls:'control-label col-form-label',cn:[{tag:'span',html:this.fieldLabel} -,{tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'}]},{cls:"roo-combobox-wrap ",cn:[E]}];H=A.cn[0];I=A.cn[1];}if(this.labelWidth>12){H.style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth; -}if(this.labellg>0){H.cls+=' col-lg-'+this.labellg;I.cls+=' col-lg-'+(12-this.labellg);}if(this.labelmd>0){H.cls+=' col-md-'+this.labelmd;I.cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){H.cls+=' col-sm-'+this.labelsm;I.cls+=' col-sm-'+(12-this.labelsm); -}if(this.labelxs>0){H.cls+=' col-xs-'+this.labelxs;I.cls+=' col-xs-'+(12-this.labelxs);}}else if(this.fieldLabel.length){A.cn=[{tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'},{tag:'label',cls:'control-label',html:this.fieldLabel} -,{cls:'',cn:[E]}];if(this.indicatorpos=='right'){A.cn=[{tag:'label',cls:'control-label',html:this.fieldLabel,cn:[{tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'}]},{cls:'',cn:[E]}];}}else{A.cn=E; -}var J=this;['xs','sm','md','lg'].map(function(K){if(J[K]){A.cls+=' col-'+K+'-'+J[K];}});return A;},initTouchView:function(){this.renderTouchView();this.touchViewEl.on('scroll',function(){this.el.dom.scrollTop=0;},this);this.originalValue=this.getValue(); -this.triggerEl=this.el.select('span.dropdown-toggle',true).first();this.inputEl().on("click",this.showTouchView,this);if(this.triggerEl){this.triggerEl.on("click",this.showTouchView,this);}this.touchViewFooterEl.select('.roo-touch-view-cancel',true).first().on('click',this.hideTouchView,this); -this.touchViewFooterEl.select('.roo-touch-view-ok',true).first().on('click',this.setTouchViewValue,this);this.maskEl=new Roo.LoadMask(this.touchViewEl,{store:this.store,msgCls:'roo-el-mask-msg'});this.store.on('beforeload',this.onTouchViewBeforeLoad,this); -this.store.on('load',this.onTouchViewLoad,this);this.store.on('loadexception',this.onTouchViewLoadException,this);if(this.hiddenName){this.hiddenField=this.el.select('input.form-hidden-field',true).first();this.hiddenField.dom.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:''; -this.el.dom.removeAttribute('name');this.hiddenField.dom.setAttribute('name',this.hiddenName);}if(this.multiple){this.choices=this.el.select('ul.roo-select2-choices',true).first();this.searchField=this.el.select('ul li.roo-select2-search-field',true).first(); -}if(this.removable&&!this.multiple){var A=this.closeTriggerEl();if(A){A.setVisibilityMode(Roo.Element.DISPLAY).hide();A.on('click',this.removeBtnClick,this,A);}}this.inputEl().on("focus",function(e){document.activeElement.blur();},this);this._touchViewMask=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-dlg-mask"} -,true);return;},renderTouchView:function(){this.touchViewEl=Roo.get(document.body).createChild(Roo.bootstrap.ComboBox.touchViewTemplate);this.touchViewEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.touchViewHeaderEl=this.touchViewEl.select('.modal-header',true).first(); -this.touchViewHeaderEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.touchViewBodyEl=this.touchViewEl.select('.modal-body',true).first();this.touchViewBodyEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.touchViewBodyEl.setStyle('overflow','auto'); -this.touchViewListGroup=this.touchViewBodyEl.select('.list-group',true).first();this.touchViewListGroup.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.touchViewFooterEl=this.touchViewEl.select('.modal-footer',true).first();this.touchViewFooterEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block'; -},showTouchView:function(){if(this.disabled){return;}this.touchViewHeaderEl.hide();if(this.modalTitle.length){this.touchViewHeaderEl.dom.innerHTML=this.modalTitle;this.touchViewHeaderEl.show();}this.touchViewEl.setStyle('z-index',Roo.bootstrap.Modal.zIndex++); -this.touchViewEl.show();this.touchViewEl.select('.modal-dialog',true).first().setStyle({margin:'0px',width:'100%'});var A=Roo.lib.Dom.getViewHeight()-this.touchViewFooterEl.getHeight()+this.touchViewBodyEl.getPadding('tb');if(this.modalTitle.length){A=A-this.touchViewHeaderEl.getHeight(); -}this.touchViewBodyEl.setHeight(A);if(this.animate){var B=this;(function(){B.touchViewEl.addClass(['in','show']);}).defer(50);}else{this.touchViewEl.addClass(['in','show']);}if(this._touchViewMask){Roo.get(document.body).addClass("x-body-masked");this._touchViewMask.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true)); -this._touchViewMask.setStyle('z-index',10000);this._touchViewMask.addClass('show');}this.doTouchViewQuery();},hideTouchView:function(){this.touchViewEl.removeClass(['in','show']);if(this.animate){var A=this;(function(){A.touchViewEl.setStyle('display','none'); -}).defer(150);}else{this.touchViewEl.setStyle('display','none');}if(this._touchViewMask){this._touchViewMask.removeClass('show');Roo.get(document.body).removeClass("x-body-masked");}},setTouchViewValue:function(){if(this.multiple){this.clearItem();var A=this; -Roo.each(this.tickItems,function(o){this.addItem(o);},this);}this.hideTouchView();},doTouchViewQuery:function(){var qe={query:'',forceAll:true,combo:this,cancel:false};if(this.fireEvent('beforequery',qe)===false||qe.cancel){return false;}if(!this.alwaysQuery||this.mode=='local'){this.onTouchViewLoad(); -return;}this.store.load();},onTouchViewBeforeLoad:function(A,B){return;},onTouchViewLoad:function(){if(this.store.getCount()<1){this.onTouchViewEmptyResults();return;}this.clearTouchView();var A=this.getRawValue();var B=(this.multiple)?Roo.bootstrap.ComboBox.listItemCheckbox:Roo.bootstrap.ComboBox.listItemRadio; -this.tickItems=[];this.store.data.each(function(d,G){var H=this.touchViewListGroup.createChild(B);if(typeof(d.data.cls)!='undefined'&&d.data.cls.length){H.addClass(d.data.cls);}if(this.displayField&&typeof(d.data[this.displayField])!='undefined'){var I={data:d.data,html:d.data[this.displayField]} -;if(this.fireEvent('touchviewdisplay',this,I)!==false){H.select('.roo-combobox-list-group-item-value',true).first().dom.innerHTML=I.html;}}H.removeClass('selected');if(!this.multiple&&this.valueField&&typeof(d.data[this.valueField])!='undefined'&&d.data[this.valueField]==this.getValue()){H.select('.roo-combobox-list-group-item-box > input',true).first().attr('checked',true); -H.addClass('selected');}if(this.multiple&&this.valueField&&typeof(d.data[this.valueField])!='undefined'&&this.getValue().indexOf(d.data[this.valueField])!=-1){H.select('.roo-combobox-list-group-item-box > input',true).first().attr('checked',true);this.tickItems.push(d.data); -}H.on('click',this.onTouchViewClick,this,{row:H,rowIndex:G});},this);var C=this.touchViewListGroup.select('.list-group-item > .roo-combobox-list-group-item-box > input:checked',true).first();var D=Roo.lib.Dom.getViewHeight()-this.touchViewFooterEl.getHeight()+this.touchViewBodyEl.getPadding('tb'); -if(this.modalTitle.length){D=D-this.touchViewHeaderEl.getHeight();}var E=this.touchViewListGroup.getHeight()+this.touchViewBodyEl.getPadding('tb')*2;if(this.mobile_restrict_height&&ED){(function(){C.findParent('li').scrollIntoView(F.touchViewListGroup.dom); -}).defer(500);}},onTouchViewLoadException:function(){this.hideTouchView();},onTouchViewEmptyResults:function(){this.clearTouchView();this.touchViewListGroup.createChild(Roo.bootstrap.ComboBox.emptyResult);this.touchViewListGroup.select('.roo-combobox-touch-view-empty-result',true).first().dom.innerHTML=this.emptyResultText; +]}]})}if(this.multiple){E.cls+=' roo-select2-container-multi';}var G=this.allowBlank?{tag:'i',style:'display: none'}:{tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'};var H=this.labelAlign||this.parentLabelAlign(); +if(H==='left'&&this.fieldLabel.length){A.cn=[G,{tag:'label',cls:'control-label col-form-label',html:this.fieldLabel},{cls:'roo-combobox-wrap ',cn:[E]}];var I=A.cn[1];var J=A.cn[2];if(this.indicatorpos=='right'){A.cn=[{tag:'label','for':id,cls:'control-label col-form-label',cn:[{tag:'span',html:this.fieldLabel} +,G]},{cls:"roo-combobox-wrap ",cn:[E]}];I=A.cn[0];J=A.cn[1];}if(this.labelWidth>12){I.style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;}if(this.labellg>0){I.cls+=' col-lg-'+this.labellg;J.cls+=' col-lg-'+(12-this.labellg); +}if(this.labelmd>0){I.cls+=' col-md-'+this.labelmd;J.cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){I.cls+=' col-sm-'+this.labelsm;J.cls+=' col-sm-'+(12-this.labelsm);}if(this.labelxs>0){I.cls+=' col-xs-'+this.labelxs;J.cls+=' col-xs-'+(12-this.labelxs); +}}else if(this.fieldLabel.length){A.cn=[G,{tag:'label',cls:'control-label',html:this.fieldLabel},{cls:'',cn:[E]}];if(this.indicatorpos=='right'){A.cn=[{tag:'label',cls:'control-label',html:this.fieldLabel,cn:[G]},{cls:'',cn:[E]}];}}else{A.cn=E;}var K=this; +['xs','sm','md','lg'].map(function(L){if(K[L]){A.cls+=' col-'+L+'-'+K[L];}});return A;},initTouchView:function(){this.renderTouchView();this.touchViewEl.on('scroll',function(){this.el.dom.scrollTop=0;},this);this.originalValue=this.getValue();this.triggerEl=this.el.select('span.dropdown-toggle',true).first(); +this.inputEl().on("click",this.showTouchView,this);if(this.triggerEl){this.triggerEl.on("click",this.showTouchView,this);}this.touchViewFooterEl.select('.roo-touch-view-cancel',true).first().on('click',this.hideTouchView,this);this.touchViewFooterEl.select('.roo-touch-view-ok',true).first().on('click',this.setTouchViewValue,this); +this.maskEl=new Roo.LoadMask(this.touchViewEl,{store:this.store,msgCls:'roo-el-mask-msg'});this.store.on('beforeload',this.onTouchViewBeforeLoad,this);this.store.on('load',this.onTouchViewLoad,this);this.store.on('loadexception',this.onTouchViewLoadException,this); +if(this.hiddenName){this.hiddenField=this.el.select('input.form-hidden-field',true).first();this.hiddenField.dom.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:'';this.el.dom.removeAttribute('name');this.hiddenField.dom.setAttribute('name',this.hiddenName); +}if(this.multiple){this.choices=this.el.select('ul.roo-select2-choices',true).first();this.searchField=this.el.select('ul li.roo-select2-search-field',true).first();}if(this.removable&&!this.multiple){var A=this.closeTriggerEl();if(A){A.setVisibilityMode(Roo.Element.DISPLAY).hide(); +A.on('click',this.removeBtnClick,this,A);}}this.inputEl().on("focus",function(e){document.activeElement.blur();},this);this._touchViewMask=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-dlg-mask"},true);return;},renderTouchView:function(){this.touchViewEl=Roo.get(document.body).createChild(Roo.bootstrap.form.ComboBox.touchViewTemplate); +this.touchViewEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.touchViewHeaderEl=this.touchViewEl.select('.modal-header',true).first();this.touchViewHeaderEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.touchViewBodyEl=this.touchViewEl.select('.modal-body',true).first(); +this.touchViewBodyEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.touchViewBodyEl.setStyle('overflow','auto');this.touchViewListGroup=this.touchViewBodyEl.select('.list-group',true).first();this.touchViewListGroup.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block'; +this.touchViewFooterEl=this.touchViewEl.select('.modal-footer',true).first();this.touchViewFooterEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';},showTouchView:function(){if(this.disabled){return;}this.touchViewHeaderEl.hide();if(this.modalTitle.length){this.touchViewHeaderEl.dom.innerHTML=this.modalTitle; +this.touchViewHeaderEl.show();}this.touchViewEl.setStyle('z-index',Roo.bootstrap.Modal.zIndex++);this.touchViewEl.show();this.touchViewEl.select('.modal-dialog',true).first().setStyle({margin:'0px',width:'100%'});var A=Roo.lib.Dom.getViewHeight()-this.touchViewFooterEl.getHeight()+this.touchViewBodyEl.getPadding('tb'); +if(this.modalTitle.length){A=A-this.touchViewHeaderEl.getHeight();}this.touchViewBodyEl.setHeight(A);if(this.animate){var B=this;(function(){B.touchViewEl.addClass(['in','show']);}).defer(50);}else{this.touchViewEl.addClass(['in','show']);}if(this._touchViewMask){Roo.get(document.body).addClass("x-body-masked"); +this._touchViewMask.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));this._touchViewMask.setStyle('z-index',10000);this._touchViewMask.addClass('show');}this.doTouchViewQuery();},hideTouchView:function(){this.touchViewEl.removeClass(['in','show']); +if(this.animate){var A=this;(function(){A.touchViewEl.setStyle('display','none');}).defer(150);}else{this.touchViewEl.setStyle('display','none');}if(this._touchViewMask){this._touchViewMask.removeClass('show');Roo.get(document.body).removeClass("x-body-masked"); +}},setTouchViewValue:function(){if(this.multiple){this.clearItem();var A=this;Roo.each(this.tickItems,function(o){this.addItem(o);},this);}this.hideTouchView();},doTouchViewQuery:function(){var qe={query:'',forceAll:true,combo:this,cancel:false};if(this.fireEvent('beforequery',qe)===false||qe.cancel){return false; +}if(!this.alwaysQuery||this.mode=='local'){this.onTouchViewLoad();return;}this.store.load();},onTouchViewBeforeLoad:function(A,B){return;},onTouchViewLoad:function(){if(this.store.getCount()<1){this.onTouchViewEmptyResults();return;}this.clearTouchView(); +var A=this.getRawValue();var B=(this.multiple)?Roo.bootstrap.form.ComboBox.listItemCheckbox:Roo.bootstrap.form.ComboBox.listItemRadio;this.tickItems=[];this.store.data.each(function(d,G){var H=this.touchViewListGroup.createChild(B);if(typeof(d.data.cls)!='undefined'&&d.data.cls.length){H.addClass(d.data.cls); +}if(this.displayField&&typeof(d.data[this.displayField])!='undefined'){var I={data:d.data,html:d.data[this.displayField]};if(this.fireEvent('touchviewdisplay',this,I)!==false){H.select('.roo-combobox-list-group-item-value',true).first().dom.innerHTML=I.html; +}}H.removeClass('selected');if(!this.multiple&&this.valueField&&typeof(d.data[this.valueField])!='undefined'&&d.data[this.valueField]==this.getValue()){H.select('.roo-combobox-list-group-item-box > input',true).first().attr('checked',true);H.addClass('selected'); +}if(this.multiple&&this.valueField&&typeof(d.data[this.valueField])!='undefined'&&this.getValue().indexOf(d.data[this.valueField])!=-1){H.select('.roo-combobox-list-group-item-box > input',true).first().attr('checked',true);this.tickItems.push(d.data);}H.on('click',this.onTouchViewClick,this,{row:H,rowIndex:G} +);},this);var C=this.touchViewListGroup.select('.list-group-item > .roo-combobox-list-group-item-box > input:checked',true).first();var D=Roo.lib.Dom.getViewHeight()-this.touchViewFooterEl.getHeight()+this.touchViewBodyEl.getPadding('tb');if(this.modalTitle.length){D=D-this.touchViewHeaderEl.getHeight(); +}var E=this.touchViewListGroup.getHeight()+this.touchViewBodyEl.getPadding('tb')*2;if(this.mobile_restrict_height&&ED){(function(){C.findParent('li').scrollIntoView(F.touchViewListGroup.dom);}).defer(500); +}},onTouchViewLoadException:function(){this.hideTouchView();},onTouchViewEmptyResults:function(){this.clearTouchView();this.touchViewListGroup.createChild(Roo.bootstrap.form.ComboBox.emptyResult);this.touchViewListGroup.select('.roo-combobox-touch-view-empty-result',true).first().dom.innerHTML=this.emptyResultText; },clearTouchView:function(){this.touchViewListGroup.dom.innerHTML='';},onTouchViewClick:function(e,el,o){e.preventDefault();var A=o.row;var B=o.rowIndex;var r=this.store.getAt(B);if(this.fireEvent('beforeselect',this,r,B)!==false){if(!this.multiple){Roo.each(this.touchViewListGroup.select('.list-group-item > .roo-combobox-list-group-item-box > input:checked',true).elements,function(c){c.dom.removeAttribute('checked'); },this);A.select('.roo-combobox-list-group-item-box > input',true).first().attr('checked',true);this.setFromData(r.data);var C=this.closeTriggerEl();if(C){C.show();}this.hideTouchView();this.fireEvent('select',this,r,B);return;}if(this.valueField&&typeof(r.data[this.valueField])!='undefined'&&this.getValue().indexOf(r.data[this.valueField])!=-1){A.select('.roo-combobox-list-group-item-box > input',true).first().dom.removeAttribute('checked'); this.tickItems.splice(this.tickItems.indexOf(r.data),1);return;}A.select('.roo-combobox-list-group-item-box > input',true).first().attr('checked',true);this.addItem(r.data);this.tickItems.push(r.data);}},getAutoCreateNativeIOS:function(){var A={cls:'form-group'} @@ -752,10 +829,10 @@ return;},onIOSViewLoad:function(){if(this.store.getCount()<1){return;}this.clear );var o={};o[this.valueField]=0;o[this.displayField]=A;this.ios_options.push({data:o,el:B});}this.store.data.each(function(d,C){var D='';if(this.displayField&&typeof(d.data[this.displayField])!='undefined'){D=d.data[this.displayField];}var E='';if(this.valueField&&typeof(d.data[this.valueField])!='undefined'){E=d.data[this.valueField]; }var F={tag:'option',value:E,html:D};if(this.value==d.data[this.valueField]){F['selected']=true;}var G=this.inputEl().createChild(F);this.ios_options.push({data:d.data,el:G});},this);this.inputEl().on('change',function(){this.fireEvent('select',this);},this); },clearIOSView:function(){this.inputEl().dom.innerHTML='';this.ios_options=[];},setIOSValue:function(v){this.value=v;if(!this.ios_options){return;}Roo.each(this.ios_options,function(A){A.el.dom.removeAttribute('selected');if(A.data[this.valueField]!=v){return; -}A.el.dom.setAttribute('selected',true);},this);}});Roo.apply(Roo.bootstrap.ComboBox,{header:{tag:'div',cls:'modal-header',cn:[{tag:'h4',cls:'modal-title'}]},body:{tag:'div',cls:'modal-body',cn:[{tag:'ul',cls:'list-group'}]},listItemRadio:{tag:'li',cls:'list-group-item',cn:[{tag:'span',cls:'roo-combobox-list-group-item-value'} +}A.el.dom.setAttribute('selected',true);},this);}});Roo.apply(Roo.bootstrap.form.ComboBox,{header:{tag:'div',cls:'modal-header',cn:[{tag:'h4',cls:'modal-title'}]},body:{tag:'div',cls:'modal-body',cn:[{tag:'ul',cls:'list-group'}]},listItemRadio:{tag:'li',cls:'list-group-item',cn:[{tag:'span',cls:'roo-combobox-list-group-item-value'} ,{tag:'div',cls:'roo-combobox-list-group-item-box pull-xs-right radio-inline radio radio-info',cn:[{tag:'input',type:'radio'},{tag:'label'}]}]},listItemCheckbox:{tag:'li',cls:'list-group-item',cn:[{tag:'span',cls:'roo-combobox-list-group-item-value'},{tag:'div',cls:'roo-combobox-list-group-item-box pull-xs-right checkbox-inline checkbox checkbox-info',cn:[{tag:'input',type:'checkbox'} ,{tag:'label'}]}]},emptyResult:{tag:'div',cls:'alert alert-danger roo-combobox-touch-view-empty-result'},footer:{tag:'div',cls:'modal-footer',cn:[{tag:'div',cls:'row',cn:[{tag:'div',cls:'col-xs-6 text-left',cn:{tag:'button',cls:'btn btn-danger roo-touch-view-cancel',html:'Cancel'} -},{tag:'div',cls:'col-xs-6 text-right',cn:{tag:'button',cls:'btn btn-success roo-touch-view-ok',html:'OK'}}]}]}});Roo.apply(Roo.bootstrap.ComboBox,{touchViewTemplate:{tag:'div',cls:'modal fade roo-combobox-touch-view',cn:[{tag:'div',cls:'modal-dialog',style:'position:fixed',cn:[{tag:'div',cls:'modal-content',cn:[Roo.bootstrap.ComboBox.header,Roo.bootstrap.ComboBox.body,Roo.bootstrap.ComboBox.footer]} +},{tag:'div',cls:'col-xs-6 text-right',cn:{tag:'button',cls:'btn btn-success roo-touch-view-ok',html:'OK'}}]}]}});Roo.apply(Roo.bootstrap.form.ComboBox,{touchViewTemplate:{tag:'div',cls:'modal fade roo-combobox-touch-view',cn:[{tag:'div',cls:'modal-dialog',style:'position:fixed',cn:[{tag:'div',cls:'modal-content',cn:[Roo.bootstrap.form.ComboBox.header,Roo.bootstrap.form.ComboBox.body,Roo.bootstrap.form.ComboBox.footer]} ]}]}}); // Roo/View.js Roo.View=function(A,B,C){this.parent=false;if(typeof(B)=='undefined'){Roo.apply(this,A);this.el=Roo.get(this.el);}else{this.el=Roo.get(A);this.tpl=B;Roo.apply(this,C);}this.wrapEl=this.el.wrap().wrap();if(typeof(this.tpl)=="string"){this.tpl=new Roo.Template(this.tpl); @@ -784,7 +861,7 @@ this.selections.push(E);if(!C){this.fireEvent("selectionchange",this,this.select }else if(typeof A=="number"){return this.nodes[A];}return A;},getNodes:function(A,B){var ns=this.nodes;A=A||0;B=typeof B=="undefined"?ns.length-1:B;var C=[];if(A<=B){for(var i=A;i<=B;i++){C.push(ns[i]);}}else{for(var i=A;i>=B;i--){C.push(ns[i]);}}return C; },indexOf:function(A){A=this.getNode(A);if(typeof A.nodeIndex=="number"){return A.nodeIndex;}var ns=this.nodes;for(var i=0,B=ns.length;i'+K+'',unselectable:'on'});};var B={};if(!this.header){B={tag:'table',cls:'fc-header',style:'width:100%',cn:[{tag:'tr',cn:[{tag:'td',cls:'fc-header-left',cn:[A('prev','left','arrow','‹'),A('next','right','arrow','›'),{tag:'span',cls:'fc-header-space'} ,A('today','left right','','today')]},{tag:'td',cls:'fc-header-center',cn:[{tag:'span',cls:'fc-header-title',cn:{tag:'H2',html:'month / year'}}]},{tag:'td',cls:'fc-header-right',cn:[]}]}]};}B=this.header;var C=function(){var H=[];for(var i=0;i0&&ithis.startX){A.showPanelPrev();return;}if(this.startX>this.endX){A.showPanelNext();return;}}}); -// Roo/bootstrap/DateField.js -Roo.bootstrap.DateField=function(A){Roo.bootstrap.DateField.superclass.constructor.call(this,A);this.addEvents({show:true,hide:true,select:true,beforeselect:true});};Roo.extend(Roo.bootstrap.DateField,Roo.bootstrap.Input,{format:"m/d/y",altFormats:"m/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d",weekStart:0,viewMode:'',minViewMode:'',todayHighlight:false,todayBtn:false,language:'en',keyboardNavigation:true,calendarWeeks:false,startDate:-Infinity,endDate:Infinity,daysOfWeekDisabled:[],_events:[],singleMode:false,UTCDate:function(){return new Date(Date.UTC.apply(Date,arguments)); +// Roo/bootstrap/form/DateField.js +Roo.bootstrap.form.DateField=function(A){Roo.bootstrap.form.DateField.superclass.constructor.call(this,A);this.addEvents({show:true,hide:true,select:true,beforeselect:true});};Roo.extend(Roo.bootstrap.form.DateField,Roo.bootstrap.form.Input,{format:"m/d/y",altFormats:"m/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d",weekStart:0,viewMode:'',minViewMode:'',todayHighlight:false,todayBtn:false,language:'en',keyboardNavigation:true,calendarWeeks:false,startDate:-Infinity,endDate:Infinity,daysOfWeekDisabled:[],_events:[],singleMode:false,UTCDate:function(){return new Date(Date.UTC.apply(Date,arguments)); },UTCToday:function(){var A=new Date();return this.UTCDate(A.getUTCFullYear(),A.getUTCMonth(),A.getUTCDate());},getDate:function(){var d=this.getUTCDate();return new Date(d.getTime()+(d.getTimezoneOffset()*60000));},getUTCDate:function(){return this.date; -},setDate:function(d){this.setUTCDate(new Date(d.getTime()-(d.getTimezoneOffset()*60000)));},setUTCDate:function(d){this.date=d;this.setValue(this.formatDate(this.date));},onRender:function(ct,A){Roo.bootstrap.DateField.superclass.onRender.call(this,ct,A); -this.language=this.language||'en';this.language=this.language in Roo.bootstrap.DateField.dates?this.language:this.language.split('-')[0];this.language=this.language in Roo.bootstrap.DateField.dates?this.language:"en";this.isRTL=Roo.bootstrap.DateField.dates[this.language].rtl||false; +},setDate:function(d){this.setUTCDate(new Date(d.getTime()-(d.getTimezoneOffset()*60000)));},setUTCDate:function(d){this.date=d;this.setValue(this.formatDate(this.date));},onRender:function(ct,A){Roo.bootstrap.form.DateField.superclass.onRender.call(this,ct,A); +this.language=this.language||'en';this.language=this.language in Roo.bootstrap.form.DateField.dates?this.language:this.language.split('-')[0];this.language=this.language in Roo.bootstrap.form.DateField.dates?this.language:"en";this.isRTL=Roo.bootstrap.form.DateField.dates[this.language].rtl||false; this.format=this.format||'m/d/y';this.isInline=false;this.isInput=true;this.component=this.el.select('.add-on',true).first()||false;this.component=(this.component&&this.component.length===0)?false:this.component;this.hasInput=this.component&&this.inputEl().length; if(typeof(this.minViewMode==='string')){switch(this.minViewMode){case 'months':this.minViewMode=1;break;case 'years':this.minViewMode=2;break;default:this.minViewMode=0;break;}}if(typeof(this.viewMode==='string')){switch(this.viewMode){case 'months':this.viewMode=1; -break;case 'years':this.viewMode=2;break;default:this.viewMode=0;break;}}this.pickerEl=Roo.get(document.body).createChild(Roo.bootstrap.DateField.template);this.picker().setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.picker().on('mousedown',this.onMousedown,this); +break;case 'years':this.viewMode=2;break;default:this.viewMode=0;break;}}this.pickerEl=Roo.get(document.body).createChild(Roo.bootstrap.form.DateField.template);this.picker().setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.picker().on('mousedown',this.onMousedown,this); this.picker().on('click',this.onClick,this);this.picker().addClass('datepicker-dropdown');this.startViewMode=this.viewMode;if(this.singleMode){Roo.each(this.picker().select('thead > tr > th',true).elements,function(v){v.setVisibilityMode(Roo.Element.DISPLAY); -v.hide();});Roo.each(this.picker().select('tbody > tr > td',true).elements,function(v){v.setStyle('width','189px');});}Roo.each(this.picker().select('tfoot th.today',true).elements,function(v){if(!this.calendarWeeks){v.remove();return;}v.dom.innerHTML=Roo.bootstrap.DateField.dates[this.language].today; +v.hide();});Roo.each(this.picker().select('tbody > tr > td',true).elements,function(v){v.setStyle('width','189px');});}Roo.each(this.picker().select('tfoot th.today',true).elements,function(v){if(!this.calendarWeeks){v.remove();return;}v.dom.innerHTML=Roo.bootstrap.form.DateField.dates[this.language].today; v.attr('colspan',function(i,B){return parseInt(B)+1;});});this.weekEnd=this.weekStart===0?6:this.weekStart-1;this.setStartDate(this.startDate);this.setEndDate(this.endDate);this.setDaysOfWeekDisabled(this.daysOfWeekDisabled);this.fillDow();this.fillMonths(); -this.update();this.showMode();if(this.isInline){this.showPopup();}},picker:function(){return this.pickerEl;},fillDow:function(){var A=this.weekStart;var B={tag:'tr',cn:[]};if(this.calendarWeeks){B.cn.push({tag:'th',cls:'cw',html:' '})}while(A.datepicker-days thead',true).first().createChild(B);},fillMonths:function(){var i=0;var A=this.picker().select('>.datepicker-months td',true).first();A.dom.innerHTML='';while(i<12){var B={tag:'span',cls:'month',html:Roo.bootstrap.DateField.dates[this.language].monthsShort[i++]} +this.update();this.showMode();if(this.isInline){this.showPopup();}},picker:function(){return this.pickerEl;},fillDow:function(){var A=this.weekStart;var B={tag:'tr',cn:[]};if(this.calendarWeeks){B.cn.push({tag:'th',cls:'cw',html:' '})}while(A.datepicker-days thead',true).first().createChild(B);},fillMonths:function(){var i=0;var A=this.picker().select('>.datepicker-months td',true).first();A.dom.innerHTML='';while(i<12){var B={tag:'span',cls:'month',html:Roo.bootstrap.form.DateField.dates[this.language].monthsShort[i++]} ;A.createChild(B);}},update:function(){this.date=(typeof(this.date)==='undefined'||((typeof(this.date)==='string')&&!this.date.length))?this.UTCToday():(typeof(this.date)==='string')?this.parseDate(this.date):this.date;if(this.datethis.endDate){this.viewDate=new Date(this.endDate);}else{this.viewDate=new Date(this.date);}this.fill();},fill:function(){var d=new Date(this.viewDate),A=d.getUTCFullYear(),B=d.getUTCMonth(),C=this.startDate!==-Infinity?this.startDate.getUTCFullYear():-Infinity,D=this.startDate!==-Infinity?this.startDate.getUTCMonth():-Infinity,E=this.endDate!==Infinity?this.endDate.getUTCFullYear():Infinity,F=this.endDate!==Infinity?this.endDate.getUTCMonth():Infinity,G=this.date&&this.date.valueOf(),H=this.UTCToday(); -this.picker().select('>.datepicker-days thead th.switch',true).first().dom.innerHTML=Roo.bootstrap.DateField.dates[this.language].months[B]+' '+A;this.updateNavArrows();this.fillMonths();var I=this.UTCDate(A,B-1,28,0,0,0,0),J=I.getDaysInMonth(I.getUTCFullYear(),I.getUTCMonth()); +this.picker().select('>.datepicker-days thead th.switch',true).first().dom.innerHTML=Roo.bootstrap.form.DateField.dates[this.language].months[B]+' '+A;this.updateNavArrows();this.fillMonths();var I=this.UTCDate(A,B-1,28,0,0,0,0),J=I.getDaysInMonth(I.getUTCFullYear(),I.getUTCMonth()); I.setUTCDate(J);I.setUTCDate(J-(I.getUTCDay()-this.weekStart+7)%7);var K=new Date(I);K.setUTCDate(K.getUTCDate()+42);K=K.valueOf();var L=false;this.picker().select('>.datepicker-days tbody',true).first().dom.innerHTML='';while(I.valueOf()<=K){var M='';if(I.getUTCDay()===this.weekStart){if(L){this.picker().select('>.datepicker-days tbody',true).first().createChild(L); }L={tag:'tr',cn:[]};if(this.calendarWeeks){var ws=new Date(+I+(this.weekStart-I.getUTCDay()-7)%7*864e5),th=new Date(+ws+(7+4-ws.getUTCDay())%7*864e5),N=new Date(+(N=this.UTCDate(th.getUTCFullYear(),0,1))+(7+4-N.getUTCDay())%7*864e5),O=(th-N)/864e5/7+1;L.cn.push({tag:'td',cls:'cw',html:O} );}}if(I.getUTCFullYear()A||(I.getUTCFullYear()==A&&I.getUTCMonth()>B)){M+=' new';}if(this.todayHighlight&&I.getUTCFullYear()==H.getFullYear()&&I.getUTCMonth()==H.getMonth()&&I.getUTCDate()==H.getDate()){M+=' today'; @@ -901,24 +979,24 @@ I.setUTCDate(J);I.setUTCDate(J-(I.getUTCDay()-this.weekStart+7)%7);var K=new Dat var Q=this.date&&this.date.getUTCMonth();this.picker().select('>.datepicker-months th.switch',true).first().dom.innerHTML=A;Roo.each(this.picker().select('>.datepicker-months tbody span',true).elements,function(v,k){v.removeClass('active');if(P===A&&k===Q){v.addClass('active'); }if(AE||(A==C&&kF)){v.addClass('disabled');}});A=parseInt(A/10,10)*10;this.picker().select('>.datepicker-years th.switch',true).first().dom.innerHTML=A+'-'+(A+9);this.picker().select('>.datepicker-years tbody td',true).first().dom.innerHTML=''; A-=1;for(var i=-1;i<11;i++){this.picker().select('>.datepicker-years tbody td',true).first().createChild({tag:'span',cls:'year'+(i===-1||i===10?' old':'')+(P===A?' active':'')+(AE?' disabled':''),html:A});A+=1;}},showMode:function(A){if(A){this.viewMode=Math.max(this.minViewMode,Math.min(2,this.viewMode+A)); -}Roo.each(this.picker().select('>div',true).elements,function(v){v.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';v.hide();});this.picker().select('>.datepicker-'+Roo.bootstrap.DateField.modes[this.viewMode].clsName,true).first().show();},place:function(){if(this.isInline){return; -}this.picker().removeClass(['bottom','top']);if((Roo.lib.Dom.getViewHeight()+Roo.get(document.body).getScroll().top)-(this.inputEl().getBottom()+this.picker().getHeight())<0){this.picker().addClass('top');this.picker().setTop(this.inputEl().getTop()-this.picker().getHeight()).setLeft(this.inputEl().getLeft()); +}Roo.each(this.picker().select('>div',true).elements,function(v){v.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';v.hide();});this.picker().select('>.datepicker-'+Roo.bootstrap.form.DateField.modes[this.viewMode].clsName,true).first().show(); +},place:function(){if(this.isInline){return;}this.picker().removeClass(['bottom','top']);if((Roo.lib.Dom.getViewHeight()+Roo.get(document.body).getScroll().top)-(this.inputEl().getBottom()+this.picker().getHeight())<0){this.picker().addClass('top');this.picker().setTop(this.inputEl().getTop()-this.picker().getHeight()).setLeft(this.inputEl().getLeft()); return;}this.picker().addClass('bottom');this.picker().setTop(this.inputEl().getBottom()).setLeft(this.inputEl().getLeft());},parseDate:function(A){if(!A||A instanceof Date){return A;}var v=Date.parseDate(A,this.format);if(!v&&(this.useIso||A.match(/^(\d{4})-0?(\d+)-0?(\d+)/))){v=Date.parseDate(A,'Y-m-d'); }if(!v&&this.altFormats){if(!this.altFormatsArray){this.altFormatsArray=this.altFormats.split("|");}for(var i=0,B=this.altFormatsArray.length;i-1){this.viewDate.setUTCMonth(Roo.bootstrap.DateField.dates[this.language].monthsShort.indexOf(D));}else{var G=parseInt(D,10)||0;this.viewDate.setUTCFullYear(G); -}if(this.singleMode){this.setValue(this.formatDate(this.viewDate));this.hidePopup();return;}this.showMode(-1);this.fill();}break;case 'td':if(C.indexOf('day')>-1&&C.indexOf('disabled')<0){var H=parseInt(D,10)||1;var G=(this.viewDate||new Date()).getUTCFullYear(),I=(this.viewDate||new Date()).getUTCMonth(); +}break;case 'span':if(C.indexOf('disabled')<0){if(!this.viewDate){this.viewDate=new Date();}this.viewDate.setUTCDate(1);if(C.indexOf('month')>-1){this.viewDate.setUTCMonth(Roo.bootstrap.form.DateField.dates[this.language].monthsShort.indexOf(D));}else{var G=parseInt(D,10)||0; +this.viewDate.setUTCFullYear(G);}if(this.singleMode){this.setValue(this.formatDate(this.viewDate));this.hidePopup();return;}this.showMode(-1);this.fill();}break;case 'td':if(C.indexOf('day')>-1&&C.indexOf('disabled')<0){var H=parseInt(D,10)||1;var G=(this.viewDate||new Date()).getUTCFullYear(),I=(this.viewDate||new Date()).getUTCMonth(); if(C.indexOf('old')>-1){if(I===0){I=11;G-=1;}else{I-=1;}}else if(C.indexOf('new')>-1){if(I==11){I=0;G+=1;}else{I+=1;}}this.date=this.UTCDate(G,I,H,0,0,0,0);this.viewDate=this.UTCDate(G,I,Math.min(28,H),0,0,0,0);this.setValue(this.formatDate(this.date));this.hidePopup(); }break;}},setStartDate:function(A){this.startDate=A||-Infinity;if(this.startDate!==-Infinity){this.startDate=this.parseDate(this.startDate);}this.update();this.updateNavArrows();},setEndDate:function(A){this.endDate=A||Infinity;if(this.endDate!==Infinity){this.endDate=this.parseDate(this.endDate); }this.update();this.updateNavArrows();},setDaysOfWeekDisabled:function(A){this.daysOfWeekDisabled=A||[];if(typeof(this.daysOfWeekDisabled)!=='object'){this.daysOfWeekDisabled=this.daysOfWeekDisabled.split(/,\s*/);}this.daysOfWeekDisabled=this.daysOfWeekDisabled.map(function(d){return parseInt(d,10); @@ -929,14 +1007,14 @@ if(C.indexOf('old')>-1){if(I===0){I=11;G-=1;}else{I-=1;}}else if(C.indexOf('new' }return C;},moveYear:function(A,B){return this.moveMonth(A,B*12);},dateWithinRange:function(A){return A>=this.startDate&&A<=this.endDate;},remove:function(){this.picker().remove();},validateValue:function(A){if(this.getVisibilityEl().hasClass('hidden')){return true; }if(A.length<1){if(this.allowBlank){return true;}return false;}if(A.lengththis.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;}if(typeof(this.parseDate(A))=='undefined'){return false;}if(this.endDate!==Infinity&&this.parseDate(A).getTime()>this.endDate.getTime()){return false;}if(this.startDate!==-Infinity&&this.parseDate(A).getTime()'},{tag:'th',cls:'switch',colspan:'5'} -,{tag:'th',cls:'next',html:''}]}]},content:{tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:'7'}]}]},footer:{tag:'tfoot',cn:[{tag:'tr',cn:[{tag:'th',colspan:'7',cls:'today'}]}]},dates:{en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today"} -},modes:[{clsName:'days',navFnc:'Month',navStep:1},{clsName:'months',navFnc:'FullYear',navStep:1},{clsName:'years',navFnc:'FullYear',navStep:10}]});Roo.apply(Roo.bootstrap.DateField,{template:{tag:'div',cls:'datepicker dropdown-menu roo-dynamic shadow',cn:[{tag:'div',cls:'datepicker-days',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.DateField.head,{tag:'tbody'} -,Roo.bootstrap.DateField.footer]}]},{tag:'div',cls:'datepicker-months',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.DateField.head,Roo.bootstrap.DateField.content,Roo.bootstrap.DateField.footer]}]},{tag:'div',cls:'datepicker-years',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.DateField.head,Roo.bootstrap.DateField.content,Roo.bootstrap.DateField.footer]} +}return true;},reset:function(){this.date=this.viewDate='';Roo.bootstrap.form.DateField.superclass.setValue.call(this,'');}});Roo.apply(Roo.bootstrap.form.DateField,{head:{tag:'thead',cn:[{tag:'tr',cn:[{tag:'th',cls:'prev',html:''} +,{tag:'th',cls:'switch',colspan:'5'},{tag:'th',cls:'next',html:''}]}]},content:{tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:'7'}]}]},footer:{tag:'tfoot',cn:[{tag:'tr',cn:[{tag:'th',colspan:'7',cls:'today'}]}]},dates:{en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today"} +},modes:[{clsName:'days',navFnc:'Month',navStep:1},{clsName:'months',navFnc:'FullYear',navStep:1},{clsName:'years',navFnc:'FullYear',navStep:10}]});Roo.apply(Roo.bootstrap.form.DateField,{template:{tag:'div',cls:'datepicker dropdown-menu roo-dynamic shadow',cn:[{tag:'div',cls:'datepicker-days',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.form.DateField.head,{tag:'tbody'} +,Roo.bootstrap.form.DateField.footer]}]},{tag:'div',cls:'datepicker-months',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.form.DateField.head,Roo.bootstrap.form.DateField.content,Roo.bootstrap.form.DateField.footer]}]},{tag:'div',cls:'datepicker-years',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.form.DateField.head,Roo.bootstrap.form.DateField.content,Roo.bootstrap.form.DateField.footer]} ]}]}}); -// Roo/bootstrap/TimeField.js -Roo.bootstrap.TimeField=function(A){Roo.bootstrap.TimeField.superclass.constructor.call(this,A);this.addEvents({show:true,hide:true,select:true});};Roo.extend(Roo.bootstrap.TimeField,Roo.bootstrap.Input,{format:"H:i",getAutoCreate:function(){this.after=''; -return Roo.bootstrap.TimeField.superclass.getAutoCreate.call(this);},onRender:function(ct,A){Roo.bootstrap.TimeField.superclass.onRender.call(this,ct,A);this.pickerEl=Roo.get(document.body).createChild(Roo.bootstrap.TimeField.template);this.picker().setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block'; +// Roo/bootstrap/form/TimeField.js +Roo.bootstrap.form.TimeField=function(A){Roo.bootstrap.form.TimeField.superclass.constructor.call(this,A);this.addEvents({show:true,hide:true,select:true});};Roo.extend(Roo.bootstrap.form.TimeField,Roo.bootstrap.form.Input,{format:"H:i",getAutoCreate:function(){this.after=''; +return Roo.bootstrap.form.TimeField.superclass.getAutoCreate.call(this);},onRender:function(ct,A){Roo.bootstrap.form.TimeField.superclass.onRender.call(this,ct,A);this.pickerEl=Roo.get(document.body).createChild(Roo.bootstrap.form.TimeField.template);this.picker().setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block'; this.pop=this.picker().select('>.datepicker-time',true).first();this.pop.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.picker().on('mousedown',this.onMousedown,this);this.picker().on('click',this.onClick,this);this.picker().addClass('datepicker-dropdown'); this.fillTime();this.update();this.pop.select('.hours-up',true).first().on('click',this.onIncrementHours,this);this.pop.select('.hours-down',true).first().on('click',this.onDecrementHours,this);this.pop.select('.minutes-up',true).first().on('click',this.onIncrementMinutes,this); this.pop.select('.minutes-down',true).first().on('click',this.onDecrementMinutes,this);this.pop.select('button.period',true).first().on('click',this.onTogglePeriod,this);this.pop.select('button.ok',true).first().on('click',this.setTime,this);},fireKey:function(e){if(!this.picker().isVisible()){if(e.keyCode==27){this.show(); @@ -948,33 +1026,33 @@ e.preventDefault();},picker:function(){return this.pickerEl;},fillTime:function( },fill:function(){var A=this.time.getHours();var B=this.time.getMinutes();var C='AM';if(A>11){C='PM';}if(A==0){A=12;}if(A>12){A=A-12;}if(A<10){A='0'+A;}if(B<10){B='0'+B;}this.pop.select('.timepicker-hour',true).first().dom.innerHTML=A;this.pop.select('.timepicker-minute',true).first().dom.innerHTML=B; this.pop.select('button',true).first().dom.innerHTML=C;},place:function(){this.picker().removeClass(['bottom-left','bottom-right','top-left','top-right']);var A=['bottom'];if((Roo.lib.Dom.getViewHeight()+Roo.get(document.body).getScroll().top)-(this.inputEl().getBottom()+this.picker().getHeight())<0){A.pop(); A.push('top');}A.push('right');if((Roo.lib.Dom.getViewWidth()+Roo.get(document.body).getScroll().left)-(this.inputEl().getLeft()+this.picker().getWidth())<0){A.pop();A.push('left');}this.picker().addClass(A.join('-'));var B=this;Roo.each(A,function(c){if(c=='bottom'){(function(){} -).defer(200);B.picker().alignTo(B.inputEl(),"tr-br",[0,10],false);return;}if(c=='top'){B.picker().alignTo(B.inputEl(),"br-tr",[0,10],false);return;}});},onFocus:function(){Roo.bootstrap.TimeField.superclass.onFocus.call(this);this.show();},onBlur:function(){Roo.bootstrap.TimeField.superclass.onBlur.call(this); +).defer(200);B.picker().alignTo(B.inputEl(),"tr-br",[0,10],false);return;}if(c=='top'){B.picker().alignTo(B.inputEl(),"br-tr",[0,10],false);return;}});},onFocus:function(){Roo.bootstrap.form.TimeField.superclass.onFocus.call(this);this.show();},onBlur:function(){Roo.bootstrap.form.TimeField.superclass.onBlur.call(this); this.hide();},show:function(){this.picker().show();this.pop.show();this.update();this.place();this.fireEvent('show',this,this.date);},hide:function(){this.picker().hide();this.pop.hide();this.fireEvent('hide',this,this.date);},setTime:function(){this.hide(); this.setValue(this.time.format(this.format));this.fireEvent('select',this,this.date);},onMousedown:function(e){e.stopPropagation();e.preventDefault();},onIncrementHours:function(){Roo.log('onIncrementHours');this.time=this.time.add(Date.HOUR,1);this.update(); },onDecrementHours:function(){Roo.log('onDecrementHours');this.time=this.time.add(Date.HOUR,-1);this.update();},onIncrementMinutes:function(){Roo.log('onIncrementMinutes');this.time=this.time.add(Date.MINUTE,1);this.update();},onDecrementMinutes:function(){Roo.log('onDecrementMinutes'); -this.time=this.time.add(Date.MINUTE,-1);this.update();},onTogglePeriod:function(){Roo.log('onTogglePeriod');this.time=this.time.add(Date.HOUR,12);this.update();}});Roo.apply(Roo.bootstrap.TimeField,{template:{tag:'div',cls:'datepicker dropdown-menu',cn:[{tag:'div',cls:'datepicker-time',cn:[{tag:'table',cls:'table-condensed',cn:[{tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:'7'} +this.time=this.time.add(Date.MINUTE,-1);this.update();},onTogglePeriod:function(){Roo.log('onTogglePeriod');this.time=this.time.add(Date.HOUR,12);this.update();}});Roo.apply(Roo.bootstrap.form.TimeField,{template:{tag:'div',cls:'datepicker dropdown-menu',cn:[{tag:'div',cls:'datepicker-time',cn:[{tag:'table',cls:'table-condensed',cn:[{tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:'7'} ]}]},{tag:'tfoot',cn:[{tag:'tr',cn:[{tag:'th',colspan:'7',cls:'',cn:[{tag:'button',cls:'btn btn-info ok',html:'OK'}]}]}]}]}]}]}}); -// Roo/bootstrap/MonthField.js -Roo.bootstrap.MonthField=function(A){Roo.bootstrap.MonthField.superclass.constructor.call(this,A);this.addEvents({show:true,hide:true,select:true});};Roo.extend(Roo.bootstrap.MonthField,Roo.bootstrap.Input,{onRender:function(ct,A){Roo.bootstrap.MonthField.superclass.onRender.call(this,ct,A); -this.language=this.language||'en';this.language=this.language in Roo.bootstrap.MonthField.dates?this.language:this.language.split('-')[0];this.language=this.language in Roo.bootstrap.MonthField.dates?this.language:"en";this.isRTL=Roo.bootstrap.MonthField.dates[this.language].rtl||false; -this.isInline=false;this.isInput=true;this.component=this.el.select('.add-on',true).first()||false;this.component=(this.component&&this.component.length===0)?false:this.component;this.hasInput=this.component&&this.inputEL().length;this.pickerEl=Roo.get(document.body).createChild(Roo.bootstrap.MonthField.template); +// Roo/bootstrap/form/MonthField.js +Roo.bootstrap.form.MonthField=function(A){Roo.bootstrap.form.MonthField.superclass.constructor.call(this,A);this.addEvents({show:true,hide:true,select:true});};Roo.extend(Roo.bootstrap.form.MonthField,Roo.bootstrap.form.Input,{onRender:function(ct,A){Roo.bootstrap.form.MonthField.superclass.onRender.call(this,ct,A); +this.language=this.language||'en';this.language=this.language in Roo.bootstrap.form.MonthField.dates?this.language:this.language.split('-')[0];this.language=this.language in Roo.bootstrap.form.MonthField.dates?this.language:"en";this.isRTL=Roo.bootstrap.form.MonthField.dates[this.language].rtl||false; +this.isInline=false;this.isInput=true;this.component=this.el.select('.add-on',true).first()||false;this.component=(this.component&&this.component.length===0)?false:this.component;this.hasInput=this.component&&this.inputEL().length;this.pickerEl=Roo.get(document.body).createChild(Roo.bootstrap.form.MonthField.template); this.picker().setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.picker().on('mousedown',this.onMousedown,this);this.picker().on('click',this.onClick,this);this.picker().addClass('datepicker-dropdown');Roo.each(this.picker().select('tbody > tr > td',true).elements,function(v){v.setStyle('width','189px'); -});this.fillMonths();this.update();if(this.isInline){this.show();}},setValue:function(v,A){var o=this.getValue();Roo.bootstrap.MonthField.superclass.setValue.call(this,v);this.update();if(A!==true){this.fireEvent('select',this,o,v);}},getValue:function(){return this.value; +});this.fillMonths();this.update();if(this.isInline){this.show();}},setValue:function(v,A){var o=this.getValue();Roo.bootstrap.form.MonthField.superclass.setValue.call(this,v);this.update();if(A!==true){this.fireEvent('select',this,o,v);}},getValue:function(){return this.value; },onClick:function(e){e.stopPropagation();e.preventDefault();var A=e.getTarget();if(A.nodeName.toLowerCase()==='i'){A=Roo.get(A).dom.parentNode;}var B=A.nodeName;var C=A.className;var D=A.innerHTML;if(B.toLowerCase()!='span'||C.indexOf('disabled')>-1||C.indexOf('month')==-1){return; -}this.vIndex=Roo.bootstrap.MonthField.dates[this.language].monthsShort.indexOf(D);this.setValue(Roo.bootstrap.MonthField.dates[this.language].months[this.vIndex]);this.hide();},picker:function(){return this.pickerEl;},fillMonths:function(){var i=0;var A=this.picker().select('>.datepicker-months td',true).first(); -A.dom.innerHTML='';while(i<12){var B={tag:'span',cls:'month',html:Roo.bootstrap.MonthField.dates[this.language].monthsShort[i++]};A.createChild(B);}},update:function(){var A=this;if(typeof(this.vIndex)=='undefined'&&this.value.length){this.vIndex=Roo.bootstrap.MonthField.dates[this.language].months.indexOf(this.value); +}this.vIndex=Roo.bootstrap.form.MonthField.dates[this.language].monthsShort.indexOf(D);this.setValue(Roo.bootstrap.form.MonthField.dates[this.language].months[this.vIndex]);this.hide();},picker:function(){return this.pickerEl;},fillMonths:function(){var i=0; +var A=this.picker().select('>.datepicker-months td',true).first();A.dom.innerHTML='';while(i<12){var B={tag:'span',cls:'month',html:Roo.bootstrap.form.MonthField.dates[this.language].monthsShort[i++]};A.createChild(B);}},update:function(){var A=this;if(typeof(this.vIndex)=='undefined'&&this.value.length){this.vIndex=Roo.bootstrap.form.MonthField.dates[this.language].months.indexOf(this.value); }Roo.each(this.pickerEl.select('> .datepicker-months tbody > tr > td > span',true).elements,function(e,k){e.removeClass('active');if(typeof(A.vIndex)!='undefined'&&k==A.vIndex){e.addClass('active');}})},place:function(){if(this.isInline){return;}this.picker().removeClass(['bottom','top']); if((Roo.lib.Dom.getViewHeight()+Roo.get(document.body).getScroll().top)-(this.inputEl().getBottom()+this.picker().getHeight())<0){this.picker().addClass('top');this.picker().setTop(this.inputEl().getTop()-this.picker().getHeight()).setLeft(this.inputEl().getLeft()); -return;}this.picker().addClass('bottom');this.picker().setTop(this.inputEl().getBottom()).setLeft(this.inputEl().getLeft());},onFocus:function(){Roo.bootstrap.MonthField.superclass.onFocus.call(this);this.show();},onBlur:function(){Roo.bootstrap.MonthField.superclass.onBlur.call(this); +return;}this.picker().addClass('bottom');this.picker().setTop(this.inputEl().getBottom()).setLeft(this.inputEl().getLeft());},onFocus:function(){Roo.bootstrap.form.MonthField.superclass.onFocus.call(this);this.show();},onBlur:function(){Roo.bootstrap.form.MonthField.superclass.onBlur.call(this); var d=this.inputEl().getValue();this.setValue(d);this.hide();},show:function(){this.picker().show();this.picker().select('>.datepicker-months',true).first().show();this.update();this.place();this.fireEvent('show',this,this.date);},hide:function(){if(this.isInline){return; -}this.picker().hide();this.fireEvent('hide',this,this.date);},onMousedown:function(e){e.stopPropagation();e.preventDefault();},keyup:function(e){Roo.bootstrap.MonthField.superclass.keyup.call(this);this.update();},fireKey:function(e){if(!this.picker().isVisible()){if(e.keyCode==27){this.show(); -}return;}var A;switch(e.keyCode){case 27:this.hide();e.preventDefault();break;case 37:case 39:A=e.keyCode==37?-1:1;this.vIndex=this.vIndex+A;if(this.vIndex<0){this.vIndex=0;}if(this.vIndex>11){this.vIndex=11;}if(isNaN(this.vIndex)){this.vIndex=0;}this.setValue(Roo.bootstrap.MonthField.dates[this.language].months[this.vIndex]); -break;case 38:case 40:A=e.keyCode==38?-1:1;this.vIndex=this.vIndex+A*4;if(this.vIndex<0){this.vIndex=0;}if(this.vIndex>11){this.vIndex=11;}if(isNaN(this.vIndex)){this.vIndex=0;}this.setValue(Roo.bootstrap.MonthField.dates[this.language].months[this.vIndex]); -break;case 13:if(typeof(this.vIndex)!='undefined'&&!isNaN(this.vIndex)){this.setValue(Roo.bootstrap.MonthField.dates[this.language].months[this.vIndex]);}this.hide();e.preventDefault();break;case 9:if(typeof(this.vIndex)!='undefined'&&!isNaN(this.vIndex)){this.setValue(Roo.bootstrap.MonthField.dates[this.language].months[this.vIndex]); -}this.hide();break;case 16:case 17:case 18:break;default:this.hide();}},remove:function(){this.picker().remove();}});Roo.apply(Roo.bootstrap.MonthField,{content:{tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:'7'}]}]},dates:{en:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]} -}});Roo.apply(Roo.bootstrap.MonthField,{template:{tag:'div',cls:'datepicker dropdown-menu roo-dynamic',cn:[{tag:'div',cls:'datepicker-months',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.DateField.content]}]}]}}); -// Roo/bootstrap/CheckBox.js -Roo.bootstrap.CheckBox=function(A){Roo.bootstrap.CheckBox.superclass.constructor.call(this,A);this.addEvents({check:true,click:true});};Roo.extend(Roo.bootstrap.CheckBox,Roo.bootstrap.Input,{inputType:'checkbox',inputValue:1,valueOff:0,boxLabel:false,checked:false,weight:false,inline:false,tooltip:'',invalidClass:"",validClass:"",getAutoCreate:function(){var A=(!this.labelAlign)?this.parentLabelAlign():this.labelAlign; +}this.picker().hide();this.fireEvent('hide',this,this.date);},onMousedown:function(e){e.stopPropagation();e.preventDefault();},keyup:function(e){Roo.bootstrap.form.MonthField.superclass.keyup.call(this);this.update();},fireKey:function(e){if(!this.picker().isVisible()){if(e.keyCode==27){this.show(); +}return;}var A;switch(e.keyCode){case 27:this.hide();e.preventDefault();break;case 37:case 39:A=e.keyCode==37?-1:1;this.vIndex=this.vIndex+A;if(this.vIndex<0){this.vIndex=0;}if(this.vIndex>11){this.vIndex=11;}if(isNaN(this.vIndex)){this.vIndex=0;}this.setValue(Roo.bootstrap.form.MonthField.dates[this.language].months[this.vIndex]); +break;case 38:case 40:A=e.keyCode==38?-1:1;this.vIndex=this.vIndex+A*4;if(this.vIndex<0){this.vIndex=0;}if(this.vIndex>11){this.vIndex=11;}if(isNaN(this.vIndex)){this.vIndex=0;}this.setValue(Roo.bootstrap.form.MonthField.dates[this.language].months[this.vIndex]); +break;case 13:if(typeof(this.vIndex)!='undefined'&&!isNaN(this.vIndex)){this.setValue(Roo.bootstrap.form.MonthField.dates[this.language].months[this.vIndex]);}this.hide();e.preventDefault();break;case 9:if(typeof(this.vIndex)!='undefined'&&!isNaN(this.vIndex)){this.setValue(Roo.bootstrap.form.MonthField.dates[this.language].months[this.vIndex]); +}this.hide();break;case 16:case 17:case 18:break;default:this.hide();}},remove:function(){this.picker().remove();}});Roo.apply(Roo.bootstrap.form.MonthField,{content:{tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:'7'}]}]},dates:{en:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]} +}});Roo.apply(Roo.bootstrap.form.MonthField,{template:{tag:'div',cls:'datepicker dropdown-menu roo-dynamic',cn:[{tag:'div',cls:'datepicker-months',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.form.DateField.content]}]}]}}); +// Roo/bootstrap/form/CheckBox.js +Roo.bootstrap.form.CheckBox=function(A){Roo.bootstrap.form.CheckBox.superclass.constructor.call(this,A);this.addEvents({check:true,click:true});};Roo.extend(Roo.bootstrap.form.CheckBox,Roo.bootstrap.form.Input,{inputType:'checkbox',inputValue:1,valueOff:0,boxLabel:false,checked:false,weight:false,inline:false,tooltip:'',invalidClass:"",validClass:"",getAutoCreate:function(){var A=(!this.labelAlign)?this.parentLabelAlign():this.labelAlign; var id=Roo.id();var B={};B.cls='form-group form-check '+this.inputType;if(this.inline){B.cls+=' '+this.inputType+'-inline form-check-inline';}var C={tag:'input',id:id,type:this.inputType,value:this.inputValue,cls:'roo-'+this.inputType,placeholder:this.placeholder||''} ;if(this.inputType!='radio'){var D={tag:'input',type:'hidden',cls:'roo-hidden-value',value:this.checked?this.inputValue:this.valueOff};}if(this.weight){B.cls+=" "+this.inputType+"-"+this.weight;}if(this.disabled){C.disabled=true;}if(this.checked){C.checked=this.checked; }if(this.name){C.name=this.name;if(this.inputType!='radio'){D.name=this.name;C.name='_hidden_'+this.name;}}if(this.size){C.cls+=' input-'+this.size;}var E=this;['xs','sm','md','lg'].map(function(H){if(E[H]){B.cls+=' col-'+H+'-'+E[H];}});var F=C;if(this.before||this.after){F={cls:'input-group',cn:[]} @@ -984,181 +1062,297 @@ var id=Roo.id();var B={};B.cls='form-group form-check '+this.inputType;if(this.i }if(this.labelsm>0){B.cn[0].cls+=' col-sm-'+this.labelsm;B.cn[1].cls+=' col-sm-'+(12-this.labelsm);}if(this.labelxs>0){B.cn[0].cls+=' col-xs-'+this.labelxs;B.cn[1].cls+=' col-xs-'+(12-this.labelxs);}}else if(this.fieldLabel.length){B.cn=[{tag:this.boxLabel?'span':'label','for':id,cls:'control-label box-input-label',html:this.fieldLabel} ,F];if(G){B.cn.push(G);}}else{B.cn=[F];if(G){B.cn.push(G);}}if(this.inputType!='radio'){B.cn.push(D);}return B;},inputEl:function(){return this.el.select('input.roo-'+this.inputType,true).first();},hiddenEl:function(){return this.el.select('input.roo-hidden-value',true).first(); },labelEl:function(){return this.el.select('label.control-label',true).first();},label:function(){return this.labelEl();},boxLabelEl:function(){return this.el.select('label.box-label',true).first();},initEvents:function(){this.inputEl().on('click',this.onClick,this); -if(this.boxLabel){this.el.select('label.box-label',true).first().on('click',this.onClick,this);}this.startValue=this.getValue();if(this.groupId){Roo.bootstrap.CheckBox.register(this);}},onClick:function(e){if(this.fireEvent('click',this,e)!==false){this.setChecked(!this.checked); +if(this.boxLabel){this.el.select('label.box-label',true).first().on('click',this.onClick,this);}this.startValue=this.getValue();if(this.groupId){Roo.bootstrap.form.CheckBox.register(this);}},onClick:function(e){if(this.fireEvent('click',this,e)!==false){this.setChecked(!this.checked); }},setChecked:function(A,B){this.startValue=this.getValue();if(this.inputType=='radio'){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){e.dom.checked=false;});this.inputEl().dom.checked=true;this.inputEl().dom.value=this.inputValue; if(B!==true){this.fireEvent('check',this,true);}this.validate();return;}this.checked=A;this.inputEl().dom.checked=A;this.hiddenEl().dom.value=A?this.inputValue:this.valueOff;if(B!==true){this.fireEvent('check',this,A);}this.validate();},getValue:function(){if(this.inputType=='radio'){return this.getGroupValue(); }return this.hiddenEl().dom.value;},getGroupValue:function(){if(typeof(this.el.up('form').child('input[name='+this.name+']:checked',true))=='undefined'){return '';}return this.el.up('form').child('input[name='+this.name+']:checked',true).value;},setValue:function(v,A){if(this.inputType=='radio'){this.setGroupValue(v,A); return;}this.setChecked(((typeof(v)=='undefined')?this.checked:(String(v)===String(this.inputValue))),A);this.validate();},setGroupValue:function(v,A){this.startValue=this.getValue();Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){e.dom.checked=false; if(e.dom.value==v){e.dom.checked=true;}});if(A!==true){this.fireEvent('check',this,true);}this.validate();return;},validate:function(){if(this.getVisibilityEl().hasClass('hidden')){return true;}if(this.disabled||(this.inputType=='radio'&&this.validateRadio())||(this.inputType=='checkbox'&&this.validateCheckbox())){this.markValid(); return true;}this.markInvalid();return false;},validateRadio:function(){if(this.getVisibilityEl().hasClass('hidden')){return true;}if(this.allowBlank){return true;}var A=false;Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){if(!e.dom.checked){return; -}A=true;return false;});return A;},validateCheckbox:function(){if(!this.groupId){return (this.getValue()==this.inputValue||this.allowBlank)?true:false;}var A=Roo.bootstrap.CheckBox.get(this.groupId);if(!A){return false;}var r=false;for(var i in A){if(A[i].el.isVisible(true)){r=false; -break;}r=true;}for(var i in A){if(r){break;}r=(A[i].getValue()==A[i].inputValue)?true:false;}return r;},markValid:function(){var A=this;this.fireEvent('valid',this);var B=Roo.bootstrap.FieldLabel.get(this.name+'-group');if(this.groupId){B=Roo.bootstrap.FieldLabel.get(this.groupId+'-group'); +}A=true;return false;});return A;},validateCheckbox:function(){if(!this.groupId){return (this.getValue()==this.inputValue||this.allowBlank)?true:false;}var A=Roo.bootstrap.form.CheckBox.get(this.groupId);if(!A){return false;}var r=false;for(var i in A){if(A[i].el.isVisible(true)){r=false; +break;}r=true;}for(var i in A){if(r){break;}r=(A[i].getValue()==A[i].inputValue)?true:false;}return r;},markValid:function(){var A=this;this.fireEvent('valid',this);var B=Roo.bootstrap.form.FieldLabel.get(this.name+'-group');if(this.groupId){B=Roo.bootstrap.form.FieldLabel.get(this.groupId+'-group'); }if(B){B.markValid();}if(this.inputType=='radio'){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){var fg=e.findParent('.form-group',false,true);if(Roo.bootstrap.version==3){fg.removeClass([A.invalidClass,A.validClass]); fg.addClass(A.validClass);}else{fg.removeClass(['is-valid','is-invalid']);fg.addClass('is-valid');}});return;}if(!this.groupId){var fg=this.el.findParent('.form-group',false,true);if(Roo.bootstrap.version==3){fg.removeClass([this.invalidClass,this.validClass]); -fg.addClass(this.validClass);}else{fg.removeClass(['is-valid','is-invalid']);fg.addClass('is-valid');}return;}var C=Roo.bootstrap.CheckBox.get(this.groupId);if(!C){return;}for(var i in C){var fg=C[i].el.findParent('.form-group',false,true);if(Roo.bootstrap.version==3){fg.removeClass([this.invalidClass,this.validClass]); -fg.addClass(this.validClass);}else{fg.removeClass(['is-valid','is-invalid']);fg.addClass('is-valid');}}},markInvalid:function(A){if(this.allowBlank){return;}var B=this;this.fireEvent('invalid',this,A);var C=Roo.bootstrap.FieldLabel.get(this.name+'-group'); -if(this.groupId){C=Roo.bootstrap.FieldLabel.get(this.groupId+'-group');}if(C){C.markInvalid();}if(this.inputType=='radio'){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){var fg=e.findParent('.form-group',false,true); +fg.addClass(this.validClass);}else{fg.removeClass(['is-valid','is-invalid']);fg.addClass('is-valid');}return;}var C=Roo.bootstrap.form.CheckBox.get(this.groupId);if(!C){return;}for(var i in C){var fg=C[i].el.findParent('.form-group',false,true);if(Roo.bootstrap.version==3){fg.removeClass([this.invalidClass,this.validClass]); +fg.addClass(this.validClass);}else{fg.removeClass(['is-valid','is-invalid']);fg.addClass('is-valid');}}},markInvalid:function(A){if(this.allowBlank){return;}var B=this;this.fireEvent('invalid',this,A);var C=Roo.bootstrap.form.FieldLabel.get(this.name+'-group'); +if(this.groupId){C=Roo.bootstrap.form.FieldLabel.get(this.groupId+'-group');}if(C){C.markInvalid();}if(this.inputType=='radio'){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){var fg=e.findParent('.form-group',false,true); if(Roo.bootstrap.version==3){fg.removeClass([B.invalidClass,B.validClass]);fg.addClass(B.invalidClass);}else{fg.removeClass(['is-invalid','is-valid']);fg.addClass('is-invalid');}});return;}if(!this.groupId){var fg=this.el.findParent('.form-group',false,true); -if(Roo.bootstrap.version==3){fg.removeClass([B.invalidClass,B.validClass]);fg.addClass(B.invalidClass);}else{fg.removeClass(['is-invalid','is-valid']);fg.addClass('is-invalid');}return;}var D=Roo.bootstrap.CheckBox.get(this.groupId);if(!D){return;}for(var i in D){var fg=D[i].el.findParent('.form-group',false,true); -if(Roo.bootstrap.version==3){fg.removeClass([B.invalidClass,B.validClass]);fg.addClass(B.invalidClass);}else{fg.removeClass(['is-invalid','is-valid']);fg.addClass('is-invalid');}}},clearInvalid:function(){Roo.bootstrap.Input.prototype.clearInvalid.call(this); -var A=Roo.bootstrap.FieldLabel.get(this.name+'-group');if(A&&A.iconEl){A.iconEl.removeClass([A.validClass,A.invalidClass]);A.iconEl.removeClass(['is-invalid','is-valid']);}},disable:function(){if(this.inputType!='radio'){Roo.bootstrap.CheckBox.superclass.disable.call(this); +if(Roo.bootstrap.version==3){fg.removeClass([B.invalidClass,B.validClass]);fg.addClass(B.invalidClass);}else{fg.removeClass(['is-invalid','is-valid']);fg.addClass('is-invalid');}return;}var D=Roo.bootstrap.form.CheckBox.get(this.groupId);if(!D){return;}for(var i in D){var fg=D[i].el.findParent('.form-group',false,true); +if(Roo.bootstrap.version==3){fg.removeClass([B.invalidClass,B.validClass]);fg.addClass(B.invalidClass);}else{fg.removeClass(['is-invalid','is-valid']);fg.addClass('is-invalid');}}},clearInvalid:function(){Roo.bootstrap.form.Input.prototype.clearInvalid.call(this); +var A=Roo.bootstrap.form.FieldLabel.get(this.name+'-group');if(A&&A.iconEl){A.iconEl.removeClass([A.validClass,A.invalidClass]);A.iconEl.removeClass(['is-invalid','is-valid']);}},disable:function(){if(this.inputType!='radio'){Roo.bootstrap.form.CheckBox.superclass.disable.call(this); return;}var A=this;if(this.rendered){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){A.getActionEl().addClass(this.disabledClass);e.dom.disabled=true;});}this.disabled=true;this.fireEvent("disable",this);return this; -},enable:function(){if(this.inputType!='radio'){Roo.bootstrap.CheckBox.superclass.enable.call(this);return;}var A=this;if(this.rendered){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){A.getActionEl().removeClass(this.disabledClass); -e.dom.disabled=false;});}this.disabled=false;this.fireEvent("enable",this);return this;},setBoxLabel:function(v){this.boxLabel=v;if(this.rendered){this.el.select('label.box-label',true).first().dom.innerHTML=(v===null||v===undefined?'':v);}}});Roo.apply(Roo.bootstrap.CheckBox,{groups:{} +},enable:function(){if(this.inputType!='radio'){Roo.bootstrap.form.CheckBox.superclass.enable.call(this);return;}var A=this;if(this.rendered){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){A.getActionEl().removeClass(this.disabledClass); +e.dom.disabled=false;});}this.disabled=false;this.fireEvent("enable",this);return this;},setBoxLabel:function(v){this.boxLabel=v;if(this.rendered){this.el.select('label.box-label',true).first().dom.innerHTML=(v===null||v===undefined?'':v);}}});Roo.apply(Roo.bootstrap.form.CheckBox,{groups:{} ,register:function(A){if(typeof(this.groups[A.groupId])=='undefined'){this.groups[A.groupId]={};}if(this.groups[A.groupId].hasOwnProperty(A.name)){return;}this.groups[A.groupId][A.name]=A;},get:function(A){if(typeof(this.groups[A])=='undefined'){return false; }return this.groups[A];}}); -// Roo/bootstrap/Radio.js -Roo.bootstrap.Radio=function(A){Roo.bootstrap.Radio.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Radio,Roo.bootstrap.Component,{boxLabel:'',value:'',getAutoCreate:function(){var A={tag:'div',cls:'form-group radio',cn:[{tag:'label',cls:'box-label',html:this.boxLabel} +// Roo/bootstrap/form/Radio.js +Roo.bootstrap.form.Radio=function(A){Roo.bootstrap.form.Radio.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.form.Radio,Roo.bootstrap.Component,{boxLabel:'',value:'',getAutoCreate:function(){var A={tag:'div',cls:'form-group radio',cn:[{tag:'label',cls:'box-label',html:this.boxLabel} ]};return A;},initEvents:function(){this.parent().register(this);this.el.on('click',this.onClick,this);},onClick:function(e){if(this.parent().fireEvent('click',this.parent(),this,e)!==false){this.setChecked(true);}},setChecked:function(A,B){this.parent().setValue(this.value,B); },setBoxLabel:function(v){this.boxLabel=v;if(this.rendered){this.el.select('label.box-label',true).first().dom.innerHTML=(v===null||v===undefined?'':v);}}}); -// Roo/bootstrap/SecurePass.js -Roo.bootstrap.SecurePass=function(A){this.errors={PwdEmpty:"Please type a password, and then retype it to confirm.",PwdShort:"Your password must be at least 6 characters long. Please type a different password.",PwdLong:"Your password can't contain more than 16 characters. Please type a different password.",PwdBadChar:"The password contains characters that aren't allowed. Please type a different password.",IDInPwd:"Your password can't include the part of your ID. Please type a different password.",FNInPwd:"Your password can't contain your first name. Please type a different password.",LNInPwd:"Your password can't contain your last name. Please type a different password.",TooWeak:"Your password is Too Weak."} +// Roo/bootstrap/form/SecurePass.js +Roo.bootstrap.form.SecurePass=function(A){this.errors={PwdEmpty:"Please type a password, and then retype it to confirm.",PwdShort:"Your password must be at least 6 characters long. Please type a different password.",PwdLong:"Your password can't contain more than 16 characters. Please type a different password.",PwdBadChar:"The password contains characters that aren't allowed. Please type a different password.",IDInPwd:"Your password can't include the part of your ID. Please type a different password.",FNInPwd:"Your password can't contain your first name. Please type a different password.",LNInPwd:"Your password can't contain your last name. Please type a different password.",TooWeak:"Your password is Too Weak."} ,this.meterLabel="Password strength:";this.pwdStrengths=["Too Weak","Weak","Medium","Strong"];this.meterClass=["roo-password-meter-tooweak","roo-password-meter-weak","roo-password-meter-medium","roo-password-meter-strong","roo-password-meter-grey"];this.errors={} -;Roo.bootstrap.SecurePass.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.SecurePass,Roo.bootstrap.Input,{meterWidth:300,errorMsg:'',errors:false,imageRoot:'/',meterLabel:'',pwdStrengths:false,strength:0,_lastPwd:null,kCapitalLetter:0,kSmallLetter:1,kDigit:2,kPunctuation:3,insecure:false,initEvents:function(){Roo.bootstrap.SecurePass.superclass.initEvents.call(this); -if(this.el.is('input[type=password]')&&Roo.isSafari){this.el.on('keydown',this.SafariOnKeyDown,this);}this.el.on('keyup',this.checkStrength,this,{buffer:50});},onRender:function(ct,A){Roo.bootstrap.SecurePass.superclass.onRender.call(this,ct,A);this.wrap=this.el.wrap({cls:'x-form-field-wrap'} +;Roo.bootstrap.form.SecurePass.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.form.SecurePass,Roo.bootstrap.form.Input,{meterWidth:300,errorMsg:'',errors:false,imageRoot:'/',meterLabel:'',pwdStrengths:false,strength:0,_lastPwd:null,kCapitalLetter:0,kSmallLetter:1,kDigit:2,kPunctuation:3,insecure:false,initEvents:function(){Roo.bootstrap.form.SecurePass.superclass.initEvents.call(this); +if(this.el.is('input[type=password]')&&Roo.isSafari){this.el.on('keydown',this.SafariOnKeyDown,this);}this.el.on('keyup',this.checkStrength,this,{buffer:50});},onRender:function(ct,A){Roo.bootstrap.form.SecurePass.superclass.onRender.call(this,ct,A);this.wrap=this.el.wrap({cls:'x-form-field-wrap'} );this.trigger=this.wrap.createChild({tag:'div',cls:'StrengthMeter '+this.triggerClass});this.trigger.createChild({cn:[{tag:'div',cls:'roo-password-meter-grey col-xs-12',style:{}},{cls:'roo-password-meter-text'}]});if(this.hideTrigger){this.trigger.setDisplayed(false); -}this.setSize(this.width||'',this.height||'');},onDestroy:function(){if(this.trigger){this.trigger.removeAllListeners();this.trigger.remove();}if(this.wrap){this.wrap.remove();}Roo.bootstrap.TriggerField.superclass.onDestroy.call(this);},checkStrength:function(){var A=this.inputEl().getValue(); +}this.setSize(this.width||'',this.height||'');},onDestroy:function(){if(this.trigger){this.trigger.removeAllListeners();this.trigger.remove();}if(this.wrap){this.wrap.remove();}Roo.bootstrap.form.TriggerField.superclass.onDestroy.call(this);},checkStrength:function(){var A=this.inputEl().getValue(); if(A==this._lastPwd){return;}var B;if(this.ClientSideStrongPassword(A)){B=3;}else if(this.ClientSideMediumPassword(A)){B=2;}else if(this.ClientSideWeakPassword(A)){B=1;}else{B=0;}Roo.log('strength1: '+B);var pm=this.trigger.child('div/div');pm.removeClass(this.meterClass); -pm.addClass(this.meterClass[B]);var pt=this.trigger.child('/div').child('>*[class=roo-password-meter-text]').dom;pt.innerHTML=this.meterLabel+' '+this.pwdStrengths[B];this._lastPwd=A;},reset:function(){Roo.bootstrap.SecurePass.superclass.reset.call(this); +pm.addClass(this.meterClass[B]);var pt=this.trigger.child('/div').child('>*[class=roo-password-meter-text]').dom;pt.innerHTML=this.meterLabel+' '+this.pwdStrengths[B];this._lastPwd=A;},reset:function(){Roo.bootstrap.form.SecurePass.superclass.reset.call(this); this._lastPwd='';var pm=this.trigger.child('div/div');pm.removeClass(this.meterClass);pm.addClass('roo-password-meter-grey');var pt=this.trigger.child('/div').child('>*[class=roo-password-meter-text]').dom;pt.innerHTML='';this.inputEl().dom.type='password'; -},validateValue:function(A){if(!Roo.bootstrap.SecurePass.superclass.validateValue.call(this,A)){return false;}if(A.length==0){if(this.allowBlank){this.clearInvalid();return true;}this.markInvalid(this.errors.PwdEmpty);this.errorMsg=this.errors.PwdEmpty;return false; -}if(this.insecure){return true;}if(!A.match(/[\x21-\x7e]+/)){this.markInvalid(this.errors.PwdBadChar);this.errorMsg=this.errors.PwdBadChar;return false;}if(A.length<6){this.markInvalid(this.errors.PwdShort);this.errorMsg=this.errors.PwdShort;return false; -}if(A.length>16){this.markInvalid(this.errors.PwdLong);this.errorMsg=this.errors.PwdLong;return false;}var B;if(this.ClientSideStrongPassword(A)){B=3;}else if(this.ClientSideMediumPassword(A)){B=2;}else if(this.ClientSideWeakPassword(A)){B=1;}else{B=0;}if(B<2){this.errorMsg=this.errors.TooWeak; -}console.log('strength2: '+B);var pm=this.trigger.child('div/div');pm.removeClass(this.meterClass);pm.addClass(this.meterClass[B]);var pt=this.trigger.child('/div').child('>*[class=roo-password-meter-text]').dom;pt.innerHTML=this.meterLabel+' '+this.pwdStrengths[B]; -this.errorMsg='';return true;},CharacterSetChecks:function(A){this.type=A;this.fResult=false;},isctype:function(A,B){switch(B){case this.kCapitalLetter:if(A>='A'&&A<='Z'){return true;}break;case this.kSmallLetter:if(A>='a'&&A<='z'){return true;}break;case this.kDigit:if(A>='0'&&A<='9'){return true; -}break;case this.kPunctuation:if('!@#$%^&*()_+-=\'";:[{]}|.>,=0){return true;}break;default:return false;}},IsLongEnough:function(A,B){return !(A==null||isNaN(B)||A.length16){this.markInvalid(this.errors.PwdLong);this.errorMsg=this.errors.PwdLong;return false;}var B;if(this.ClientSideStrongPassword(A)){B=3;}else if(this.ClientSideMediumPassword(A)){B=2;}else if(this.ClientSideWeakPassword(A)){B=1; +}else{B=0;}if(B<2){this.errorMsg=this.errors.TooWeak;}console.log('strength2: '+B);var pm=this.trigger.child('div/div');pm.removeClass(this.meterClass);pm.addClass(this.meterClass[B]);var pt=this.trigger.child('/div').child('>*[class=roo-password-meter-text]').dom; +pt.innerHTML=this.meterLabel+' '+this.pwdStrengths[B];this.errorMsg='';return true;},CharacterSetChecks:function(A){this.type=A;this.fResult=false;},isctype:function(A,B){switch(B){case this.kCapitalLetter:if(A>='A'&&A<='Z'){return true;}break;case this.kSmallLetter:if(A>='a'&&A<='z'){return true; +}break;case this.kDigit:if(A>='0'&&A<='9'){return true;}break;case this.kPunctuation:if('!@#$%^&*()_+-=\'";:[{]}|.>,=0){return true;}break;default:return false;}},IsLongEnough:function(A,B){return !(A==null||isNaN(B)||A.length-1&&typeof(this.tag)=='object'&&this.tag.indexOf(":")>-1:case e.tagName.indexOf(":")>-1&&typeof(this.tag)=='string'&&this.tag==":":case typeof(this.tag)=='object'&&this.tag.indexOf(e.tagName)>-1:case typeof(this.tag)=='string'&&this.tag==e.tagName:if(this.replaceTag&&false===this.replaceTag(e)){return; +}if(e.hasChildNodes()){this.walk(e);}return;default:if(e.hasChildNodes()){this.walk(e);}}},this);}}; +// Roo/htmleditor/FilterAttributes.js +Roo.htmleditor.FilterAttributes=function(A){Roo.apply(this,A);this.attrib_black=this.attrib_black||[];this.attrib_white=this.attrib_white||[];this.attrib_clean=this.attrib_clean||[];this.style_white=this.style_white||[];this.style_black=this.style_black||[]; +this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterAttributes,Roo.htmleditor.Filter,{tag:true,attrib_black:false,attrib_clean:false,attrib_white:false,style_white:false,style_black:false,replaceTag:function(A){if(!A.attributes||!A.attributes.length){return true; +}for(var i=A.attributes.length-1;i>-1;i--){var a=A.attributes[i];if(this.attrib_white.length&&this.attrib_white.indexOf(a.name.toLowerCase())<0){A.removeAttribute(a.name);continue;}if(a.name.toLowerCase().substr(0,2)=='on'){A.removeAttribute(a.name);continue; +}if(this.attrib_black.indexOf(a.name.toLowerCase())>-1){A.removeAttribute(a.name);continue;}if(this.attrib_clean.indexOf(a.name.toLowerCase())>-1){this.cleanAttr(A,a.name,a.value);continue;}if(a.name=='style'){this.cleanStyle(A,a.name,a.value);continue;}if(a.name=='class'){if(a.value.match(/^Mso/)){A.removeAttribute('class'); +}if(a.value.match(/^body$/)){A.removeAttribute('class');}continue;}}return true;},cleanAttr:function(A,n,v){if(v.match(/^\./)||v.match(/^\//)){return;}if(v.match(/^(http|https):\/\//)||v.match(/^mailto:/)||v.match(/^ftp:/)||v.match(/^data:/)){return;}if(v.match(/^#/)){return; +}if(v.match(/^\{/)){return;}A.removeAttribute(n);},cleanStyle:function(A,n,v){if(v.match(/expression/)){A.removeAttribute(n);return;}var B=v.split(/;/);var C=[];Roo.each(B,function(p){p=p.replace(/^\s+/g,'').replace(/\s+$/g,'');if(!p.length){return true;} +var l=p.split(':').shift().replace(/\s+/g,'');l=l.replace(/^\s+/g,'').replace(/\s+$/g,'');if(this.style_black.length&&(this.style_black.indexOf(l)>-1||this.style_black.indexOf(l.toLowerCase())>-1)){return true;}if(this.style_white.length&&style_white.indexOf(l)<0&&style_white.indexOf(l.toLowerCase())<0){return true; +}C.push(p);return true;},this);if(C.length){A.setAttribute(n,C.join(';'));}else{A.removeAttribute(n);}}}); +// Roo/htmleditor/FilterBlack.js +Roo.htmleditor.FilterBlack=function(A){Roo.apply(this,A);this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterBlack,Roo.htmleditor.Filter,{tag:true,replaceTag:function(n){n.parentNode.removeChild(n);}}); +// Roo/htmleditor/FilterComment.js +Roo.htmleditor.FilterComment=function(A){this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterComment,Roo.htmleditor.Filter,{replaceComment:function(n){n.parentNode.removeChild(n);}}); +// Roo/htmleditor/FilterKeepChildren.js +Roo.htmleditor.FilterKeepChildren=function(A){Roo.apply(this,A);if(this.tag===false){return;}this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterKeepChildren,Roo.htmleditor.FilterBlack,{replaceTag:function(A){var ar=Array.from(A.childNodes);for(var i=0;i-1)||(typeof(this.tag)=='string'&&this.tag==ar[i].tagName)){this.replaceTag(ar[i]);continue;}}}ar=Array.from(A.childNodes);for(var i=0;i0){return true;}Roo.htmleditor.FilterKeepChildren.prototype.replaceTag.call(this,A); +return false;}}); +// Roo/htmleditor/FilterTableWidth.js +Roo.htmleditor.FilterTableWidth=function(A){this.tag=['TABLE','TD','TR','TH','THEAD','TBODY'];this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterTableWidth,Roo.htmleditor.Filter,{replaceTag:function(A){if(A.hasAttribute('width')){A.removeAttribute('width'); +}if(A.hasAttribute("style")){var B=A.getAttribute("style").split(";");var C=[];Roo.each(B,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");if(kv[0].match(/^\s*(width|min-width)\s*$/)){return;}C.push(s);});A.setAttribute("style",C.length?C.join(';'):''); +if(!C.length){A.removeAttribute('style');}}return true;}}); +// Roo/htmleditor/FilterWord.js +Roo.htmleditor.FilterWord=function(A){this.replaceDocBullets(A.node);};Roo.extend(Roo.htmleditor.FilterWord,Roo.htmleditor.Filter,{tag:true,replaceTag:function(A){if(A.nodeName=='SPAN'&&!A.hasAttributes()&&A.childNodes.length==1&&A.firstChild.nodeName=="#text"){var B=A.firstChild; +A.removeChild(B);if(A.getAttribute('lang')!='zh-CN'){A.parentNode.insertBefore(A.ownerDocument.createTextNode(" "),A);}A.parentNode.insertBefore(B,A);if(A.getAttribute('lang')!='zh-CN'){A.parentNode.insertBefore(A.ownerDocument.createTextNode(" "),A);}A.parentNode.removeChild(A); +return false;}if(A.tagName.toLowerCase().match(/^(style|script|applet|embed|noframes|noscript)$/)){A.parentNode.removeChild(A);return false;}if(A.tagName.toLowerCase().match(/^(meta|link|\\?xml:|st1:|o:|v:|font)/)){while(A.childNodes.length){var cn=A.childNodes[0]; +A.removeChild(cn);A.parentNode.insertBefore(cn,A);if(cn.nodeType==1){this.replaceTag(cn);}}A.parentNode.removeChild(A);return false;}if(A.className.length){var cn=A.className.split(/\W+/);var C=[];Roo.each(cn,function(F){if(F.match(/Mso[a-zA-Z]+/)){return; +}C.push(F);});A.className=C.length?C.join(' '):'';if(!C.length){A.removeAttribute("class");}}if(A.hasAttribute("lang")){A.removeAttribute("lang");}if(A.hasAttribute("style")){var D=A.getAttribute("style").split(";");var E=[];Roo.each(D,function(s){if(!s.match(/:/)){return; +}var kv=s.split(":");if(kv[0].match(/^(mso-|line|font|background|margin|padding|color)/)){return;}E.push(s);});A.setAttribute("style",E.length?E.join(';'):'');if(!E.length){A.removeAttribute('style');}}return true;},styleToObject:function(A){var B=(A.getAttribute("style")||'').split(";"); +var C={};Roo.each(B,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");C[kv[0].trim()]=kv[1];});return C;},replaceDocBullets:function(A){var B=A.getElementsByClassName('MsoListParagraphCxSpFirst');for(var i=0;iF){var M=B.createElement('ul');if(!H){H=B.createElement('li');G[F].appendChild(H);}H.appendChild(M); +G[L]=M;}F=L;var N=G[L].appendChild(B.createElement('li'));H=N;N.innerHTML=n.innerHTML;A.removeChild(n);},this);}}); +// Roo/htmleditor/FilterStyleToTag.js +Roo.htmleditor.FilterStyleToTag=function(A){this.tags={B:['fontWeight','bold'],I:['fontStyle','italic'],SUP:['verticalAlign','super'],SUB:['verticalAlign','sub']};Roo.apply(this,A);this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterStyleToTag,Roo.htmleditor.Filter,{tag:true,tags:false,replaceTag:function(A){if(A.getAttribute("style")===null){return true; +}var B=[];for(var k in this.tags){if(A.style[this.tags[k][0]]==this.tags[k][1]){B.push(k);A.style.removeProperty(this.tags[k][0]);}}if(!B.length){return true;}var cn=Array.from(A.childNodes);var nn=A;Roo.each(B,function(t){var nc=A.ownerDocument.createElement(t); +nn.appendChild(nc);nn=nc;});for(var i=0;i-1){A.parentNode.removeChild(A); +return false;}if(!ps||ps.nodeType!=1){return false;}if(!ps||ps.tagName!='BR'){return false;}if(!A.previousSibling){return false;}var ps=A.previousSibling;while(ps&&ps.nodeType==3&&ps.nodeValue.trim().length<1){ps=ps.previousSibling;}if(!ps||ps.nodeType!=1){return false; +}if(!ps||['BR','H1','H2','H3','H4','H5','H6'].indexOf(ps.tagName)<0){return false;}A.parentNode.removeChild(A);return false;}}); +// Roo/htmleditor/FilterBlock.js +Roo.htmleditor.FilterBlock=function(A){Roo.apply(this,A);var qa=A.node.querySelectorAll;this.removeAttributes('data-block');this.removeAttributes('contenteditable');this.removeAttributes('id');};Roo.apply(Roo.htmleditor.FilterBlock.prototype,{node:true,removeAttributes:function(A){var ar=this.node.querySelectorAll('*['+A+']'); +for(var i=0;i'+B().video_url+''); +}},xns:C.Toolbar},{xtype:'TextItem',text:"Width: ",xns:C.Toolbar},{xtype:'ComboBox',allowBlank:false,displayField:'val',editable:true,listWidth:100,triggerAction:'all',typeAhead:true,valueField:'val',width:70,name:'width',listeners:{select:function(F,r,G){A.editorcore.selectNode(A.tb.selectedNode); +var b=B();b.width=r.get('val');b.updateElement();D();A.editorcore.onEditorEvent();}},xns:C.form,store:{xtype:'SimpleStore',data:[['100%'],['80%'],['50%'],['20%'],['10%']],fields:['val'],xns:Roo.data}},{xtype:'TextItem',text:"Align: ",xns:C.Toolbar},{xtype:'ComboBox',allowBlank:false,displayField:'val',editable:true,listWidth:100,triggerAction:'all',typeAhead:true,valueField:'val',width:70,name:'align',listeners:{select:function(F,r,G){A.editorcore.selectNode(A.tb.selectedNode); +var b=B();b.align=r.get('val');b.updateElement();D();A.editorcore.onEditorEvent();}},xns:C.form,store:{xtype:'SimpleStore',data:[['left'],['right'],['center']],fields:['val'],xns:Roo.data}},{xtype:'Button',text:'Hide Caption',name:'caption_display',pressed:false,enableToggle:true,setValue:function(v){this.setText(v?"Hide Caption":"Show Caption"); +this.setPressed(v!='block');},listeners:{toggle:function(F,G){var b=B();b.caption_display=b.caption_display=='block'?'none':'block';this.setText(b.caption_display=='block'?"Hide Caption":"Show Caption");b.updateElement();D();A.editorcore.selectNode(A.tb.selectedNode); +A.editorcore.onEditorEvent();}},xns:C.Toolbar}];},toObject:function(){var d=document.createElement('div');d.innerHTML=this.caption;var m=this.width!='100%'&&this.align=='center'?'0 auto':0;var iw=this.align=='center'?this.width:'100%';var A={tag:'img',contenteditable:'false',src:this.image_src,alt:d.innerText.replace(/\n/g," ").replace(/\s+/g,' ').trim(),style:{width:iw,maxWidth:iw+' !important',margin:m} +};if(this.href.length>0){A={tag:'a',href:this.href,contenteditable:'true',cn:[A]};}if(this.video_url.length>0){A={tag:'div',cls:this.cls,frameborder:0,allowfullscreen:true,width:420,height:315,src:this.video_url,cn:[A]};}var B=this.caption_display=='none'?'':(this.caption.length?this.caption:"Caption"); +var C={tag:'figure','data-block':'Figure','data-width':this.width,contenteditable:'false',style:{display:'block',float:this.align,maxWidth:this.align=='center'?'100% !important':(this.width+' !important'),width:this.align=='center'?'100%':this.width,margin:'0px',padding:this.align=='center'?'0':'0 10px',textAlign:this.align} +,align:this.align,cn:[A,{tag:'figcaption','data-display':this.caption_display,style:{textAlign:'left',fontSize:'16px',lineHeight:'24px',display:this.caption_display,maxWidth:(this.align=='center'?this.width:'100%')+' !important',margin:m,width:this.align=='center'?this.width:'100%'} +,cls:this.cls.length>0?(this.cls+'-thumbnail'):'',cn:[{tag:'div',style:{marginTop:'16px',textAlign:'left'},align:'left',cn:[{tag:'i',contenteditable:true,html:B}]}]}]};return C;},readElement:function(A){this.video_url=this.getVal(A,'div','src');this.cls=this.getVal(A,'div','class'); +this.href=this.getVal(A,'a','href');this.image_src=this.getVal(A,'img','src');this.align=this.getVal(A,'figure','align');var B=this.getVal(A,'figcaption',false);if(B!==''){this.caption=this.getVal(B,'i','html');}this.caption_display=this.getVal(A,'figcaption','data-display'); +this.width=this.getVal(A,true,'data-width');},removeNode:function(){return this.node;}}) +// Roo/htmleditor/BlockTable.js +Roo.htmleditor.BlockTable=function(A){if(A.node){this.readElement(A.node);this.updateElement(A.node);}Roo.apply(this,A);if(!A.node){this.rows=[];for(var r=0;r1){td.colspan=D.colspan;nc+=D.colspan;}else{nc++;}if(D.rowspan>1){td.rowspan=D.rowspan;}tr.cn.push(td);},this);B=Math.max(nc,B);},this);B++;return A;},readElement:function(A){A=A?A:this.node;this.width=this.getVal(A,true,'style','width')||'100%'; +this.rows=[];this.no_row=0;var B=Array.from(A.rows);B.forEach(function(tr){var C=[];this.rows.push(C);this.no_row++;var D=0;Array.from(tr.cells).forEach(function(td){var E={colspan:td.hasAttribute('colspan')?td.getAttribute('colspan')*1:1,rowspan:td.hasAttribute('rowspan')?td.getAttribute('rowspan')*1:1,style:td.hasAttribute('style')?td.getAttribute('style'):'',html:td.innerHTML} +;D+=E.colspan;C.push(E);},this);this.no_col=Math.max(this.no_col,D);},this);},normalizeRows:function(){var A=[];var B=-1;this.rows.forEach(function(C){B++;A[B]=[];C=this.normalizeRow(C);var D=0;C.forEach(function(c){while(typeof(A[B][D])!='undefined'){D++; +}if(typeof(A[B])=='undefined'){A[B]=[];}A[B][D]=c;c.row=B;c.col=D;if(c.rowspan<2){return;}for(var i=1;i1){D.colspan--;}else{B.remove(D); +}},this);this.no_col--;},removeColumn:function(){this.deleteColumn({type:'col',col:this.no_col-1});this.updateElement();},addColumn:function(){this.rows.forEach(function(A){A.push(this.emptyCell());},this);this.updateElement();},deleteRow:function(A){if(!A||A.type!='row'){return; +}if(this.no_row<2){return;}var B=this.normalizeRows();B[A.row].forEach(function(D){if(D.rowspan>1){D.rowspan--;}else{D.remove=1;}},this);var C=[];this.rows.forEach(function(D){newrow=[];D.forEach(function(c){if(typeof(c.remove)=='undefined'){newrow.push(c); +}});if(newrow.length>0){C.push(D);}});this.rows=C;this.no_row--;this.updateElement();},removeRow:function(){this.deleteRow({type:'row',row:this.no_row-1});},addRow:function(){var A=[];for(var i=0;i1){A.colspan=this.colspan;}if(this.rowspan>1){A.rowspan=this.rowspan;}return A;},readElement:function(A){A=A?A:this.node;this.width=A.style.width;this.colspan=Math.max(1,1*A.getAttribute('colspan')); +this.rowspan=Math.max(1,1*A.getAttribute('rowspan'));this.html=A.innerHTML;},emptyCell:function(){return {colspan:1,rowspan:1,textAlign:'left',html:" "};},removeNode:function(){return this.node.closest('table');},cellData:false,colWidths:false,toTableArray:function(){var A=[]; +var B=this.node.closest('tr').closest('table');Array.from(B.rows).forEach(function(r,ri){A[ri]=[];});var rn=0;this.colWidths=[];var C=true;Array.from(B.rows).forEach(function(r,ri){var cn=0;Array.from(r.cells).forEach(function(ce,ci){var c={cell:ce,row:rn,col:cn,colspan:ce.colSpan,rowspan:ce.rowSpan} +;if(ce.isEqualNode(this.node)){this.cellData=c;}if(typeof(A[rn][cn])!='undefined'){while(typeof(A[rn][cn])!='undefined'){cn++;}c.col=cn;}if(typeof(this.colWidths[cn])=='undefined'&&c.colspan<2){this.colWidths[cn]=ce.style.width;if(this.colWidths[cn]!=''){C=false; +}}if(c.colspan<2&&c.rowspan<2){A[rn][cn]=c;cn++;return;}for(var j=0;j=tr.childNodes.length-1){return;}var A=this.toTableArray();if(typeof(A[this.cellData.row][this.cellData.col+this.cellData.colspan])=='undefined'){return; +}var rc=A[this.cellData.row][this.cellData.col+this.cellData.colspan];if(rc.rowspan!=this.cellData.rowspan||rc.row!=this.cellData.row){return;}this.node.innerHTML+=' '+rc.cell.innerHTML;tr.removeChild(rc.cell);this.colspan+=rc.colspan;this.node.setAttribute('colspan',this.colspan); +var A=this.toTableArray();this.normalizeWidths(A);this.updateWidths(A);},mergeBelow:function(){var A=this.toTableArray();if(typeof(A[this.cellData.row+this.cellData.rowspan])=='undefined'){return;}if(typeof(A[this.cellData.row+this.cellData.rowspan][this.cellData.col])=='undefined'){return; +}var rc=A[this.cellData.row+this.cellData.rowspan][this.cellData.col];if(rc.colspan!=this.cellData.colspan||rc.col!=this.cellData.col){return;}this.node.innerHTML=this.node.innerHTML+rc.cell.innerHTML;rc.cell.parentNode.removeChild(rc.cell);this.rowspan+=rc.rowspan; +this.node.setAttribute('rowspan',this.rowspan);},split:function(){if(this.node.rowSpan<2&&this.node.colSpan<2){return;}var A=this.toTableArray();var cd=this.cellData;this.rowspan=1;this.colspan=1;for(var r=cd.row;r1){var el=Roo.htmleditor.Block.factory(A[r][c].cell); +var B=0;for(var i=0;i0){t+=D;return;}B.push(i);},this);var nc=this.colWidths.length;if(B.length){var C=(nc-B.length)/(1.0*nc); +var t=C*t;var ew=(100-t)/(1.0*B.length);this.colWidths.forEach(function(w,i){if(w>0){this.colWidths[i]=w*C;return;}this.colWidths[i]=ew;},this);}},shrinkColumn:function(){var A=this.toTableArray();this.normalizeWidths(A);var B=this.cellData.col;var nw=this.colWidths[B]*0.8; +if(nw<5){return;}var C=(this.colWidths[B]*0.2)/(this.colWidths.length-1);this.colWidths.forEach(function(w,i){if(i==B){this.colWidths[i]=nw;return;}this.colWidths[i]+=C},this);this.updateWidths(A);},growColumn:function(){var A=this.toTableArray();this.normalizeWidths(A); +var B=this.cellData.col;var nw=this.colWidths[B]*1.2;if(nw>90){return;}var C=(this.colWidths[B]*0.2)/(this.colWidths.length-1);this.colWidths.forEach(function(w,i){if(i==B){this.colWidths[i]=nw;return;}this.colWidths[i]-=C},this);this.updateWidths(A);},deleteRow:function(){var A=this.toTableArray(); +for(var i=0;i1){c.rowspan--;c.cell.setAttribute('rowspan',c.rowspan);}}A.splice(this.cellData.row,1); +this.redrawAllCells(A);},deleteColumn:function(){var A=this.toTableArray();for(var i=0;i1){c.colspan--;c.cell.setAttribute('colspan',c.colspan); +}A[i].splice(this.cellData.col,1);}this.redrawAllCells(A);}}) // Roo/HtmlEditorCore.js -Roo.HtmlEditorCore=function(A){Roo.HtmlEditorCore.superclass.constructor.call(this,A);this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editorevent:true});this.applyBlacklists();};Roo.extend(Roo.HtmlEditorCore,Roo.Component,{owner:false,resizable:false,height:300,width:500,stylesheets:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',clearUp:true,black:false,white:false,bodyCls:'',getDocMarkup:function(){var st=''; +Roo.HtmlEditorCore=function(A){Roo.HtmlEditorCore.superclass.constructor.call(this,A);this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editorevent:true});this.applyBlacklists();};Roo.extend(Roo.HtmlEditorCore,Roo.Component,{owner:false,resizable:false,height:300,width:500,autoClean:true,enableBlocks:true,stylesheets:false,language:'en',allowComments:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',clearUp:true,black:false,white:false,bodyCls:'',undoManager:false,getDocMarkup:function(){var st=''; if(this.stylesheets===false){Roo.get(document.head).select('style').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom);});Roo.get(document.head).select('link').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom); -});}else if(!this.stylesheets.length){st='';}else{for(var i in this.stylesheets){st+='';} -}st+='';var A='roo-htmleditor-body';if(this.bodyCls.length){A+=' '+this.bodyCls;}return ''+st+' '; +});}else if(!this.stylesheets.length){st='';}else{for(var i in this.stylesheets){if(typeof(this.stylesheets[i])!='string'){continue;}st+=''; +}}st+='';st+='';var A='notranslate roo-htmleditor-body';if(this.bodyCls.length){A+=' '+this.bodyCls;}return ''+st+' '; },onRender:function(ct,A){var _t=this;this.el=this.owner.inputEl?this.owner.inputEl():this.owner.el;this.el.dom.style.border='0 none';this.el.dom.setAttribute('tabIndex',-1);this.el.addClass('x-hidden hide');if(Roo.isIE){this.el.applyStyles('margin-top:-1px;margin-bottom:-1px;')} this.frameId=Roo.id();var B=this.owner.wrap.createChild({tag:'iframe',cls:'form-control',id:this.frameId,name:this.frameId,frameBorder:'no','src':Roo.SSL_SECURE_URL?Roo.SSL_SECURE_URL:"javascript:false"},this.el);this.iframe=B.dom;this.assignDocWin();this.doc.designMode='on'; this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var C={run:function(){this.assignDocWin();if(this.doc.body||this.doc.readyState=='complete'){try{this.doc.designMode="on";}catch(e){return;}Roo.TaskMgr.stop(C);this.initEditor.defer(10,this); }},interval:10,duration:10000,scope:this};Roo.TaskMgr.start(C);},onResize:function(w,h){Roo.log('resize: '+w+','+h);if(!this.iframe){return;}if(typeof w=='number'){this.iframe.style.width=w+'px';}if(typeof h=='number'){this.iframe.style.height=h+'px';if(this.doc){(this.doc.body||this.doc.documentElement).style.height=(h-(this.iframePad*2))+'px'; -}}},toggleSourceEdit:function(A){this.sourceEditMode=A===true;if(this.sourceEditMode){Roo.get(this.iframe).addClass(['x-hidden','hide']);}else{Roo.get(this.iframe).removeClass(['x-hidden','hide']);this.deferFocus();}},cleanHtml:function(A){A=String(A);if(A.length>5){if(Roo.isSafari){A=A.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,''); -}}if(A==' '){A='';}return A;},syncValue:function(){if(this.initialized){var bd=(this.doc.body||this.doc.documentElement);var A=bd.innerHTML;if(Roo.isSafari){var bs=bd.getAttribute('style');var m=bs?bs.match(/text-align:(.*?);/i):false;if(m&&m[1]){A='
    '+A+'
    '; -}}A=this.cleanHtml(A);A=A.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\u0080-\uFFFF]/g,function(B){var cc=B.charCodeAt();if(B.length==2){var C=B.charCodeAt(0)-0xD800;var D=B.charCodeAt(1)-0xDC00;cc=(C*0x400)+D+0x10000;}else if((cc>=0x4E00&&cc<0xA000)||(cc>=0x3400&&cc<0x4E00)||(cc>=0xf900&&cc<0xfb00)){return B; -}return "&#"+cc+";";});if(this.owner.fireEvent('beforesync',this,A)!==false){this.el.dom.value=A;this.owner.fireEvent('sync',this,A);}}},pushValue:function(){if(this.initialized){var v=this.el.dom.value.trim();if(this.owner.fireEvent('beforepush',this,v)!==false){var d=(this.doc.body||this.doc.documentElement); -d.innerHTML=v;this.cleanUpPaste();this.el.dom.value=d.innerHTML;this.owner.fireEvent('push',this,v);}}},deferFocus:function(){this.focus.defer(10,this);},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus();}else{this.el.focus();}},assignDocWin:function(){var A=this.iframe; -if(Roo.isIE){this.doc=A.contentWindow.document;this.win=A.contentWindow;}else{if(!Roo.get(this.frameId)&&!A.contentDocument){return;}this.doc=(A.contentDocument||Roo.get(this.frameId).dom.document);this.win=(A.contentWindow||Roo.get(this.frameId).dom.contentWindow); -}},initEditor:function(){this.assignDocWin();this.doc.designMode="on";this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var A=(this.doc.body||this.doc.documentElement);A.bgProperties='fixed';Roo.EventManager.on(this.doc,{'mouseup':this.onEditorEvent,'dblclick':this.onEditorEvent,'click':this.onEditorEvent,'keyup':this.onEditorEvent,buffer:100,scope:this} -);if(Roo.isGecko){Roo.EventManager.on(this.doc,'keypress',this.mozKeyPress,this);}if(Roo.isIE||Roo.isSafari||Roo.isOpera){Roo.EventManager.on(this.doc,'keydown',this.fixKeys,this);}this.initialized=true;this.owner.fireEvent('initialize',this);this.pushValue(); -},onDestroy:function(){if(this.rendered){}},onFirstFocus:function(){this.assignDocWin();this.activated=true;if(Roo.isGecko){this.win.focus();var s=this.win.getSelection();if(!s.focusNode||s.focusNode.nodeType!=3){var r=s.getRangeAt(0);r.selectNodeContents((this.doc.body||this.doc.documentElement)); -r.collapse(true);this.deferFocus();}try{this.execCmd('useCSS',true);this.execCmd('styleWithCSS',false);}catch(e){}}this.owner.fireEvent('activate',this);},adjustFont:function(A){var B=A.cmd=='increasefontsize'?1:-1;var v=parseInt(this.doc.queryCommandValue('FontSize')||3,10); -if(Roo.isSafari){var sm={10:1,13:2,16:3,18:4,24:5,32:6,48:7};v=(v<10)?10:v;v=(v>48)?48:v;v=typeof(sm[v])=='undefined'?1:sm[v];}v=Math.max(1,v+B);this.execCmd('FontSize',v);},onEditorEvent:function(e){this.owner.fireEvent('editorevent',this,e);this.syncValue(); -},insertTag:function(tg){if(tg.toLowerCase()=='span'||tg.toLowerCase()=='code'||tg.toLowerCase()=='sup'||tg.toLowerCase()=='sub'){range=this.createRange(this.getSelection());var A=this.doc.createElement(tg.toLowerCase());A.appendChild(range.extractContents()); -range.insertNode(A);return;}this.execCmd("formatblock",tg);},insertText:function(A){var B=this.createRange();B.deleteContents();B.insertNode(this.doc.createTextNode(A));},relayCmd:function(A,B){this.win.focus();this.execCmd(A,B);this.owner.fireEvent('editorevent',this); +}}},toggleSourceEdit:function(A){this.sourceEditMode=A===true;if(this.sourceEditMode){Roo.get(this.iframe).addClass(['x-hidden','hide','d-none']);}else{Roo.get(this.iframe).removeClass(['x-hidden','hide','d-none']);this.deferFocus();}},cleanHtml:function(A){A=String(A); +if(A.length>5){if(Roo.isSafari){A=A.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,'');}}if(A==' '){A='';}return A;},syncValue:function(){if(this.initialized){if(this.undoManager){this.undoManager.addEvent();}var bd=(this.doc.body||this.doc.documentElement); +var A=this.win.getSelection();var B=document.createElement('div');B.innerHTML=bd.innerHTML;var C=B.getElementsByClassName('gtx-trans-icon');if(C.length>0){var rm=C.item(0).parentNode;rm.parentNode.removeChild(rm);}if(this.enableBlocks){new Roo.htmleditor.FilterBlock({node:B} +);}var D=new Roo.htmleditor.TidySerializer({inner:true});var E=D.serialize(B);if(Roo.isSafari){var bs=bd.getAttribute('style');var m=bs?bs.match(/text-align:(.*?);/i):false;if(m&&m[1]){E='
    '+E+'
    ';}}E=this.cleanHtml(E);E=E.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\u0080-\uFFFF]/g,function(F){var cc=F.charCodeAt(); +if(F.length==2){var G=F.charCodeAt(0)-0xD800;var H=F.charCodeAt(1)-0xDC00;cc=(G*0x400)+H+0x10000;}else if((cc>=0x4E00&&cc<0xA000)||(cc>=0x3400&&cc<0x4E00)||(cc>=0xf900&&cc<0xfb00)){return F;}return "&#"+cc+";";});if(this.owner.fireEvent('beforesync',this,E)!==false){this.el.dom.value=E; +this.owner.fireEvent('sync',this,E);}}},pushValue:function(){if(this.initialized){var v=this.el.dom.value.trim();if(this.owner.fireEvent('beforepush',this,v)!==false){var d=(this.doc.body||this.doc.documentElement);d.innerHTML=v;this.el.dom.value=d.innerHTML; +this.owner.fireEvent('push',this,v);}if(this.autoClean){new Roo.htmleditor.FilterParagraph({node:this.doc.body});new Roo.htmleditor.FilterSpan({node:this.doc.body});}if(this.enableBlocks){Roo.htmleditor.Block.initAll(this.doc.body);}this.updateLanguage(); +var lc=this.doc.body.lastChild;if(lc&&lc.nodeType==1&&lc.getAttribute("contenteditable")=="false"){this.doc.body.appendChild(this.doc.createElement('br'));}}},deferFocus:function(){this.focus.defer(10,this);},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus(); +}else{this.el.focus();}},assignDocWin:function(){var A=this.iframe;if(Roo.isIE){this.doc=A.contentWindow.document;this.win=A.contentWindow;}else{if(!Roo.get(this.frameId)&&!A.contentDocument){return;}this.doc=(A.contentDocument||Roo.get(this.frameId).dom.document); +this.win=(A.contentWindow||Roo.get(this.frameId).dom.contentWindow);}},initEditor:function(){this.assignDocWin();this.doc.designMode="on";this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var A=(this.doc.body||this.doc.documentElement); +A.bgProperties='fixed';A.setAttribute("translate","no");Roo.EventManager.on(this.doc,{'mouseup':this.onEditorEvent,'dblclick':this.onEditorEvent,'click':this.onEditorEvent,'keyup':this.onEditorEvent,buffer:100,scope:this});Roo.EventManager.on(this.doc,{'paste':this.onPasteEvent,scope:this} +);if(Roo.isGecko){Roo.EventManager.on(this.doc,'keypress',this.mozKeyPress,this);}if(Roo.isIE||Roo.isSafari||Roo.isOpera){Roo.EventManager.on(this.doc,'keydown',this.fixKeys,this);}this.initialized=true;new Roo.htmleditor.KeyEnter({core:this});this.owner.fireEvent('initialize',this); +this.pushValue();},onPasteEvent:function(e,v){var cd=(e.browserEvent.clipboardData||window.clipboardData);if(cd.files&&cd.files.length>0){var A=(window.createObjectURL&&window)||(window.URL&&URL.revokeObjectURL&&URL)||(window.webkitURL&&webkitURL);var B=A.createObjectURL(cd.files[0]); +this.insertAtCursor('');return false;}if(cd.types.indexOf('text/html')<0){return false;}var C=[];var D=cd.getData('text/html');if(cd.types.indexOf('text/rtf')>-1){var E=new Roo.rtf.Parser(cd.getData('text/rtf'));C=E.doc?E.doc.getElementsByType('pict'):[]; +}C=C.filter(function(g){return !g.path.match(/^rtf\/(head|pgdsctbl|listtable|footerf)/);}).map(function(g){return g.toDataURL();}).filter(function(g){return g!='about:blank';});D=this.cleanWordChars(D);var d=(new DOMParser().parseFromString(D,'text/html')).body; +var sn=this.getParentElement();if(d.getElementsByTagName('table').length&&sn&&sn.closest('table')){e.preventDefault();this.insertAtCursor("You can not nest tables");return false;}if(C.length>0){Roo.each(d.getElementsByTagName('img'),function(F,i){F.setAttribute('src',C[i]); +});}if(this.autoClean){new Roo.htmleditor.FilterWord({node:d});new Roo.htmleditor.FilterStyleToTag({node:d});new Roo.htmleditor.FilterAttributes({node:d,attrib_white:['href','src','name','align','colspan','rowspan','data-display','data-width'],attrib_clean:['href','src']} +);new Roo.htmleditor.FilterBlack({node:d,tag:this.black});new Roo.htmleditor.FilterKeepChildren({node:d,tag:['FONT',':']});new Roo.htmleditor.FilterParagraph({node:d});new Roo.htmleditor.FilterSpan({node:d});new Roo.htmleditor.FilterLongBr({node:d});new Roo.htmleditor.FilterComment({node:d} +);}if(this.enableBlocks){Array.from(d.getElementsByTagName('img')).forEach(function(F){if(F.closest('figure')){return;}var G=new Roo.htmleditor.BlockFigure({image_src:F.src});G.updateElement(F);});}this.insertAtCursor(d.innerHTML.replace(/ /g,' '));if(this.enableBlocks){Roo.htmleditor.Block.initAll(this.doc.body); +}e.preventDefault();return false;},onDestroy:function(){if(this.rendered){}},onFirstFocus:function(){this.assignDocWin();this.undoManager=new Roo.lib.UndoManager(100,(this.doc.body||this.doc.documentElement));this.activated=true;if(Roo.isGecko){this.win.focus(); +var s=this.win.getSelection();if(!s.focusNode||s.focusNode.nodeType!=3){var r=s.getRangeAt(0);r.selectNodeContents((this.doc.body||this.doc.documentElement));r.collapse(true);this.deferFocus();}try{this.execCmd('useCSS',true);this.execCmd('styleWithCSS',false); +}catch(e){}}this.owner.fireEvent('activate',this);},adjustFont:function(A){var B=A.cmd=='increasefontsize'?1:-1;var v=parseInt(this.doc.queryCommandValue('FontSize')||3,10);if(Roo.isSafari){var sm={10:1,13:2,16:3,18:4,24:5,32:6,48:7};v=(v<10)?10:v;v=(v>48)?48:v; +v=typeof(sm[v])=='undefined'?1:sm[v];}v=Math.max(1,v+B);this.execCmd('FontSize',v);},onEditorEvent:function(e){if(e&&(e.ctrlKey||e.metaKey)&&e.keyCode===90){return;}if(e&&e.target.nodeName=='BODY'&&e.type=="mouseup"&&this.doc.body.lastChild){var lc=this.doc.body.lastChild; +while((lc.nodeType==3&&lc.nodeValue=='')||lc.id=='gtx-trans'){lc=lc.previousSibling;}if(lc.nodeType==1&&lc.nodeName!='BR'){var ns=this.doc.createElement('br');this.doc.body.appendChild(ns);range=this.doc.createRange();range.setStartAfter(ns);range.collapse(true); +var A=this.win.getSelection();A.removeAllRanges();A.addRange(range);}}this.fireEditorEvent(e);this.syncValue();},fireEditorEvent:function(e){this.owner.fireEvent('editorevent',this,e);},insertTag:function(tg){if(tg.toLowerCase()=='span'||tg.toLowerCase()=='code'||tg.toLowerCase()=='sup'||tg.toLowerCase()=='sub'){range=this.createRange(this.getSelection()); +var A=this.doc.createElement(tg.toLowerCase());A.appendChild(range.extractContents());range.insertNode(A);return;}this.execCmd("formatblock",tg);this.undoManager.addEvent();},insertText:function(A){var B=this.createRange();B.deleteContents();B.insertNode(this.doc.createTextNode(A)); +this.undoManager.addEvent();},relayCmd:function(A,B){switch(A){case 'justifyleft':case 'justifyright':case 'justifycenter':var n=this.getParentElement();var td=n.closest('td');if(td){var bl=Roo.htmleditor.Block.factory(td);bl.textAlign=A.replace('justify',''); +bl.updateElement();this.owner.fireEvent('editorevent',this);return;}this.execCmd('styleWithCSS',true);break;case 'bold':case 'italic':this.execCmd('styleWithCSS',false);break;default:break;}this.win.focus();this.execCmd(A,B);this.owner.fireEvent('editorevent',this); this.owner.deferFocus();},execCmd:function(A,B){this.doc.execCommand(A,false,B===undefined?null:B);this.syncValue();},insertAtCursor:function(A){if(!this.activated){return;}if(Roo.isGecko||Roo.isOpera||Roo.isSafari){this.win.focus();var B,C;var D=this.win; -if(D.getSelection&&D.getSelection().getRangeAt){B=D.getSelection().getRangeAt(0);C=typeof(A)=='string'?B.createContextualFragment(A):A;B.insertNode(C);}else if(D.document.selection&&D.document.selection.createRange){var E=typeof(A)=='string'?A:A.outerHTML; -D.document.selection.createRange().pasteHTML(E);}else{var E=typeof(A)=='string'?A:A.outerHTML;this.execCmd('InsertHTML',E);}this.syncValue();this.deferFocus();}},mozKeyPress:function(e){if(e.ctrlKey){var c=e.getCharCode(),A;if(c>0){c=String.fromCharCode(c).toLowerCase(); -switch(c){case 'b':A='bold';break;case 'i':A='italic';break;case 'u':A='underline';break;case 'v':this.cleanUpPaste.defer(100,this);return;}if(A){this.win.focus();this.execCmd(A);this.deferFocus();e.preventDefault();}}}},fixKeys:function(){if(Roo.isIE){return function(e){var k=e.getKey(),r; -if(k==e.TAB){e.stopEvent();r=this.doc.selection.createRange();if(r){r.collapse(true);r.pasteHTML('    ');this.deferFocus();}return;}if(k==e.ENTER){r=this.doc.selection.createRange();if(r){var A=r.parentElement();if(!A||A.tagName.toLowerCase()!='li'){e.stopEvent(); -r.pasteHTML('
    ');r.collapse(false);r.select();}}}if(String.fromCharCode(k).toLowerCase()=='v'){this.cleanUpPaste.defer(100,this);return;}};}else if(Roo.isOpera){return function(e){var k=e.getKey();if(k==e.TAB){e.stopEvent();this.win.focus();this.execCmd('InsertHTML','    '); -this.deferFocus();}if(String.fromCharCode(k).toLowerCase()=='v'){this.cleanUpPaste.defer(100,this);return;}};}else if(Roo.isSafari){return function(e){var k=e.getKey();if(k==e.TAB){e.stopEvent();this.execCmd('InsertText','\t');this.deferFocus();return;}if(String.fromCharCode(k).toLowerCase()=='v'){this.cleanUpPaste.defer(100,this); -return;}};}}(),getAllAncestors:function(){var p=this.getSelectedNode();var a=[];if(!p){a.push(p);p=this.getParentElement();}while(p&&(p.nodeType==1)&&(p.tagName.toLowerCase()!='body')){a.push(p);p=p.parentNode;}a.push(this.doc.body);return a;},lastSel:false,lastSelNode:false,getSelection:function(){this.assignDocWin(); -return Roo.isIE?this.doc.selection:this.win.getSelection();},getSelectedNode:function(){var A=this.createRange(this.getSelection()).cloneRange();if(Roo.isIE){var B=A.parentElement();while(true){var C=A.duplicate();C.moveToElementText(B);if(C.inRange(A)){break; -}if((B.nodeType!=1)||(B.tagName.toLowerCase()=='body')){break;}B=B.parentElement;}return B;}var ac=A.commonAncestorContainer;if(ac.nodeType==3){ac=ac.parentNode;}var ar=ac.childNodes;var D=[];var E=[];var F=false;for(var i=0;i0)){E.push(ar[i]);continue;}if(!this.rangeIntersectsNode(A,ar[i])||(this.rangeCompareNode(A,ar[i])==0)){continue; -}F=true;}if(!D.length&&E.length){D=E;}if(F||!D.length||(D.length>1)){return false;}return D[0];},createRange:function(A){if(typeof A!="undefined"){try{return A.getRangeAt?A.getRangeAt(0):A.createRange();}catch(e){return this.doc.createRange();}}else{return this.doc.createRange(); -}},getParentElement:function(){this.assignDocWin();var A=Roo.isIE?this.doc.selection:this.win.getSelection();var B=this.createRange(A);try{var p=B.commonAncestorContainer;while(p.nodeType==3){p=p.parentNode;}return p;}catch(e){return null;}},rangeIntersectsNode:function(A,B){var C=B.ownerDocument.createRange(); -try{C.selectNode(B);}catch(e){C.selectNodeContents(B);}var D=A.cloneRange();D.collapse(true);var E=A.cloneRange();E.collapse(false);var F=C.cloneRange();F.collapse(true);var G=C.cloneRange();G.collapse(false);return D.compareBoundaryPoints(Range.START_TO_START,G)==-1&&E.compareBoundaryPoints(Range.START_TO_START,F)==1; -},rangeCompareNode:function(A,B){var C=B.ownerDocument.createRange();try{C.selectNode(B);}catch(e){C.selectNodeContents(B);}A.collapse(true);C.collapse(true);var ss=A.compareBoundaryPoints(Range.START_TO_START,C);var ee=A.compareBoundaryPoints(Range.END_TO_END,C); -var D=ss==1;var E=ee==-1;if(D&&E){return 0;}if(!D&&E){return 1;}if(D&&!E){return 2;}return 3;},cleanUpPaste:function(){Roo.log('cleanuppaste');this.cleanUpChildren(this.doc.body);var A=this.cleanWordChars(this.doc.body.innerHTML);if(A!=this.doc.body.innerHTML){this.doc.body.innerHTML=A; -}},cleanWordChars:function(A){var he=Roo.HtmlEditorCore;var B=A;Roo.each(he.swapCodes,function(sw){var C=new RegExp("\\u"+sw[0].toString(16),"g");B=B.replace(C,sw[1]);});return B;},cleanUpChildren:function(n){if(!n.childNodes.length){return;}for(var i=n.childNodes.length-1; -i>-1;i--){this.cleanUpChild(n.childNodes[i]);}},cleanUpChild:function(A){var ed=this;if(A.nodeName=="#text"){return;}if(A.nodeName=="#comment"){A.parentNode.removeChild(A);return;}var B=A.tagName.toLowerCase();if(this.black.indexOf(B)>-1&&this.clearUp){A.parentNode.removeChild(A); -return;}var C=Roo.HtmlEditorCore.remove.indexOf(A.tagName.toLowerCase())>-1;if((!A.attributes||!A.attributes.length)&&B=='span'){C=true;}if(C){this.cleanUpChildren(A);while(A.childNodes.length){var cn=A.childNodes[0];A.removeChild(cn);A.parentNode.insertBefore(cn,A); -}A.parentNode.removeChild(A);return;}if(!A.attributes||!A.attributes.length){this.cleanUpChildren(A);return;}function cleanAttr(n,v){if(v.match(/^\./)||v.match(/^\//)){return;}if(v.match(/^(http|https):\/\//)||v.match(/^mailto:/)||v.match(/^ftp:/)){return; -}if(v.match(/^#/)){return;}if(v.match(/^\{/)){return;}A.removeAttribute(n);}var D=this.cwhite;var E=this.cblack;function cleanStyle(n,v){if(v.match(/expression/)){A.removeAttribute(n);return;}var F=v.split(/;/);var G=[];Roo.each(F,function(p){p=p.replace(/^\s+/g,'').replace(/\s+$/g,''); -if(!p.length){return true;}var l=p.split(':').shift().replace(/\s+/g,'');l=l.replace(/^\s+/g,'').replace(/\s+$/g,'');if(D.length&&E.indexOf(l)>-1){return true;}if(D.length&&D.indexOf(l)<0){return true;}G.push(p);return true;});if(G.length){A.setAttribute(n,G.join(';')); -}else{A.removeAttribute(n);}}for(var i=A.attributes.length-1;i>-1;i--){var a=A.attributes[i];if(a.name.toLowerCase().substr(0,2)=='on'){A.removeAttribute(a.name);continue;}if(Roo.HtmlEditorCore.ablack.indexOf(a.name.toLowerCase())>-1){A.removeAttribute(a.name); -continue;}if(Roo.HtmlEditorCore.aclean.indexOf(a.name.toLowerCase())>-1){cleanAttr(a.name,a.value);continue;}if(a.name=='style'){cleanStyle(a.name,a.value);continue;}if(a.name=='class'){if(a.value.match(/^Mso/)){A.removeAttribute('class');}if(a.value.match(/^body$/)){A.removeAttribute('class'); -}continue;}}this.cleanUpChildren(A);},cleanWord:function(A){if(!A){this.cleanWord(this.doc.body);return;}if(A.nodeName=='SPAN'&&!A.hasAttributes()&&A.childNodes.length==1&&A.firstChild.nodeName=="#text"){var B=A.firstChild;A.removeChild(B);if(A.getAttribute('lang')!='zh-CN'){A.parentNode.insertBefore(A.ownerDocument.createTextNode(" "),A); -}A.parentNode.insertBefore(B,A);if(A.getAttribute('lang')!='zh-CN'){A.parentNode.insertBefore(A.ownerDocument.createTextNode(" "),A);}A.parentNode.removeChild(A);}if(A.nodeName=="#text"){return;}if(A.nodeName=="#comment"){A.parentNode.removeChild(A);return; -}if(A.tagName.toLowerCase().match(/^(style|script|applet|embed|noframes|noscript)$/)){A.parentNode.removeChild(A);return;}if(A.tagName.toLowerCase().match(/^(meta|link|\\?xml:|st1:|o:|v:|font)/)){while(A.childNodes.length){var cn=A.childNodes[0];A.removeChild(cn); -A.parentNode.insertBefore(cn,A);this.cleanWord(cn);}A.parentNode.removeChild(A);return;}if(A.className.length){var cn=A.className.split(/\W+/);var C=[];Roo.each(cn,function(F){if(F.match(/Mso[a-zA-Z]+/)){return;}C.push(F);});A.className=C.length?C.join(' '):''; -if(!C.length){A.removeAttribute("class");}}if(A.hasAttribute("lang")){A.removeAttribute("lang");}if(A.hasAttribute("style")){var D=A.getAttribute("style").split(";");var E=[];Roo.each(D,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");if(kv[0].match(/^(mso-|line|font|background|margin|padding|color)/)){return; -}E.push(s);});A.setAttribute("style",E.length?E.join(';'):'');if(!E.length){A.removeAttribute('style');}}this.iterateChildren(A,this.cleanWord);},iterateChildren:function(A,fn){if(!A.childNodes.length){return;}for(var i=A.childNodes.length-1;i>-1;i--){fn.call(this,A.childNodes[i])} -},cleanTableWidths:function(A){if(!A){this.cleanTableWidths(this.doc.body);return;}if(A.nodeName=="#text"||A.nodeName=="#comment"){return;}Roo.log(A.tagName);if(!A.tagName.toLowerCase().match(/^(table|td|tr)$/)){this.iterateChildren(A,this.cleanTableWidths); -return;}if(A.hasAttribute('width')){A.removeAttribute('width');}if(A.hasAttribute("style")){var B=A.getAttribute("style").split(";");var C=[];Roo.each(B,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");if(kv[0].match(/^\s*(width|min-width)\s*$/)){return; -}C.push(s);});A.setAttribute("style",C.length?C.join(';'):'');if(!C.length){A.removeAttribute('style');}}this.iterateChildren(A,this.cleanTableWidths);},domToHTML:function(A,B,C){B=B||0;C=C||false;if(!A){return this.domToHTML(this.doc.body);}var j;var D=false; -var E=A.nodeName;var F=Roo.util.Format.htmlEncode(A.tagName);if(E=='#text'){return C?A.nodeValue:A.nodeValue.trim();}var G='';if(E!='BODY'){var i=0;if(F){var H=[];for(i=0;i";}else{}}else{F=false;}if(['IMG','BR','HR','INPUT'].indexOf(F)>-1){return G;}if(['PRE','TEXTAREA','TD','A','SPAN'].indexOf(F)>-1){C=true; -}i=0;var J=A.childNodes.item(i);var D=true;var K='';lastnode='';while(J){var L=C;if(lastnode=='SPAN'){L=true;}if(J.nodeName=='#text'){var M=Roo.util.Format.htmlEncode(J.nodeValue);M=C?M:M.trim();if(!L&&M.length>80){K+="\n"+(new Array(B+1)).join(" ");}K+=M; -i++;J=A.childNodes.item(i);lastNode='';continue;}D=false;K+=L?'':"\n"+(new Array(B+1)).join(" ");K+=this.domToHTML(J,B+1,C);lastnode=J.nodeName;i++;J=A.childNodes.item(i);}G+=K;if(!D){G+=C?'':"\n"+(new Array(B)).join(" ");}if(F){G+="";}return G; -},applyBlacklists:function(){var w=typeof(this.owner.white)!='undefined'&&this.owner.white?this.owner.white:[];var b=typeof(this.owner.black)!='undefined'&&this.owner.black?this.owner.black:[];this.white=[];this.black=[];Roo.each(Roo.HtmlEditorCore.white,function(A){if(b.indexOf(A)>-1){return; -}this.white.push(A);},this);Roo.each(w,function(A){if(b.indexOf(A)>-1){return;}if(this.white.indexOf(A)>-1){return;}this.white.push(A);},this);Roo.each(Roo.HtmlEditorCore.black,function(A){if(w.indexOf(A)>-1){return;}this.black.push(A);},this);Roo.each(b,function(A){if(w.indexOf(A)>-1){return; -}if(this.black.indexOf(A)>-1){return;}this.black.push(A);},this);w=typeof(this.owner.cwhite)!='undefined'&&this.owner.cwhite?this.owner.cwhite:[];b=typeof(this.owner.cblack)!='undefined'&&this.owner.cblack?this.owner.cblack:[];this.cwhite=[];this.cblack=[]; -Roo.each(Roo.HtmlEditorCore.cwhite,function(A){if(b.indexOf(A)>-1){return;}this.cwhite.push(A);},this);Roo.each(w,function(A){if(b.indexOf(A)>-1){return;}if(this.cwhite.indexOf(A)>-1){return;}this.cwhite.push(A);},this);Roo.each(Roo.HtmlEditorCore.cblack,function(A){if(w.indexOf(A)>-1){return; +if(D.getSelection&&D.getSelection().getRangeAt){this.createRange(this.getSelection()).deleteContents();B=D.getSelection().getRangeAt(0);C=typeof(A)=='string'?B.createContextualFragment(A):A;B.insertNode(C);B=B.cloneRange();B.collapse(false);D.getSelection().removeAllRanges(); +D.getSelection().addRange(B);}else if(D.document.selection&&D.document.selection.createRange){var E=typeof(A)=='string'?A:A.outerHTML;D.document.selection.createRange().pasteHTML(E);}else{var E=typeof(A)=='string'?A:A.outerHTML;this.execCmd('InsertHTML',E); +}this.syncValue();this.deferFocus();}},mozKeyPress:function(e){if(e.ctrlKey){var c=e.getCharCode(),A;if(c>0){c=String.fromCharCode(c).toLowerCase();switch(c){case 'b':A='bold';break;case 'i':A='italic';break;case 'u':A='underline';break;}if(A){this.relayCmd(A); +e.preventDefault();}}}},fixKeys:function(){if(Roo.isIE){return function(e){var k=e.getKey(),r;if(k==e.TAB){e.stopEvent();r=this.doc.selection.createRange();if(r){r.collapse(true);r.pasteHTML('    ');this.deferFocus();}return;}};}else if(Roo.isOpera){return function(e){var k=e.getKey(); +if(k==e.TAB){e.stopEvent();this.win.focus();this.execCmd('InsertHTML','    ');this.deferFocus();}};}else if(Roo.isSafari){return function(e){var k=e.getKey();if(k==e.TAB){e.stopEvent();this.execCmd('InsertText','\t');this.deferFocus(); +return;}this.mozKeyPress(e);};}}(),getAllAncestors:function(){var p=this.getSelectedNode();var a=[];if(!p){a.push(p);p=this.getParentElement();}while(p&&(p.nodeType==1)&&(p.tagName.toLowerCase()!='body')){a.push(p);p=p.parentNode;}a.push(this.doc.body);return a; +},lastSel:false,lastSelNode:false,getSelection:function(){this.assignDocWin();return Roo.lib.Selection.wrap(Roo.isIE?this.doc.selection:this.win.getSelection(),this.doc);},selectNode:function(A,B){var C=A.ownerDocument.createRange();try{C.selectNode(A);}catch(e){C.selectNodeContents(A); +}if(B===true){C.collapse(true);}var s=this.win.getSelection();s.removeAllRanges();s.addRange(C);},getSelectedNode:function(){var A=this.createRange(this.getSelection()).cloneRange();if(Roo.isIE){var B=A.parentElement();while(true){var C=A.duplicate();C.moveToElementText(B); +if(C.inRange(A)){break;}if((B.nodeType!=1)||(B.tagName.toLowerCase()=='body')){break;}B=B.parentElement;}return B;}var ac=A.commonAncestorContainer;if(ac.nodeType==3){ac=ac.parentNode;}var ar=ac.childNodes;var D=[];var E=[];var F=false;for(var i=0;i0)){E.push(ar[i]); +continue;}if(!this.rangeIntersectsNode(A,ar[i])||(this.rangeCompareNode(A,ar[i])==0)){continue;}F=true;}if(!D.length&&E.length){D=E;}if(F||!D.length||(D.length>1)){return false;}return D[0];},createRange:function(A){if(typeof A!="undefined"){try{return A.getRangeAt?A.getRangeAt(0):A.createRange(); +}catch(e){return this.doc.createRange();}}else{return this.doc.createRange();}},getParentElement:function(){this.assignDocWin();var A=Roo.isIE?this.doc.selection:this.win.getSelection();var B=this.createRange(A);try{var p=B.commonAncestorContainer;while(p.nodeType==3){p=p.parentNode; +}return p;}catch(e){return null;}},rangeIntersectsNode:function(A,B){var C=B.ownerDocument.createRange();try{C.selectNode(B);}catch(e){C.selectNodeContents(B);}var D=A.cloneRange();D.collapse(true);var E=A.cloneRange();E.collapse(false);var F=C.cloneRange(); +F.collapse(true);var G=C.cloneRange();G.collapse(false);return D.compareBoundaryPoints(Range.START_TO_START,G)==-1&&E.compareBoundaryPoints(Range.START_TO_START,F)==1;},rangeCompareNode:function(A,B){var C=B.ownerDocument.createRange();try{C.selectNode(B); +}catch(e){C.selectNodeContents(B);}A.collapse(true);C.collapse(true);var ss=A.compareBoundaryPoints(Range.START_TO_START,C);var ee=A.compareBoundaryPoints(Range.END_TO_END,C);var D=ss==1;var E=ee==-1;if(D&&E){return 0;}if(!D&&E){return 1;}if(D&&!E){return 2; +}return 3;},cleanWordChars:function(A){var B=[[8211,"–"],[8212,"—"],[8216,"'"],[8217,"'"],[8220,'"'],[8221,'"'],[8226,"*"],[8230,"..."]];var C=A;Roo.each(B,function(sw){var D=new RegExp("\\u"+sw[0].toString(16),"g");C=C.replace(D,sw[1]);});return C; +},cleanUpChild:function(A){new Roo.htmleditor.FilterComment({node:A});new Roo.htmleditor.FilterAttributes({node:A,attrib_black:this.ablack,attrib_clean:this.aclean,style_white:this.cwhite,style_black:this.cblack});new Roo.htmleditor.FilterBlack({node:A,tag:this.black} +);new Roo.htmleditor.FilterKeepChildren({node:A,tag:this.tag_remove});},cleanWord:function(A){new Roo.htmleditor.FilterWord({node:A?A:this.doc.body});new Roo.htmleditor.FilterKeepChildren({node:A?A:this.doc.body,tag:['FONT',':']});},cleanTableWidths:function(A){new Roo.htmleditor.FilterTableWidth({node:A?A:this.doc.body} +);},applyBlacklists:function(){var w=typeof(this.owner.white)!='undefined'&&this.owner.white?this.owner.white:[];var b=typeof(this.owner.black)!='undefined'&&this.owner.black?this.owner.black:[];this.aclean=typeof(this.owner.aclean)!='undefined'&&this.owner.aclean?this.owner.aclean:Roo.HtmlEditorCore.aclean; +this.ablack=typeof(this.owner.ablack)!='undefined'&&this.owner.ablack?this.owner.ablack:Roo.HtmlEditorCore.ablack;this.tag_remove=typeof(this.owner.tag_remove)!='undefined'&&this.owner.tag_remove?this.owner.tag_remove:Roo.HtmlEditorCore.tag_remove;this.white=[]; +this.black=[];Roo.each(Roo.HtmlEditorCore.white,function(A){if(b.indexOf(A)>-1){return;}this.white.push(A);},this);Roo.each(w,function(A){if(b.indexOf(A)>-1){return;}if(this.white.indexOf(A)>-1){return;}this.white.push(A);},this);Roo.each(Roo.HtmlEditorCore.black,function(A){if(w.indexOf(A)>-1){return; +}this.black.push(A);},this);Roo.each(b,function(A){if(w.indexOf(A)>-1){return;}if(this.black.indexOf(A)>-1){return;}this.black.push(A);},this);w=typeof(this.owner.cwhite)!='undefined'&&this.owner.cwhite?this.owner.cwhite:[];b=typeof(this.owner.cblack)!='undefined'&&this.owner.cblack?this.owner.cblack:[]; +this.cwhite=[];this.cblack=[];Roo.each(Roo.HtmlEditorCore.cwhite,function(A){if(b.indexOf(A)>-1){return;}this.cwhite.push(A);},this);Roo.each(w,function(A){if(b.indexOf(A)>-1){return;}if(this.cwhite.indexOf(A)>-1){return;}this.cwhite.push(A);},this);Roo.each(Roo.HtmlEditorCore.cblack,function(A){if(w.indexOf(A)>-1){return; }this.cblack.push(A);},this);Roo.each(b,function(A){if(w.indexOf(A)>-1){return;}if(this.cblack.indexOf(A)>-1){return;}this.cblack.push(A);},this);},setStylesheets:function(A){if(typeof(A)=='string'){Roo.get(this.iframe.contentDocument.head).createChild({tag:'link',rel:'stylesheet',type:'text/css',href:A} -);return;}var B=this;Roo.each(A,function(s){if(!s.length){return;}Roo.get(B.iframe.contentDocument.head).createChild({tag:'link',rel:'stylesheet',type:'text/css',href:s});});},removeStylesheets:function(){var A=this;Roo.each(Roo.get(A.iframe.contentDocument.head).select('link[rel=stylesheet]',true).elements,function(s){s.remove(); -});},setStyle:function(A){Roo.get(this.iframe.contentDocument.head).createChild({tag:'style',type:'text/css',html:A});return;}});Roo.HtmlEditorCore.white=['area','br','img','input','hr','wbr','address','blockquote','center','dd','dir','div','dl','dt','h1','h2','h3','h4','h5','h6','hr','isindex','listing','marquee','menu','multicol','ol','p','plaintext','pre','table','ul','xmp','caption','col','colgroup','tbody','td','tfoot','th','thead','tr','dir','menu','ol','ul','dl','embed','object']; -Roo.HtmlEditorCore.black=['applet','base','basefont','bgsound','blink','body','frame','frameset','head','html','ilayer','iframe','layer','link','meta','object','script','style','title','xml'];Roo.HtmlEditorCore.clean=['script','style','title','xml'];Roo.HtmlEditorCore.remove=['font']; -Roo.HtmlEditorCore.ablack=['on'];Roo.HtmlEditorCore.aclean=['action','background','codebase','dynsrc','href','lowsrc'];Roo.HtmlEditorCore.pwhite=['http','https','mailto'];Roo.HtmlEditorCore.cwhite=[];Roo.HtmlEditorCore.cblack=[];Roo.HtmlEditorCore.swapCodes=[[8211,"–"],[8212,"—"],[8216,"'"],[8217,"'"],[8220,'"'],[8221,'"'],[8226,"*"],[8230,"..."]]; +);return;}var B=this;Roo.each(A,function(s){if(!s.length){return;}Roo.get(B.iframe.contentDocument.head).createChild({tag:'link',rel:'stylesheet',type:'text/css',href:s});});},updateLanguage:function(){if(!this.iframe||!this.iframe.contentDocument){return; +}Roo.get(this.iframe.contentDocument.body).attr("lang",this.language);},removeStylesheets:function(){var A=this;Roo.each(Roo.get(A.iframe.contentDocument.head).select('link[rel=stylesheet]',true).elements,function(s){s.remove();});},setStyle:function(A){Roo.get(this.iframe.contentDocument.head).createChild({tag:'style',type:'text/css',html:A} +);return;}});Roo.HtmlEditorCore.white=['AREA','BR','IMG','INPUT','HR','WBR','ADDRESS','BLOCKQUOTE','CENTER','DD','DIR','DIV','DL','DT','H1','H2','H3','H4','H5','H6','HR','ISINDEX','LISTING','MARQUEE','MENU','MULTICOL','OL','P','PLAINTEXT','PRE','TABLE','UL','XMP','CAPTION','COL','COLGROUP','TBODY','TD','TFOOT','TH','THEAD','TR','DIR','MENU','OL','UL','DL','EMBED','OBJECT']; +Roo.HtmlEditorCore.black=['APPLET','BASE','BASEFONT','BGSOUND','BLINK','BODY','FRAME','FRAMESET','HEAD','HTML','ILAYER','IFRAME','LAYER','LINK','META','OBJECT','SCRIPT','STYLE','TITLE','XML','COLGROUP','COL'];Roo.HtmlEditorCore.clean=['SCRIPT','STYLE','TITLE','XML']; +Roo.HtmlEditorCore.tag_remove=['FONT','TBODY'];Roo.HtmlEditorCore.ablack=['on'];Roo.HtmlEditorCore.aclean=['action','background','codebase','dynsrc','href','lowsrc'];Roo.HtmlEditorCore.pwhite=['http','https','mailto'];Roo.HtmlEditorCore.cwhite=[];Roo.HtmlEditorCore.cblack=[]; -// Roo/bootstrap/HtmlEditor.js -Roo.bootstrap.HtmlEditor=function(A){Roo.bootstrap.HtmlEditor.superclass.constructor.call(this,A);if(!this.toolbars){this.toolbars=[];}this.editorcore=new Roo.HtmlEditorCore(Roo.apply({owner:this},A));this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editmodechange:true,editorevent:true,firstfocus:true,autosave:true,savedpreview:true} -);};Roo.extend(Roo.bootstrap.HtmlEditor,Roo.bootstrap.TextArea,{toolbars:false,btns:[],resizable:false,height:300,width:false,stylesheets:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',tbContainer:false,bodyCls:'',toolbarContainer:function(){return this.wrap.select('.x-html-editor-tb',true).first(); -},createToolbar:function(){Roo.log('renewing');Roo.log("create toolbars");this.toolbars=[new Roo.bootstrap.htmleditor.ToolbarStandard({editor:this})];this.toolbars[0].render(this.toolbarContainer());return;},onRender:function(ct,A){var _t=this;Roo.bootstrap.HtmlEditor.superclass.onRender.call(this,ct,A); +// Roo/bootstrap/form/HtmlEditor.js +Roo.bootstrap.form.HtmlEditor=function(A){Roo.bootstrap.form.HtmlEditor.superclass.constructor.call(this,A);if(!this.toolbars){this.toolbars=[];}this.editorcore=new Roo.HtmlEditorCore(Roo.apply({owner:this},A));this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editmodechange:true,editorevent:true,firstfocus:true,autosave:true,savedpreview:true} +);};Roo.extend(Roo.bootstrap.form.HtmlEditor,Roo.bootstrap.form.TextArea,{toolbars:false,btns:[],resizable:false,height:300,width:false,stylesheets:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',tbContainer:false,bodyCls:'',toolbarContainer:function(){return this.wrap.select('.x-html-editor-tb',true).first(); +},createToolbar:function(){Roo.log('renewing');Roo.log("create toolbars");this.toolbars=[new Roo.bootstrap.form.HtmlEditorToolbarStandard({editor:this})];this.toolbars[0].render(this.toolbarContainer());return;},onRender:function(ct,A){var _t=this;Roo.bootstrap.form.HtmlEditor.superclass.onRender.call(this,ct,A); this.wrap=this.inputEl().wrap({cls:'x-html-editor-wrap',cn:{cls:'x-html-editor-tb'}});this.editorcore.onRender(ct,A);if(this.resizable){this.resizeEl=new Roo.Resizable(this.wrap,{pinned:true,wrap:true,dynamic:true,minHeight:this.height,height:this.height,handles:this.resizable,width:this.width,listeners:{resize:function(r,w,h){_t.onResize(w,h); -}}});}this.createToolbar(this);if(!this.width&&this.resizable){this.setSize(this.wrap.getSize());}if(this.resizeEl){this.resizeEl.resizeTo.defer(100,this.resizeEl,[this.width,this.height]);}},onResize:function(w,h){Roo.log('resize: '+w+','+h);Roo.bootstrap.HtmlEditor.superclass.onResize.apply(this,arguments); +}}});}this.createToolbar(this);if(!this.width&&this.resizable){this.setSize(this.wrap.getSize());}if(this.resizeEl){this.resizeEl.resizeTo.defer(100,this.resizeEl,[this.width,this.height]);}},onResize:function(w,h){Roo.log('resize: '+w+','+h);Roo.bootstrap.form.HtmlEditor.superclass.onResize.apply(this,arguments); var ew=false;var eh=false;if(this.inputEl()){if(typeof w=='number'){var aw=w-this.wrap.getFrameWidth('lr');this.inputEl().setWidth(this.adjustWidth('textarea',aw));ew=aw;}if(typeof h=='number'){var A=-11;for(var i=0;i'+f+'',tagname:f,listeners:{click:function(){C.insertTag(this.tagname); D.focus();}}});});E.push(style);F('bold',false,true);F('italic',false,true);F('align-left','justifyleft',true);F('align-center','justifycenter',true);F('align-right','justifyright',true);F('link',false,false,function(G){var H=prompt(this.createLinkText,this.defaultLinkValue); if(H&&H!='http:/'+'/'){this.editorcore.relayCmd('createlink',H);}}),F('list','insertunorderedlist',true);F('pencil',false,true,function(G){Roo.log(this);this.toggleSourceEdit(G.pressed);});if(this.editor.btns.length>0){for(var i=0;i{0}',this.placeholder||'');}else{this.markdownEl.dom.innerHTML=Roo.Markdown.toHtml(Roo.util.Format.htmlEncode(this.getValue())); +// Roo/bootstrap/form/Markdown.js +Roo.bootstrap.form.Markdown=function(A){Roo.bootstrap.form.Markdown.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.form.Markdown,Roo.bootstrap.form.TextArea,{editing:false,initEvents:function(){Roo.bootstrap.form.TextArea.prototype.initEvents.call(this); +this.markdownEl=this.el.createChild({cls:'roo-markdown-area'});this.inputEl().addClass('d-none');if(this.getValue()==''){this.markdownEl.dom.innerHTML=String.format('{0}',this.placeholder||'');}else{this.markdownEl.dom.innerHTML=Roo.Markdown.toHtml(Roo.util.Format.htmlEncode(this.getValue())); }this.markdownEl.on('click',this.toggleTextEdit,this);this.on('blur',this.toggleTextEdit,this);this.on('specialkey',this.resizeTextArea,this);},toggleTextEdit:function(){var sh=this.markdownEl.getHeight();this.inputEl().addClass('d-none');this.markdownEl.addClass('d-none'); if(!this.editing){this.inputEl().setHeight(Math.min(500,Math.max(sh,(this.getValue().split("\n").length+1)*30)));this.inputEl().removeClass('d-none');this.inputEl().focus();this.editing=true;return;}this.updateMarkdown();this.markdownEl.removeClass('d-none'); this.editing=false;return;},updateMarkdown:function(){if(this.getValue()==''){this.markdownEl.dom.innerHTML=String.format('{0}',this.placeholder||'');return;}this.markdownEl.dom.innerHTML=Roo.Markdown.toHtml(Roo.util.Format.htmlEncode(this.getValue())); -},resizeTextArea:function(){var sh=100;Roo.log([sh,this.getValue().split("\n").length*30]);this.inputEl().setHeight(Math.min(500,Math.max(sh,(this.getValue().split("\n").length+1)*30)));},setValue:function(A){Roo.bootstrap.TextArea.prototype.setValue.call(this,A); +},resizeTextArea:function(){var sh=100;Roo.log([sh,this.getValue().split("\n").length*30]);this.inputEl().setHeight(Math.min(500,Math.max(sh,(this.getValue().split("\n").length+1)*30)));},setValue:function(A){Roo.bootstrap.form.TextArea.prototype.setValue.call(this,A); if(!this.editing){this.updateMarkdown();}},focus:function(){if(!this.editing){this.toggleTextEdit();}}}); -// Roo/bootstrap/Table/AbstractSelectionModel.js -Roo.bootstrap.Table.AbstractSelectionModel=function(){this.locked=false;Roo.bootstrap.Table.AbstractSelectionModel.superclass.constructor.call(this);};Roo.extend(Roo.bootstrap.Table.AbstractSelectionModel,Roo.util.Observable,{init:function(A){this.grid=A;this.initEvents(); -},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},initEvents:function(){}}); -// Roo/bootstrap/Table/RowSelectionModel.js -Roo.bootstrap.Table.RowSelectionModel=function(A){Roo.apply(this,A);this.selections=new Roo.util.MixedCollection(false,function(o){return o.id;});this.last=false;this.lastActive=false;this.addEvents({"selectionchange":true,"afterselectionchange":true,"beforerowselect":true,"rowselect":true,"rowdeselect":true} -);Roo.bootstrap.Table.RowSelectionModel.superclass.constructor.call(this);this.locked=false;};Roo.extend(Roo.bootstrap.Table.RowSelectionModel,Roo.bootstrap.Table.AbstractSelectionModel,{singleSelect:false,initEvents:function(){this.grid.on("rowclick",this.handleMouseDown,this); -this.rowNav=new Roo.KeyNav(this.grid.getGridEl(),{"up":function(e){if(!e.shiftKey){this.selectPrevious(e.shiftKey);}else if(this.last!==false&&this.lastActive!==false){var A=this.last;this.selectRange(this.last,this.lastActive-1);this.grid.getView().focusRow(this.lastActive); -if(A!==false){this.last=A;}}else{this.selectFirstRow();}this.fireEvent("afterselectionchange",this);},"down":function(e){if(!e.shiftKey){this.selectNext(e.shiftKey);}else if(this.last!==false&&this.lastActive!==false){var A=this.last;this.selectRange(this.last,this.lastActive+1); -this.grid.getView().focusRow(this.lastActive);if(A!==false){this.last=A;}}else{this.selectFirstRow();}this.fireEvent("afterselectionchange",this);},scope:this});this.grid.store.on('load',function(){this.selections.clear();},this);},onRefresh:function(){var ds=this.grid.store,i,v=this.grid.view; -var s=this.selections;s.each(function(r){if((i=ds.indexOfId(r.id))!=-1){v.onRowSelect(i);}else{s.remove(r);}});},onRemove:function(v,A,r){this.selections.remove(r);},onRowUpdated:function(v,A,r){if(this.isSelected(r)){v.onRowSelect(A);}},selectRecords:function(A,B){if(!B){this.clearSelections(); -}var ds=this.grid.store;for(var i=0,C=A.length;i0; -},isSelected:function(A){var r=typeof A=="number"?this.grid.store.getAt(A):A;return (r&&this.selections.key(r.id)?true:false);},isIdSelected:function(id){return (this.selections.key(id)?true:false);},handleMouseDBClick:function(e,t){},handleMouseDown:function(e,t){var A=this.grid.headerShow?t.dom.rowIndex-1:t.dom.rowIndex; -if(this.isLocked()||A<0){return;};if(e.shiftKey&&this.last!==false){var B=this.last;this.selectRange(B,A,e.ctrlKey);this.last=B;t.focus();}else{var C=this.isSelected(A);if(C){this.deselectRow(A);}else{this.selectRow(A,true);}}this.fireEvent("afterselectionchange",this); -},handleDragableRowClick:function(A,B,e){if(e.button===0&&!e.shiftKey&&!e.ctrlKey){this.selectRow(B,false);A.view.focusRow(B);this.fireEvent("afterselectionchange",this);}},selectRows:function(A,B){if(!B){this.clearSelections();}for(var i=0,C=A.length;i=B;i--){this.selectRow(i,true);}}},deselectRange:function(A,B,C){if(this.locked){return; -}for(var i=A;i<=B;i++){this.deselectRow(i,C);}},selectRow:function(A,B,C){if(this.locked||(A<0||A>this.grid.store.getCount())){return;}if(this.fireEvent("beforerowselect",this,A,B)!==false){if(!B||this.singleSelect){this.clearSelections();}var r=this.grid.store.getAt(A); -this.selections.add(r);this.last=this.lastActive=A;if(!C){var D=new Roo.Element(this.grid.getRowDom(A));D.addClass('bg-info info');}this.fireEvent("rowselect",this,A,r);this.fireEvent("selectionchange",this);}},deselectRow:function(A,B){if(this.locked){return; -}if(this.last==A){this.last=false;}if(this.lastActive==A){this.lastActive=false;}var r=this.grid.store.getAt(A);if(!r){return;}this.selections.remove(r);if(!B){var C=new Roo.Element(this.grid.getRowDom(A));C.removeClass('bg-info info');}this.fireEvent("rowdeselect",this,A); -this.fireEvent("selectionchange",this);},restoreLast:function(){if(this._last){this.last=this._last;}},acceptsNav:function(A,B,cm){return !cm.isHidden(B)&&cm.isCellEditable(B,A);},onEditorKey:function(A,e){var k=e.getKey(),B,g=this.grid,ed=g.activeEditor; -if(k==e.TAB){e.stopEvent();ed.completeEdit();if(e.shiftKey){B=g.walkCells(ed.row,ed.col-1,-1,this.acceptsNav,this);}else{B=g.walkCells(ed.row,ed.col+1,1,this.acceptsNav,this);}}else if(k==e.ENTER&&!e.ctrlKey){e.stopEvent();ed.completeEdit();if(e.shiftKey){B=g.walkCells(ed.row-1,ed.col,-1,this.acceptsNav,this); -}else{B=g.walkCells(ed.row+1,ed.col,1,this.acceptsNav,this);}}else if(k==e.ESC){ed.cancelEdit();}if(B){g.startEditing(B[0],B[1]);}}}); // Roo/bootstrap/PagingToolbar.js Roo.bootstrap.PagingToolbar=function(A){this.ds=A.dataSource;if(A.store&&!this.ds){this.store=Roo.factory(A.store,Roo.data);this.ds=this.store;this.ds.xmodule=this.xmodule||false;}this.toolbarItems=[];if(A.items){this.toolbarItems=A.items;}Roo.bootstrap.PagingToolbar.superclass.constructor.call(this,A); -this.cursor=0;if(this.ds){this.bind(this.ds);}if(Roo.bootstrap.version==4){this.navgroup=new Roo.bootstrap.ButtonGroup({cls:'pagination'});}else{this.navgroup=new Roo.bootstrap.NavGroup({cls:'pagination'});}};Roo.extend(Roo.bootstrap.PagingToolbar,Roo.bootstrap.NavSimplebar,{pageSize:20,displayMsg:'Displaying {0} - {1} of {2}',emptyMsg:'No data to display',beforePageText:"Page",afterPageText:"of {0}",firstText:"First Page",prevText:"Previous Page",nextText:"Next Page",lastText:"Last Page",refreshText:"Refresh",buttons:false,onRender:function(ct,A){Roo.bootstrap.PagingToolbar.superclass.onRender.call(this,ct,A); +this.cursor=0;if(this.ds){this.bind(this.ds);}if(Roo.bootstrap.version==4){this.navgroup=new Roo.bootstrap.ButtonGroup({cls:'pagination'});}else{this.navgroup=new Roo.bootstrap.nav.Group({cls:'pagination'});}};Roo.extend(Roo.bootstrap.PagingToolbar,Roo.bootstrap.nav.Simplebar,{pageSize:20,displayMsg:'Displaying {0} - {1} of {2}',emptyMsg:'No data to display',beforePageText:"Page",afterPageText:"of {0}",firstText:"First Page",prevText:"Previous Page",nextText:"Next Page",lastText:"Last Page",refreshText:"Refresh",buttons:false,onRender:function(ct,A){Roo.bootstrap.PagingToolbar.superclass.onRender.call(this,ct,A); this.navgroup.parentId=this.id;this.navgroup.onRender(this.el,null);if(this.displayInfo){this.el.select('ul.navbar-nav',true).first().createChild({cls:'x-paging-info'});this.displayEl=this.el.select('.x-paging-info',true).first();}var B=this;if(this.buttons){Roo.each(B.buttons,function(e){Roo.factory(e).render(B.el); });}Roo.each(B.toolbarItems,function(e){B.navgroup.addItem(e);});this.first=this.navgroup.addItem({tooltip:this.firstText,cls:"prev btn-outline-secondary",html:' ',disabled:true,preventDefault:true,listeners:{click:this.onClick.createDelegate(this,["first"])} });this.prev=this.navgroup.addItem({tooltip:this.prevText,cls:"prev btn-outline-secondary",html:' ',disabled:true,preventDefault:true,listeners:{click:this.onClick.createDelegate(this,["prev"])}});var C=this.navgroup.addItem({tagtype:'span',cls:'x-paging-position btn-outline-secondary',disabled:true,html:this.beforePageText+''+''+String.format(this.afterPageText,1)+''} @@ -1167,8 +1361,8 @@ this.navgroup.parentId=this.id;this.navgroup.onRender(this.el,null);if(this.disp });},updateInfo:function(){if(this.displayEl){var A=(typeof(this.getCount)=='undefined')?this.ds.getCount():this.getCount();var B=A==0?this.emptyMsg:String.format(this.displayMsg,this.cursor+1,this.cursor+A,this.ds.getTotalCount());this.displayEl.update(B); }},onLoad:function(ds,r,o){this.cursor=o.params&&o.params.start?o.params.start:0;var d=this.getPageData(),ap=d.activePage,ps=d.pages;this.afterTextEl.dom.innerHTML=String.format(this.afterPageText,d.pages);this.field.dom.value=ap;this.first.setDisabled(ap==1); this.prev.setDisabled(ap==1);this.next.setDisabled(ap==ps);this.last.setDisabled(ap==ps);this.loading.enable();this.updateInfo();},getPageData:function(){var A=this.ds.getTotalCount();return {total:A,activePage:Math.ceil((this.cursor+this.pageSize)/this.pageSize),pages:A=1&parseInt(v,10)+B<=d.pages){this.field.dom.value=parseInt(v,10)+B;A=Math.min(Math.max(1,A+B),d.pages)-1;this.ds.load({params:{start:A*this.pageSize,limit:this.pageSize} });}e.stopEvent();}},beforeLoad:function(){if(this.loading){this.loading.disable();}},onClick:function(A){var ds=this.ds;if(!ds){return;}switch(A){case "first":ds.load({params:{start:0,limit:this.pageSize}});break;case "prev":ds.load({params:{start:Math.max(0,this.cursor-this.pageSize),limit:this.pageSize} @@ -1189,6 +1383,8 @@ return;}this.raphael=Raphael(this.el.dom);},load:function(A,B,C){this.raphael.cl ,500,"bounce");if(this.label){this.label[0].animate({r:5},500,"bounce");this.label[1].attr({"font-weight":400});}};switch(A){case 'bar':this.raphael.barchart(this.g_x,this.g_y,this.g_width,this.g_height,B,C).hover(D,E);break;case 'hbar':this.raphael.hbarchart(this.g_x,this.g_y,this.g_width,this.g_height,B,C).hover(D,E); break;case 'pie':this.raphael.piechart(this.g_x,this.g_y,this.g_r,B,C).hover(F,G);break;}if(this.title){this.raphael.text(this.title.x,this.title.y,this.title.text).attr(this.title.attr);}},setTitle:function(o){this.title=o;},initEvents:function(){if(!this.href){this.el.on('click',this.onClick,this); }},onClick:function(e){Roo.log('img onclick');this.fireEvent('click',this,e);}}); +// Roo/bootstrap/dash/namespace.js +Roo.bootstrap.dash={}; // Roo/bootstrap/dash/NumberBox.js Roo.bootstrap.dash=Roo.bootstrap.dash||{};Roo.bootstrap.dash.NumberBox=function(A){Roo.bootstrap.dash.NumberBox.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.dash.NumberBox,Roo.bootstrap.Component,{headline:'',content:'',icon:'',footer:'',fhref:'',ficon:'',getAutoCreate:function(){var A={tag:'div',cls:'small-box ',cn:[{tag:'div',cls:'inner',cn:[{tag:'h3',cls:'roo-headline',html:this.headline} ,{tag:'p',cls:'roo-content',html:this.content}]}]};if(this.icon){A.cn.push({tag:'div',cls:'icon',cn:[{tag:'i',cls:'ion '+this.icon}]});}if(this.footer){var B={tag:'a',cls:'small-box-footer',href:this.fhref||'#',html:this.footer};A.cn.push(B);}return A;},onRender:function(ct,A){Roo.bootstrap.dash.NumberBox.superclass.onRender.call(this,ct,A); @@ -1205,23 +1401,6 @@ return false;}return;});return r;}}); // Roo/bootstrap/dash/TabPane.js Roo.bootstrap.dash=Roo.bootstrap.dash||{};Roo.bootstrap.dash.TabPane=function(A){Roo.bootstrap.dash.TabPane.superclass.constructor.call(this,A);this.addEvents({"activate":true});};Roo.extend(Roo.bootstrap.dash.TabPane,Roo.bootstrap.Component,{active:false,title:'',tab:false,getAutoCreate:function(){var A={tag:'div',cls:'tab-pane'} ;if(this.active){A.cls+=' active';}return A;},initEvents:function(){this.parent().fireEvent('addpane',this)},setTitle:function(A){if(!this.tab){return;}this.title=A;this.tab.select('a',true).first().dom.innerHTML=A;}}); -// Roo/bootstrap/menu/Menu.js -Roo.bootstrap.menu=Roo.bootstrap.menu||{};Roo.bootstrap.menu.Menu=function(A){Roo.bootstrap.menu.Menu.superclass.constructor.call(this,A);this.addEvents({beforeshow:true,beforehide:true,show:true,hide:true,click:true});};Roo.extend(Roo.bootstrap.menu.Menu,Roo.bootstrap.Component,{submenu:false,html:'',weight:'default',icon:false,pos:'bottom',getChildContainer:function(){if(this.isSubMenu){return this.el; -}return this.el.select('ul.dropdown-menu',true).first();},getAutoCreate:function(){var A=[{tag:'span',cls:'roo-menu-text',html:this.html}];if(this.icon){A.unshift({tag:'i',cls:'fa '+this.icon})}var B={tag:'div',cls:'btn-group',cn:[{tag:'button',cls:'dropdown-button btn btn-'+this.weight,cn:A} -,{tag:'button',cls:'dropdown-toggle btn btn-'+this.weight,cn:[{tag:'span',cls:'caret'}]},{tag:'ul',cls:'dropdown-menu'}]};if(this.pos=='top'){B.cls+=' dropup';}if(this.isSubMenu){B={tag:'ul',cls:'dropdown-menu'}}return B;},onRender:function(ct,A){this.isSubMenu=ct.hasClass('dropdown-submenu'); -Roo.bootstrap.menu.Menu.superclass.onRender.call(this,ct,A);},initEvents:function(){if(this.isSubMenu){return;}this.hidden=true;this.triggerEl=this.el.select('button.dropdown-toggle',true).first();this.triggerEl.on('click',this.onTriggerPress,this);this.buttonEl=this.el.select('button.dropdown-button',true).first(); -this.buttonEl.on('click',this.onClick,this);},list:function(){if(this.isSubMenu){return this.el;}return this.el.select('ul.dropdown-menu',true).first();},onClick:function(e){this.fireEvent("click",this,e);},onTriggerPress:function(e){if(this.isVisible()){this.hide(); -}else{this.show();}},isVisible:function(){return !this.hidden;},show:function(){this.fireEvent("beforeshow",this);this.hidden=false;this.el.addClass('open');Roo.get(document).on("mouseup",this.onMouseUp,this);this.fireEvent("show",this);},hide:function(){this.fireEvent("beforehide",this); -this.hidden=true;this.el.removeClass('open');Roo.get(document).un("mouseup",this.onMouseUp);this.fireEvent("hide",this);},onMouseUp:function(){this.hide();}}); -// Roo/bootstrap/menu/Item.js -Roo.bootstrap.menu=Roo.bootstrap.menu||{};Roo.bootstrap.menu.Item=function(A){Roo.bootstrap.menu.Item.superclass.constructor.call(this,A);this.addEvents({mouseover:true,mouseout:true,click:true});};Roo.extend(Roo.bootstrap.menu.Item,Roo.bootstrap.Component,{submenu:false,href:'',html:'',preventDefault:true,disable:false,icon:false,pos:'right',getAutoCreate:function(){var A=[{tag:'span',cls:'roo-menu-item-text',html:this.html} -];if(this.icon){A.unshift({tag:'i',cls:'fa '+this.icon})}var B={tag:'li',cn:[{tag:'a',href:this.href||'#',cn:A}]};if(this.disable){B.cls=(typeof(B.cls)=='undefined')?'disabled':(B.cls+' disabled');}if(this.submenu){B.cls=(typeof(B.cls)=='undefined')?'dropdown-submenu':(B.cls+' dropdown-submenu'); -if(this.pos=='left'){B.cls=(typeof(B.cls)=='undefined')?'pull-left':(B.cls+' pull-left');}}return B;},initEvents:function(){this.el.on('mouseover',this.onMouseOver,this);this.el.on('mouseout',this.onMouseOut,this);this.el.select('a',true).first().on('click',this.onClick,this); -},onClick:function(e){if(this.preventDefault){e.preventDefault();}this.fireEvent("click",this,e);},onMouseOver:function(e){if(this.submenu&&this.pos=='left'){this.el.select('ul.dropdown-menu',true).first().setLeft(this.el.select('ul.dropdown-menu',true).first().getWidth()*-1); -}this.fireEvent("mouseover",this,e);},onMouseOut:function(e){this.fireEvent("mouseout",this,e);}}); -// Roo/bootstrap/menu/Separator.js -Roo.bootstrap.menu=Roo.bootstrap.menu||{};Roo.bootstrap.menu.Separator=function(A){Roo.bootstrap.menu.Separator.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.menu.Separator,Roo.bootstrap.Component,{getAutoCreate:function(){var A={tag:'li',cls:'dropdown-divider divider'} -;return A;}}); // Roo/bootstrap/Tooltip.js Roo.bootstrap.Tooltip=function(A){Roo.bootstrap.Tooltip.superclass.constructor.call(this,A);this.alignment=Roo.bootstrap.Tooltip.alignment;if(typeof(A)!='undefined'&&typeof(A.alignment)!='undefined'){this.alignment=A.alignment;}};Roo.apply(Roo.bootstrap.Tooltip,{currentEl:false,currentTip:false,currentRegion:false,init:function(){Roo.get(document).on('mouseover',this.enter,this); Roo.get(document).on('mouseout',this.leave,this);this.currentTip=new Roo.bootstrap.Tooltip();},enter:function(ev){var A=ev.getTarget();var el=Roo.fly(A);if(this.currentEl){if(this.currentEl==el){return;}if(A!=this.currentEl.dom&&this.currentEl.contains(A)){return; @@ -1262,9 +1441,9 @@ B.addressLine2="";return B;},setZoomLevel:function(A){this.gMapContext.map.setZo // Roo/bootstrap/Alert.js Roo.bootstrap.Alert=function(A){Roo.bootstrap.Alert.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Alert,Roo.bootstrap.Component,{title:'',html:'',weight:false,fa:false,faicon:false,close:false,getAutoCreate:function(){var A={tag:'div',cls:'alert',cn:[{tag:'button',type:"button",cls:"close",html:'×',style:this.close?'':'display:none'} ,{tag:'i',cls:'roo-alert-icon'},{tag:'b',cls:'roo-alert-title',html:this.title},{tag:'span',cls:'roo-alert-text',html:this.html}]};if(this.faicon){A.cn[0].cls+=' fa '+this.faicon;}if(this.fa){A.cn[0].cls+=' fa '+this.fa;}if(this.weight){A.cls+=' alert-'+this.weight; -}return A;},initEvents:function(){this.el.setVisibilityMode(Roo.Element.DISPLAY);this.titleEl=this.el.select('.roo-alert-title',true).first();this.iconEl=this.el.select('.roo-alert-icon',true).first();if(this.seconds>0){this.hide.defer(this.seconds,this); -}},setTitle:function(A){this.titleEl.dom.innerHTML=A;},setText:function(A){this.titleEl.dom.innerHTML=A;},setWeight:function(A){if(this.weight){this.el.removeClass('alert-'+this.weight);}this.weight=A;this.el.addClass('alert-'+this.weight);},setIcon:function(A){if(this.faicon){this.alertEl.removeClass(['fa','fa-'+this.faicon]); -}this.faicon=A;this.alertEl.addClass(['fa','fa-'+this.faicon]);},hide:function(){this.el.hide();},show:function(){this.el.show();}}); +}return A;},initEvents:function(){this.el.setVisibilityMode(Roo.Element.DISPLAY);this.titleEl=this.el.select('.roo-alert-title',true).first();this.iconEl=this.el.select('.roo-alert-icon',true).first();this.htmlEl=this.el.select('.roo-alert-text',true).first(); +if(this.seconds>0){this.hide.defer(this.seconds,this);}},setTitle:function(A){this.titleEl.dom.innerHTML=A;},setHtml:function(A){this.htmlEl.dom.innerHTML=A;},setWeight:function(A){if(this.weight){this.el.removeClass('alert-'+this.weight);}this.weight=A;this.el.addClass('alert-'+this.weight); +},setIcon:function(A){if(this.faicon){this.alertEl.removeClass(['fa','fa-'+this.faicon]);}this.faicon=A;this.alertEl.addClass(['fa','fa-'+this.faicon]);},hide:function(){this.el.hide();},show:function(){this.el.show();}}); // Roo/bootstrap/UploadCropbox.js Roo.bootstrap.UploadCropbox=function(A){Roo.bootstrap.UploadCropbox.superclass.constructor.call(this,A);this.addEvents({"beforeselectfile":true,"initial":true,"crop":true,"prepare":true,"exception":true,"beforeloadcanvas":true,"trash":true,"download":true,"footerbuttonclick":true,"resize":true,"rotate":true,"inspect":true,"upload":true,"arrange":true} );this.buttons=this.buttons||Roo.bootstrap.UploadCropbox.footer.STANDARD;};Roo.extend(Roo.bootstrap.UploadCropbox,Roo.bootstrap.Component,{emptyText:'Click to upload image',rotateNotify:'Image is too small to rotate',errorTimeout:3000,scale:0,baseScale:1,rotate:0,dragable:false,pinching:false,mouseX:0,mouseY:0,cropData:false,minWidth:300,minHeight:300,file:false,exif:{} @@ -1403,41 +1582,24 @@ this.footerEl.setVisibilityMode(Roo.Element.DISPLAY);this.downloadBtn=this.el.se this.trashBtn.setVisibilityMode(Roo.Element.DISPLAY);this.bodyEl.on('click',this.onClick,this);this.downloadBtn.on('click',this.onDownload,this);this.trashBtn.on('click',this.onTrash,this);this.downloadBtn.hide();this.trashBtn.hide();if(this.showDownload){this.downloadBtn.show(); }if(this.showTrash){this.trashBtn.show();}if(!this.showDownload&&!this.showTrash){this.footerEl.hide();}},initial:function(){this.fireEvent('initial',this);},onClick:function(e){e.preventDefault();this.fireEvent('click',this);},onDownload:function(e){e.preventDefault(); this.fireEvent('download',this);},onTrash:function(e){e.preventDefault();this.fireEvent('trash',this);}}); -// Roo/bootstrap/NavProgressBar.js -Roo.bootstrap.NavProgressBar=function(A){Roo.bootstrap.NavProgressBar.superclass.constructor.call(this,A);this.bullets=this.bullets||[];this.addEvents({'changed':true});};Roo.extend(Roo.bootstrap.NavProgressBar,Roo.bootstrap.Component,{bullets:[],barItems:[],getAutoCreate:function(){var A=Roo.apply({} -,Roo.bootstrap.NavProgressBar.superclass.getAutoCreate.call(this));A={tag:'div',cls:'roo-navigation-bar-group',cn:[{tag:'div',cls:'roo-navigation-top-bar'},{tag:'div',cls:'roo-navigation-bullets-bar',cn:[{tag:'ul',cls:'roo-navigation-bar'}]},{tag:'div',cls:'roo-navigation-bottom-bar'} -]};return A;},initEvents:function(){},onRender:function(ct,A){Roo.bootstrap.NavProgressBar.superclass.onRender.call(this,ct,A);if(this.bullets.length){Roo.each(this.bullets,function(b){this.addItem(b);},this);}this.format();},addItem:function(A){var B=new Roo.bootstrap.NavProgressItem(A); -B.parentId=this.id;B.render(this.el.select('.roo-navigation-bar',true).first(),null);if(A.html){var C=new Roo.bootstrap.Element({tag:'div',cls:'roo-navigation-bar-text'});var D=new Roo.bootstrap.Element({tag:'div',cls:'roo-navigation-bar-text'});C.onRender(this.el.select('.roo-navigation-top-bar',true).first(),null); -D.onRender(this.el.select('.roo-navigation-bottom-bar',true).first(),null);var E=new Roo.bootstrap.Element({tag:'span',html:(typeof(A.position)!='undefined'&&A.position=='top')?A.html:''});var F=new Roo.bootstrap.Element({tag:'span',html:(typeof(A.position)!='undefined'&&A.position=='top')?'':A.html} -);E.onRender(C.el,null);F.onRender(D.el,null);B.topEl=C;B.bottomEl=D;}this.barItems.push(B);return B;},getActive:function(){var A=false;Roo.each(this.barItems,function(v){if(!v.isActive()){return;}A=v;return false;});return A;},setActiveItem:function(A){var B=false; -Roo.each(this.barItems,function(v){if(v.rid==A.rid){return;}if(v.isActive()){v.setActive(false);B=v;}});A.setActive(true);this.fireEvent('changed',this,A,B);},getBarItem:function(A){var B=false;Roo.each(this.barItems,function(e){if(e.rid!=A){return;}B=e;return false; -});return B;},indexOfItem:function(A){var B=false;Roo.each(this.barItems,function(v,i){if(v.rid!=A.rid){return;}B=i;return false});return B;},setActiveNext:function(){var i=this.indexOfItem(this.getActive());if(i>this.barItems.length){return;}this.setActiveItem(this.barItems[i+1]); -},setActivePrev:function(){var i=this.indexOfItem(this.getActive());if(i<1){return;}this.setActiveItem(this.barItems[i-1]);},format:function(){if(!this.barItems.length){return;}var A=100/this.barItems.length;Roo.each(this.barItems,function(i){i.el.setStyle('width',A+'%'); -i.topEl.el.setStyle('width',A+'%');i.bottomEl.el.setStyle('width',A+'%');},this);}}); -// Roo/bootstrap/NavProgressItem.js -Roo.bootstrap.NavProgressItem=function(A){Roo.bootstrap.NavProgressItem.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.NavProgressItem,Roo.bootstrap.Component,{rid:'',active:false,disabled:false,html:'',position:'bottom',icon:false,getAutoCreate:function(){var A='roo-navigation-bar-item-icon'; -A+=((this.icon)?(' '+this.icon):(' step-number'));var B={tag:'li',cls:'roo-navigation-bar-item',cn:[{tag:'i',cls:A}]};if(this.active){B.cls+=' active';}if(this.disabled){B.cls+=' disabled';}return B;},disable:function(){this.setDisabled(true);},enable:function(){this.setDisabled(false); -},initEvents:function(){this.iconEl=this.el.select('.roo-navigation-bar-item-icon',true).first();this.iconEl.on('click',this.onClick,this);},onClick:function(e){e.preventDefault();if(this.disabled){return;}if(this.fireEvent('click',this,e)===false){return; -};this.parent().setActiveItem(this);},isActive:function(){return this.active;},setActive:function(A){if(this.active==A){return;}this.active=A;if(A){this.el.addClass('active');return;}this.el.removeClass('active');return;},setDisabled:function(A){if(this.disabled==A){return; -}this.disabled=A;if(A){this.el.addClass('disabled');return;}this.el.removeClass('disabled');},tooltipEl:function(){return this.el.select('.roo-navigation-bar-item-icon',true).first();;}}); -// Roo/bootstrap/FieldLabel.js -Roo.bootstrap.FieldLabel=function(A){Roo.bootstrap.Element.superclass.constructor.call(this,A);this.addEvents({invalid:true,valid:true});};Roo.extend(Roo.bootstrap.FieldLabel,Roo.bootstrap.Component,{tag:'label',cls:'',html:'',target:'',allowBlank:true,invalidClass:'has-warning',validClass:'has-success',iconTooltip:'This field is required',indicatorpos:'left',getAutoCreate:function(){var A=""; +// Roo/bootstrap/form/FieldLabel.js +Roo.bootstrap.form.FieldLabel=function(A){Roo.bootstrap.Element.superclass.constructor.call(this,A);this.addEvents({invalid:true,valid:true});};Roo.extend(Roo.bootstrap.form.FieldLabel,Roo.bootstrap.Component,{tag:'label',cls:'',html:'',target:'',allowBlank:true,invalidClass:'has-warning',validClass:'has-success',iconTooltip:'This field is required',indicatorpos:'left',getAutoCreate:function(){var A=""; if(!this.allowBlank){A="visible";}var B={tag:this.tag,cls:'roo-bootstrap-field-label '+this.cls,for:this.target,cn:[{tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg fa-star '+A,tooltip:this.iconTooltip},{tag:'span',html:this.html}]} ;if(this.indicatorpos=='right'){var B={tag:this.tag,cls:'roo-bootstrap-field-label '+this.cls,for:this.target,cn:[{tag:'span',html:this.html},{tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star '+A,tooltip:this.iconTooltip}]} -;}return B;},initEvents:function(){Roo.bootstrap.Element.superclass.initEvents.call(this);this.indicator=this.indicatorEl();if(this.indicator){this.indicator.removeClass('visible');this.indicator.addClass('invisible');}Roo.bootstrap.FieldLabel.register(this); +;}return B;},initEvents:function(){Roo.bootstrap.Element.superclass.initEvents.call(this);this.indicator=this.indicatorEl();if(this.indicator){this.indicator.removeClass('visible');this.indicator.addClass('invisible');}Roo.bootstrap.form.FieldLabel.register(this); },indicatorEl:function(){var A=this.el.select('i.roo-required-indicator',true).first();if(!A){return false;}return A;},markValid:function(){if(this.indicator){this.indicator.removeClass('visible');this.indicator.addClass('invisible');}if(Roo.bootstrap.version==3){this.el.removeClass(this.invalidClass); this.el.addClass(this.validClass);}else{this.el.removeClass('is-invalid');this.el.addClass('is-valid');}this.fireEvent('valid',this);},markInvalid:function(A){if(this.indicator){this.indicator.removeClass('invisible');this.indicator.addClass('visible');}if(Roo.bootstrap.version==3){this.el.removeClass(this.validClass); -this.el.addClass(this.invalidClass);}else{this.el.removeClass('is-valid');this.el.addClass('is-invalid');}this.fireEvent('invalid',this,A);}});Roo.apply(Roo.bootstrap.FieldLabel,{groups:{},register:function(A){if(this.groups.hasOwnProperty(A.target)){return; +this.el.addClass(this.invalidClass);}else{this.el.removeClass('is-valid');this.el.addClass('is-invalid');}this.fireEvent('invalid',this,A);}});Roo.apply(Roo.bootstrap.form.FieldLabel,{groups:{},register:function(A){if(this.groups.hasOwnProperty(A.target)){return; }this.groups[A.target]=A;},get:function(A){if(typeof(this.groups[A])=='undefined'){return false;}return this.groups[A];}}); -// Roo/bootstrap/DateSplitField.js -Roo.bootstrap.DateSplitField=function(A){Roo.bootstrap.DateSplitField.superclass.constructor.call(this,A);this.addEvents({"years":true,"days":true,invalid:true,valid:true});};Roo.extend(Roo.bootstrap.DateSplitField,Roo.bootstrap.Component,{fieldLabel:'',labelAlign:'top',labelWidth:3,dayAllowBlank:false,monthAllowBlank:false,yearAllowBlank:false,dayPlaceholder:'',monthPlaceholder:'',yearPlaceholder:'',dayFormat:'d',monthFormat:'m',yearFormat:'Y',isFormField:true,labellg:0,labelmd:0,labelsm:0,labelxs:0,getAutoCreate:function(){var A={tag:'div',cls:'row roo-date-split-field-group',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field roo-date-split-field-group-value',name:this.name} +// Roo/bootstrap/form/DateSplitField.js +Roo.bootstrap.form.DateSplitField=function(A){Roo.bootstrap.form.DateSplitField.superclass.constructor.call(this,A);this.addEvents({"years":true,"days":true,invalid:true,valid:true});};Roo.extend(Roo.bootstrap.form.DateSplitField,Roo.bootstrap.Component,{fieldLabel:'',labelAlign:'top',labelWidth:3,dayAllowBlank:false,monthAllowBlank:false,yearAllowBlank:false,dayPlaceholder:'',monthPlaceholder:'',yearPlaceholder:'',dayFormat:'d',monthFormat:'m',yearFormat:'Y',isFormField:true,labellg:0,labelmd:0,labelsm:0,labelxs:0,getAutoCreate:function(){var A={tag:'div',cls:'row roo-date-split-field-group',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field roo-date-split-field-group-value',name:this.name} ]};var B='col-md-12';var C='col-md-4';if(this.fieldLabel){var D={tag:'div',cls:'column roo-date-split-field-label col-md-'+((this.labelAlign=='top')?'12':this.labelWidth),cn:[{tag:'label',html:this.fieldLabel}]};if(this.labelAlign=='left'){if(this.labelWidth>12){D.style="width: "+this.labelWidth+'px'; }if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;}if(this.labellg>0){B=' col-lg-'+this.labellg;C=' col-lg-'+((12-this.labellg)/3);}if(this.labelmd>0){B=' col-md-'+this.labelmd;C=' col-md-'+((12-this.labelmd)/3);}if(this.labelsm>0){B=' col-sm-'+this.labelsm; C=' col-sm-'+((12-this.labelsm)/3);}if(this.labelxs>0){B=' col-xs-'+this.labelxs;C=' col-xs-'+((12-this.labelxs)/3);}}D.cls+=' '+B;A.cn.push(D);}Roo.each(['day','month','year'],function(t){A.cn.push({tag:'div',cls:'column roo-date-split-field-'+t+' '+C}); -},this);return A;},inputEl:function(){return this.el.select('.roo-date-split-field-group-value',true).first();},onRender:function(ct,A){var B=this;Roo.bootstrap.NavProgressBar.superclass.onRender.call(this,ct,A);this.inputEl=this.el.select('.roo-date-split-field-group-value',true).first(); -this.dayField=new Roo.bootstrap.ComboBox({allowBlank:this.dayAllowBlank,alwaysQuery:true,displayField:'value',editable:false,fieldLabel:'',forceSelection:true,mode:'local',placeholder:this.dayPlaceholder,selectOnFocus:true,tpl:'
    {value}
    ',triggerAction:'all',typeAhead:true,valueField:'value',store:new Roo.data.SimpleStore({data:(function(){var C=[]; -B.fireEvent('days',B,C);return C;})(),fields:['value']}),listeners:{select:function(C,D,E){B.setValue(B.getValue());}}});this.dayField.render(this.el.select('.roo-date-split-field-day',true).first(),null);this.monthField=new Roo.bootstrap.MonthField({after:'',allowBlank:this.monthAllowBlank,placeholder:this.monthPlaceholder,readOnly:true,listeners:{render:function(C){this.el.select('span.input-group-addon',true).first().on('click',function(e){e.preventDefault(); -C.focus();});},select:function(C,D,E){B.setValue(B.getValue());}}});this.monthField.render(this.el.select('.roo-date-split-field-month',true).first(),null);this.yearField=new Roo.bootstrap.ComboBox({allowBlank:this.yearAllowBlank,alwaysQuery:true,displayField:'value',editable:false,fieldLabel:'',forceSelection:true,mode:'local',placeholder:this.yearPlaceholder,selectOnFocus:true,tpl:'
    {value}
    ',triggerAction:'all',typeAhead:true,valueField:'value',store:new Roo.data.SimpleStore({data:(function(){var C=[]; +},this);return A;},inputEl:function(){return this.el.select('.roo-date-split-field-group-value',true).first();},onRender:function(ct,A){var B=this;Roo.bootstrap.DateSplitFiel.superclass.onRender.call(this,ct,A);this.inputEl=this.el.select('.roo-date-split-field-group-value',true).first(); +this.dayField=new Roo.bootstrap.form.ComboBox({allowBlank:this.dayAllowBlank,alwaysQuery:true,displayField:'value',editable:false,fieldLabel:'',forceSelection:true,mode:'local',placeholder:this.dayPlaceholder,selectOnFocus:true,tpl:'
    {value}
    ',triggerAction:'all',typeAhead:true,valueField:'value',store:new Roo.data.SimpleStore({data:(function(){var C=[]; +B.fireEvent('days',B,C);return C;})(),fields:['value']}),listeners:{select:function(C,D,E){B.setValue(B.getValue());}}});this.dayField.render(this.el.select('.roo-date-split-field-day',true).first(),null);this.monthField=new Roo.bootstrap.form.MonthField({after:'',allowBlank:this.monthAllowBlank,placeholder:this.monthPlaceholder,readOnly:true,listeners:{render:function(C){this.el.select('span.input-group-addon',true).first().on('click',function(e){e.preventDefault(); +C.focus();});},select:function(C,D,E){B.setValue(B.getValue());}}});this.monthField.render(this.el.select('.roo-date-split-field-month',true).first(),null);this.yearField=new Roo.bootstrap.form.ComboBox({allowBlank:this.yearAllowBlank,alwaysQuery:true,displayField:'value',editable:false,fieldLabel:'',forceSelection:true,mode:'local',placeholder:this.yearPlaceholder,selectOnFocus:true,tpl:'
    {value}
    ',triggerAction:'all',typeAhead:true,valueField:'value',store:new Roo.data.SimpleStore({data:(function(){var C=[]; B.fireEvent('years',B,C);return C;})(),fields:['value']}),listeners:{select:function(C,D,E){B.setValue(B.getValue());}}});this.yearField.render(this.el.select('.roo-date-split-field-year',true).first(),null);},setValue:function(v,A){this.inputEl.dom.value=v; var f=A||(this.yearFormat+'-'+this.monthFormat+'-'+this.dayFormat);var d=Date.parseDate(v,f);if(!d){this.validate();return;}this.setDay(d.format(this.dayFormat));this.setMonth(d.format(this.monthFormat));this.setYear(d.format(this.yearFormat));this.validate(); return;},setDay:function(v){this.dayField.setValue(v);this.inputEl.dom.value=this.getValue();this.validate();return;},setMonth:function(v){this.monthField.setValue(v,true);this.inputEl.dom.value=this.getValue();this.validate();return;},setYear:function(v){this.yearField.setValue(v); @@ -1543,11 +1705,11 @@ if(this.href.length){A+=' roo-brick-link';}if(this.bgimage.length){A+=' roo-bric A.setHeight(A.getWidth()+A.getPadding('tb'));if(this.bgimage.length){var B=this.el.select('.roo-brick-image-view',true).first();B.setWidth(A.getWidth());if(this.square){B.setHeight(A.getWidth());}this.el.setHeight(B.getHeight());A.setHeight(B.getHeight()); }},enter:function(e,el){e.preventDefault();if(this.bgimage.length){this.el.select('.roo-brick-paragraph',true).first().setOpacity(0.9,true);this.el.select('.roo-brick-image-view',true).first().setOpacity(0.1,true);}},leave:function(e,el){e.preventDefault(); if(this.bgimage.length){this.el.select('.roo-brick-paragraph',true).first().setOpacity(0,true);this.el.select('.roo-brick-image-view',true).first().setOpacity(1,true);}}}); -// Roo/bootstrap/NumberField.js -Roo.bootstrap.NumberField=function(A){Roo.bootstrap.NumberField.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.NumberField,Roo.bootstrap.Input,{allowDecimals:true,decimalSeparator:".",decimalPrecision:2,allowNegative:true,allowZero:true,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,minText:"The minimum value for this field is {0}",maxText:"The maximum value for this field is {0}",nanText:"{0} is not a valid number",thousandsDelimiter:false,valueAlign:"left",getAutoCreate:function(){var A={tag:'input',type:'hidden',id:Roo.id(),cls:'hidden-number-input'} -;if(this.name){A.name=this.name;}this.name='';var B=Roo.bootstrap.NumberField.superclass.getAutoCreate.call(this);this.name=A.name;if(B.cn.length>0){B.cn.push(A);}return B;},initEvents:function(){Roo.bootstrap.NumberField.superclass.initEvents.call(this); +// Roo/bootstrap/form/NumberField.js +Roo.bootstrap.form.NumberField=function(A){Roo.bootstrap.form.NumberField.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.form.NumberField,Roo.bootstrap.form.Input,{allowDecimals:true,decimalSeparator:".",decimalPrecision:2,allowNegative:true,allowZero:true,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,minText:"The minimum value for this field is {0}",maxText:"The maximum value for this field is {0}",nanText:"{0} is not a valid number",thousandsDelimiter:false,valueAlign:"left",getAutoCreate:function(){var A={tag:'input',type:'hidden',id:Roo.id(),cls:'hidden-number-input'} +;if(this.name){A.name=this.name;}this.name='';var B=Roo.bootstrap.form.NumberField.superclass.getAutoCreate.call(this);this.name=A.name;if(B.cn.length>0){B.cn.push(A);}return B;},initEvents:function(){Roo.bootstrap.form.NumberField.superclass.initEvents.call(this); var A="0123456789";if(this.allowDecimals){A+=this.decimalSeparator;}if(this.allowNegative){A+="-";}if(this.thousandsDelimiter){A+=",";}this.stripCharsRe=new RegExp('[^'+A+']','gi');var B=function(e){var k=e.getKey();var c=e.getCharCode();if((String.fromCharCode(c)=='.'||String.fromCharCode(c)=='-')&&A.indexOf(String.fromCharCode(c))===-1){e.stopEvent(); -return;}if(!Roo.isIE&&(e.isSpecialKey()||k==e.BACKSPACE||k==e.DELETE)){return;}if(A.indexOf(String.fromCharCode(c))===-1){e.stopEvent();}};this.el.on("keypress",B,this);},validateValue:function(A){if(!Roo.bootstrap.NumberField.superclass.validateValue.call(this,A)){return false; +return;}if(!Roo.isIE&&(e.isSpecialKey()||k==e.BACKSPACE||k==e.DELETE)){return;}if(A.indexOf(String.fromCharCode(c))===-1){e.stopEvent();}};this.el.on("keypress",B,this);},validateValue:function(A){if(!Roo.bootstrap.form.NumberField.superclass.validateValue.call(this,A)){return false; }var B=this.parseValue(A);if(isNaN(B)){this.markInvalid(String.format(this.nanText,A));return false;}if(Bthis.maxValue){this.markInvalid(String.format(this.maxText,this.maxValue)); return false;}return true;},getValue:function(){var v=this.hiddenEl().getValue();return this.fixPrecision(this.parseValue(v));},parseValue:function(A){if(this.thousandsDelimiter){A+="";r=new RegExp(",","g");A=A.replace(r,"");}A=parseFloat(String(A).replace(this.decimalSeparator,".")); return isNaN(A)?'':A;},fixPrecision:function(A){if(this.thousandsDelimiter){A+="";r=new RegExp(",","g");A=A.replace(r,"");}var B=isNaN(A);if(!this.allowDecimals||this.decimalPrecision==-1||B||!A){return B?'':A;}return parseFloat(A).toFixed(this.decimalPrecision); @@ -1564,8 +1726,8 @@ this.nextIndicator=this.el.select('.roo-document-slider-next i',true).first();th },initial:function(){if(this.files.length){this.indicator=1;this.update()}this.fireEvent('initial',this);},update:function(){this.imageEl.attr('src',this.files[this.indicator-1]);this.titleEl.dom.innerHTML=String.format('{0} / {1}',this.indicator,this.files.length); this.prevIndicator.show();if(this.indicator==1){this.prevIndicator.hide();}this.nextIndicator.show();if(this.indicator==this.files.length){this.nextIndicator.hide();}this.thumbEl.scrollTo('top');this.fireEvent('update',this);},onClick:function(e){e.preventDefault(); this.fireEvent('click',this);},prev:function(e){e.preventDefault();this.indicator=Math.max(1,this.indicator-1);this.update();},next:function(e){e.preventDefault();this.indicator=Math.min(this.files.length,this.indicator+1);this.update();}}); -// Roo/bootstrap/RadioSet.js -Roo.bootstrap.RadioSet=function(A){Roo.bootstrap.RadioSet.superclass.constructor.call(this,A);this.radioes=[];Roo.bootstrap.RadioSet.register(this);this.addEvents({check:true,click:true});};Roo.extend(Roo.bootstrap.RadioSet,Roo.bootstrap.Input,{radioes:false,inline:true,weight:'',indicatorpos:'left',getAutoCreate:function(){var A={tag:'label',cls:'roo-radio-set-label',cn:[{tag:'span',html:this.fieldLabel} +// Roo/bootstrap/form/RadioSet.js +Roo.bootstrap.form.RadioSet=function(A){Roo.bootstrap.form.RadioSet.superclass.constructor.call(this,A);this.radioes=[];Roo.bootstrap.form.RadioSet.register(this);this.addEvents({check:true,click:true});};Roo.extend(Roo.bootstrap.form.RadioSet,Roo.bootstrap.form.Input,{radioes:false,inline:true,weight:'',indicatorpos:'left',getAutoCreate:function(){var A={tag:'label',cls:'roo-radio-set-label',cn:[{tag:'span',html:this.fieldLabel} ]};if(Roo.bootstrap.version==3){if(this.indicatorpos=='left'){A.cn.unshift({tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'});}else{A.cn.push({tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'} );}}var B={tag:'div',cls:'roo-radio-set-items'};var C=(!this.labelAlign)?this.parentLabelAlign():this.labelAlign;if(C==='left'&&this.fieldLabel.length){B={cls:"roo-radio-set-right",cn:[B]};if(this.labelWidth>12){A.style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth; }if(this.labellg>0){A.cls+=' col-lg-'+this.labellg;B.cls+=' col-lg-'+(12-this.labellg);}if(this.labelmd>0){A.cls+=' col-md-'+this.labelmd;B.cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){A.cls+=' col-sm-'+this.labelsm;B.cls+=' col-sm-'+(12-this.labelsm); @@ -1578,8 +1740,8 @@ this.indicatorEl().addClass('invisible');}if(Roo.bootstrap.version==3){this.el.r },markInvalid:function(A){if(this.allowBlank||this.disabled){return;}if(this.labelEl.isVisible(true)&&this.indicatorEl()){this.indicatorEl().removeClass('invisible');this.indicatorEl().addClass('visible');}if(Roo.bootstrap.version==3){this.el.removeClass([this.invalidClass,this.validClass]); this.el.addClass(this.invalidClass);}else{this.el.removeClass(['is-invalid','is-valid']);this.el.addClass(['is-invalid']);}this.fireEvent('invalid',this,A);},setValue:function(v,A){if(this.value===v){return;}this.value=v;if(this.rendered){this.inputEl().dom.value=(v===null||v===undefined?'':v); }Roo.each(this.radioes,function(i){i.checked=false;i.el.removeClass('checked');});Roo.each(this.radioes,function(i){if(i.value===v||i.value.toString()===v.toString()){i.checked=true;i.el.addClass('checked');if(A!==true){this.fireEvent('check',this,i);}return false; -}},this);this.validate();},clearInvalid:function(){if(!this.el||this.preventMark){return;}this.el.removeClass([this.invalidClass]);this.fireEvent('valid',this);}});Roo.apply(Roo.bootstrap.RadioSet,{groups:{},register:function(A){this.groups[A.name]=A;},get:function(A){if(typeof(this.groups[A])=='undefined'){return false; -}return this.groups[A];}}); +}},this);this.validate();},clearInvalid:function(){if(!this.el||this.preventMark){return;}this.el.removeClass([this.invalidClass]);this.fireEvent('valid',this);}});Roo.apply(Roo.bootstrap.form.RadioSet,{groups:{},register:function(A){this.groups[A.name]=A; +},get:function(A){if(typeof(this.groups[A])=='undefined'){return false;}return this.groups[A];}}); // Roo/bootstrap/SplitBar.js Roo.bootstrap.SplitBar=function(A){this.el=Roo.get(A.dragElement,true);this.el.dom.unselectable="on";this.resizingEl=Roo.get(A.resizingElement,true);this.orientation=A.orientation||Roo.bootstrap.SplitBar.HORIZONTAL;this.minSize=0;this.maxSize=2000;this.animate=false; this.useShim=false;this.shim=null;if(!A.existingProxy){this.proxy=Roo.bootstrap.SplitBar.createProxy(this.orientation);}else{this.proxy=Roo.get(A.existingProxy).dom;}this.dd=new Roo.dd.DDProxy(this.el.dom.id,"XSplitBars",{dragElId:this.proxy.id});this.dd.b4StartDrag=this.onStartProxyDrag.createDelegate(this); @@ -1600,10 +1762,8 @@ if(B){B(s,A);}}else{s.resizingEl.setHeight(A,true,.1,B,'easeOut');}}}};Roo.boots },getElementSize:function(s){return this.basic.getElementSize(s);},setElementSize:function(s,A,B){this.basic.setElementSize(s,A,this.moveSplitter.createDelegate(this,[s]));},moveSplitter:function(s){var A=Roo.bootstrap.SplitBar;switch(s.placement){case A.LEFT:s.el.setX(s.resizingEl.getRight()); break;case A.RIGHT:s.el.setStyle("right",(this.container.getWidth()-s.resizingEl.getLeft())+"px");break;case A.TOP:s.el.setY(s.resizingEl.getBottom());break;case A.BOTTOM:s.el.setY(s.resizingEl.getTop()-s.el.getHeight());break;}}};Roo.bootstrap.SplitBar.VERTICAL=1; Roo.bootstrap.SplitBar.HORIZONTAL=2;Roo.bootstrap.SplitBar.LEFT=1;Roo.bootstrap.SplitBar.RIGHT=2;Roo.bootstrap.SplitBar.TOP=3;Roo.bootstrap.SplitBar.BOTTOM=4; -// Roo/bootstrap/layout/layout-ns.js -Roo.namespace("Roo.bootstrap.layout"); // Roo/bootstrap/layout/Manager.js -Roo.bootstrap.layout.Manager=function(A){Roo.bootstrap.layout.Manager.superclass.constructor.call(this,A);this.monitorWindowResize=true;this.regions={};this.addEvents({"layout":true,"regionresized":true,"regioncollapsed":true,"regionexpanded":true});this.updating=false; +Roo.bootstrap.layout.Manager=function(A){this.monitorWindowResize=true;Roo.bootstrap.layout.Manager.superclass.constructor.call(this,A);this.regions={};this.addEvents({"layout":true,"regionresized":true,"regioncollapsed":true,"regionexpanded":true});this.updating=false; if(A.el){this.el=Roo.get(A.el);this.initEvents();}};Roo.extend(Roo.bootstrap.layout.Manager,Roo.bootstrap.Component,{regions:null,monitorWindowResize:true,updating:false,onRender:function(ct,A){if(!this.el){this.el=Roo.get(ct);this.initEvents();}},initEvents:function(){if(this.el.dom==document.body&&Roo.isIE&&!config.allowScroll){document.body.scroll="no"; }else if(this.el.dom!=document.body&&this.el.getStyle('position')=='static'){this.el.position('relative');}this.id=this.el.id;this.el.addClass("roo-layout-container");Roo.EventManager.onWindowResize(this.onWindowResize,this,true);if(this.el.dom!=document.body){this.el.on('resize',this.layout,this); this.el.on('show',this.layout,this);}},isUpdating:function(){return this.updating;},beginUpdate:function(){this.updating=true;},endUpdate:function(A){this.updating=false;if(!A){this.layout();}},layout:function(){},onRegionResized:function(A,B){this.fireEvent("regionresized",A,B); @@ -1713,16 +1873,14 @@ Roo.bootstrap.layout.West=function(A){A.region="west";A.cursor="w-resize";Roo.bo }};Roo.extend(Roo.bootstrap.layout.West,Roo.bootstrap.layout.Split,{orientation:Roo.bootstrap.SplitBar.HORIZONTAL,onRender:function(A,B){Roo.bootstrap.layout.West.superclass.onRender.call(this,A,B);var C=this.config.initialSize||this.config.width;if(typeof C!="undefined"){this.el.setWidth(C); }},getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var A=this.el.getBox();if(A.width==0){A.width=this.config.width;}if(this.split){A.width+=this.split.el.getWidth();}return A;},updateBox:function(A){if(this.split&&!this.collapsed){var sw=this.split.el.getWidth(); A.width-=sw;this.split.el.setLeft(A.x+A.width);this.split.el.setTop(A.y);this.split.el.setHeight(A.height);}if(this.collapsed){this.updateBody(null,A.height);}Roo.bootstrap.layout.Region.prototype.updateBox.call(this,A);}}); -// Roo/bootstrap/panel/panel-ns.js -Roo.namespace("Roo.bootstrap.panel"); // Roo/bootstrap/panel/Content.js Roo.bootstrap.panel.Content=function(A){this.tpl=A.tpl||false;var el=A.el;var B=A.content;if(A.autoCreate){el=Roo.id();}this.el=Roo.get(el);if(!this.el&&A&&A.autoCreate){if(typeof A.autoCreate=="object"){if(!A.autoCreate.id){A.autoCreate.id=A.id||el;}this.el=Roo.DomHelper.append(document.body,A.autoCreate,true); }else{var C={tag:"div",cls:(A.cls||'')+(A.background?' bg-'+A.background:'')+" roo-layout-inactive-content",id:A.id||el};if(A.iframe){C.cn=[{tag:'iframe',style:'border: 0px',src:'about:blank'}];}if(A.html){C.html=A.html;}this.el=Roo.DomHelper.append(document.body,C,true); if(A.iframe){this.iframeEl=this.el.select('iframe',true).first();}}}this.closable=false;this.loaded=false;this.active=false;if(A.toolbar&&!A.toolbar.el&&A.toolbar.xtype){this.toolbar=new A.toolbar.xns[A.toolbar.xtype](A.toolbar);this.wrapEl=this.el;var ti=[]; if(A.toolbar.items){ti=A.toolbar.items;delete A.toolbar.items;}var D=[];this.toolbar.render(this.wrapEl,'before');for(var i=0;i=0){var s=k.split('-');for(var i=0;i"+this.title[k]+"";}}else{t+=""+this.title[k]+""; }}return t;},setTitle:function(A){this.title=A;if(this.region){this.region.updatePanelTitle(this,A);}},isClosable:function(){return this.closable;},beforeSlide:function(){this.el.clip();this.resizeEl.clip();},afterSlide:function(){this.el.unclip();this.resizeEl.unclip(); },refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate();}},destroy:function(){this.el.removeAllListeners();var A=document.createElement("span");A.appendChild(this.el.dom);A.innerHTML="";this.el.remove();this.el=null;},form:false,view:false,getChildContainer:function(){return this.getEl(); -}}); +},onScroll:function(e){this.fireEvent('scroll',this,e);}}); // Roo/bootstrap/panel/Grid.js Roo.bootstrap.panel.Grid=function(A){this.wrapper=Roo.DomHelper.append(document.body,{tag:"div",cls:"roo-layout-grid-wrapper roo-layout-inactive-content"},true);A.el=this.wrapper;if(A.container){this.wrapper.setStyle("overflow","hidden");this.wrapper.addClass('roo-grid-container'); }if(A.toolbar){var B=this.wrapper.createChild();this.toolbar=Roo.factory(A.toolbar);var ti=[];if(A.toolbar.items){ti=A.toolbar.items;delete A.toolbar.items;}var C=[];this.toolbar.render(B);for(var i=0;i0){J.cls+=' col-xs-'+this.labelxs;H.cls+=' col-xs-'+(12-this.labelxs);}}}C.cn=[J,H];var L=this;['xs','sm','md','lg'].map(function(M){if(L[M]){C.cls+=' col-'+M+'-'+L[M];}});this.store=new Roo.data.Store({proxy:new Roo.data.MemoryProxy({}),reader:new Roo.data.JsonReader({fields:[{'name':'name','type':'string'} ,{'name':'iso2','type':'string'},{'name':'dialCode','type':'string'},{'name':'priority','type':'string'},{'name':'areaCodes','type':'string'}]})});if(!this.preferedCountries){this.preferedCountries=['hk','gb','us'];}var p=this.preferedCountries.reverse(); if(p){for(var i=0;ithis.maxValue){this.markInvalid(String.format(this.maxText,this.maxValue)); return false;}return true;},validate:function(){if(this.disabled||this.allowBlank){this.markValid();return true;}var A=this.getCurrency();if(this.validateValue(this.getRawValue())&&A.length){this.markValid();return true;}this.markInvalid();return false;},getName:function(){return this.name; },beforeBlur:function(){if(!this.castInt){return;}var v=this.parseValue(this.getRawValue());if(v||v==0){this.setValue(v);}},onBlur:function(){this.beforeBlur();if(!Roo.isOpera&&this.focusClass){}this.hasFocus=false;if(this.validationEvent!==false&&this.validateOnBlur&&this.validationEvent!="blur"){this.validate(); @@ -1880,3 +2038,14 @@ var c3=this.calculateControlPoints(A[1],A[2],A[3],C).c1;return new Bezier(A[1],c if(i>0){var C=cx-px;var D=cy-py;B+=Math.sqrt(C*C+D*D);}px=cx;py=cy;}return B;};Bezier.prototype.point=function(t,A,c1,c2,B){return (A*(1.0-t)*(1.0-t)*(1.0-t))+(3.0*c1*(1.0-t)*(1.0-t)*t)+(3.0*c2*(1.0-t)*t*t)+(B*t*t*t);};return Bezier;}()),throttleStroke:function(fn,A){if(A===void 0){A=250; }var B=0;var C=null;var D;var E;var F;var G=function(){B=Date.now();C=null;D=fn.apply(E,F);if(!C){E=null;F=[];}};return function H(){var I=[];for(var _i=0;_iA){if(C){clearTimeout(C); C=null;}B=J;D=fn.apply(E,F);if(!C){E=null;F=[];}}else if(!C){C=window.setTimeout(G,K);}return D;};}}); +// Roo/bootstrap/form/deprecated.js +Roo.bootstrap.Form=Roo.bootstrap.form.Form;Roo.bootstrap.Input=Roo.bootstrap.form.Input;Roo.bootstrap.TextArea=Roo.bootstrap.form.TextArea;Roo.bootstrap.TriggerField=Roo.bootstrap.form.TriggerField;Roo.bootstrap.ComboBox=Roo.bootstrap.form.ComboBox;Roo.bootstrap.DateField=Roo.bootstrap.form.DateField; +Roo.bootstrap.TimeField=Roo.bootstrap.form.TimeField;Roo.bootstrap.MonthField=Roo.bootstrap.form.MonthField;Roo.bootstrap.CheckBox=Roo.bootstrap.form.CheckBox;Roo.bootstrap.Radio=Roo.bootstrap.form.Radio;Roo.bootstrap.RadioSet=Roo.bootstrap.form.RadioSet; +Roo.bootstrap.SecurePass=Roo.bootstrap.form.SecurePass;Roo.bootstrap.FieldLabel=Roo.bootstrap.form.FieldLabel;Roo.bootstrap.DateSplitField=Roo.bootstrap.form.DateSplitField;Roo.bootstrap.NumberField=Roo.bootstrap.form.NumberField;Roo.bootstrap.PhoneInput=Roo.bootstrap.form.PhoneInput; +Roo.bootstrap.PhoneInputData=Roo.bootstrap.form.PhoneInputData;Roo.bootstrap.MoneyField=Roo.bootstrap.form.MoneyField;Roo.bootstrap.HtmlEditor=Roo.bootstrap.form.HtmlEditor;Roo.bootstrap.HtmlEditor.ToolbarStandard=Roo.bootstrap.form.HtmlEditorToolbarStandard; +Roo.bootstrap.Markdown=Roo.bootstrap.form.Markdown;Roo.bootstrap.CardUploader=Roo.bootstrap.form.CardUploader; +// Roo/bootstrap/nav/deprecated.js +Roo.bootstrap.Navbar=Roo.bootstrap.nav.Bar;Roo.bootstrap.NavGroup=Roo.bootstrap.nav.Group;Roo.bootstrap.NavHeaderbar=Roo.bootstrap.nav.Headerbar;Roo.bootstrap.NavItem=Roo.bootstrap.nav.Item;Roo.bootstrap.NavProgressBar=Roo.bootstrap.nav.ProgressBar;Roo.bootstrap.NavProgressBarItem=Roo.bootstrap.nav.ProgressBarItem; +Roo.bootstrap.NavSidebar=Roo.bootstrap.nav.Sidebar;Roo.bootstrap.NavSidebarItem=Roo.bootstrap.nav.SidebarItem;Roo.bootstrap.NavSimplebar=Roo.bootstrap.nav.Simplebar; +// Roo/bootstrap/menu/deprecated.js +Roo.bootstrap.Menu=Roo.bootstrap.menu.Menu;Roo.bootstrap.MenuItem=Roo.bootstrap.menu.Item;Roo.bootstrap.MenuSeparator=Roo.bootstrap.menu.Separator