roojs-core.js
authorEdward <edward@roojs.com>
Mon, 8 Jun 2015 05:14:46 +0000 (13:14 +0800)
committerEdward <edward@roojs.com>
Mon, 8 Jun 2015 05:14:46 +0000 (13:14 +0800)
roojs-core-debug.js
roojs-ui.js
roojs-ui-debug.js
roojs-all.js
roojs-debug.js

roojs-all.js
roojs-debug.js
roojs-ui-debug.js
roojs-ui.js

index af01bbb..526838c 100644 (file)
@@ -929,9 +929,9 @@ this.cblack.push(A);},this);}});Roo.HtmlEditorCore.white=['area','br','img','inp
 //Roo/form/HtmlEditor.js
 Roo.form.HtmlEditor=function(A){Roo.form.HtmlEditor.superclass.constructor.call(this,A);if(!this.toolbars){this.toolbars=[];}
 this.editorcore=new Roo.HtmlEditorCore(Roo.apply({owner:this},A));};Roo.extend(Roo.form.HtmlEditor,Roo.form.Field,{clearUp:true,toolbars:false,resizable:false,height:300,width:500,stylesheets:false,cblack:false,cwhite:false,black:false,white:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',actionMode:'container',defaultAutoCreate:{tag:"textarea",style:"width:500px;height:300px;",autocomplete:"off"},initComponent:function(){this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editmodechange:true,editorevent:true,firstfocus:true,autosave:true,savedpreview:true});this.defaultAutoCreate={tag:"textarea",style:'width: '+this.width+'px;height: '+this.height+'px;',autocomplete:"off"};},createToolbar:function(A){Roo.log("create toolbars");if(!A.toolbars||!A.toolbars.length){A.toolbars=[new Roo.form.HtmlEditor.ToolbarStandard()];}for(var i=0;i<A.toolbars.length;i++){A.toolbars[i]=Roo.factory(typeof(A.toolbars[i])=='string'?{xtype:A.toolbars[i]}:A.toolbars[i],Roo.form.HtmlEditor);A.toolbars[i].init(A);}},onRender:function(ct,A){var _t=this;Roo.form.HtmlEditor.superclass.onRender.call(this,ct,A);this.wrap=this.el.wrap({cls:'x-html-editor-wrap',cn:{cls:'x-html-editor-tb'}});this.editorcore.onRender(ct,A);if(this.resizable){this.resizeEl=new Roo.Resizable(this.wrap,{pinned:true,wrap:true,dynamic:true,minHeight:this.height,height:this.height,handles:this.resizable,width:this.width,listeners:{resize:function(r,w,h){_t.onResize(w,h);}}});}
-this.createToolbar(this);if(!this.width){this.setSize(this.wrap.getSize());}if(this.resizeEl){this.resizeEl.resizeTo.defer(100,this.resizeEl,[this.width,this.height]);}},onResize:function(w,h){Roo.form.HtmlEditor.superclass.onResize.apply(this,arguments);var ew=false;var eh=false;if(this.el){if(typeof w=='number'){var aw=w-this.wrap.getFrameWidth('lr');this.el.setWidth(this.adjustWidth('textarea',aw));ew=aw;}if(typeof h=='number'){var A=0;for(var i=0;i<this.toolbars.length;i++){A+=this.toolbars[i].tb.el.getHeight();if(this.toolbars[i].footer){A+=this.toolbars[i].footer.el.getHeight();}}var ah=h-this.wrap.getFrameWidth('tb')-A;ah-=5;this.el.setHeight(this.adjustWidth('textarea',ah));var eh=ah;}}
-Roo.log('onResize:'+[w,h,ew,eh].join(','));this.editorcore.onResize(ew,eh);},toggleSourceEdit:function(A){this.editorcore.toggleSourceEdit(A);if(this.editorcore.sourceEditMode){Roo.log('editor - showing textarea');this.editorcore.syncValue();this.el.removeClass('x-hidden');this.el.dom.removeAttribute('tabIndex');this.el.focus();Roo.each(this.toolbars,function(t){if(t instanceof Roo.form.HtmlEditor.ToolbarContext){t.tb.hide();t.footer.hide();}});}else {Roo.log('editor - hiding textarea');this.editorcore.pushValue();this.el.addClass('x-hidden');this.el.dom.setAttribute('tabIndex',-1);Roo.each(this.toolbars,function(t){if(t instanceof Roo.form.HtmlEditor.ToolbarContext){t.tb.show();t.footer.show();}});}
-this.setSize(this.wrap.getSize());this.fireEvent('editmodechange',this,this.editorcore.sourceEditMode);},adjustSize:Roo.BoxComponent.prototype.adjustSize,getResizeEl:function(){return this.wrap;},getPositionEl:function(){return this.wrap;},initEvents:function(){this.originalValue=this.getValue();},markInvalid:Roo.emptyFn,clearInvalid:Roo.emptyFn,setValue:function(v){Roo.form.HtmlEditor.superclass.setValue.call(this,v);this.editorcore.pushValue();},deferFocus:function(){this.focus.defer(10,this);},focus:function(){this.editorcore.focus();},onDestroy:function(){if(this.rendered){for(var i=0;i<this.toolbars.length;i++){this.toolbars[i].onDestroy();}
+this.createToolbar(this);if(!this.width){this.setSize(this.wrap.getSize());}if(this.resizeEl){this.resizeEl.resizeTo.defer(100,this.resizeEl,[this.width,this.height]);}},onResize:function(w,h){Roo.form.HtmlEditor.superclass.onResize.apply(this,arguments);var ew=false;var eh=false;if(this.el){if(typeof w=='number'){var aw=w-this.wrap.getFrameWidth('lr');this.el.setWidth(this.adjustWidth('textarea',aw));ew=aw;}if(typeof h=='number'){var A=0;for(var i=0;i<this.toolbars.length;i++){A+=this.toolbars[i].tb.el.getHeight();if(this.toolbars[i].footer){A+=this.toolbars[i].footer.el.getHeight();}}var ah=h-this.wrap.getFrameWidth('tb')-A;ah-=5;Roo.log(ah);this.el.setHeight(this.adjustWidth('textarea',ah));var eh=ah;}}
+Roo.log('onResize:'+[w,h,ew,eh].join(','));this.editorcore.onResize(ew,eh);},toggleSourceEdit:function(A){this.editorcore.toggleSourceEdit(A);if(this.editorcore.sourceEditMode){Roo.log('editor - showing textarea');this.editorcore.syncValue();this.el.removeClass('x-hidden');this.el.dom.removeAttribute('tabIndex');this.el.focus();for(var i=0;i<this.toolbars.length;i++){if(this.toolbars[i] instanceof Roo.form.HtmlEditor.ToolbarContext){this.toolbars[i].tb.hide();this.toolbars[i].footer.hide();}}}else {Roo.log('editor - hiding textarea');this.editorcore.pushValue();this.el.addClass('x-hidden');this.el.dom.setAttribute('tabIndex',-1);for(var i=0;i<this.toolbars.length;i++){if(this.toolbars[i] instanceof Roo.form.HtmlEditor.ToolbarContext){this.toolbars[i].tb.show();this.toolbars[i].footer.show();}}}
+this.setSize(this.wrap.getSize());this.onResize(this.wrap.getSize().width,this.wrap.getSize().height);this.fireEvent('editmodechange',this,this.editorcore.sourceEditMode);},adjustSize:Roo.BoxComponent.prototype.adjustSize,getResizeEl:function(){return this.wrap;},getPositionEl:function(){return this.wrap;},initEvents:function(){this.originalValue=this.getValue();},markInvalid:Roo.emptyFn,clearInvalid:Roo.emptyFn,setValue:function(v){Roo.form.HtmlEditor.superclass.setValue.call(this,v);this.editorcore.pushValue();},deferFocus:function(){this.focus.defer(10,this);},focus:function(){this.editorcore.focus();},onDestroy:function(){if(this.rendered){for(var i=0;i<this.toolbars.length;i++){this.toolbars[i].onDestroy();}
 this.wrap.dom.innerHTML='';this.wrap.remove();}},onFirstFocus:function(){this.editorcore.onFirstFocus();for(var i=0;i<this.toolbars.length;i++){this.toolbars[i].onFirstFocus();}},syncValue:function(){this.editorcore.syncValue();},pushValue:function(){this.editorcore.pushValue();}});
 //Roo/form/HtmlEditor/ToolbarStandard.js
 Roo.form.HtmlEditor.ToolbarStandard=function(A){Roo.apply(this,A);this.disable=this.disable||{};Roo.applyIf(this.disable,{fontSize:true,colors:true,specialElements:true});}
index 5109287..dd02328 100644 (file)
@@ -42906,7 +42906,6 @@ Roo.extend(Roo.form.HtmlEditor, Roo.form.Field, {
     // private
     onResize : function(w, h)
     {
-        //Roo.log('resize: ' +w + ',' + h );
         Roo.form.HtmlEditor.superclass.onResize.apply(this, arguments);
         var ew = false;
         var eh = false;
@@ -42932,6 +42931,7 @@ Roo.extend(Roo.form.HtmlEditor, Roo.form.Field, {
                 
                 var ah = h - this.wrap.getFrameWidth('tb') - tbh;// this.tb.el.getHeight();
                 ah -= 5; // knock a few pixes off for look..
+                Roo.log(ah);
                 this.el.setHeight(this.adjustWidth('textarea', ah));
                 var eh = ah;
             }
@@ -42959,12 +42959,12 @@ Roo.extend(Roo.form.HtmlEditor, Roo.form.Field, {
             this.el.dom.removeAttribute('tabIndex');
             this.el.focus();
             
-            Roo.each(this.toolbars, function(t){
-                if(t instanceof Roo.form.HtmlEditor.ToolbarContext){
-                    t.tb.hide();
-                    t.footer.hide();
+            for (var i = 0; i < this.toolbars.length; i++) {
+                if(this.toolbars[i] instanceof Roo.form.HtmlEditor.ToolbarContext){
+                    this.toolbars[i].tb.hide();
+                    this.toolbars[i].footer.hide();
                 }
-            });
+            }
             
         }else{
             Roo.log('editor - hiding textarea');
@@ -42975,16 +42975,19 @@ Roo.extend(Roo.form.HtmlEditor, Roo.form.Field, {
             this.el.addClass('x-hidden');
             this.el.dom.setAttribute('tabIndex', -1);
             
-            Roo.each(this.toolbars, function(t){
-                if(t instanceof Roo.form.HtmlEditor.ToolbarContext){
-                    t.tb.show();
-                    t.footer.show();
+            for (var i = 0; i < this.toolbars.length; i++) {
+                if(this.toolbars[i] instanceof Roo.form.HtmlEditor.ToolbarContext){
+                    this.toolbars[i].tb.show();
+                    this.toolbars[i].footer.show();
                 }
-            });
+            }
+            
             //this.deferFocus();
         }
-         
+        
         this.setSize(this.wrap.getSize());
+        this.onResize(this.wrap.getSize().width, this.wrap.getSize().height);
+        
         this.fireEvent('editmodechange', this, this.editorcore.sourceEditMode);
     },
  
index 6c77291..8e05eb7 100644 (file)
@@ -26476,7 +26476,6 @@ Roo.extend(Roo.form.HtmlEditor, Roo.form.Field, {
     // private
     onResize : function(w, h)
     {
-        //Roo.log('resize: ' +w + ',' + h );
         Roo.form.HtmlEditor.superclass.onResize.apply(this, arguments);
         var ew = false;
         var eh = false;
@@ -26502,6 +26501,7 @@ Roo.extend(Roo.form.HtmlEditor, Roo.form.Field, {
                 
                 var ah = h - this.wrap.getFrameWidth('tb') - tbh;// this.tb.el.getHeight();
                 ah -= 5; // knock a few pixes off for look..
+                Roo.log(ah);
                 this.el.setHeight(this.adjustWidth('textarea', ah));
                 var eh = ah;
             }
@@ -26529,12 +26529,12 @@ Roo.extend(Roo.form.HtmlEditor, Roo.form.Field, {
             this.el.dom.removeAttribute('tabIndex');
             this.el.focus();
             
-            Roo.each(this.toolbars, function(t){
-                if(t instanceof Roo.form.HtmlEditor.ToolbarContext){
-                    t.tb.hide();
-                    t.footer.hide();
+            for (var i = 0; i < this.toolbars.length; i++) {
+                if(this.toolbars[i] instanceof Roo.form.HtmlEditor.ToolbarContext){
+                    this.toolbars[i].tb.hide();
+                    this.toolbars[i].footer.hide();
                 }
-            });
+            }
             
         }else{
             Roo.log('editor - hiding textarea');
@@ -26545,16 +26545,19 @@ Roo.extend(Roo.form.HtmlEditor, Roo.form.Field, {
             this.el.addClass('x-hidden');
             this.el.dom.setAttribute('tabIndex', -1);
             
-            Roo.each(this.toolbars, function(t){
-                if(t instanceof Roo.form.HtmlEditor.ToolbarContext){
-                    t.tb.show();
-                    t.footer.show();
+            for (var i = 0; i < this.toolbars.length; i++) {
+                if(this.toolbars[i] instanceof Roo.form.HtmlEditor.ToolbarContext){
+                    this.toolbars[i].tb.show();
+                    this.toolbars[i].footer.show();
                 }
-            });
+            }
+            
             //this.deferFocus();
         }
-         
+        
         this.setSize(this.wrap.getSize());
+        this.onResize(this.wrap.getSize().width, this.wrap.getSize().height);
+        
         this.fireEvent('editmodechange', this, this.editorcore.sourceEditMode);
     },
  
index ad61890..2eea296 100644 (file)
@@ -594,9 +594,9 @@ this.cblack.push(A);},this);}});Roo.HtmlEditorCore.white=['area','br','img','inp
 //Roo/form/HtmlEditor.js
 Roo.form.HtmlEditor=function(A){Roo.form.HtmlEditor.superclass.constructor.call(this,A);if(!this.toolbars){this.toolbars=[];}
 this.editorcore=new Roo.HtmlEditorCore(Roo.apply({owner:this},A));};Roo.extend(Roo.form.HtmlEditor,Roo.form.Field,{clearUp:true,toolbars:false,resizable:false,height:300,width:500,stylesheets:false,cblack:false,cwhite:false,black:false,white:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',actionMode:'container',defaultAutoCreate:{tag:"textarea",style:"width:500px;height:300px;",autocomplete:"off"},initComponent:function(){this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editmodechange:true,editorevent:true,firstfocus:true,autosave:true,savedpreview:true});this.defaultAutoCreate={tag:"textarea",style:'width: '+this.width+'px;height: '+this.height+'px;',autocomplete:"off"};},createToolbar:function(A){Roo.log("create toolbars");if(!A.toolbars||!A.toolbars.length){A.toolbars=[new Roo.form.HtmlEditor.ToolbarStandard()];}for(var i=0;i<A.toolbars.length;i++){A.toolbars[i]=Roo.factory(typeof(A.toolbars[i])=='string'?{xtype:A.toolbars[i]}:A.toolbars[i],Roo.form.HtmlEditor);A.toolbars[i].init(A);}},onRender:function(ct,A){var _t=this;Roo.form.HtmlEditor.superclass.onRender.call(this,ct,A);this.wrap=this.el.wrap({cls:'x-html-editor-wrap',cn:{cls:'x-html-editor-tb'}});this.editorcore.onRender(ct,A);if(this.resizable){this.resizeEl=new Roo.Resizable(this.wrap,{pinned:true,wrap:true,dynamic:true,minHeight:this.height,height:this.height,handles:this.resizable,width:this.width,listeners:{resize:function(r,w,h){_t.onResize(w,h);}}});}
-this.createToolbar(this);if(!this.width){this.setSize(this.wrap.getSize());}if(this.resizeEl){this.resizeEl.resizeTo.defer(100,this.resizeEl,[this.width,this.height]);}},onResize:function(w,h){Roo.form.HtmlEditor.superclass.onResize.apply(this,arguments);var ew=false;var eh=false;if(this.el){if(typeof w=='number'){var aw=w-this.wrap.getFrameWidth('lr');this.el.setWidth(this.adjustWidth('textarea',aw));ew=aw;}if(typeof h=='number'){var A=0;for(var i=0;i<this.toolbars.length;i++){A+=this.toolbars[i].tb.el.getHeight();if(this.toolbars[i].footer){A+=this.toolbars[i].footer.el.getHeight();}}var ah=h-this.wrap.getFrameWidth('tb')-A;ah-=5;this.el.setHeight(this.adjustWidth('textarea',ah));var eh=ah;}}
-Roo.log('onResize:'+[w,h,ew,eh].join(','));this.editorcore.onResize(ew,eh);},toggleSourceEdit:function(A){this.editorcore.toggleSourceEdit(A);if(this.editorcore.sourceEditMode){Roo.log('editor - showing textarea');this.editorcore.syncValue();this.el.removeClass('x-hidden');this.el.dom.removeAttribute('tabIndex');this.el.focus();Roo.each(this.toolbars,function(t){if(t instanceof Roo.form.HtmlEditor.ToolbarContext){t.tb.hide();t.footer.hide();}});}else {Roo.log('editor - hiding textarea');this.editorcore.pushValue();this.el.addClass('x-hidden');this.el.dom.setAttribute('tabIndex',-1);Roo.each(this.toolbars,function(t){if(t instanceof Roo.form.HtmlEditor.ToolbarContext){t.tb.show();t.footer.show();}});}
-this.setSize(this.wrap.getSize());this.fireEvent('editmodechange',this,this.editorcore.sourceEditMode);},adjustSize:Roo.BoxComponent.prototype.adjustSize,getResizeEl:function(){return this.wrap;},getPositionEl:function(){return this.wrap;},initEvents:function(){this.originalValue=this.getValue();},markInvalid:Roo.emptyFn,clearInvalid:Roo.emptyFn,setValue:function(v){Roo.form.HtmlEditor.superclass.setValue.call(this,v);this.editorcore.pushValue();},deferFocus:function(){this.focus.defer(10,this);},focus:function(){this.editorcore.focus();},onDestroy:function(){if(this.rendered){for(var i=0;i<this.toolbars.length;i++){this.toolbars[i].onDestroy();}
+this.createToolbar(this);if(!this.width){this.setSize(this.wrap.getSize());}if(this.resizeEl){this.resizeEl.resizeTo.defer(100,this.resizeEl,[this.width,this.height]);}},onResize:function(w,h){Roo.form.HtmlEditor.superclass.onResize.apply(this,arguments);var ew=false;var eh=false;if(this.el){if(typeof w=='number'){var aw=w-this.wrap.getFrameWidth('lr');this.el.setWidth(this.adjustWidth('textarea',aw));ew=aw;}if(typeof h=='number'){var A=0;for(var i=0;i<this.toolbars.length;i++){A+=this.toolbars[i].tb.el.getHeight();if(this.toolbars[i].footer){A+=this.toolbars[i].footer.el.getHeight();}}var ah=h-this.wrap.getFrameWidth('tb')-A;ah-=5;Roo.log(ah);this.el.setHeight(this.adjustWidth('textarea',ah));var eh=ah;}}
+Roo.log('onResize:'+[w,h,ew,eh].join(','));this.editorcore.onResize(ew,eh);},toggleSourceEdit:function(A){this.editorcore.toggleSourceEdit(A);if(this.editorcore.sourceEditMode){Roo.log('editor - showing textarea');this.editorcore.syncValue();this.el.removeClass('x-hidden');this.el.dom.removeAttribute('tabIndex');this.el.focus();for(var i=0;i<this.toolbars.length;i++){if(this.toolbars[i] instanceof Roo.form.HtmlEditor.ToolbarContext){this.toolbars[i].tb.hide();this.toolbars[i].footer.hide();}}}else {Roo.log('editor - hiding textarea');this.editorcore.pushValue();this.el.addClass('x-hidden');this.el.dom.setAttribute('tabIndex',-1);for(var i=0;i<this.toolbars.length;i++){if(this.toolbars[i] instanceof Roo.form.HtmlEditor.ToolbarContext){this.toolbars[i].tb.show();this.toolbars[i].footer.show();}}}
+this.setSize(this.wrap.getSize());this.onResize(this.wrap.getSize().width,this.wrap.getSize().height);this.fireEvent('editmodechange',this,this.editorcore.sourceEditMode);},adjustSize:Roo.BoxComponent.prototype.adjustSize,getResizeEl:function(){return this.wrap;},getPositionEl:function(){return this.wrap;},initEvents:function(){this.originalValue=this.getValue();},markInvalid:Roo.emptyFn,clearInvalid:Roo.emptyFn,setValue:function(v){Roo.form.HtmlEditor.superclass.setValue.call(this,v);this.editorcore.pushValue();},deferFocus:function(){this.focus.defer(10,this);},focus:function(){this.editorcore.focus();},onDestroy:function(){if(this.rendered){for(var i=0;i<this.toolbars.length;i++){this.toolbars[i].onDestroy();}
 this.wrap.dom.innerHTML='';this.wrap.remove();}},onFirstFocus:function(){this.editorcore.onFirstFocus();for(var i=0;i<this.toolbars.length;i++){this.toolbars[i].onFirstFocus();}},syncValue:function(){this.editorcore.syncValue();},pushValue:function(){this.editorcore.pushValue();}});
 //Roo/form/HtmlEditor/ToolbarStandard.js
 Roo.form.HtmlEditor.ToolbarStandard=function(A){Roo.apply(this,A);this.disable=this.disable||{};Roo.applyIf(this.disable,{fontSize:true,colors:true,specialElements:true});}