Fix #7586 - more events for editor
[roojs1] / roojs-all.js
index ec0fa8a..08309a6 100644 (file)
@@ -2144,10 +2144,10 @@ Roo.HtmlEditorCore.tag_remove=['FONT','TBODY'];Roo.HtmlEditorCore.ablack=['on'];
 
 // 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,allowComments:false,enableBlocks:true,autoClean:true,bodyCls:'',language:'en',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:"new-password"}
-,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,stylesheetsclick:true,paste:true});this.defaultAutoCreate={tag:"textarea",style:'width: '+this.width+'px;height: '+this.height+'px;',autocomplete:"new-password"}
-;},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);}},getSelectedNode:function(){if(this.toolbars.length<2||!this.toolbars[1].tb){return false;}return this.toolbars[1].tb.selectedNode;},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);
+,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,stylesheetsclick:true,paste:true,imageadd:true,imagedelete:true}
+);this.defaultAutoCreate={tag:"textarea",style:'width: '+this.width+'px;height: '+this.height+'px;',autocomplete:"new-password"};},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);}},getSelectedNode:function(){if(this.toolbars.length<2||!this.toolbars[1].tb){return false;
+}return this.toolbars[1].tb.selectedNode;},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]);}this.keyNav=new Roo.KeyNav(this.el,{"tab":function(e){e.preventDefault();var B=this.getValue();
 var C=this.el.dom.selectionStart;var D=this.el.dom.selectionEnd;if(!e.shiftKey){this.setValue(B.substring(0,C)+"\t"+B.substring(D));this.el.dom.setSelectionRange(D+1,D+1);return;}var f=B.substring(0,C).split("\t");if(f.pop().length!=0){return;}this.setValue(f.join("\t")+B.substring(D));
 this.el.dom.setSelectionRange(C-1,C-1);},"home":function(e){e.preventDefault();var B=this.el.dom.selectionStart;var C=this.getValue().split("\n");if(!C.length){return;}if(e.ctrlKey){this.el.dom.setSelectionRange(0,0);return;}var D=0;for(var i=0;i<C.length;