gHtmlEditor = Ext.extend(Ext.form.HtmlEditor, {
textMode:false,
invalidMarker:'',
tags:'',
hideMode:'display',
//implementa i metodi non supportati
markInvalid:function(msg) {
//var bd = this.getEditorBody();
//this.savedBorderStyle=bd.style.border;
//bd.style.border='1px solid #DD7870';
if (this.invalidMarker) {
this.invalidMarker.getEl().setStyle('width','0px');
this.invalidMarker.getEl().setStyle('padding','0');
this.invalidMarker.getEl().setStyle('border','none');
this.invalidMarker.getEl().setStyle('display','block');
this.invalidMarker.markInvalid(msg);
}
},
clearInvalid:function() {
//var bd = this.getEditorBody();
//bd.style.border=this.savedBorderStyle;
if (this.invalidMarker) {
this.invalidMarker.getEl().setStyle('display','none');
this.invalidMarker.clearInvalid();
}
},
hide:function(obj) {
this.wrap.dom.style.display='none';
return gHtmlEditor.superclass.hide.call(this,obj);
},
show:function(obj) {
this.wrap.dom.style.display='block';
return gHtmlEditor.superclass.show.call(this,obj);
},
onRender:function(ct, position) {
if (this.textMode) {
this.enableFormat=this.enableFontSize=this.enableColors=false;
this.enableAlignments=this.enableLists=this.enableLinks=this.enableFont=this.enableSourceEdit=false;
}
gHtmlEditor.superclass.onRender.call(this,ct, position);
},
createToolbar:function(o) {
//call standard method
gHtmlEditor.superclass.createToolbar.call(this,o);
//create user-defined toolbar buttons
function createTagOptions(o){ //build tag options
var buf=[],fs=o.tags,ff,lc,text;
buf.push('');
for(var i=0,len=fs.length;i',text,'');
}
buf.push('');
buf.push('');
buf.push('');
return buf.join('');
};
var tb=this.tb;
var shtml=createTagOptions(this); //obtaing option html
this.tagSelect = tb.el.createChild({ //build new select object to be added to the toolbar
tag:'select',
cls:'x-tag-select',
html:shtml
});
this.tagSelect.on('change', function() { //on change add the new tag
var tag = this.tagSelect.dom.value;
if (tag!='') {
this.insertAtCursor(tag);
this.deferFocus();
}
}, this);
if (!this.textMode)
tb.add('-');
tb.add('Tags ');
tb.add(this.tagSelect.dom);
}
});