Ticket #1484862: tinymce3.diff

File tinymce3.diff, 17.6 kB (added by alec, 8 months ago)
  • program/include/rcube_html.inc

    diff -ruN rc-trunk/program/include/rcube_html.inc rc1/program/include/rcube_html.inc
    old new  
    496496    if (isset($this->attrib['value'])) 
    497497      unset($this->attrib['value']); 
    498498 
    499     if (!empty($value) && !isset($this->attrib['mce_editable'])) 
     499    if (!empty($value)) 
    500500      $value = Q($value, 'strict', FALSE); 
    501501 
    502502    // return final tag 
  • program/js/app.js

    diff -ruN rc-trunk/program/js/app.js rc1/program/js/app.js
    old new  
    33503327    }; 
    33513328 
    33523329 
    3353   this.toggle_editor = function(checkbox, textElementName) 
     3330  this.toggle_editor = function(checkbox, textElementID) 
    33543331    { 
    33553332    var ischecked = checkbox.checked; 
    33563333    if (ischecked) 
    33573334      { 
    3358         tinyMCE.execCommand('mceAddControl', true, textElementName); 
     3335        tinyMCE.execCommand('mceAddControl', true, textElementID); 
    33593336      } 
    33603337    else 
    33613338      { 
    3362         tinyMCE.execCommand('mceRemoveControl', true, textElementName); 
     3339        tinyMCE.execCommand('mceRemoveControl', true, textElementID); 
    33633340      } 
    33643341    }; 
    33653342 
  • program/js/editor.js

    diff -ruN rc-trunk/program/js/editor.js rc1/program/js/editor.js
    old new  
    1515 
    1616// Initialize the message editor 
    1717 
    18 function rcmail_editor_init(skin_path) 
     18function rcmail_editor_init(skin_path, lang) 
    1919  { 
    2020  tinyMCE.init({ mode : 'specific_textareas', 
    21                  accessibility_focus : false, 
    22                  apply_source_formatting : true, 
    23                  theme : 'advanced', 
    24                  plugins : 'emotions,media,nonbreaking,table,searchreplace,spellchecker,visualchars', 
    25                  theme_advanced_buttons1 : 'bold,italic,underline,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,outdent,indent,separator,emotions,charmap,code,forecolor,backcolor,fontselect,fontsizeselect, separator,undo,redo,image,media', 
    26                  theme_advanced_buttons2 : '', 
    27                  theme_advanced_buttons3 : '', 
    28                  theme_advanced_toolbar_location : 'top', 
    29                  theme_advanced_toolbar_align : 'left', 
    30                  extended_valid_elements : 'font[face|size|color|style],span[id|class|align|style]', 
    31                  content_css : skin_path + '/editor_content.css', 
    32                  editor_css : skin_path + '/editor_ui.css', 
    33                  external_image_list_url : 'program/js/editor_images.js' 
     21                editor_selector: "mce_editable", 
     22                accessibility_focus : false, 
     23                theme : 'advanced', 
     24                language: lang, 
     25                plugins : 'emotions,media,nonbreaking,table,searchreplace,spellchecker,visualchars', 
     26                theme_advanced_buttons1 : 'bold,italic,underline,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,outdent,indent,separator,emotions,charmap,code,forecolor,backcolor,fontselect,fontsizeselect, separator,undo,redo,image,media', 
     27                theme_advanced_buttons2 : '', 
     28                theme_advanced_buttons3 : '', 
     29                theme_advanced_toolbar_location : 'top', 
     30                theme_advanced_toolbar_align : 'left', 
     31                extended_valid_elements : 'font[face|size|color|style],span[id|class|align|style]', 
     32                content_css : skin_path + '/editor_content.css', 
     33                external_image_list_url : 'program/js/editor_images.js' 
    3434               }); 
    3535  } 
    3636 
     
    8080    var existingPlainText = composeElement.value; 
    8181    var htmlText = "<pre>" + existingPlainText + "</pre>"; 
    8282    composeElement.value = htmlText; 
    83     tinyMCE.execCommand('mceAddControl', true, '_message'); 
     83    tinyMCE.execCommand('mceAddControl', true, 'compose-body'); 
    8484    htmlFlag.value = "1"; 
    8585    } 
    8686  else 
    8787    { 
    8888    rcmail.set_busy(true, 'converting'); 
    89     var thisMCE = tinyMCE.getInstanceById('_message'); 
    90     var existingHtml = tinyMCE.getContent(); 
     89    var existingHtml = tinyMCE.get('compose-body').getContent(); 
    9190    rcmail_html2plain(existingHtml); 
    92     tinyMCE.execCommand('mceRemoveControl', true, '_message'); 
     91    tinyMCE.execCommand('mceRemoveControl', true, 'compose-body'); 
    9392    htmlFlag.value = "0"; 
    9493    } 
    9594  } 
  • program/steps/mail/compose.inc

    diff -ruN rc-trunk/program/steps/mail/compose.inc rc1/program/steps/mail/compose.inc
    old new  
    409409    $body = rcmail_create_draft_body($body, $isHtml); 
    410410    } 
    411411 
     412  $tinylang = substr($_SESSION['user_lang'], 0, 2); 
     413  if(!file_exists('program/js/tiny_mce/langs/'.$tinylang.'.js')) { 
     414    $tinylang = 'en'; 
     415  } 
     416 
    412417  $OUTPUT->include_script('tiny_mce/tiny_mce.js'); 
    413418  $OUTPUT->include_script("editor.js"); 
    414   $OUTPUT->add_script('rcmail_editor_init("$__skin_path");'); 
     419  $OUTPUT->add_script('rcmail_editor_init("$__skin_path","'.$tinylang.'");'); 
    415420 
    416421  $out = $form_start ? "$form_start\n" : ''; 
    417422 
     
    426431 
    427432  // If desired, set this text area to be editable by TinyMCE 
    428433  if ($isHtml) 
    429     $attrib['mce_editable'] = "true"; 
     434    $attrib['class'] = "mce_editable"; 
    430435  $textarea = new textarea($attrib); 
    431436  $out .= $textarea->show($body); 
    432437  $out .= $form_end ? "\n$form_end" : ''; 
  • program/steps/settings/edit_identity.inc

    diff -ruN rc-trunk/program/steps/settings/edit_identity.inc rc1/program/steps/settings/edit_identity.inc
    old new  
    3939  { 
    4040  global $IDENTITY_RECORD, $OUTPUT; 
    4141 
    42   $OUTPUT->include_script('tiny_mce/tiny_mce_src.js'); 
     42  $tinylang = substr($_SESSION['user_lang'], 0, 2); 
     43  if(!file_exists('program/js/tiny_mce/langs/'.$tinylang.'.js')) { 
     44    $tinylang = 'en'; 
     45  } 
     46 
     47  $OUTPUT->include_script('tiny_mce/tiny_mce.js'); 
    4348  $OUTPUT->add_script("tinyMCE.init({ mode : 'specific_textareas'," . 
    44                                     "apply_source_formatting : true," . 
    45                                     "content_css : '\$__skin_path' + '/editor_content.css'," . 
    46                                     "editor_css : '\$__skin_path' + '/editor_ui.css'," . 
    47                                     "theme : 'advanced'," . 
    48                                     "theme_advanced_toolbar_location : 'top'," . 
    49                                     "theme_advanced_toolbar_align : 'left'," . 
    50                                     "theme_advanced_buttons1 : 'bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,separator,outdent,indent,charmap,hr'," . 
    51                                     "theme_advanced_buttons2 : 'link,unlink,code,forecolor,fontselect,fontsizeselect'," . 
    52                                     "theme_advanced_buttons3 : '' });"); 
     49                        "editor_selector: 'mce_editable', " . 
     50                        "accessibility_focus: false, " . 
     51                        "language: '$tinylang', " . 
     52                        "apply_source_formatting : true," . 
     53                        "content_css : '\$__skin_path' + '/editor_content.css'," . 
     54                        "theme : 'advanced'," . 
     55                        "theme_advanced_toolbar_location : 'top'," . 
     56                        "theme_advanced_toolbar_align : 'left'," . 
     57                        "theme_advanced_buttons1 : 'bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,separator,outdent,indent,charmap,hr'," . 
     58                        "theme_advanced_buttons2 : 'link,unlink,code,forecolor,fontselect,fontsizeselect'," . 
     59                        "theme_advanced_buttons3 : '' });"); 
    5360 
    5461  if (!$IDENTITY_RECORD && $GLOBALS['_action']!='add-identity') 
    5562    return rcube_label('notfound'); 
     
    6976                       'reply-to'     => array('type' => 'text', 'label' => 'replyto'), 
    7077                       'bcc'          => array('type' => 'text'), 
    7178                       'signature'        => array('type' => 'textarea', 'size' => "40", 'rows' => "6"), 
    72                        'html_signature'=>array('type' => 'checkbox', 'label' => 'htmlsignature', 'onclick' => 'return rcmail.toggle_editor(this, \'_signature\');'), 
     79                       'html_signature'=>array('type' => 'checkbox', 'label' => 'htmlsignature', 'onclick' => 'return rcmail.toggle_editor(this, \'rcmfd_signature\');'), 
    7380                       'standard'     => array('type' => 'checkbox', 'label' => 'setdefault')); 
    7481 
    7582 
     
    104111      { 
    105112      $attrib['size'] = $colprop['size']; 
    106113      $attrib['rows'] = $colprop['rows']; 
    107       $attrib['mce_editable'] = $IDENTITY_RECORD['html_signature'] ? "true" : "false"; 
     114      if ($IDENTITY_RECORD['html_signature']) 
     115        $attrib['class'] =  "mce_editable"; 
    108116      } 
    109117    else 
    110118      { 
    111119      unset($attrib['size']); 
    112120      unset($attrib['rows']); 
    113       unset($attrib['mce_editable']); 
     121      unset($attrib['class']); 
    114122      } 
    115123 
    116124    $label = strlen($colprop['label']) ? $colprop['label'] : $col; 
  • skins/default/editor_ui.css

    diff -ruN rc-trunk/skins/default/editor_ui.css rc1/skins/default/editor_ui.css
    old new  
    1 /* This file contains the CSS data for the editor UI of TinyMCE instances */ 
    2  
    3 .mceToolbarTop a, .mceToolbarTop a:visited, .mceToolbarTop a:hover, .mceToolbarBottom a, .mceToolbarBottom a:visited, .mceToolbarBottom a:hover {border: 0; margin: 0; padding: 0; background: transparent;} 
    4 .mceSeparatorLine {border: 0; padding: 0; margin-left: 4px; margin-right: 2px;} 
    5 .mceSelectList {font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; font-size: 7pt !important; font-weight: normal; margin-top: 3px; padding: 0; display: inline; vertical-align: top; background-color: #F0F0EE;} 
    6 .mceLabel, .mceLabelDisabled {font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; font-size: 9pt;} 
    7 .mceLabel {color: #000000;} 
    8 .mceLabelDisabled {cursor: text; color: #999999;} 
    9 .mceEditor {background: #F0F0EE; border: 1px solid #cccccc; padding: 0; margin: 0;} 
    10 .mceEditorArea { font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; background: #FFFFFF; padding: 0; margin: 0; } 
    11 .mceToolbarTop, .mceToolbarBottom {background: #F0F0EE; line-height: 1px; font-size: 1px;} 
    12 .mceToolbarTop {border-bottom: 1px solid #cccccc; padding-bottom: 1px;} 
    13 .mceToolbarBottom {border-top: 1px solid #cccccc;} 
    14 .mceToolbarContainer {display: block; position: relative; left: 0; top: 0; width: 100%;} 
    15 .mceStatusbarTop, .mceStatusbarBottom, .mceStatusbar {height: 20px;} 
    16 .mceStatusbarTop .mceStatusbarPathText, .mceStatusbarBottom .mceStatusbarPathText, .mceStatusbar .mceStatusbarPathText {font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; font-size: 9pt; padding: 2px; line-height: 16px; overflow: visible;} 
    17 .mceStatusbarTop {border-bottom: 1px solid #cccccc;} 
    18 .mceStatusbarBottom {border-top: 1px solid #cccccc;} 
    19 .mceStatusbar {border-bottom: 1px solid #cccccc;} 
    20 .mcePathItem, .mcePathItem:link, .mcePathItem:visited, .mcePathItem:hover {text-decoration: none; font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; font-size: 9pt; color: #000000;} 
    21 .mcePathItem:hover {text-decoration: underline;} 
    22 .mceStatusbarPathText {float: left;} 
    23 .mceStatusbarResize {float: right; background-image: url('../images/statusbar_resize.gif'); background-repeat: no-repeat; width: 11px; height: 20px; cursor: se-resize;} 
    24 .mceResizeBox {width: 10px; height: 10px; display: none; border: 1px dotted gray; margin: 0; padding: 0;} 
    25 .mceEditorIframe {border: 0;} 
    26  
    27 /* Button CSS rules */ 
    28  
    29 a.mceButtonDisabled img, a.mceButtonNormal img, a.mceButtonSelected img {width: 20px; height: 20px; cursor: default; margin-top: 1px; margin-left: 1px;} 
    30 a.mceButtonDisabled img {border: 0 !important;} 
    31 a.mceButtonNormal img, a.mceButtonSelected img {border: 1px solid #F0F0EE !important;} 
    32 a.mceButtonSelected img {border: 1px solid #6779AA !important; background-color: #D4D5D8;} 
    33 a.mceButtonNormal img:hover, a.mceButtonSelected img:hover {border: 1px solid #0A246A !important; cursor: default; background-color: #B6BDD2;} 
    34 a.mceButtonDisabled img {-moz-opacity:0.3; opacity: 0.3; border: 1px solid #F0F0EE !important; cursor: default;} 
    35 a.mceTiledButton img {background-image: url('../images/buttons.gif'); background-repeat: no-repeat;} 
    36  
    37 /* Menu button CSS rules */ 
    38  
    39 span.mceMenuButton img, span.mceMenuButtonSelected img {border: 1px solid #F0F0EE; margin-left: 1px;} 
    40 span.mceMenuButtonSelected img {border: 1px solid #6779AA; background-color: #B6BDD2;} 
    41 span.mceMenuButtonSelected img.mceMenuButton {border: 1px solid #F0F0EE; background-color: transparent;} 
    42 span.mceMenuButton img.mceMenuButton, span.mceMenuButtonSelected img.mceMenuButton {border-left: 0; margin-left: 0;} 
    43 span.mceMenuButton:hover img, span.mceMenuButtonSelected:hover img {border: 1px solid #0A246A; background-color: #B6BDD2;} 
    44 span.mceMenuButton:hover img.mceMenuButton, span.mceMenuButtonSelected:hover img.mceMenuButton {border-left: 0;} 
    45 span.mceMenuButtonFocus img {border: 1px solid gray; border-right: 0; margin-left: 1px; background-color: #F5F4F2;} 
    46 span.mceMenuButtonFocus img.mceMenuButton {border: 1px solid gray; border-left: 1px solid #F5F4F2; margin-left: 0;} 
    47 span.mceMenuHover img {border: 1px solid #0A246A; background-color: #B6BDD2;} 
    48 span.mceMenuButtonSelected.mceMenuHover img.mceMenuButton {border: 1px solid #0A246A; background-color: #B6BDD2; border-left: 0;} 
    49  
    50 /* Menu */ 
    51  
    52 .mceMenu {position: absolute; left: 0; top: 0; display: none; z-index: 1000; background-color: white; border: 1px solid gray; font-weight: normal;} 
    53 .mceMenu a, .mceMenuTitle, .mceMenuDisabled {display: block; width: 100%; text-decoration: none; background-color: white; font-family: Tahoma, Verdana, Arial, Helvetica; font-size: 11px; line-height: 20px; color: black;} 
    54 .mceMenu a:hover {background-color: #B6BDD2; color: black; text-decoration: none !important;} 
    55 .mceMenu span {padding-left: 10px; padding-right: 10px; display: block; line-height: 20px;} 
    56 .mceMenuSeparator {border-bottom: 1px solid gray; background-color: gray; height: 1px;} 
    57 .mceMenuTitle span {padding-left: 5px;} 
    58 .mceMenuTitle {background-color: #DDDDDD; font-weight: bold;} 
    59 .mceMenuDisabled {color: gray;} 
    60 span.mceMenuSelectedItem {background-image: url('../images/menu_check.gif'); background-repeat: no-repeat; background-position: 5px 8px; padding-left: 20px;} 
    61 span.mceMenuCheckItem {padding-left: 20px;} 
    62 span.mceMenuLine {display: block; position: absolute; left: 0; top: -1px; background-color: #F5F4F2; width: 30px; height: 1px; overflow: hidden; padding-left: 0; padding-right: 0;} 
    63 .mceColors table, .mceColors td {margin: 0; padding: 2px;} 
    64 a.mceMoreColors {width: auto; padding: 0; margin: 0 3px 3px 3px; text-align: center; border: 1px solid white; text-decoration: none !important;} 
    65 .mceColorPreview {position: absolute; overflow:hidden; left: 0; top: 0; margin-left: 3px; margin-top: 15px; width: 16px; height: 4px; background-color: red;} 
    66 a.mceMoreColors:hover {border: 1px solid #0A246A;} 
    67 .mceColors td a {width: 9px; height: 9px; overflow: hidden; border: 1px solid #808080;} 
    68  
    69 /* MSIE 6 specific rules */ 
    70  
    71 * html a.mceButtonNormal img, * html a.mceButtonSelected img, * html a.mceButtonDisabled img {border: 0 !important; margin-top: 2px; margin-bottom: 1px;} 
    72 * html a.mceButtonDisabled img {filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); border: 0 !important;} 
    73 * html a.mceButtonDisabled {border: 1px solid #F0F0EE !important;} 
    74 * html a.mceButtonNormal, * html a.mceButtonSelected {border: 1px solid #F0F0EE !important; cursor: default;} 
    75 * html a.mceButtonSelected {border: 1px solid #6779AA !important; background-color: #D4D5D8;} 
    76 * html a.mceButtonNormal:hover, * html a.mceButtonSelected:hover {border: 1px solid #0A246A !important; background-color: #B6BDD2; cursor: default;} 
    77 * html .mceSelectList {margin-top: 2px;} 
    78 * html span.mceMenuButton, * html span.mceMenuButtonFocus {position: relative; left: 0; top: 0;} 
    79 * html span.mceMenuButton img, * html span.mceMenuButtonSelected img, * html span.mceMenuButtonFocus img {position: relative; top: 1px;} 
    80 * html a.mceMoreColors {width: auto;} 
    81 * html .mceColors td a {width: 10px; height: 10px;} 
    82 * html .mceColorPreview {margin-left: 2px; margin-top: 14px;} 
    83  
    84 /* MSIE 7 specific rules */ 
    85  
    86 *:first-child+html a.mceButtonNormal img, *:first-child+html a.mceButtonSelected img, *:first-child+html a.mceButtonDisabled img {border: 0 !important; margin-top: 2px; margin-bottom: 1px;} 
    87 *:first-child+html a.mceButtonDisabled img {filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); border: 0 !important;} 
    88 *:first-child+html a.mceButtonDisabled {border: 1px solid #F0F0EE !important;} 
    89 *:first-child+html a.mceButtonNormal, *:first-child+html a.mceButtonSelected {border: 1px solid #F0F0EE !important; cursor: default;} 
    90 *:first-child+html a.mceButtonSelected {border: 1px solid #6779AA !important; background-color: #D4D5D8;} 
    91 *:first-child+html a.mceButtonNormal:hover, *:first-child+html a.mceButtonSelected:hover {border: 1px solid #0A246A !important; background-color: #B6BDD2; cursor: default;} 
    92 *:first-child+html .mceSelectList {margin-top: 2px;} 
    93 *:first-child+html span.mceMenuButton, *:first-child+html span.mceMenuButtonFocus {position: relative; left: 0; top: 0;} 
    94 *:first-child+html span.mceMenuButton img, *:first-child+html span.mceMenuButtonSelected img, *:first-child+html span.mceMenuButtonFocus img {position: relative; top: 1px;} 
    95 *:first-child+html a.mceMoreColors {width: 137px;} 
    96 *:first-child+html .mceColors td a {width: 10px; height: 10px;} 
    97 *:first-child+html .mceColorPreview {margin: 0; padding-left: 4px; margin-top: 14px; width: 14px;}