docs/default.css
[roojs1] / roojs-bootstrap.js
index 531eb63..4803e5e 100644 (file)
@@ -986,8 +986,8 @@ if(this.faicon){A.cn[0].cls+=' fa '+this.faicon;}if(this.weight){A.cls+=' alert-
 },setIcon:function(A){if(this.faicon){this.el.select('.roo-alert-icon',true).first().removeClass(['fa','fa-'+this.faicon]);}this.faicon=Athis.el.select('.roo-alert-icon',true).first().addClass(['fa','fa-'+this.faicon]);},hide:function(){this.el.hide();},show:function(){this.el.show();
 }});
 // Roo/bootstrap/UploadCropbox.js
-Roo.bootstrap.UploadCropbox=function(A){Roo.bootstrap.UploadCropbox.superclass.constructor.call(this,A);this.addEvents({"beforeselectfile":true,"initial":true,"crop":true,"prepare":true,"exception":true,"beforeloadcanvas":true,"trash":true,"download":true,"footerbuttonclick":true,"resize":true,"rotate":true,"exception":true,"upload":true});
-this.buttons=this.buttons||Roo.bootstrap.UploadCropbox.footer.STANDARD;};Roo.extend(Roo.bootstrap.UploadCropbox,Roo.bootstrap.Component,{emptyText:'Click to upload image',rotateNotify:'Image is too small to rotate',errorTimeout:3000,scale:0,baseScale:1,rotate:0,dragable:false,pinching:false,mouseX:0,mouseY:0,cropData:false,minWidth:300,minHeight:300,file:false,exif:{},baseRotate:1,cropType:'image/jpeg',buttons:false,canvasLoaded:false,isDocument:false,getAutoCreate:function(){var A={tag:'div',cls:'roo-upload-cropbox',cn:[{tag:'div',cls:'roo-upload-cropbox-body',style:'cursor:pointer',cn:[{tag:'input',cls:'roo-upload-cropbox-selector',type:'file'},{tag:'div',cls:'roo-upload-cropbox-preview'},{tag:'div',cls:'roo-upload-cropbox-thumb'},{tag:'div',cls:'roo-upload-cropbox-empty-notify',html:this.emptyText},{tag:'div',cls:'roo-upload-cropbox-error-notify alert alert-danger',html:this.rotateNotify}]},{tag:'div',cls:'roo-upload-cropbox-footer',cn:{tag:'div',cls:'btn-group btn-group-justified roo-upload-cropbox-btn-group',cn:[]}}]};
+Roo.bootstrap.UploadCropbox=function(A){Roo.bootstrap.UploadCropbox.superclass.constructor.call(this,A);this.addEvents({"beforeselectfile":true,"initial":true,"crop":true,"prepare":true,"exception":true,"beforeloadcanvas":true,"trash":true,"download":true,"footerbuttonclick":true,"resize":true,"rotate":true,"inspect":true,"upload":true,"arrange":true});
+this.buttons=this.buttons||Roo.bootstrap.UploadCropbox.footer.STANDARD;};Roo.extend(Roo.bootstrap.UploadCropbox,Roo.bootstrap.Component,{emptyText:'Click to upload image',rotateNotify:'Image is too small to rotate',errorTimeout:3000,scale:0,baseScale:1,rotate:0,dragable:false,pinching:false,mouseX:0,mouseY:0,cropData:false,minWidth:300,minHeight:300,file:false,exif:{},baseRotate:1,cropType:'image/jpeg',buttons:false,canvasLoaded:false,isDocument:false,method:'POST',paramName:'imageUpload',getAutoCreate:function(){var A={tag:'div',cls:'roo-upload-cropbox',cn:[{tag:'input',cls:'roo-upload-cropbox-selector',type:'file'},{tag:'div',cls:'roo-upload-cropbox-body',style:'cursor:pointer',cn:[{tag:'div',cls:'roo-upload-cropbox-preview'},{tag:'div',cls:'roo-upload-cropbox-thumb'},{tag:'div',cls:'roo-upload-cropbox-empty-notify',html:this.emptyText},{tag:'div',cls:'roo-upload-cropbox-error-notify alert alert-danger',html:this.rotateNotify}]},{tag:'div',cls:'roo-upload-cropbox-footer',cn:{tag:'div',cls:'btn-group btn-group-justified roo-upload-cropbox-btn-group',cn:[]}}]};
 return A;},onRender:function(ct,A){Roo.bootstrap.UploadCropbox.superclass.onRender.call(this,ct,A);if(this.buttons.length){Roo.each(this.buttons,function(bb){var B=this.el.select('.roo-upload-cropbox-footer div.roo-upload-cropbox-btn-group').first().createChild(bb);
 B.on('click',this.onFooterButtonClick.createDelegate(this,[bb.action],true));},this);}},initEvents:function(){this.urlAPI=(window.createObjectURL&&window)||(window.URL&&URL.revokeObjectURL&&URL)||(window.webkitURL&&webkitURL);this.bodyEl=this.el.select('.roo-upload-cropbox-body',true).first();
 this.bodyEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.selectorEl=this.el.select('.roo-upload-cropbox-selector',true).first();this.selectorEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.selectorEl.hide();this.previewEl=this.el.select('.roo-upload-cropbox-preview',true).first();
@@ -996,13 +996,13 @@ this.notifyEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';thi
 this.footerEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.footerEl.hide();this.setThumbBoxSize();this.bind();this.resize();this.fireEvent('initial',this);},bind:function(){var A=this;window.addEventListener("resize",function(){A.resize();
 });this.bodyEl.on('click',this.beforeSelectFile,this);if(Roo.isTouch){this.bodyEl.on('touchstart',this.onTouchStart,this);this.bodyEl.on('touchmove',this.onTouchMove,this);this.bodyEl.on('touchend',this.onTouchEnd,this);}if(!Roo.isTouch){this.bodyEl.on('mousedown',this.onMouseDown,this);
 this.bodyEl.on('mousemove',this.onMouseMove,this);var B=(/Firefox/i.test(navigator.userAgent))?'DOMMouseScroll':'mousewheel';this.bodyEl.on(B,this.onMouseWheel,this);Roo.get(document).on('mouseup',this.onMouseUp,this);}this.selectorEl.on('change',this.onFileSelected,this);
-},reset:function(){this.scale=0;this.baseScale=1;this.rotate=0;this.baseRotate=1;this.dragable=false;this.pinching=false;this.mouseX=0;this.mouseY=0;this.cropData=false;this.notifyEl.dom.innerHTML=this.emptyText;},resize:function(){if(this.fireEvent('resize',this)!=false){this.setThumbBoxPosition();
+},reset:function(){this.scale=0;this.baseScale=1;this.rotate=0;this.baseRotate=1;this.dragable=false;this.pinching=false;this.mouseX=0;this.mouseY=0;this.cropData=false;this.notifyEl.dom.innerHTML=this.emptyText;this.selectorEl.dom.value='';},resize:function(){if(this.fireEvent('resize',this)!=false){this.setThumbBoxPosition();
 this.setCanvasPosition();}},onFooterButtonClick:function(e,el,o,A){switch(A){case 'rotate-left':this.onRotateLeft(e);break;case 'rotate-right':this.onRotateRight(e);break;case 'picture':this.beforeSelectFile(e);break;case 'trash':this.trash(e);break;case 'crop':this.crop(e);
 break;case 'download':this.download(e);break;default:break;}this.fireEvent('footerbuttonclick',this,A);},beforeSelectFile:function(e){e.preventDefault();if(this.fireEvent('beforeselectfile',this)!=false){this.selectorEl.dom.click();}},onFileSelected:function(e){e.preventDefault();
 if(typeof(this.selectorEl.dom.files)=='undefined'||!this.selectorEl.dom.files.length){return;}var A=this.selectorEl.dom.files[0];if(this.fireEvent('inspect',this,A)!=false){this.prepare(A);}},trash:function(e){this.fireEvent('trash',this);},download:function(e){this.fireEvent('download',this);
-},loadCanvas:function(A){if(this.fireEvent('beforeloadcanvas',this,A)!=false){this.reset();this.imageEl=document.createElement('img');var B=this;this.imageEl.addEventListener("load",function(){B.onLoadCanvas();});this.imageEl.src=A;}},onLoadCanvas:function(){this.bodyEl.un('click',this.beforeSelectFile,this);
-this.notifyEl.hide();this.thumbEl.show();this.footerEl.show();this.imageEl.OriginWidth=this.imageEl.naturalWidth||this.imageEl.width;this.imageEl.OriginHeight=this.imageEl.naturalHeight||this.imageEl.height;this.baseRotateLevel();if(this.isDocument){this.setThumbBoxSize();
-}this.setThumbBoxPosition();this.baseScaleLevel();this.draw();this.resize();this.canvasLoaded=true;},setCanvasPosition:function(){if(!this.canvasEl){return;}var pw=Math.ceil((this.bodyEl.getWidth()-this.canvasEl.width)/2);var ph=Math.ceil((this.bodyEl.getHeight()-this.canvasEl.height)/2);
+},loadCanvas:function(A){if(this.fireEvent('beforeloadcanvas',this,A)!=false){this.reset();this.imageEl=document.createElement('img');var B=this;this.imageEl.addEventListener("load",function(){B.onLoadCanvas();});this.imageEl.src=A;}},onLoadCanvas:function(){this.imageEl.OriginWidth=this.imageEl.naturalWidth||this.imageEl.width;
+this.imageEl.OriginHeight=this.imageEl.naturalHeight||this.imageEl.height;this.bodyEl.un('click',this.beforeSelectFile,this);this.notifyEl.hide();this.thumbEl.show();this.footerEl.show();this.baseRotateLevel();if(this.isDocument){this.setThumbBoxSize();}this.setThumbBoxPosition();
+this.baseScaleLevel();this.draw();this.resize();this.canvasLoaded=true;},setCanvasPosition:function(){if(!this.canvasEl){return;}var pw=Math.ceil((this.bodyEl.getWidth()-this.canvasEl.width)/2);var ph=Math.ceil((this.bodyEl.getHeight()-this.canvasEl.height)/2);
 this.previewEl.setLeft(pw);this.previewEl.setTop(ph);},onMouseDown:function(e){e.stopEvent();this.dragable=true;this.pinching=false;if(this.isDocument&&(this.canvasEl.width<this.thumbEl.getWidth()||this.canvasEl.height<this.thumbEl.getHeight())){this.dragable=false;
 return;}this.mouseX=Roo.isTouch?e.browserEvent.touches[0].pageX:e.getPageX();this.mouseY=Roo.isTouch?e.browserEvent.touches[0].pageY:e.getPageY();},onMouseMove:function(e){e.stopEvent();if(!this.canvasLoaded){return;}if(!this.dragable){return;}var A=Math.ceil(this.thumbEl.getLeft(true));
 var B=Math.ceil(this.thumbEl.getTop(true));var C=Math.ceil(A+this.thumbEl.getWidth()-this.canvasEl.width);var D=Math.ceil(B+this.thumbEl.getHeight()-this.canvasEl.height);var x=Roo.isTouch?e.browserEvent.touches[0].pageX:e.getPageX();var y=Roo.isTouch?e.browserEvent.touches[0].pageY:e.getPageY();
@@ -1044,7 +1044,7 @@ E.drawImage(A,sx,sy,F,G,x,y,F,G);break;case 270:var F=(this.thumbEl.getWidth()/t
 var x=(this.thumbEl.getLeft(true)>this.previewEl.getLeft(true))?0:((this.previewEl.getLeft(true)-this.thumbEl.getLeft(true))/this.getScaleLevel());var y=(this.thumbEl.getTop(true)>this.previewEl.getTop(true))?0:((this.previewEl.getTop(true)-this.thumbEl.getTop(true))/this.getScaleLevel());
 var H=this.minWidth-2*x;var I=this.minHeight-2*y;var J=1;if((x==0&&y==0)||(x==0&&y>0)){J=H/F;}if(x>0&&y==0){J=I/G;}if(x>0&&y>0){J=H/F;if(F<G){J=I/G;}}E.scale(J,J);var sx=Math.min(this.canvasEl.width-this.thumbEl.getWidth(),this.thumbEl.getLeft(true)-this.previewEl.getLeft(true));
 var sy=Math.min(this.canvasEl.height-this.thumbEl.getHeight(),this.thumbEl.getTop(true)-this.previewEl.getTop(true));sx=sx<0?0:(sx/this.getScaleLevel());sy=sy<0?0:(sy/this.getScaleLevel());sy+=(this.imageEl.OriginWidth>this.imageEl.OriginHeight)?0:Math.abs(this.imageEl.OriginWidth-this.imageEl.OriginHeight);
-E.drawImage(A,sx,sy,F,G,x,y,F,G);break;default:break;}this.cropData=D.toDataURL(this.cropType);this.fireEvent('crop',this,this.cropData);return;},setThumbBoxSize:function(){var A,B;if(this.isDocument&&typeof(this.imageEl)!='undefined'){A=(this.imageEl.OriginWidth>this.imageEl.OriginHeight)?Math.max(this.minWidth,this.minHeight):Math.min(this.minWidth,this.minHeight);
+E.drawImage(A,sx,sy,F,G,x,y,F,G);break;default:break;}this.cropData=D.toDataURL(this.cropType);if(this.fireEvent('crop',this,this.cropData)!==false){this.process(this.file,this.cropData);}return;},setThumbBoxSize:function(){var A,B;if(this.isDocument&&typeof(this.imageEl)!='undefined'){A=(this.imageEl.OriginWidth>this.imageEl.OriginHeight)?Math.max(this.minWidth,this.minHeight):Math.min(this.minWidth,this.minHeight);
 B=(this.imageEl.OriginWidth>this.imageEl.OriginHeight)?Math.min(this.minWidth,this.minHeight):Math.max(this.minWidth,this.minHeight);this.minWidth=A;this.minHeight=B;if(this.rotate==90||this.rotate==270){this.minWidth=B;this.minHeight=A;}}B=300;A=Math.ceil(this.minWidth*B/this.minHeight);
 if(this.minWidth>this.minHeight){A=300;B=Math.ceil(this.minHeight*A/this.minWidth);}this.thumbEl.setStyle({width:A+'px',height:B+'px'});return;},setThumbBoxPosition:function(){var x=Math.ceil((this.bodyEl.getWidth()-this.thumbEl.getWidth())/2);var y=Math.ceil((this.bodyEl.getHeight()-this.thumbEl.getHeight())/2);
 this.thumbEl.setLeft(x);this.thumbEl.setTop(y);},baseRotateLevel:function(){this.baseRotate=1;if(typeof(this.exif)!='undefined'&&typeof(this.exif[Roo.bootstrap.UploadCropbox['tags']['Orientation']])!='undefined'&&[1,3,6,8].indexOf(this.exif[Roo.bootstrap.UploadCropbox['tags']['Orientation']])!=-1){this.baseRotate=this.exif[Roo.bootstrap.UploadCropbox['tags']['Orientation']];
@@ -1057,14 +1057,12 @@ this.baseScale=B/this.imageEl.OriginHeight;if(this.imageEl.OriginWidth*this.base
 },onTouchStart:function(e){if(!this.canvasLoaded){this.beforeSelectFile(e);return;}var A=e.browserEvent.touches;if(!A){return;}if(A.length==1){this.onMouseDown(e);return;}if(A.length!=2){return;}var B=[];for(var i=0,C;C=A[i];i++){B.push(C.pageX,C.pageY);}var x=Math.pow(B[0]-B[2],2);
 var y=Math.pow(B[1]-B[3],2);this.startDistance=Math.sqrt(x+y);this.startScale=this.scale;this.pinching=true;this.dragable=false;},onTouchMove:function(e){if(!this.pinching&&!this.dragable){return;}var A=e.browserEvent.touches;if(!A){return;}if(this.dragable){this.onMouseMove(e);
 return;}var B=[];for(var i=0,C;C=A[i];i++){B.push(C.pageX,C.pageY);}var x=Math.pow(B[0]-B[2],2);var y=Math.pow(B[1]-B[3],2);this.endDistance=Math.sqrt(x+y);this.scale=this.startScale+Math.floor(Math.log(this.endDistance/this.startDistance)/Math.log(1.1));
-if(!this.zoomable()){this.scale=this.startScale;return;}this.draw();},onTouchEnd:function(e){this.pinching=false;this.dragable=false;},process:function(A,B){this.xhr=new XMLHttpRequest();if(typeof(this.file.id)!='undefined'&&this.file.id*1>0){return;}A.xhr=this.xhr;
-this.xhr.open(this.method,this.url,true);var C={"Accept":"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};for(var D in C){var E=C[D];if(E){this.xhr.setRequestHeader(D,E);}}var F=this;this.xhr.onload=function(){F.xhrOnLoad(F.xhr);
-};this.xhr.onerror=function(){F.xhrOnError(F.xhr);};var G=new FormData();G.append('returnHTML','NO');if(B){G.append('crop',B);}G.append(this.paramName,A,A.name);if(this.fireEvent('prepare',this,G)!=false){this.xhr.send(G);};},xhrOnLoad:function(A){if(A.readyState!==4){this.fireEvent('exception',this,A);
+if(!this.zoomable()){this.scale=this.startScale;return;}this.draw();},onTouchEnd:function(e){this.pinching=false;this.dragable=false;},process:function(A,B){this.xhr=new XMLHttpRequest();A.xhr=this.xhr;this.xhr.open(this.method,this.url,true);var C={"Accept":"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};
+for(var D in C){var E=C[D];if(E){this.xhr.setRequestHeader(D,E);}}var F=this;this.xhr.onload=function(){F.xhrOnLoad(F.xhr);};this.xhr.onerror=function(){F.xhrOnError(F.xhr);};var G=new FormData();G.append('returnHTML','NO');if(B){G.append('crop',B);}if(typeof(A)!='undefined'&&(typeof(A.id)=='undefined'||A.id*1<1)){G.append(this.paramName,A,A.name);
+}if(typeof(A.filename)!='undefined'){G.append('filename',A.filename);}if(typeof(A.mimetype)!='undefined'){G.append('mimetype',A.mimetype);}if(this.fireEvent('arrange',this,G)!=false){this.xhr.send(G);};},xhrOnLoad:function(A){if(A.readyState!==4){this.fireEvent('exception',this,A);
 return;}var B=Roo.decode(A.responseText);if(!B.success){this.fireEvent('exception',this,A);return;}var B=Roo.decode(A.responseText);this.fireEvent('upload',this,B);},xhrOnError:function(){Roo.log('xhr on error');var A=Roo.decode(xhr.responseText);Roo.log(A);
-},uploadFromSource:function(A,B){this.xhr=new XMLHttpRequest();this.xhr.open(this.method,this.url,true);var C={"Accept":"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};for(var D in C){var E=C[D];if(E){this.xhr.setRequestHeader(D,E);
-}}var F=this;this.xhr.onload=function(){F.xhrOnLoad(F.xhr);};this.xhr.onerror=function(){F.xhrOnError(F.xhr);};var G=new FormData();G.append('returnHTML','NO');G.append('crop',B);if(typeof(A.filename)!='undefined'){G.append('filename',A.filename);}if(typeof(A.mimetype)!='undefined'){G.append('mimetype',A.mimetype);
-}if(this.fireEvent('prepare',this,G)!=false){this.xhr.send(G);};},prepare:function(A){this.file=false;this.exif={};if(typeof(A)==='string'){this.loadCanvas(A);return;}if(!A||!this.urlAPI){return;}this.file=A;this.cropType=A.type;var B=this;if(this.fireEvent('prepare',this,this.file)!=false){var C=new FileReader();
-C.onload=function(e){if(e.target.error){Roo.log(e.target.error);return;}var D=e.target.result,E=new DataView(D),F=2,G=E.byteLength-4,H,I;if(E.getUint16(0)===0xffd8){while(F<G){H=E.getUint16(F);if((H>=0xffe0&&H<=0xffef)||H===0xfffe){I=E.getUint16(F+2)+2;if(F+I>E.byteLength){Roo.log('Invalid meta data: Invalid segment size.');
+},prepare:function(A){this.file=false;this.exif={};if(typeof(A)==='string'){this.loadCanvas(A);return;}if(!A||!this.urlAPI){return;}this.file=A;this.cropType=A.type;var B=this;if(this.fireEvent('prepare',this,this.file)!=false){var C=new FileReader();C.onload=function(e){if(e.target.error){Roo.log(e.target.error);
+return;}var D=e.target.result,E=new DataView(D),F=2,G=E.byteLength-4,H,I;if(E.getUint16(0)===0xffd8){while(F<G){H=E.getUint16(F);if((H>=0xffe0&&H<=0xffef)||H===0xfffe){I=E.getUint16(F+2)+2;if(F+I>E.byteLength){Roo.log('Invalid meta data: Invalid segment size.');
 break;}if(H==0xffe1){B.parseExifData(E,F,I);}F+=I;continue;}break;}}var J=B.urlAPI.createObjectURL(B.file);B.loadCanvas(J);return;};C.readAsArrayBuffer(this.file);}},parseExifData:function(A,B,C){var D=B+10,E,F;if(A.getUint32(B+4)!==0x45786966){return;}if(A.getUint32(B+4)!==0x45786966){return;
 }if(D+8>A.byteLength){Roo.log('Invalid Exif data: Invalid segment size.');return;}if(A.getUint16(B+8)!==0x0000){Roo.log('Invalid Exif data: Missing byte alignment offset.');return;}switch(A.getUint16(D)){case 0x4949:E=true;break;case 0x4D4D:E=false;break;
 default:Roo.log('Invalid Exif data: Invalid byte alignment marker.');return;}if(A.getUint16(D+2,E)!==0x002A){Roo.log('Invalid Exif data: Missing TIFF marker.');return;}F=A.getUint32(D+4,E);this.parseExifTags(A,D,D+F,E);},parseExifTags:function(A,B,C,D){var E,F,i;
@@ -1077,7 +1075,7 @@ i+=1){c=J[i];if(c==='\u0000'){break;}K+=c;}return K;}return J;}});Roo.apply(Roo.
 },size:4},10:{getValue:function(A,B,C){return A.getInt32(B,C)/A.getInt32(B+4,C);},size:8}},footer:{STANDARD:[{tag:'div',cls:'btn-group roo-upload-cropbox-rotate-left',action:'rotate-left',cn:[{tag:'button',cls:'btn btn-default',html:'<i class="fa fa-undo"></i>'}]},{tag:'div',cls:'btn-group roo-upload-cropbox-picture',action:'picture',cn:[{tag:'button',cls:'btn btn-default',html:'<i class="fa fa-picture-o"></i>'}]},{tag:'div',cls:'btn-group roo-upload-cropbox-rotate-right',action:'rotate-right',cn:[{tag:'button',cls:'btn btn-default',html:'<i class="fa fa-repeat"></i>'}]}],DOCUMENT:[{tag:'div',cls:'btn-group roo-upload-cropbox-rotate-left',action:'rotate-left',cn:[{tag:'button',cls:'btn btn-default',html:'<i class="fa fa-undo"></i>'}]},{tag:'div',cls:'btn-group roo-upload-cropbox-download',action:'download',cn:[{tag:'button',cls:'btn btn-default',html:'<i class="fa fa-download"></i>'}]},{tag:'div',cls:'btn-group roo-upload-cropbox-crop',action:'crop',cn:[{tag:'button',cls:'btn btn-default',html:'<i class="fa fa-crop"></i>'}]},{tag:'div',cls:'btn-group roo-upload-cropbox-trash',action:'trash',cn:[{tag:'button',cls:'btn btn-default',html:'<i class="fa fa-trash"></i>'}]},{tag:'div',cls:'btn-group roo-upload-cropbox-rotate-right',action:'rotate-right',cn:[{tag:'button',cls:'btn btn-default',html:'<i class="fa fa-repeat"></i>'}]}],ROTATOR:[{tag:'div',cls:'btn-group roo-upload-cropbox-rotate-left',action:'rotate-left',cn:[{tag:'button',cls:'btn btn-default',html:'<i class="fa fa-undo"></i>'}]},{tag:'div',cls:'btn-group roo-upload-cropbox-rotate-right',action:'rotate-right',cn:[{tag:'button',cls:'btn btn-default',html:'<i class="fa fa-repeat"></i>'}]}]}});
 
 // Roo/bootstrap/DocumentManager.js
-Roo.bootstrap.DocumentManager=function(A){Roo.bootstrap.DocumentManager.superclass.constructor.call(this,A);this.addEvents({"initial":true,"inspect":true,"exception":true,"prepare":true,"remove":true,"refresh":true,"click":true,"edit":true,"beforeselectfile":true});
+Roo.bootstrap.DocumentManager=function(A){Roo.bootstrap.DocumentManager.superclass.constructor.call(this,A);this.addEvents({"initial":true,"inspect":true,"exception":true,"prepare":true,"remove":true,"refresh":true,"click":true,"edit":true,"beforeselectfile":true,"process":true});
 };Roo.extend(Roo.bootstrap.DocumentManager,Roo.bootstrap.Component,{boxes:0,inputName:'',thumbSize:300,multiple:true,files:[],method:'POST',url:'',paramName:'imageUpload',fieldLabel:'',labelWidth:4,labelAlign:'left',editable:true,delegates:[],getAutoCreate:function(){var A={tag:'div',cls:'roo-document-manager',cn:[{tag:'input',cls:'roo-document-manager-selector',type:'file'},{tag:'div',cls:'roo-document-manager-uploader',cn:[{tag:'div',cls:'roo-document-manager-upload-btn',html:'<i class="fa fa-plus"></i>'}]}]};
 var B=[{tag:'div',cls:'column col-md-12',cn:A}];if(this.fieldLabel.length){B=[{tag:'div',cls:'column col-md-12',html:this.fieldLabel},{tag:'div',cls:'column col-md-12',cn:A}];if(this.labelAlign=='left'){B=[{tag:'div',cls:'column col-md-'+this.labelWidth,html:this.fieldLabel},{tag:'div',cls:'column col-md-'+(12-this.labelWidth),cn:A}];
 }}var C={tag:'div',cls:'row clearfix',cn:B};return C;},initEvents:function(){this.managerEl=this.el.select('.roo-document-manager',true).first();this.managerEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.selectorEl=this.el.select('.roo-document-manager-selector',true).first();
@@ -1095,11 +1093,11 @@ this.progressBar.update(this.progressBar.aria_valuemax-this.delegates.length);A(
 },clear:function(){Roo.each(this.files,function(A){if(!A.target){return;}A.target.remove();},this);this.files=[];this.refresh();},onClick:function(e,el,o){e.preventDefault();this.fireEvent('click',this,o);},closable:function(A){Roo.each(this.managerEl.select('.roo-document-manager-preview > button.close',true).elements,function(el){el.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';
 if(A){el.show();return;}el.hide();},this);},xhrOnLoad:function(A){Roo.each(this.managerEl.select('.roo-document-manager-loading',true).elements,function(el){el.remove();},this);if(A.readyState!==4){this.arrange();this.fireEvent('exception',this,A);return;
 }var B=Roo.decode(A.responseText);if(!B.success){this.arrange();this.fireEvent('exception',this,A);return;}var C=this.renderPreview(B.data);this.files.push(C);this.arrange();},xhrOnError:function(){Roo.log('xhr on error');var A=Roo.decode(xhr.responseText);
-Roo.log(A);this.arrange();},process:function(A){if(this.editable&&A.type.indexOf('image')!=-1){this.fireEvent('edit',this,A);return;}this.uploadStart(A,false);return;},uploadStart:function(A,B){this.xhr=new XMLHttpRequest();if(typeof(A.id)!='undefined'&&A.id*1>0){this.arrange();
-return;}A.xhr=this.xhr;this.managerEl.createChild({tag:'div',cls:'roo-document-manager-loading',cn:[{tag:'div',tooltip:A.name,cls:'roo-document-manager-thumb',html:'<i class="fa fa-circle-o-notch fa-spin"></i>'}]});this.xhr.open(this.method,this.url,true);
-var C={"Accept":"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};for(var D in C){var E=C[D];if(E){this.xhr.setRequestHeader(D,E);}}var F=this;this.xhr.onload=function(){F.xhrOnLoad(F.xhr);};this.xhr.onerror=function(){F.xhrOnError(F.xhr);
-};var G=new FormData();G.append('returnHTML','NO');if(B){G.append('crop',B);}G.append(this.paramName,A,A.name);if(this.fireEvent('prepare',this,G)!=false){this.xhr.send(G);};},uploadCancel:function(){this.xhr.abort();this.delegates=[];Roo.each(this.managerEl.select('.roo-document-manager-loading',true).elements,function(el){el.remove();
-},this);this.arrange();},renderPreview:function(A){if(typeof(A.target)!='undefined'&&A.target){return A;}var B=this.managerEl.createChild({tag:'div',cls:'roo-document-manager-preview',cn:[{tag:'div',tooltip:A.filename,cls:'roo-document-manager-thumb',html:'<img src="'+baseURL+'/Images/Thumb/'+this.thumbSize+'/'+A.id+'/'+A.filename+'">'},{tag:'button',cls:'close',html:'<i class="fa fa-times-circle"></i>'}]});
+Roo.log(A);this.arrange();},process:function(A){if(this.fireEvent('process',this,A)!==false){if(this.editable&&A.type.indexOf('image')!=-1){this.fireEvent('edit',this,A);return;}this.uploadStart(A,false);return;}},uploadStart:function(A,B){this.xhr=new XMLHttpRequest();
+if(typeof(A.id)!='undefined'&&A.id*1>0){this.arrange();return;}A.xhr=this.xhr;this.managerEl.createChild({tag:'div',cls:'roo-document-manager-loading',cn:[{tag:'div',tooltip:A.name,cls:'roo-document-manager-thumb',html:'<i class="fa fa-circle-o-notch fa-spin"></i>'}]});
+this.xhr.open(this.method,this.url,true);var C={"Accept":"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};for(var D in C){var E=C[D];if(E){this.xhr.setRequestHeader(D,E);}}var F=this;this.xhr.onload=function(){F.xhrOnLoad(F.xhr);
+};this.xhr.onerror=function(){F.xhrOnError(F.xhr);};var G=new FormData();G.append('returnHTML','NO');if(B){G.append('crop',B);}G.append(this.paramName,A,A.name);if(this.fireEvent('prepare',this,G)!=false){this.xhr.send(G);};},uploadCancel:function(){this.xhr.abort();
+this.delegates=[];Roo.each(this.managerEl.select('.roo-document-manager-loading',true).elements,function(el){el.remove();},this);this.arrange();},renderPreview:function(A){if(typeof(A.target)!='undefined'&&A.target){return A;}var B=this.managerEl.createChild({tag:'div',cls:'roo-document-manager-preview',cn:[{tag:'div',tooltip:A.filename,cls:'roo-document-manager-thumb',html:'<img src="'+baseURL+'/Images/Thumb/'+this.thumbSize+'/'+A.id+'/'+A.filename+'">'},{tag:'button',cls:'close',html:'<i class="fa fa-times-circle"></i>'}]});
 var C=B.select('button.close',true).first();C.on('click',this.onRemove,this,A);A.target=B;var D=B.select('img',true).first();var E=this;D.dom.addEventListener("load",function(){E.onPreviewLoad(A,D);});D.on('click',this.onClick,this,A);return A;},onPreviewLoad:function(A,B){if(typeof(A.target)=='undefined'||!A.target){return;
 }var C=B.dom.naturalWidth||B.dom.width;var D=B.dom.naturalHeight||B.dom.height;if(C>D){A.target.addClass('wide');return;}A.target.addClass('tall');return;},uploadFromSource:function(A,B){this.xhr=new XMLHttpRequest();this.managerEl.createChild({tag:'div',cls:'roo-document-manager-loading',cn:[{tag:'div',tooltip:A.name,cls:'roo-document-manager-thumb',html:'<i class="fa fa-circle-o-notch fa-spin"></i>'}]});
 this.xhr.open(this.method,this.url,true);var C={"Accept":"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};for(var D in C){var E=C[D];if(E){this.xhr.setRequestHeader(D,E);}}var F=this;this.xhr.onload=function(){F.xhrOnLoad(F.xhr);
@@ -1113,16 +1111,17 @@ this.trashBtn=this.el.select('.roo-document-viewer-trash',true).first();this.tra
 },onClick:function(e){e.preventDefault();this.fireEvent('click',this);},onTrash:function(e){e.preventDefault();this.fireEvent('trash',this);}});
 // Roo/bootstrap/NavProgressBar.js
 Roo.bootstrap.NavProgressBar=function(A){Roo.bootstrap.NavProgressBar.superclass.constructor.call(this,A);this.bullets=this.bullets||[];this.addEvents({'changed':true});};Roo.extend(Roo.bootstrap.NavProgressBar,Roo.bootstrap.Component,{bullets:[],barItems:[],getAutoCreate:function(){var A=Roo.apply({},Roo.bootstrap.NavProgressBar.superclass.getAutoCreate.call(this));
-A={tag:'ul',cls:'roo-navigation-bar'};return A;},onRender:function(ct,A){Roo.bootstrap.NavProgressBar.superclass.onRender.call(this,ct,A);if(this.bullets.length){Roo.each(this.bullets,function(b){this.addItem(b);},this);}},addItem:function(A){var B=new Roo.bootstrap.NavProgressItem(A);
-B.parentId=this.id;B.render(this.el,null);this.barItems.push(B);this.formatBullets();return B;},getActive:function(){var A=false;Roo.each(this.barItems,function(v){if(!v.isActive()){return;}A=v;return false;});return A;},setActiveItem:function(A){var B=false;
-Roo.each(this.barItems,function(v){if(v.rid==A.rid){return;}if(v.isActive()){v.setActive(false);B=v;}});A.setActive(true);this.fireEvent('changed',this,A,B);},getBarItem:function(A){var B=false;Roo.each(this.barItems,function(e){if(e.rid!=A){return;}B=e;return false;
-});return B;},indexOfItem:function(A){var B=false;Roo.each(this.barItems,function(v,i){if(v.rid!=A.rid){return;}B=i;return false});return B;},setActiveNext:function(){var i=this.indexOfItem(this.getActive());if(i>this.barItems.length){return;}this.setActiveItem(this.barItems[i+1]);
-},setActivePrev:function(){var i=this.indexOfItem(this.getActive());if(i<1){return;}this.setActiveItem(this.barItems[i-1]);},formatBullets:function(){if(!this.barItems.length){return;}var A=100/this.barItems.length;Roo.each(this.barItems,function(i){i.el.setStyle('width',A+'%');
-},this);}});
+A={tag:'div',cls:'roo-navigation-bar-group',cn:[{tag:'div',cls:'roo-navigation-top-bar'},{tag:'div',cls:'roo-navigation-bullets-bar',cn:[{tag:'ul',cls:'roo-navigation-bar'}]},{tag:'div',cls:'roo-navigation-bottom-bar'}]};return A;},initEvents:function(){},onRender:function(ct,A){Roo.bootstrap.NavProgressBar.superclass.onRender.call(this,ct,A);
+if(this.bullets.length){Roo.each(this.bullets,function(b){this.addItem(b);},this);}this.format();},addItem:function(A){var B=new Roo.bootstrap.NavProgressItem(A);B.parentId=this.id;B.render(this.el.select('.roo-navigation-bar',true).first(),null);if(A.html){var C=new Roo.bootstrap.Element({tag:'div',cls:'roo-navigation-bar-text'});
+var D=new Roo.bootstrap.Element({tag:'div',cls:'roo-navigation-bar-text'});C.onRender(this.el.select('.roo-navigation-top-bar',true).first(),null);D.onRender(this.el.select('.roo-navigation-bottom-bar',true).first(),null);var E=new Roo.bootstrap.Element({tag:'span',html:(typeof(A.position)!='undefined'&&A.position=='top')?A.html:''});
+var F=new Roo.bootstrap.Element({tag:'span',html:(typeof(A.position)!='undefined'&&A.position=='top')?'':A.html});E.onRender(C.el,null);F.onRender(D.el,null);B.topEl=C;B.bottomEl=D;}this.barItems.push(B);return B;},getActive:function(){var A=false;Roo.each(this.barItems,function(v){if(!v.isActive()){return;
+}A=v;return false;});return A;},setActiveItem:function(A){var B=false;Roo.each(this.barItems,function(v){if(v.rid==A.rid){return;}if(v.isActive()){v.setActive(false);B=v;}});A.setActive(true);this.fireEvent('changed',this,A,B);},getBarItem:function(A){var B=false;
+Roo.each(this.barItems,function(e){if(e.rid!=A){return;}B=e;return false;});return B;},indexOfItem:function(A){var B=false;Roo.each(this.barItems,function(v,i){if(v.rid!=A.rid){return;}B=i;return false});return B;},setActiveNext:function(){var i=this.indexOfItem(this.getActive());
+if(i>this.barItems.length){return;}this.setActiveItem(this.barItems[i+1]);},setActivePrev:function(){var i=this.indexOfItem(this.getActive());if(i<1){return;}this.setActiveItem(this.barItems[i-1]);},format:function(){if(!this.barItems.length){return;}var A=100/this.barItems.length;
+Roo.each(this.barItems,function(i){i.el.setStyle('width',A+'%');i.topEl.el.setStyle('width',A+'%');i.bottomEl.el.setStyle('width',A+'%');},this);}});
 // Roo/bootstrap/NavProgressItem.js
-Roo.bootstrap.NavProgressItem=function(A){Roo.bootstrap.NavProgressItem.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.NavProgressItem,Roo.bootstrap.Component,{rid:'',active:false,disabled:false,html:'',position:'bottom',icon:false,forceIcon:false,getAutoCreate:function(){var A='roo-navigation-bar-item-icon';
-if((this.forceIcon&&this.icon)||!this.forceIcon&&Roo.isTouch){A+=' '+this.icon;}var B={tag:'li',cls:'roo-navigation-bar-item',cn:[{tag:'i',cls:A},{tag:'span',cls:'roo-navigation-bar-item-text '+this.position,html:this.html}]};if(this.active){B.cls+=' active';
-}if(this.disabled){B.cls+=' disabled';}return B;},disable:function(){this.setDisabled(true);},enable:function(){this.setDisabled(false);},initEvents:function(){this.iconEl=this.el.select('.roo-navigation-bar-item-icon',true).first();this.textEl=this.el.select('.roo-navigation-bar-item-text',true).first();
-if(Roo.isTouch){this.textEl.setVisibilityMode(Roo.Element.DISPLAY).hide();}this.iconEl.on('click',this.onClick,this);},onClick:function(e){e.preventDefault();if(this.disabled){return;}if(this.fireEvent('click',this,e)===false){return;};this.parent().setActiveItem(this);
-},isActive:function(){return this.active;},setActive:function(A){if(this.active==A){return;}this.active=A;if(A){this.el.addClass('active');return;}this.el.removeClass('active');return;},setDisabled:function(A){if(this.disabled==A){return;}this.disabled=A;
-if(A){this.el.addClass('disabled');return;}this.el.removeClass('disabled');},tooltipEl:function(){return this.el.select('.roo-navigation-bar-item-icon',true).first();;}});
+Roo.bootstrap.NavProgressItem=function(A){Roo.bootstrap.NavProgressItem.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.NavProgressItem,Roo.bootstrap.Component,{rid:'',active:false,disabled:false,html:'',position:'bottom',icon:false,getAutoCreate:function(){var A='roo-navigation-bar-item-icon';
+A+=((this.icon)?(' '+this.icon):(' step-number'));var B={tag:'li',cls:'roo-navigation-bar-item',cn:[{tag:'i',cls:A}]};if(this.active){B.cls+=' active';}if(this.disabled){B.cls+=' disabled';}return B;},disable:function(){this.setDisabled(true);},enable:function(){this.setDisabled(false);
+},initEvents:function(){this.iconEl=this.el.select('.roo-navigation-bar-item-icon',true).first();this.iconEl.on('click',this.onClick,this);},onClick:function(e){e.preventDefault();if(this.disabled){return;}if(this.fireEvent('click',this,e)===false){return;
+};this.parent().setActiveItem(this);},isActive:function(){return this.active;},setActive:function(A){if(this.active==A){return;}this.active=A;if(A){this.el.addClass('active');return;}this.el.removeClass('active');return;},setDisabled:function(A){if(this.disabled==A){return;
+}this.disabled=A;if(A){this.el.addClass('disabled');return;}this.el.removeClass('disabled');},tooltipEl:function(){return this.el.select('.roo-navigation-bar-item-icon',true).first();;}});