Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
- enableFormat : true,
- enableFontSize : false,
- enableColors : true,
- enableAlignments : true,
- enableLists : true,
- enableSourceEdit : true,
- enableLinks : true,
- enableFont : true,
- createLinkText : 'Please enter the URL for the link:',
- defaultLinkValue : 'http:/'+'/',
- fontFamilies : [
- 'Arial',
- 'Courier New', //keka2
- 'Tahoma',
- 'Times New Roman',
- 'Verdana',
- ],
- defaultFont: 'arial',
- defaultValue: (Ext.isOpera || Ext.isIE6) ? ' ' : '​',
- actionMode: 'wrap',
- validationEvent : false,
- deferHeight: true,
- initialized : false,
- activated : false,
- sourceEditMode : false,
- iframePad:3,
- hideMode:'offsets',
- defaultAutoCreate : {
- tag: "textarea",
- style:"width:500px;height:300px;",
- autocomplete: "off"
- },
- initComponent : function(){
- this.addEvents(
- 'initialize',
- 'activate',
- 'beforesync',
- 'beforepush',
- 'sync',
- 'push',
- 'editmodechange'
- );
- Ext.form.HtmlEditor.superclass.initComponent.call(this);
- },
- createFontOptions : function(){
- var buf = [], fs = this.fontFamilies, ff, lc;
- for(var i = 0, len = fs.length; i< len; i++){
- ff = fs[i]; //keka1
- lc = ff.toLowerCase();
- buf.push(
- '<option value="',lc,'" label="',ff,'" style="font-family:',ff,';"',
- (!this.defaultFont == lc ? ' selected="true">' : '>'),
- ff,
- '</option>'
- );
- }
- return buf.join('');
- },
- createToolbar : function(editor){
- var items = [];
- var tipsEnabled = Ext.QuickTips && Ext.QuickTips.isEnabled();
- function btn(id, toggle, handler){
- return {
- itemId : id,
- cls : 'x-btn-icon',
- iconCls: 'x-edit-'+id,
- enableToggle:toggle !== false,
- scope: editor,
- handler:handler||editor.relayBtnCmd,
- clickEvent:'mousedown',
- tooltip: tipsEnabled ? editor.buttonTips[id] || undefined : undefined,
- overflowText: editor.buttonTips[id].title || undefined,
- tabIndex:-1
- };
- }
- if(this.enableFont && !Ext.isSafari2){
- var fontSelectItem = new Ext.Toolbar.Item({
- autoEl: {
- tag:'select',
- cls:'x-font-select',
- html: this.createFontOptions()
- }
- });
- items.push(
- fontSelectItem,
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement