Changeset 2d889ec in github


Ignore:
Timestamp:
May 2, 2011 3:49:34 AM (2 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
87e58c7
Parents:
2a38001
Message:
  • Add possibility to change HTML editor configuration by skin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    rcf58ce8 r2d889ec  
    22=========================== 
    33 
     4- Add possibility to change HTML editor configuration by skin 
    45- Fix a bug where selecting too many contacts would produce too large URI request (#1487892) 
    56- Fix relative URLs handling according to a <base> in HTML (#1487889) 
  • program/js/editor.js

    r94dfd8a r2d889ec  
    1717function rcmail_editor_init(skin_path, editor_lang, spellcheck, mode) 
    1818{ 
    19   if (mode == 'identity') 
    20     tinyMCE.init({ 
     19  var ret, conf = { 
    2120      mode: 'textareas', 
    2221      editor_selector: 'mce_editor', 
     
    2524      language: editor_lang, 
    2625      content_css: skin_path + '/editor_content.css', 
    27       plugins: 'paste,tabfocus', 
    2826      theme_advanced_toolbar_location: 'top', 
    2927      theme_advanced_toolbar_align: 'left', 
     28      theme_advanced_buttons3: '', 
     29      extended_valid_elements: 'font[face|size|color|style],span[id|class|align|style]', 
     30      relative_urls: false, 
     31      remove_script_host: false, 
     32      gecko_spellcheck: true, 
     33      convert_urls: false, // #1486944 
     34      external_image_list_url: 'program/js/editor_images.js', 
     35      rc_client: rcmail 
     36    }; 
     37 
     38  if (mode == 'identity') 
     39    $.extend(conf, { 
     40      plugins: 'paste,tabfocus', 
    3041      theme_advanced_buttons1: 'bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,separator,outdent,indent,charmap,hr,link,unlink,code,forecolor', 
    3142      theme_advanced_buttons2: ',fontselect,fontsizeselect', 
    32       theme_advanced_buttons3: '', 
    33       relative_urls: false, 
    34       remove_script_host: false, 
    35       gecko_spellcheck: true 
    3643    }); 
    3744  else // mail compose 
    38     tinyMCE.init({ 
    39       mode: 'textareas', 
    40       editor_selector: 'mce_editor', 
    41       accessibility_focus: false, 
    42       apply_source_formatting: true, 
    43       theme: 'advanced', 
    44       language: editor_lang, 
     45    $.extend(conf, { 
    4546      plugins: 'paste,emotions,media,nonbreaking,table,searchreplace,visualchars,directionality,tabfocus,contextmenu' + (spellcheck ? ',spellchecker' : ''), 
    4647      theme_advanced_buttons1: 'bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,outdent,indent,ltr,rtl,blockquote,|,forecolor,backcolor,fontselect,fontsizeselect', 
    4748      theme_advanced_buttons2: 'link,unlink,code,|,emotions,charmap,image,media,|,search' + (spellcheck ? ',spellchecker' : '') + ',undo,redo', 
    48       theme_advanced_buttons3: '', 
    49       theme_advanced_toolbar_location: 'top', 
    50       theme_advanced_toolbar_align: 'left', 
    51       extended_valid_elements: 'font[face|size|color|style],span[id|class|align|style]', 
    52       content_css: skin_path + '/editor_content.css', 
    53       external_image_list_url: 'program/js/editor_images.js', 
    5449      spellchecker_languages: (rcmail.env.spellcheck_langs ? rcmail.env.spellcheck_langs : 'Dansk=da,Deutsch=de,+English=en,Espanol=es,Francais=fr,Italiano=it,Nederlands=nl,Polski=pl,Portugues=pt,Suomi=fi,Svenska=sv'), 
    5550      spellchecker_rpc_url: '?_task=utils&_action=spell&tiny=1', 
    56       gecko_spellcheck: true, 
    57       remove_script_host: false, 
    58       relative_urls: false, 
    59       convert_urls: false, // #1486944 
    60       rc_client: rcmail, 
     51      accessibility_focus: false, 
    6152      oninit: 'rcmail_editor_callback' 
    6253    }); 
     54 
     55  // support external configuration settings e.g. from skin 
     56  if (window.rcmail_editor_settings) 
     57    $.extend(conf, window.rcmail_editor_settings); 
     58 
     59  tinyMCE.init(conf); 
    6360} 
    6461 
Note: See TracChangeset for help on using the changeset viewer.