Advertisement
Guest User

Untitled

a guest
Jan 19th, 2022
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
  2.  
  3.     enableFormat : true,
  4.  
  5.     enableFontSize : false,
  6.  
  7.     enableColors : true,
  8.  
  9.     enableAlignments : true,
  10.  
  11.     enableLists : true,
  12.  
  13.     enableSourceEdit : true,
  14.  
  15.     enableLinks : true,
  16.  
  17.     enableFont : true,
  18.  
  19.     createLinkText : 'Please enter the URL for the link:',
  20.  
  21.     defaultLinkValue : 'http:/'+'/',
  22.  
  23.     fontFamilies : [
  24.         'Arial',
  25.         'Courier New', //keka2
  26.         'Tahoma',
  27.         'Times New Roman',
  28.         'Verdana',
  29.     ],
  30.     defaultFont: 'arial',
  31.  
  32.     defaultValue: (Ext.isOpera || Ext.isIE6) ? ' ' : '​',
  33.  
  34.  
  35.     actionMode: 'wrap',
  36.     validationEvent : false,
  37.     deferHeight: true,
  38.     initialized : false,
  39.     activated : false,
  40.     sourceEditMode : false,
  41.     iframePad:3,
  42.     hideMode:'offsets',
  43.     defaultAutoCreate : {
  44.         tag: "textarea",
  45.         style:"width:500px;height:300px;",
  46.         autocomplete: "off"
  47.     },
  48.  
  49.  
  50.     initComponent : function(){
  51.         this.addEvents(
  52.  
  53.             'initialize',
  54.  
  55.             'activate',
  56.  
  57.             'beforesync',
  58.  
  59.             'beforepush',
  60.  
  61.             'sync',
  62.  
  63.             'push',
  64.  
  65.             'editmodechange'
  66.         );
  67.         Ext.form.HtmlEditor.superclass.initComponent.call(this);
  68.     },
  69.  
  70.  
  71.     createFontOptions : function(){
  72.         var buf = [], fs = this.fontFamilies, ff, lc;
  73.         for(var i = 0, len = fs.length; i< len; i++){
  74.             ff = fs[i]; //keka1
  75.             lc = ff.toLowerCase();
  76.             buf.push(
  77.                 '<option value="',lc,'" label="',ff,'" style="font-family:',ff,';"',
  78.                     (!this.defaultFont == lc ? ' selected="true">' : '>'),
  79.                     ff,
  80.                 '</option>'
  81.             );
  82.         }
  83.         return buf.join('');
  84.     },
  85.  
  86.  
  87.     createToolbar : function(editor){
  88.         var items = [];
  89.         var tipsEnabled = Ext.QuickTips && Ext.QuickTips.isEnabled();
  90.  
  91.  
  92.         function btn(id, toggle, handler){
  93.             return {
  94.                 itemId : id,
  95.                 cls : 'x-btn-icon',
  96.                 iconCls: 'x-edit-'+id,
  97.                 enableToggle:toggle !== false,
  98.                 scope: editor,
  99.                 handler:handler||editor.relayBtnCmd,
  100.                 clickEvent:'mousedown',
  101.                 tooltip: tipsEnabled ? editor.buttonTips[id] || undefined : undefined,
  102.                 overflowText: editor.buttonTips[id].title || undefined,
  103.                 tabIndex:-1
  104.             };
  105.         }
  106.  
  107.  
  108.         if(this.enableFont && !Ext.isSafari2){
  109.             var fontSelectItem = new Ext.Toolbar.Item({
  110.                autoEl: {
  111.                     tag:'select',
  112.                     cls:'x-font-select',
  113.                     html: this.createFontOptions()
  114.                }
  115.             });
  116.  
  117.             items.push(
  118.                 fontSelectItem,
  119.             );
  120.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement