Changed docs/src/Roo_htmleditor_FilterWord.js.html
[roojs1] / roojs-bootstrap.js
index 509c9b3..692ae87 100644 (file)
@@ -1,3 +1,5 @@
+// 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
@@ -64,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<pi.length;i++){if(this==pi[i]){continue;}if(pi[i].el.hasClass('roo-button')){pi[i].setActive(false);
+}Roo.log('button on click ');if(this.href===''||this.preventDefault){e.preventDefault();}if(this.group){if(this.pressed){return;}this.setActive(true);var pi=this.parent().items;for(var i=0;i<pi.length;i++){if(this==pi[i]){continue;}if(pi[i].el.hasClass('roo-button')){pi[i].setActive(false);
 }}this.fireEvent('click',this,e);return;}if(this.pressed===true||this.pressed===false){this.toggleActive(e);}this.fireEvent('click',this,e);},onDblClick:function(e){if(this.disabled){return;}if(this.preventDefault){e.preventDefault();}this.fireEvent('dblclick',this,e);
 },enable:function(){this.disabled=false;this.el.removeClass('disabled');this.el.dom.removeAttribute("disabled");},disable:function(){this.disabled=true;this.el.addClass('disabled');this.el.attr("disabled","disabled")},setActive:function(v){this.el[v?'addClass':'removeClass']('active');
 this.pressed=v;},toggleActive:function(e){this.setActive(!this.pressed);this.fireEvent('toggle',this,e,this.pressed);},isActive:function(){return this.el.hasClass('active');},setText:function(A){this.el.select('.roo-button-text',true).first().dom.innerHTML=A;
@@ -132,11 +134,11 @@ Roo.bootstrap.CardFooter=function(A){Roo.bootstrap.CardFooter.superclass.constru
 // Roo/bootstrap/CardImageTop.js
 Roo.bootstrap.CardImageTop=function(A){Roo.bootstrap.CardImageTop.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.CardImageTop,Roo.bootstrap.Element,{container_method:'getCardImageTop'});
 // Roo/bootstrap/ButtonUploader.js
-Roo.bootstrap.ButtonUploader=function(A){Roo.bootstrap.ButtonUploader.superclass.constructor.call(this,A);this.addEvents({'beforeselect':true,'uploaded':true});};Roo.extend(Roo.bootstrap.ButtonUploader,Roo.bootstrap.Button,{errorTimeout:3000,images:false,fileCollection:false,allowBlank:true,multiple:true,getAutoCreate:function(){var im={tag:'input',type:'file',cls:'d-none  roo-card-upload-selector'}
-;if(this.multiple){im.multiple='multiple';}return {cls:'div',cn:[Roo.bootstrap.Button.prototype.getAutoCreate.call(this),im]};},initEvents:function(){Roo.bootstrap.Button.prototype.initEvents.call(this);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);},onClick:function(e){e.preventDefault();if(this.fireEvent('beforeselect',this)===false){return;}this.selectorEl.dom.click();},onFileSelected:function(e){e.preventDefault();
-if(typeof(this.selectorEl.dom.files)=='undefined'||!this.selectorEl.dom.files.length){return;}var A=Array.prototype.slice.call(this.selectorEl.dom.files);this.selectorEl.dom.value='';this.fireEvent('uploaded',this,A);},reset:function(){this.selectorEl}});
-
+Roo.bootstrap.ButtonUploader=function(A){Roo.bootstrap.ButtonUploader.superclass.constructor.call(this,A);this.addEvents({'beforeselect':true,'uploaded':true});};Roo.extend(Roo.bootstrap.ButtonUploader,Roo.bootstrap.Button,{errorTimeout:3000,images:false,fileCollection:false,allowBlank:true,multiple:true,getAutoCreate:function(){return {cls:'div',cn:[Roo.bootstrap.Button.prototype.getAutoCreate.call(this)]}
+;},initEvents:function(){Roo.bootstrap.Button.prototype.initEvents.call(this);this.urlAPI=(window.createObjectURL&&window)||(window.URL&&URL.revokeObjectURL&&URL)||(window.webkitURL&&webkitURL);var im={tag:'input',type:'file',cls:'d-none  roo-card-upload-selector'}
+;if(this.multiple){im.multiple='multiple';}this.selectorEl=Roo.get(document.body).createChild(im);this.selectorEl.on('change',this.onFileSelected,this);},onClick:function(e){e.preventDefault();if(this.fireEvent('beforeselect',this)===false){return;}this.selectorEl.dom.click();
+},onFileSelected:function(e){e.preventDefault();if(typeof(this.selectorEl.dom.files)=='undefined'||!this.selectorEl.dom.files.length){return;}var A=Array.prototype.slice.call(this.selectorEl.dom.files);this.selectorEl.dom.value='';this.fireEvent('uploaded',this,A);
+},reset:function(){this.selectorEl}});
 // Roo/bootstrap/Img.js
 Roo.bootstrap.Img=function(A){Roo.bootstrap.Img.superclass.constructor.call(this,A);this.addEvents({"click":true,"load":true});};Roo.extend(Roo.bootstrap.Img,Roo.bootstrap.Component,{imgResponsive:true,border:'',src:'about:blank',href:false,target:false,xsUrl:'',smUrl:'',mdUrl:'',lgUrl:'',backgroundContain:false,getAutoCreate:function(){if(this.src||(!this.xsUrl&&!this.smUrl&&!this.mdUrl&&!this.lgUrl)){return this.createSingleImg();
 }var A={tag:'div',cls:'roo-image-responsive-group',cn:[]};var B=this;Roo.each(['xs','sm','md','lg'],function(C){if(!B[C+'Url']){return;}var D={tag:'img',cls:(B.imgResponsive)?'img-responsive':'',html:B.html||A.html,src:B[C+'Url']};D.cls+=' roo-image-responsive-'+C;
@@ -185,7 +187,7 @@ xy=this.el.getAlignToXY(el,a[1]+'-'+a[0]+'?')}this.showAt(xy,B,false);},showAt:f
 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;}});
+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;}
 });
