if (!this.toolbars) {
this.toolbars = [];
}
+
this.editorcore = new Roo.HtmlEditorCore(Roo.apply({ owner : this} , config));
this.addEvents({
/**
* @cfg {Array} toolbars Array of toolbars. - defaults to just the Standard one
*/
toolbars : false,
+
+ /**
+ * @cfg {Array} buttons Array of toolbar's buttons. - defaults to empty
+ */
+ btns : [],
/**
* @cfg {String} resizable 's' or 'se' or 'e' - wrapps the element in a
/**
* @cfg {Number} width (in pixels)
*/
- width: 500,
+ width: false,
/**
* @cfg {Array} stylesheets url of stylesheets. set to [] to disable stylesheets.
iframePad:3,
hideMode:'offsets',
-
tbContainer : false,
+ bodyCls : '',
+
toolbarContainer :function() {
return this.wrap.select('.x-html-editor-tb',true).first();
},
* @param {HtmlEditor} editor
*/
createToolbar : function(){
+ Roo.log('renewing');
+ Roo.log("create toolbars");
- this.toolbars = [ new Roo.bootstrap.HtmlEditor.ToolbarStandard({editor: this} ) ];
+ this.toolbars = [ new Roo.bootstrap.htmleditor.ToolbarStandard({editor: this} ) ];
this.toolbars[0].render(this.toolbarContainer());
-
- Roo.log("create toolbars");
- return;
- if (!editor.toolbars || !editor.toolbars.length) {
- editor.toolbars = [ new Roo.bootstrap.HtmlEditor.ToolbarStandard() ]; // can be empty?
- }
- for (var i =0 ; i < editor.toolbars.length;i++) {
- editor.toolbars[i] = Roo.factory(
- typeof(editor.toolbars[i]) == 'string' ?
- { xtype: editor.toolbars[i]} : editor.toolbars[i],
- Roo.bootstrap.HtmlEditor);
- editor.toolbars[i].init(editor);
- }
-
+ return;
+// if (!editor.toolbars || !editor.toolbars.length) {
+// editor.toolbars = [ new Roo.bootstrap.HtmlEditor.ToolbarStandard() ]; // can be empty?
+// }
+//
+// for (var i =0 ; i < editor.toolbars.length;i++) {
+// editor.toolbars[i] = Roo.factory(
+// typeof(editor.toolbars[i]) == 'string' ?
+// { xtype: editor.toolbars[i]} : editor.toolbars[i],
+// Roo.bootstrap.HtmlEditor);
+// editor.toolbars[i].init(editor);
+// }
},
});
this.editorcore.onRender(ct, position);
-//
-// 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); // -something
-// }
-// }
-// });
-//
-// }
+
+ 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); // -something
+ }
+ }
+ });
+
+ }
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 ] );
-// // should trigger onReize..
-// }
-// if(this.autosave && this.w){
-// this.autoSaveFn = setInterval(this.autosave, 1000);
-// }
+ if(!this.width && this.resizable){
+ this.setSize(this.wrap.getSize());
+ }
+ if (this.resizeEl) {
+ this.resizeEl.resizeTo.defer(100, this.resizeEl,[ this.width,this.height ] );
+ // should trigger onReize..
+ }
+
},
// private
// Roo.log('in');
// Roo.log(this.syncValue());
- this.editorcore.syncValue();
- this.inputEl().removeClass('hide');
+ this.syncValue();
+ this.inputEl().removeClass(['hide', 'x-hidden']);
this.inputEl().dom.removeAttribute('tabIndex');
this.inputEl().focus();
}else{
Roo.log('editor - hiding textarea');
// Roo.log('out')
// Roo.log(this.pushValue());
- this.editorcore.pushValue();
+ this.pushValue();
- this.inputEl().addClass('hide');
+ this.inputEl().addClass(['hide', 'x-hidden']);
this.inputEl().dom.setAttribute('tabIndex', -1);
//this.deferFocus();
}
- this.setSize(this.wrap.getSize());
+ if(this.resizable){
+ this.setSize(this.wrap.getSize());
+ }
+
this.fireEvent('editmodechange', this, this.editorcore.sourceEditMode);
},
this.originalValue = this.getValue();
},
- /**
- * Overridden and disabled. The editor element does not support standard valid/invalid marking. @hide
- * @method
- */
- markInvalid : Roo.emptyFn,
- /**
- * Overridden and disabled. The editor element does not support standard valid/invalid marking. @hide
- * @method
- */
- clearInvalid : Roo.emptyFn,
+// /**
+// * Overridden and disabled. The editor element does not support standard valid/invalid marking. @hide
+// * @method
+// */
+// markInvalid : Roo.emptyFn,
+// /**
+// * Overridden and disabled. The editor element does not support standard valid/invalid marking. @hide
+// * @method
+// */
+// clearInvalid : Roo.emptyFn,
setValue : function(v){
Roo.bootstrap.HtmlEditor.superclass.setValue.call(this, v);
// private
syncValue : function()
- {
+ {
this.editorcore.syncValue();
},
pushValue : function()
- {
+ {
this.editorcore.pushValue();
}
/**
* @cfg {String} inputType @hide
*/
- /**
- * @cfg {String} invalidClass @hide
- */
+
/**
* @cfg {String} invalidText @hide
*/