alecpl
2010-03-28 7a48e5539f2d2f1346d9f87a3c06c281a3078aa1
program/js/editor.js
@@ -24,6 +24,7 @@
      theme : 'advanced',
      language : editor_lang,
      content_css : skin_path + '/editor_content.css',
      plugins: 'paste',
      theme_advanced_toolbar_location : 'top',
      theme_advanced_toolbar_align : 'left',
      theme_advanced_buttons1 : 'bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,separator,outdent,indent,charmap,hr,link,unlink,code,forecolor',
@@ -41,9 +42,9 @@
      apply_source_formatting : true,
      theme : 'advanced',
      language : editor_lang,
      plugins : 'emotions,media,nonbreaking,table,searchreplace,visualchars,directionality' + (spellcheck ? ',spellchecker' : ''),
      theme_advanced_buttons1 : 'bold,italic,underline,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,outdent,indent,separator,link,unlink,emotions,charmap,code,forecolor,backcolor,fontselect,fontsizeselect, separator' + (spellcheck ? ',spellchecker' : '') + ',undo,redo,image,media,ltr,rtl',
      theme_advanced_buttons2 : '',
      plugins : 'paste,emotions,media,nonbreaking,table,searchreplace,visualchars,directionality' + (spellcheck ? ',spellchecker' : ''),
      theme_advanced_buttons1 : 'bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,outdent,indent,ltr,rtl,blockquote,|,forecolor,backcolor,fontselect,fontsizeselect',
      theme_advanced_buttons2 : 'link,unlink,code,|,emotions,charmap,image,media,|,search' + (spellcheck ? ',spellchecker' : '') + ',undo,redo',
      theme_advanced_buttons3 : '',
      theme_advanced_toolbar_location : 'top',
      theme_advanced_toolbar_align : 'left',
@@ -66,7 +67,7 @@
  if (input_from && input_from.type=='select-one')
    rcmail.change_identity(input_from);
  // set tabIndex
  rcmail_editor_tabindex()
  rcmail_editor_tabindex();
}
// set tabIndex on tinyMCE editor
@@ -82,10 +83,15 @@
}
// switch html/plain mode
function rcmail_toggle_editor(ishtml, textAreaId, flagElement)
function rcmail_toggle_editor(select, textAreaId, flagElement)
{
  var composeElement = document.getElementById(textAreaId);
  var flag;
  var flag, ishtml;
  if (select.tagName != 'SELECT')
    ishtml = select.checked;
  else
    ishtml = select.value == 'html';
  if (ishtml)
    {
@@ -99,12 +105,19 @@
    }
  else
    {
    if (!confirm(rcmail.get_label('editorwarning')))
      return false;
    var thisMCE = tinyMCE.get(textAreaId);
    var existingHtml = thisMCE.getContent();
    rcmail.html2plain(existingHtml, textAreaId);
    if (existingHtml) {
      if (!confirm(rcmail.get_label('editorwarning'))) {
        if (select.tagName == 'SELECT')
     select.value = 'html';
        return false;
   }
      rcmail.html2plain(existingHtml, textAreaId);
      }
    tinyMCE.execCommand('mceRemoveControl', true, textAreaId);
    rcmail.display_spellcheck_controls(true);
    if (flagElement && (flag = rcube_find_object(flagElement)))