@@ -195,27 +197,27 @@ if(!this.el){var B=Roo.apply({},this.getAutoCreate());B.id=Roo.id();if(this.cls)
 }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<D.length;i++){C.push(this.addxtype(Roo.apply({},D[i])));}}this.items=C;this.initEvents();},getAutoCreate:function(){var A={cls:'modal-body '+(this.bodyOverflow?'overflow-auto':''),html:this.html||''};var B={tag:'h5',cls:'modal-title',html:this.title};if(this.specificTitle){B=this.title;
-}var C=[];if(this.allow_close&&Roo.bootstrap.version==3){C.push({tag:'button',cls:'close',html:'&times'});}C.push(B);if(this.editableTitle){C.push({cls:'form-control roo-editable-title d-none',tag:'input',type:'text'});}if(this.allow_close&&Roo.bootstrap.version==4){C.push({tag:'button',cls:'close',html:'&times'}
-);}var D='';if(this.size.length){D='modal-'+this.size;}var E=Roo.bootstrap.version==3?{cls:'modal-footer',cn:[{tag:'div',cls:'btn-'+this.buttonPosition}]}:{cls:'modal-footer'};var F={cls:"modal",cn:[{cls:"modal-dialog "+D,cn:[{cls:"modal-content",cn:[{cls:'modal-header',cn:C}
-,A,E]}]}]};if(this.animate){F.cls+=' fade';}return F;},getChildContainer:function(){return this.bodyEl;},getButtonContainer:function(){return Roo.bootstrap.version==4?this.el.select('.modal-footer',true).first():this.el.select('.modal-footer div',true).first();
+i<D.length;i++){D[i].monitorWindowResize=false;C.push(this.addxtype(Roo.apply({},D[i])));}}this.items=C;this.initEvents();},getAutoCreate:function(){var A={cls:'modal-body '+(this.bodyOverflow?'overflow-auto':''),html:this.html||''};var B={tag:'h5',cls:'modal-title',html:this.title}
+;if(this.specificTitle){B=this.title;}var C=[];if(this.allow_close&&Roo.bootstrap.version==3){C.push({tag:'button',cls:'close',html:'&times'});}C.push(B);if(this.editableTitle){C.push({cls:'form-control roo-editable-title d-none',tag:'input',type:'text'});
+}if(this.allow_close&&Roo.bootstrap.version==4){C.push({tag:'button',cls:'close',html:'&times'});}var D='';if(this.size.length){D='modal-'+this.size;}var E=Roo.bootstrap.version==3?{cls:'modal-footer',cn:[{tag:'div',cls:'btn-'+this.buttonPosition}]}:{cls:'modal-footer'}
+;var F={cls:"modal",cn:[{cls:"modal-dialog "+D,cn:[{cls:"modal-content",cn:[{cls:'modal-header',cn:C},A,E]}]}]};if(this.animate){F.cls+=' fade';}return F;},getChildContainer:function(){return this.bodyEl;},getButtonContainer:function(){return Roo.bootstrap.version==4?this.el.select('.modal-footer',true).first():this.el.select('.modal-footer div',true).first();
 },initEvents:function(){if(this.allow_close){this.closeEl.on('click',this.hide,this);}Roo.EventManager.onWindowResize(this.resize,this,true);if(this.editableTitle){this.headerEditEl=this.headerEl.select('.form-control',true).first();this.headerEl.on('click',function(){this.toggleHeaderInput(true)}
 ,this);this.headerEditEl.on('keyup',function(e){if([e.RETURN,e.TAB,e.ESC].indexOf(e.keyCode)>-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<A.length;i++){B+=A[i].offsetHeight;}return B;},toggleHeaderInput:function(A){if(!this.editableTitle){return;}if(A&&this.is_header_editing){return;}if(A){this.headerEditEl.dom.value=this.title;this.headerEditEl.removeClass('d-none');this.headerEditEl.dom.focus();
-this.titleEl.addClass('d-none');this.is_header_editing=true;return}this.title=this.headerEditEl.dom.value;this.headerEditEl.addClass('d-none');this.titleEl.removeClass('d-none');this.titleEl.dom.innerHTML=String.format('{0}',this.title);this.is_header_editing=false;
-this.fireEvent('titlechanged',this,this.title);}});Roo.apply(Roo.bootstrap.Modal,{OK:[{name:'ok',weight:'primary',html:'OK'}],YESNO:[{name:'no',html:'No'},{name:'yes',weight:'primary',html:'Yes'}],OKCANCEL:[{name:'cancel',html:'Cancel'},{name:'ok',weight:'primary',html:'OK'}
-],YESNOCANCEL:[{name:'yes',weight:'primary',html:'Yes'},{name:'no',html:'No'},{name:'cancel',html:'Cancel'}],zIndex:10001});
+}},setSize:function(w,h){if(!w&&!h){return;}this.resizeTo(w,h);(function(){this.items.forEach(function(e){e.layout?e.layout():false;});}).defer(100,this);},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<A.length;i++){B+=A[i].offsetHeight;}return B;},toggleHeaderInput:function(A){if(!this.editableTitle){return;}if(A&&this.is_header_editing){return;}if(A){this.headerEditEl.dom.value=this.title;this.headerEditEl.removeClass('d-none');
+this.headerEditEl.dom.focus();this.titleEl.addClass('d-none');this.is_header_editing=true;return}this.title=this.headerEditEl.dom.value;this.headerEditEl.addClass('d-none');this.titleEl.removeClass('d-none');this.titleEl.dom.innerHTML=String.format('{0}',this.title);
+this.is_header_editing=false;this.fireEvent('titlechanged',this,this.title);}});Roo.apply(Roo.bootstrap.Modal,{OK:[{name:'ok',weight:'primary',html:'OK'}],YESNO:[{name:'no',html:'No'},{name:'yes',weight:'primary',html:'Yes'}],OKCANCEL:[{name:'cancel',html:'Cancel'}
+,{name:'ok',weight:'primary',html:'OK'}],YESNOCANCEL:[{name:'yes',weight:'primary',html:'Yes'},{name:'no',html:'No'},{name:'cancel',html:'Cancel'}],zIndex:10001});
 // Roo/bootstrap/MessageBox.js
 Roo.bootstrap.MessageBox=function(){var A,B,C,D;var E,F,G,H,I,pp;var J,K,L;var M=function(Q){A.hide();Roo.callback(B.fn,B.scope||window,[Q,K.dom.value],1);};var N=function(){if(B&&B.cls){A.el.removeClass(B.cls);}};var O=function(b){var Q=0;if(!b){J["ok"].hide();
 J["cancel"].hide();J["yes"].hide();J["no"].hide();A.footerEl.hide();return Q;}A.footerEl.show();for(var k in J){if(typeof J[k]!="function"){if(b[k]){J[k].show();J[k].setText(typeof b[k]=="string"?b[k]:Roo.bootstrap.MessageBox.buttonText[k]);Q+=J[k].el.getWidth()+15;
@@ -279,8 +281,8 @@ if(this.href){A.href=this.href;}if(this.fa){A.html='<i class="fa fas fa-'+this.f
 }else if(this.fa){A.cn[0].html='<i class="fa fas fa-'+this.fa+'"></i> <span class="nav-html">'+A.cn[0].html+'</span>';}else if(this.glyphicon){A.cn[0].html='<span class="glyphicon glyphicon-'+this.glyphicon+'"></span> '+A.cn[0].html;}else{A.cn[0].cls+=" nav-html";
 }if(this.menu){A.cn[0].html+=" <span class='caret'></span>";}if(this.badge!==''){A.cn[0].html+=' <span class="badge badge-secondary">'+this.badge+'</span>';}}return A;},onRender:function(ct,A){if(Roo.bootstrap.version==4&&ct.dom.type!='ul'){this.tag='div';
 }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=='#'){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();
+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.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');
@@ -673,8 +675,8 @@ break;case 'date':da[c.name]=new Date();break;case 'float':da[c.name]=0.0;break;
 // Roo/data/DataProxy.js
 Roo.data.DataProxy=function(){this.addEvents({beforeload:true,load:true,loadexception:true});Roo.data.DataProxy.superclass.constructor.call(this);};Roo.extend(Roo.data.DataProxy,Roo.util.Observable);
 // Roo/data/MemoryProxy.js
-Roo.data.MemoryProxy=function(A){if(A.data){A=A.data;}Roo.data.MemoryProxy.superclass.constructor.call(this);this.data=A;};Roo.extend(Roo.data.MemoryProxy,Roo.data.DataProxy,{load:function(A,B,C,D,E){A=A||{};var F;try{F=B.readRecords(A.data?A.data:this.data);
-}catch(e){this.fireEvent("loadexception",this,E,null,e);C.call(D,null,E,false);return;}C.call(D,F,E,true);},update:function(A,B){}});
+Roo.data.MemoryProxy=function(A){var B=A;if(typeof(A)!='undefined'&&typeof(A.data)!='undefined'){B=A.data;}Roo.data.MemoryProxy.superclass.constructor.call(this);this.data=B;};Roo.extend(Roo.data.MemoryProxy,Roo.data.DataProxy,{load:function(A,B,C,D,E){A=A||{}
+;var F;try{F=B.readRecords(A.data?A.data:this.data);}catch(e){this.fireEvent("loadexception",this,E,null,e);C.call(D,null,E,false);return;}C.call(D,F,E,true);},update:function(A,B){}});
 // Roo/data/HttpProxy.js
 Roo.data.HttpProxy=function(A){Roo.data.HttpProxy.superclass.constructor.call(this);this.conn=A;this.useAjax=!A||!A.events;};Roo.extend(Roo.data.HttpProxy,Roo.data.DataProxy,{getConnection:function(){return this.useAjax?Roo.Ajax:this.conn;},load:function(A,B,C,D,E){if(this.fireEvent("beforeload",this,A)!==false){var o={params:A||{}
 ,request:{callback:C,scope:D,arg:E},reader:B,callback:this.loadResponse,scope:this};if(this.useAjax){Roo.applyIf(o,this.conn);if(this.activeRequest){Roo.Ajax.abort(this.activeRequest);}this.activeRequest=Roo.Ajax.request(o);}else{this.conn.request(o);}}else{C.call(D||this,null,E,false);
@@ -697,7 +699,8 @@ return Roo.emptyFn;};}(),readRecords:function(o){this.o=o;var s=this.meta,A=this
 }this.getRoot=s.root?this.getJsonAccessor(s.root):function(p){return p;};if(s.id){var g=this.getJsonAccessor(s.id);this.getId=function(I){var r=g(I);return (r===undefined||r==="")?null:r;};}else{this.getId=function(){return null;};}this.ef=[];for(var jj=0;
 jj<fl;jj++){f=fi[jj];var B=(f.mapping!==undefined&&f.mapping!==null)?f.mapping:f.name;this.ef[jj]=this.getJsonAccessor(B);}}var C=this.getRoot(o),c=C.length,D=c,E=true;if(s.totalProperty){var vt=parseInt(this.getTotal(o),10);if(!isNaN(vt)){D=vt;}}if(s.successProperty){var vs=this.getSuccess(o);
 if(vs===false||vs==='false'){E=false;}}var F=[];for(var i=0;i<c;i++){var n=C[i];var G={};var id=this.getId(n);for(var j=0;j<fl;j++){f=fi[j];var v=this.ef[j](n);if(!f.convert){Roo.log('missing convert for '+f.name);Roo.log(f);continue;}G[f.name]=f.convert((v!==undefined)?v:f.defaultValue);
-}var H=new A(G,id);H.json=n;F[i]=H;}return {raw:o,success:E,records:F,totalRecords:D};},toLoadData:function(A){var B=typeof(A.data.cn)=='undefined'?[]:A.data.cn;return {data:B,total:B.length};}});
+}if(!A){return {raw:{errorMsg:"JSON Reader Error: fields or metadata not available to create Record"},success:false,records:[],totalRecords:0};}var H=new A(G,id);H.json=n;F[i]=H;}return {raw:o,success:E,records:F,totalRecords:D};},toLoadData:function(A){var B=typeof(A.data.cn)=='undefined'?[]:A.data.cn;
+return {data:B,total:B.length};}});
 // Roo/data/ArrayReader.js
 Roo.data.ArrayReader=function(A,B){Roo.data.ArrayReader.superclass.constructor.call(this,A,B||A.fields);};Roo.extend(Roo.data.ArrayReader,Roo.data.JsonReader,{readRecords:function(o){var A=this.meta?this.meta.id:null;var B=this.recordType,C=B.prototype.fields;
 var D=[];var E=o;for(var i=0;i<E.length;i++){var n=E[i];var F={};var id=((A||A===0)&&n[A]!==undefined&&n[A]!==""?n[A]:null);for(var j=0,G=C.length;j<G;j++){var f=C.items[j];var k=f.mapping!==undefined&&f.mapping!==null?f.mapping:j;var v=n[k]!==undefined?n[k]:f.defaultValue;
@@ -1104,75 +1107,215 @@ pt.innerHTML=this.meterLabel+'&nbsp;'+this.pwdStrengths[B];this.errorMsg='';retu
 }break;case this.kDigit:if(A>='0'&&A<='9'){return true;}break;case this.kPunctuation:if('!@#$%^&*()_+-=\'";:[{]}|.>,</?`~'.indexOf(A)>=0){return true;}break;default:return false;}},IsLongEnough:function(A,B){return !(A==null||isNaN(B)||A.length<B);},SpansEnoughCharacterSets:function(A,nb){if(!this.IsLongEnough(A,nb)){return false;
 }var B=new Array(new this.CharacterSetChecks(this.kCapitalLetter),new this.CharacterSetChecks(this.kSmallLetter),new this.CharacterSetChecks(this.kDigit),new this.CharacterSetChecks(this.kPunctuation));for(var C=0;C<A.length;++C){for(var D=0;D<B.length;++D){if(!B[D].fResult&&this.isctype(A.charAt(C),B[D].type)){B[D].fResult=true;
 break;}}}var E=0;for(var D=0;D<B.length;++D){if(B[D].fResult){++E;}}if(E<nb){return false;}return true;},ClientSideStrongPassword:function(A){return this.IsLongEnough(A,8)&&this.SpansEnoughCharacterSets(A,3);},ClientSideMediumPassword:function(A){return this.IsLongEnough(A,7)&&this.SpansEnoughCharacterSets(A,2);
-},ClientSideWeakPassword:function(A){return this.IsLongEnough(A,6)||!this.IsLongEnough(A,0);}})
+},ClientSideWeakPassword:function(A){return this.IsLongEnough(A,6)||!this.IsLongEnough(A,0);}});
+// Roo/htmleditor/namespace.js
+Roo.htmleditor={};
+// Roo/htmleditor/Filter.js
+Roo.htmleditor.Filter=function(A){Roo.apply(this.cfg);};Roo.htmleditor.Filter.prototype={node:false,tag:false,replaceComment:false,replaceTag:false,walk:function(A){Roo.each(Array.from(A.childNodes),function(e){switch(true){case e.nodeType==8&&this.replaceComment!==false:this.replaceComment(e);
+return;case e.nodeType!=1:return;case this.tag===true:case e.tagName.indexOf(":")>-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<ar.length;
+i++){if(ar[i].nodeType==1){if((typeof(this.tag)=='object'&&this.tag.indexOf(ar[i].tagName)>-1)||(typeof(this.tag)=='string'&&this.tag==ar[i].tagName)){this.replaceTag(ar[i]);continue;}}}ar=Array.from(A.childNodes);for(var i=0;i<ar.length;i++){A.removeChild(ar[i]);
+A.parentNode.insertBefore(ar[i],A);if(this.tag!==false){this.walk(ar[i]);}}A.parentNode.removeChild(A);return false;}});
+// Roo/htmleditor/FilterParagraph.js
+Roo.htmleditor.FilterParagraph=function(A){this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterParagraph,Roo.htmleditor.Filter,{tag:'P',replaceTag:function(A){if(A.childNodes.length==1&&A.childNodes[0].nodeType==3&&A.childNodes[0].textContent.trim().length<1){A.parentNode.replaceChild(A.ownerDocument.createElement('BR'),A);
+return false;}var ar=Array.from(A.childNodes);for(var i=0;i<ar.length;i++){A.removeChild(ar[i]);A.parentNode.insertBefore(ar[i],A);}A.parentNode.insertBefore(A.ownerDocument.createElement('BR'),A);A.parentNode.insertBefore(A.ownerDocument.createElement('BR'),A);
+A.parentNode.removeChild(A);return false;}});
+// Roo/htmleditor/FilterSpan.js
+Roo.htmleditor.FilterSpan=function(A){this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterSpan,Roo.htmleditor.FilterKeepChildren,{tag:'SPAN',replaceTag:function(A){if(A.attributes&&A.attributes.length>0){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;i<B.length;i++){B.item(i).className="MsoListParagraph";
+}var C=A.getElementsByTagName('h2');for(var i=0;i<C.length;i++){if(C.item(i).getAttribute('style').match(/mso-list:/)){C.item(i).className="MsoListParagraph";}}B=A.getElementsByClassName('ql-indent-1');while(B.length){this.replaceDocBullet(B.item(0));}B=A.getElementsByClassName('MsoListParagraph');
+while(B.length){this.replaceDocBullet(B.item(0));}},replaceDocBullet:function(p){var ns=p,A=p.parentNode,B=A.ownerDocument,C=[];while(ns){if(ns.nodeType!=1){ns=ns.nextSibling;continue;}if(!ns.className.match(/(MsoListParagraph|ql-indent-1)/i)){break;}var D=ns.getElementsByTagName('span');
+if(!D.length){break;}var E=false;for(var i=0;i<D.length;i++){if(D[i].getAttribute('style').match(/mso-list/)){E=true;break;}}if(!E){break;}C.push(ns);ns=ns.nextSibling;}if(!C.length){ns.className="";return;}var ul=A.ownerDocument.createElement('ul');A.insertBefore(ul,p);
+var F=0;var G=[ul];var H=false;C.forEach(function(n,I){var J=n.getElementsByTagName('span');if(!J.length){A.removeChild(n);return;}var K={};for(var i=0;i<J.length;i++){K=this.styleToObject(J[i]);if(typeof(K['mso-list'])=='undefined'){continue;}J[i].parentNode.removeChild(J[i]);
+break;}K=this.styleToObject(n);if(typeof(K['mso-list'])=='undefined'){A.removeChild(n);return;}var L=(K['mso-list'].split(' ')[1].replace(/level/,'')*1)-1;if(L>F){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<cn.length;cn++){A.removeChild(cn[i]);nn.appendChild(cn[i]);}return true}})
+// Roo/htmleditor/FilterLongBr.js
+Roo.htmleditor.FilterLongBr=function(A){this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterLongBr,Roo.htmleditor.Filter,{tag:'BR',replaceTag:function(A){var ps=A.nextSibling;while(ps&&ps.nodeType==3&&ps.nodeValue.trim().length<1){ps=ps.nextSibling;}if(!ps&&['TD','TH','LI','H1','H2','H3','H4','H5','H6'].indexOf(A.parentNode.tagName)>-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<ar.length;i++){ar[i].removeAttribute(A);}}});
+// Roo/htmleditor/KeyEnter.js
+Roo.htmleditor.KeyEnter=function(A){Roo.apply(this,A);Roo.get(this.core.doc.body).on('keypress',this.keypress,this);};Roo.htmleditor.KeyEnter.prototype={core:false,keypress:function(e){if(e.charCode!=13&&e.charCode!=10){Roo.log([e.charCode,e]);return true;
+}e.preventDefault();var A=this.core.doc;var B=this.core.getSelection();var C=B.getRangeAt(0);var n=C.commonAncestorContainer;var pc=C.closest(['ol','ul']);var D=C.closest('li');if(!pc||e.ctrlKey){if(!e.ctrlKey){B.insertNode('br','after');}else{var br=A.createElement('br');
+br.className='clear';br.setAttribute('style','clear: both');B.insertNode(br,'after');}this.core.undoManager.addEvent();this.core.fireEditorEvent(e);return false;}if(D.innerText.trim()==''&&D.previousSibling&&D.previousSibling.nodeName=='LI'&&D.previousSibling.innerText.trim()==''){D.parentNode.removeChild(D.previousSibling);
+B.cursorAfter(pc);this.core.undoManager.addEvent();this.core.fireEditorEvent(e);return false;}var li=A.createElement('LI');li.innerHTML='&nbsp;';if(!D||!D.firstSibling){pc.appendChild(li);}else{D.parentNode.insertBefore(li,D.firstSibling);}B.cursorText(li.firstChild);
+this.core.undoManager.addEvent();this.core.fireEditorEvent(e);return false;}};
+// Roo/htmleditor/Block.js
+Roo.htmleditor.Block=function(A){};Roo.htmleditor.Block.factory=function(A){var cc=Roo.htmleditor.Block.cache;var id=Roo.get(A).id;if(typeof(cc[id])!='undefined'&&(!cc[id].node||cc[id].node.closest('body'))){Roo.htmleditor.Block.cache[id].readElement(A);return Roo.htmleditor.Block.cache[id];
+}var db=A.getAttribute('data-block');if(!db){db=A.nodeName.toLowerCase().toUpperCaseFirst();}var B=Roo.htmleditor['Block'+db];if(typeof(B)=='undefined'){Roo.log("OOps missing block : "+'Block'+db);return false;}Roo.htmleditor.Block.cache[id]=new B({node:A}
+);return Roo.htmleditor.Block.cache[id];};Roo.htmleditor.Block.initAll=function(A,B){if(typeof(B)=='undefined'){var ia=Roo.htmleditor.Block.initAll;ia(A,'table');ia(A,'td');ia(A,'figure');return;}Roo.each(Roo.get(A).query(B),function(e){Roo.htmleditor.Block.factory(e);
+},this);};Roo.htmleditor.Block.cache={};Roo.htmleditor.Block.prototype={node:false,friendly_name:'Based Block',deleteTitle:false,context:false,updateElement:function(A){Roo.DomHelper.update(A===undefined?this.node:A,this.toObject());},toHTML:function(){return Roo.DomHelper.markup(this.toObject());
+},getVal:function(A,B,C,D){var n=A;if(B!==true&&n.tagName!=B.toUpperCase()){n=A.getElementsByTagName(B).item(0);}if(!n){return '';}if(C===false){return n;}if(C=='html'){return n.innerHTML;}if(C=='style'){return n.style[D];}return n.hasAttribute(C)?n.getAttribute(C):'';
+},toObject:function(){return {};},readElement:function(A){}};
+// Roo/htmleditor/BlockFigure.js
+Roo.htmleditor.BlockFigure=function(A){if(A.node){this.readElement(A.node);this.updateElement(A.node);}Roo.apply(this,A);};Roo.extend(Roo.htmleditor.BlockFigure,Roo.htmleditor.Block,{image_src:'',align:'center',caption:'',caption_display:'block',width:'100%',cls:'',href:'',video_url:'',text_align:'left',friendly_name:'Image with caption',deleteTitle:"Delete Image and Caption",contextMenu:function(A){var B=function(){return Roo.htmleditor.Block.factory(A.tb.selectedNode);
+};var C=typeof(Roo.bootstrap)=='undefined'?Roo:Roo.bootstrap;var D=A.editorcore.syncValue;var E={};return [{xtype:'TextItem',text:"Source: ",xns:C.Toolbar},{xtype:'Button',text:'Change Image URL',listeners:{click:function(F,G){var b=B();Roo.MessageBox.show({title:"Image Source URL",msg:"Enter the url for the image",buttons:Roo.MessageBox.OKCANCEL,fn:function(H,I){if(H!='ok'){return;
+}b.image_src=I;b.updateElement();D();A.editorcore.onEditorEvent();},minWidth:250,prompt:true,modal:true,value:b.image_src});}},xns:C.Toolbar},{xtype:'Button',text:'Change Link URL',listeners:{click:function(F,G){var b=B();Roo.MessageBox.show({title:"Link URL",msg:"Enter the url for the link - leave blank to have no link",buttons:Roo.MessageBox.OKCANCEL,fn:function(H,I){if(H!='ok'){return;
+}b.href=I;b.updateElement();D();A.editorcore.onEditorEvent();},minWidth:250,prompt:true,modal:true,value:b.href});}},xns:C.Toolbar},{xtype:'Button',text:'Show Video URL',listeners:{click:function(F,G){Roo.MessageBox.alert("Video URL",B().video_url==''?'This image is not linked ot a video':'The image is linked to: <a target="_new" href="'+B().video_url+'">'+B().video_url+'</a>');
+}},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;r<this.no_row;r++){this.rows[r]=[];for(var c=0;c<this.no_col;c++){this.rows[r][c]=this.emptyCell();
+}}}};Roo.extend(Roo.htmleditor.BlockTable,Roo.htmleditor.Block,{rows:false,no_col:1,no_row:1,width:'100%',friendly_name:'Table',deleteTitle:'Delete Table',contextMenu:function(A){var B=function(){return Roo.htmleditor.Block.factory(A.tb.selectedNode);};var C=typeof(Roo.bootstrap)=='undefined'?Roo:Roo.bootstrap;
+var D=A.editorcore.syncValue;var E={};return [{xtype:'TextItem',text:"Width: ",xns:C.Toolbar},{xtype:'ComboBox',allowBlank:false,displayField:'val',editable:true,listWidth:100,triggerAction:'all',typeAhead:true,valueField:'val',width:100,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%'],['auto']],fields:['val'],xns:Roo.data}},{xtype:'TextItem',text:"Columns: ",xns:C.Toolbar},{xtype:'Button',text:'-',listeners:{click:function(F,e){A.editorcore.selectNode(A.tb.selectedNode);
+B().removeColumn();D();A.editorcore.onEditorEvent();}},xns:C.Toolbar},{xtype:'Button',text:'+',listeners:{click:function(F,e){A.editorcore.selectNode(A.tb.selectedNode);B().addColumn();D();A.editorcore.onEditorEvent();}},xns:C.Toolbar},{xtype:'TextItem',text:"Rows: ",xns:C.Toolbar}
+,{xtype:'Button',text:'-',listeners:{click:function(F,e){A.editorcore.selectNode(A.tb.selectedNode);B().removeRow();D();A.editorcore.onEditorEvent();}},xns:C.Toolbar},{xtype:'Button',text:'+',listeners:{click:function(F,e){B().addRow();D();A.editorcore.onEditorEvent();
+}},xns:C.Toolbar},{xtype:'Button',text:'Reset Column Widths',listeners:{click:function(F,e){B().resetWidths();D();A.editorcore.onEditorEvent();}},xns:C.Toolbar}];},toObject:function(){var A={tag:'table',contenteditable:'false','data-block':'Table',style:{width:this.width,border:'solid 1px #000','border-collapse':'collapse'}
+,cn:[{tag:'tbody',cn:[]}]};var B=0;Roo.each(this.rows,function(C){var tr={tag:'tr',style:{margin:'6px',border:'solid 1px #000',textAlign:'left'},cn:[]};A.cn[0].cn.push(tr);var nc=0;Roo.each(C,function(D){var td={tag:'td',contenteditable:'true','data-block':'Td',html:D.html,style:D.style}
+;if(D.colspan>1){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;i<c.rowspan;i++){if(typeof(A[B+i])=='undefined'){A[B+i]=[];}A[B+i][D]=c;}});},this);return A;},normalizeRow:function(A){var B=[];A.forEach(function(c){if(c.colspan<2){B.push(c);
+return;}for(var i=0;i<c.colspan;i++){B.push(c);}});return B;},deleteColumn:function(A){if(!A||A.type!='col'){return;}if(this.no_col<2){return;}this.rows.forEach(function(B){var C=this.normalizeRow(B);var D=C[A.col];if(D.colspan>1){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;i<this.no_col;i++){A.push(this.emptyCell());}this.rows.push(A);
+this.updateElement();},emptyCell:function(){return (new Roo.htmleditor.BlockTd({})).toObject();},removeNode:function(){return this.node;},resetWidths:function(){Array.from(this.node.getElementsByTagName('td')).forEach(function(n){var nn=Roo.htmleditor.Block.factory(n);
+nn.width='';nn.updateElement(n);});}})
+// Roo/htmleditor/BlockTd.js
+Roo.htmleditor.BlockTd=function(A){if(A.node){this.readElement(A.node);this.updateElement(A.node);}Roo.apply(this,A);};Roo.extend(Roo.htmleditor.BlockTd,Roo.htmleditor.Block,{node:false,width:'',textAlign:'left',valign:'top',colspan:1,rowspan:1,friendly_name:'Table Cell',deleteTitle:false,contextMenu:function(A){var B=function(){return Roo.htmleditor.Block.factory(A.tb.selectedNode);
+};var C=function(){return Roo.htmleditor.Block.factory(A.tb.selectedNode.closest('table'));};var lr=false;var D=function(){lr=A.editorcore.getSelection().getRangeAt(0);};var restoreSel=function(){if(lr){(function(){A.editorcore.focus();var cr=A.editorcore.getSelection();
+cr.removeAllRanges();cr.addRange(lr);A.editorcore.onEditorEvent();}).defer(10,this);}};var rooui=typeof(Roo.bootstrap)=='undefined'?Roo:Roo.bootstrap;var E=A.editorcore.syncValue;var F={};return [{xtype:'Button',text:'Edit Table',listeners:{click:function(){var t=A.tb.selectedNode.closest('table');
+A.editorcore.selectNode(t);A.editorcore.onEditorEvent();}}},{xtype:'TextItem',text:"Column Width: ",xns:rooui.Toolbar},{xtype:'Button',text:'-',listeners:{click:function(G,e){A.editorcore.selectNode(A.tb.selectedNode);B().shrinkColumn();E();A.editorcore.onEditorEvent();
+}},xns:rooui.Toolbar},{xtype:'Button',text:'+',listeners:{click:function(G,e){A.editorcore.selectNode(A.tb.selectedNode);B().growColumn();E();A.editorcore.onEditorEvent();}},xns:rooui.Toolbar},{xtype:'TextItem',text:"Vertical Align: ",xns:rooui.Toolbar},{xtype:'ComboBox',allowBlank:false,displayField:'val',editable:true,listWidth:100,triggerAction:'all',typeAhead:true,valueField:'val',width:100,name:'valign',listeners:{select:function(G,r,H){A.editorcore.selectNode(A.tb.selectedNode);
+var b=B();b.valign=r.get('val');b.updateElement();E();A.editorcore.onEditorEvent();}},xns:rooui.form,store:{xtype:'SimpleStore',data:[['top'],['middle'],['bottom']],fields:['val'],xns:Roo.data}},{xtype:'TextItem',text:"Merge Cells: ",xns:rooui.Toolbar},{xtype:'Button',text:'Right',listeners:{click:function(G,e){A.editorcore.selectNode(A.tb.selectedNode);
+B().mergeRight();E();A.editorcore.onEditorEvent();}},xns:rooui.Toolbar},{xtype:'Button',text:'Below',listeners:{click:function(G,e){A.editorcore.selectNode(A.tb.selectedNode);B().mergeBelow();E();A.editorcore.onEditorEvent();}},xns:rooui.Toolbar},{xtype:'TextItem',text:"| ",xns:rooui.Toolbar}
+,{xtype:'Button',text:'Split',listeners:{click:function(G,e){B().split();E();A.editorcore.selectNode(A.tb.selectedNode);A.editorcore.onEditorEvent();}},xns:rooui.Toolbar},{xtype:'Fill',xns:rooui.Toolbar},{xtype:'Button',text:'Delete',xns:rooui.Toolbar,menu:{xtype:'Menu',xns:rooui.menu,items:[{xtype:'Item',html:'Column',listeners:{click:function(G,e){var t=C();
+B().deleteColumn();E();A.editorcore.selectNode(t.node);A.editorcore.onEditorEvent();}},xns:rooui.menu},{xtype:'Item',html:'Row',listeners:{click:function(G,e){var t=C();B().deleteRow();E();A.editorcore.selectNode(t.node);A.editorcore.onEditorEvent();}},xns:rooui.menu}
+,{xtype:'Separator',xns:rooui.menu},{xtype:'Item',html:'Table',listeners:{click:function(G,e){var t=C();var nn=t.node.nextSibling||t.node.previousSibling;t.node.parentNode.removeChild(t.node);if(nn){A.editorcore.selectNode(nn,true);}A.editorcore.onEditorEvent();
+}},xns:rooui.menu}]}}];},toObject:function(){var A={tag:'td',contenteditable:'true','data-block':'Td',valign:this.valign,style:{'text-align':this.textAlign,border:'solid 1px rgb(0, 0, 0)','border-collapse':'collapse',padding:'6px','vertical-align':this.valign}
+,html:this.html};if(this.width!=''){A.width=this.width;A.style.width=this.width;}if(this.colspan>1){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:"&nbsp;"};},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<c.rowspan;j++){if(typeof(A[rn+j])=='undefined'){continue;}A[rn+j][cn]=c;for(var i=0;i<c.colspan;i++){A[rn+j][cn+i]=c;}}cn+=c.colspan;},this);rn++;},this);if(C){this.colWidths[0]=false;}
+return A;},mergeRight:function(){var tr=this.node.closest('tr');var i=Array.prototype.indexOf.call(tr.childNodes,this.node);if(i>=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;r<cd.row+cd.rowspan;r++){for(var c=cd.col;
+c<cd.col+cd.colspan;c++){if(r==cd.row&&c==cd.col){this.node.removeAttribute('rowspan');this.node.removeAttribute('colspan');}var B=this.node.cloneNode();B.removeAttribute('id');B.style.width=this.colWidths[c];B.innerHTML='';A[r][c]={cell:B,col:c,row:r,colspan:1,rowspan:1}
+;}}this.redrawAllCells(A);},redrawAllCells:function(A){var B=this.node.closest('tr').closest('table');var C=B.rows[0].parentNode;Array.from(B.rows).forEach(function(r,ri){Array.from(r.cells).forEach(function(ce,ci){ce.parentNode.removeChild(ce);});r.parentNode.removeChild(r);
+});for(var r=0;r<A.length;r++){var re=B.rows[r];var re=B.ownerDocument.createElement('tr');C.appendChild(re);for(var c=0;c<A[r].length;c++){if(A[r][c].cell===false){continue;}re.appendChild(A[r][c].cell);A[r][c].cell=false;}}},updateWidths:function(A){for(var r=0;
+r<A.length;r++){for(var c=0;c<A[r].length;c++){if(A[r][c].cell===false){continue;}if(this.colWidths[0]!=false&&A[r][c].colspan<2){var el=Roo.htmleditor.Block.factory(A[r][c].cell);el.width=Math.floor(this.colWidths[c])+'%';el.updateElement(el.node);}if(this.colWidths[0]!=false&&A[r][c].colspan>1){var el=Roo.htmleditor.Block.factory(A[r][c].cell);
+var B=0;for(var i=0;i<A[r][c].colspan;i++){B+=Math.floor(this.colWidths[c+i]);}el.width=B+'%';el.updateElement(el.node);}A[r][c].cell=false;}}},normalizeWidths:function(A){if(this.colWidths[0]===false){var nw=100.0/this.colWidths.length;this.colWidths.forEach(function(w,i){this.colWidths[i]=nw;
+},this);return;}var t=0,B=[];this.colWidths.forEach(function(w,i){this.colWidths[i]=this.colWidths[i]==''?0:(this.colWidths[i]+'').replace(/[^0-9]+/g,'')*1;var D=this.colWidths[i];if(D>0){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;i<A[this.cellData.row].length;i++){var c=A[this.cellData.row][i];if(c.row!=this.cellData.row){c.rowspan--;c.cell.setAttribute('rowspan',c.rowspan);continue;}if(c.rowspan>1){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;i<A.length;i++){var c=A[i][this.cellData.col];if(c.col!=this.cellData.col){A[i][this.cellData.col].colspan--;}else if(c.colspan>1){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,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:'',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='<style type="text/css">'+'body{border:0;margin:0;padding:3px;height:98%;cursor:text;}'+'</style>';}else{for(var i in this.stylesheets){st+='<link rel="stylesheet" href="'+this.stylesheets[i]+'" type="text/css">';}
-}st+='<style type="text/css">'+'IMG { cursor: pointer } '+'</style>';var A='roo-htmleditor-body';if(this.bodyCls.length){A+=' '+this.bodyCls;}return '<html><head>'+st+' </head><body contenteditable="true" data-enable-grammerly="true" class="'+A+'"></body></html>';
+});}else if(!this.stylesheets.length){st='<style type="text/css">'+'body{border:0;margin:0;padding:3px;height:98%;cursor:text;}'+'</style>';}else{for(var i in this.stylesheets){if(typeof(this.stylesheets[i])!='string'){continue;}st+='<link rel="stylesheet" href="'+this.stylesheets[i]+'" type="text/css">';
+}}st+='<style type="text/css">'+'IMG { cursor: pointer } '+'</style>';st+='<meta name="google" content="notranslate">';var A='notranslate roo-htmleditor-body';if(this.bodyCls.length){A+=' '+this.bodyCls;}return '<html  class="notranslate" translate="no"><head>'+st+' </head><body contenteditable="true" data-enable-grammerly="true" class="'+A+'"></body></html>';
 },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=='&nbsp;'){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='<div style="'+m[0]+'">'+A+'</div>';
-}}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=='&nbsp;'){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='<div style="'+m[0]+'">'+E+'</div>';}}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('<img src=" + url + ">');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(/&nbsp;/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('&#160;&#160;&#160;&#160;');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('<br />');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','&#160;&#160;&#160;&#160;');
-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;i<ar.length;i++){if((ar[i].nodeType==3)&&(!ar[i].data.length)){continue;
-}if(this.rangeIntersectsNode(A,ar[i])&&this.rangeCompareNode(A,ar[i])==3){D.push(ar[i]);continue;}if((ar[i].nodeType==1)&&this.rangeIntersectsNode(A,ar[i])&&(this.rangeCompareNode(A,ar[i])>0)){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"){if(!this.allowComments){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<A.attributes.length;i++){var I=A.attributes.item(i).name;if(!A.attributes.item(i).value.length){continue;
-}H.push(I+'="'+Roo.util.Format.htmlEncode(A.attributes.item(i).value)+'"');}G="<"+A.tagName+(H.length?(' '+H.join(' ')):'')+">";}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+="</"+F+">";}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('&#160;&#160;&#160;&#160;');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','&#160;&#160;&#160;&#160;');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;i<ar.length;
+i++){if((ar[i].nodeType==3)&&(!ar[i].data.length)){continue;}if(this.rangeIntersectsNode(A,ar[i])&&this.rangeCompareNode(A,ar[i])==3){D.push(ar[i]);continue;}if((ar[i].nodeType==1)&&this.rangeIntersectsNode(A,ar[i])&&(this.rangeCompareNode(A,ar[i])>0)){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,"&#8211;"],[8212,"&#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,"&#8211;"],[8212,"&#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/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}
@@ -1218,7 +1361,7 @@ 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<this.pageSize?1:Math.ceil(A/this.pageSize)}
-;},onLoadError:function(o){this.loading.enable();if(this.ds.events.loadexception.listeners.length<2){Roo.MessageBox.alert("Error loading",o.raw.errorMsg);}},onPagingKeydown:function(e){var k=e.getKey();var d=this.getPageData();if(k==e.RETURN){var v=this.field.dom.value,A;
+;},onLoadError:function(A,o){this.loading.enable();if(this.ds.events.loadexception.listeners.length<2){Roo.MessageBox.alert("Error loading",o.raw.errorMsg);}},onPagingKeydown:function(e){var k=e.getKey();var d=this.getPageData();if(k==e.RETURN){var v=this.field.dom.value,A;
 if(!v||isNaN(A=parseInt(v,10))){this.field.dom.value=d.activePage;return;}A=Math.min(Math.max(1,A),d.pages)-1;this.ds.load({params:{start:A*this.pageSize,limit:this.pageSize}});e.stopEvent();}else if(k==e.HOME||(k==e.UP&&e.ctrlKey)||(k==e.PAGEUP&&e.ctrlKey)||(k==e.RIGHT&&e.ctrlKey)||k==e.END||(k==e.DOWN&&e.ctrlKey)||(k==e.LEFT&&e.ctrlKey)||(k==e.PAGEDOWN&&e.ctrlKey)){var A=(k==e.HOME||(k==e.DOWN&&e.ctrlKey)||(k==e.LEFT&&e.ctrlKey)||(k==e.PAGEDOWN&&e.ctrlKey))?1:d.pages;
 this.field.dom.value=A;this.ds.load({params:{start:(A-1)*this.pageSize,limit:this.pageSize}});e.stopEvent();}else if(k==e.UP||k==e.RIGHT||k==e.PAGEUP||k==e.DOWN||k==e.LEFT||k==e.PAGEDOWN){var v=this.field.dom.value,A;var B=(e.shiftKey)?10:1;if(k==e.DOWN||k==e.LEFT||k==e.PAGEDOWN){B*=-1;
 }if(!v||isNaN(A=parseInt(v,10))){this.field.dom.value=d.activePage;return;}else if(parseInt(v,10)+B>=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}
@@ -1240,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);
@@ -1618,7 +1763,7 @@ if(B){B(s,A);}}else{s.resizingEl.setHeight(A,true,.1,B,'easeOut');}}}};Roo.boots
 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/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);
