这个页面是 TinyMCE 的参考索引,包括所有可独立配置的选项。
选项配置
下面所有的配置选项都要放在JavaScript初始化调用里面。
通用
- mode
- theme
- plugins
- language
- ask
- textarea_trigger
- editor_selector
- editor_deselector
- elements
- docs_language
- debug
- focus_alert
- directionality
- auto_reset_designmode
- auto_focus
- nowrap
- button_tile_map
- auto_resize
- browsers
- dialog_type
- accessibility_warnings
- accessibility_focus
- event_elements
- table_inline_editing
- object_resizing
- custom_shortcuts
清理/输出
- cleanup
- valid_elements
- extended_valid_elements
- invalid_elements
- verify_css_classes
- verify_html
- preformatted
- encoding
- cleanup_on_startup
- fix_content_duplication
- inline_styles
- convert_newlines_to_brs
- force_br_newlines
- force_p_newlines
- entities
- entity_encoding
- remove_linebreaks
- convert_fonts_to_spans
- font_size_classes
- font_size_style_values
- merge_styles_invalid_parents
- force_hex_style_colors
- apply_source_formatting
- trim_span_elements
- doctype
URL
回调
- urlconverter_callback
- insertlink_callback
- insertimage_callback
- setupcontent_callback
- save_callback
- onchange_callback
- init_instance_callback
- file_browser_callback
- cleanup_callback
- handle_event_callback
- execcommand_callback
- oninit
- onpageload
布局
视觉辅助
撤销/重复
- custom_undo_redo
- custom_undo_redo_levels
- custom_undo_redo_keyboard_shortcuts
- custom_undo_redo_restore_selection
文件列表
触发器/补丁
高级主题
- theme_advanced_layout_manager
- theme_advanced_blockformats
- theme_advanced_styles
- theme_advanced_source_editor_width
- theme_advanced_source_editor_height
- theme_advanced_toolbar_location
- theme_advanced_toolbar_align
- theme_advanced_statusbar_location
- theme_advanced_buttons<1-n>
- theme_advanced_buttons<1-n>_add
- theme_advanced_buttons<1-n>_add_before
- theme_advanced_disable
- theme_advanced_containers
- theme_advanced_containers_default_class
- theme_advanced_containers_default_align
- theme_advanced_container_<container>
- theme_advanced_container_<container>_class
- theme_advanced_container_<container>_align
- theme_advanced_custom_layout
- theme_advanced_link_targets
- theme_advanced_resizing
- theme_advanced_resizing_use_cookie
- theme_advanced_resize_horizontal
- theme_advanced_path
- theme_advanced_fonts
初始化 TinyMCE
为了初始化 TinyMCE ,必须在网页的 HEAD 元素里放入下面的代码。下面的配置例子会在页面载入时,将所有的 TEXTAREA 元素转换成编辑器,当然还有其他的模式(Mode)。
TinyMCE 配置的例子:
<html>
<head>
<script language="javascript" type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
theme : "advanced",
mode : "textareas"
});
</script>
</head>
注意:配置列表的最后一项后面是不需要加 "," 符号的。