@@ -1738,25 +1883,25 @@ delete A.toolbar;}if(typeof A=="string"){this.title=A;}else{Roo.apply(this,A);}i
 if(this.view&&typeof(this.view.xtype)!='undefined'){this.view.el=this.el.appendChild(document.createElement("div"));this.view=Roo.factory(this.view);this.view.render&&this.view.render(false,'');}this.fireEvent('render',this);};Roo.extend(Roo.bootstrap.panel.Content,Roo.bootstrap.Component,{cls:'',background:'',tabTip:'',iframe:false,iframeEl:false,resizeEl:false,setRegion:function(A){this.region=A;
 this.setActiveClass(A&&!this.background);},setActiveClass:function(A){if(A){this.el.replaceClass("roo-layout-inactive-content","roo-layout-active-content");this.el.setStyle('position','relative');}else{this.el.replaceClass("roo-layout-active-content","roo-layout-inactive-content");
 this.el.setStyle('position','absolute');}},getToolbar:function(){return this.toolbar;},setActiveState:function(A){this.active=A;this.setActiveClass(A);if(!A){if(this.fireEvent("deactivate",this)===false){return false;}return true;}this.fireEvent("activate",this);
-return true;},setContent:function(A,B){if(this.iframe){return;}this.el.update(A,B);},ignoreResize:function(w,h){return false;if(this.lastSize&&this.lastSize.width==w&&this.lastSize.height==h){return true;}else{this.lastSize={width:w,height:h};return false;
-}},getUpdateManager:function(){if(this.iframe){return false;}return this.el.getUpdateManager();},load:function(){if(this.iframe){return this;}var um=this.el.getUpdateManager();um.update.apply(um,arguments);return this;},setUrl:function(A,B,C){if(this.iframe){this.iframeEl.dom.src=A;
-return false;}if(this.refreshDelegate){this.removeListener("activate",this.refreshDelegate);}this.refreshDelegate=this._handleRefresh.createDelegate(this,[A,B,C]);this.on("activate",this.refreshDelegate);return this.el.getUpdateManager();},_handleRefresh:function(A,B,C){if(!C||!this.loaded){var D=this.el.getUpdateManager();
-D.update(A,B,this._setLoaded.createDelegate(this));}},_setLoaded:function(){this.loaded=true;},getId:function(){return this.el.id;},getEl:function(){return this.wrapEl||this.el;},adjustForComponents:function(A,B){if(this.resizeEl!=this.el){A-=this.el.getFrameWidth('lr');
-B-=this.el.getFrameWidth('tb');}if(this.toolbar){var te=this.toolbar.getEl();te.setWidth(A);B-=te.getHeight();}if(this.footer){var te=this.footer.getEl();te.setWidth(A);B-=te.getHeight();}if(this.adjustments){A+=this.adjustments[0];B+=this.adjustments[1];
-}return {"width":A,"height":B};},setSize:function(A,B){if(this.fitToFrame&&!this.ignoreResize(A,B)){if(this.fitContainer&&this.resizeEl!=this.el){this.el.setSize(A,B);}var C=this.adjustForComponents(A,B);if(this.iframe){this.iframeEl.setSize(A,B);}this.resizeEl.setSize(this.autoWidth?"auto":C.width,this.autoHeight?"auto":C.height);
-this.fireEvent('resize',this,C.width,C.height);}},getTitle:function(){if(typeof(this.title)!='object'){return this.title;}var t='';for(var k in this.title){if(!this.title.hasOwnProperty(k)){continue;}if(k.indexOf('-')>=0){var s=k.split('-');for(var i=0;i<s.length;
-i++){t+="<span class='visible-"+s[i]+"'>"+this.title[k]+"</span>";}}else{t+="<span class='visible-"+k+"'>"+this.title[k]+"</span>";}}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);}});
+return true;},setContent:function(A,B){if(this.iframe){return;}this.el.update(A,B);},ignoreResize:function(w,h){if(this.lastSize&&this.lastSize.width==w&&this.lastSize.height==h){return true;}else{this.lastSize={width:w,height:h};return false;}},getUpdateManager:function(){if(this.iframe){return false;
+}return this.el.getUpdateManager();},load:function(){if(this.iframe){return this;}var um=this.el.getUpdateManager();um.update.apply(um,arguments);return this;},setUrl:function(A,B,C){if(this.iframe){this.iframeEl.dom.src=A;return false;}if(this.refreshDelegate){this.removeListener("activate",this.refreshDelegate);
+}this.refreshDelegate=this._handleRefresh.createDelegate(this,[A,B,C]);this.on("activate",this.refreshDelegate);return this.el.getUpdateManager();},_handleRefresh:function(A,B,C){if(!C||!this.loaded){var D=this.el.getUpdateManager();D.update(A,B,this._setLoaded.createDelegate(this));
+}},_setLoaded:function(){this.loaded=true;},getId:function(){return this.el.id;},getEl:function(){return this.wrapEl||this.el;},adjustForComponents:function(A,B){if(this.resizeEl!=this.el){A-=this.el.getFrameWidth('lr');B-=this.el.getFrameWidth('tb');}if(this.toolbar){var te=this.toolbar.getEl();
+te.setWidth(A);B-=te.getHeight();}if(this.footer){var te=this.footer.getEl();te.setWidth(A);B-=te.getHeight();}if(this.adjustments){A+=this.adjustments[0];B+=this.adjustments[1];}return {"width":A,"height":B};},setSize:function(A,B){if(this.fitToFrame&&!this.ignoreResize(A,B)){if(this.fitContainer&&this.resizeEl!=this.el){this.el.setSize(A,B);
+}var C=this.adjustForComponents(A,B);if(this.iframe){this.iframeEl.setSize(A,B);}this.resizeEl.setSize(this.autoWidth?"auto":C.width,this.autoHeight?"auto":C.height);this.fireEvent('resize',this,C.width,C.height);}},getTitle:function(){if(typeof(this.title)!='object'){return this.title;
+}var t='';for(var k in this.title){if(!this.title.hasOwnProperty(k)){continue;}if(k.indexOf('-')>=0){var s=k.split('-');for(var i=0;i<s.length;i++){t+="<span class='visible-"+s[i]+"'>"+this.title[k]+"</span>";}}else{t+="<span class='visible-"+k+"'>"+this.title[k]+"</span>";
+}}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;i<ti.length;i++){C.push(this.toolbar.addxtype(Roo.apply({}
 ,ti[i])));}this.toolbar.items=C;delete A.toolbar;}Roo.bootstrap.panel.Grid.superclass.constructor.call(this,A);A.grid.scrollBody=true;;A.grid.monitorWindowResize=false;A.grid.autoHeight=false;A.grid.autoWidth=false;this.grid=new A.grid.xns[A.grid.xtype](A.grid);
 if(A.background){this.on('activate',function(gp){if(!gp.grid.rendered){gp.grid.render(this.wrapper);gp.grid.getGridEl().replaceClass("roo-layout-inactive-content","roo-layout-component-panel");}});}else{this.grid.render(this.wrapper);this.grid.getGridEl().replaceClass("roo-layout-inactive-content","roo-layout-component-panel");
-}if(this.footer&&!this.footer.el&&this.footer.xtype){var D=this.grid.getView().getFooterPanel(true);this.footer.dataSource=this.grid.dataSource;this.footer=Roo.factory(this.footer,Roo);this.footer.render(D);}};Roo.extend(Roo.bootstrap.panel.Grid,Roo.bootstrap.panel.Content,{is_resizing:false,getId:function(){return this.grid.id;
-},getGrid:function(){return this.grid;},setSize:function(A,B){if(this.is_resizing){return;}this.is_resizing=true;if(!this.ignoreResize(A,B)){var C=this.grid;var D=this.adjustForComponents(A,B);var E=C.getGridEl();E.setSize(D.width,D.height);var F=C.getGridEl().select('tbody',true).first();
-var G=C.getGridEl().select('thead',true).first();var H=C.getGridEl().select('tfoot',true).first();if(H){D.height-=H.getHeight();}if(G){D.height-=G.getHeight();}F.setSize(D.width,D.height);var G=C.getGridEl().select('thead',true).first();C.autoSize();}this.is_resizing=false;
-},beforeSlide:function(){this.grid.getView().scroller.clip();},afterSlide:function(){this.grid.getView().scroller.unclip();},destroy:function(){this.grid.destroy();delete this.grid;Roo.bootstrap.panel.Grid.superclass.destroy.call(this);}});
+}if(this.footer&&!this.footer.el&&this.footer.xtype){var D=this.grid.getView().getFooterPanel(true);this.footer.dataSource=this.grid.dataSource;this.footer=Roo.factory(this.footer,Roo);this.footer.render(D);}};Roo.extend(Roo.bootstrap.panel.Grid,Roo.bootstrap.panel.Content,{getId:function(){return this.grid.id;
+},getGrid:function(){return this.grid;},setSize:function(A,B){var C=this.grid;var D=this.adjustForComponents(A,B);var E=C.getGridEl();E.setSize(D.width,D.height);var F=C.getGridEl().select('tbody',true).first();var G=C.getGridEl().select('thead',true).first();
+var H=C.getGridEl().select('tfoot',true).first();if(H){D.height-=H.getHeight();}if(G){D.height-=G.getHeight();}F.setSize(D.width,D.height);var G=C.getGridEl().select('thead',true).first();C.autoSize();},beforeSlide:function(){this.grid.getView().scroller.clip();
+},afterSlide:function(){this.grid.getView().scroller.unclip();},destroy:function(){this.grid.destroy();delete this.grid;Roo.bootstrap.panel.Grid.superclass.destroy.call(this);}});
 // Roo/bootstrap/panel/Nest.js
 Roo.bootstrap.panel.Nest=function(A){A.el=A.layout.getEl();Roo.bootstrap.panel.Nest.superclass.constructor.call(this,A);A.layout.monitorWindowResize=false;this.layout=A.layout;this.layout.getEl().addClass("roo-layout-nested-layout");this.layout.parent=this;
 };Roo.extend(Roo.bootstrap.panel.Nest,Roo.bootstrap.panel.Content,{layout:false,setSize:function(A,B){if(!this.ignoreResize(A,B)){var C=this.adjustForComponents(A,B);var el=this.layout.getEl();if(C.height<1){el.setWidth(C.width);}else{el.setSize(C.width,C.height);