Skip to content

Instantly share code, notes, and snippets.

@ekoneko
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ekoneko/fdba6f69c86308d9421b to your computer and use it in GitHub Desktop.
Save ekoneko/fdba6f69c86308d9421b to your computer and use it in GitHub Desktop.
tinymce configuration 中文注释
tinymce.init({
auto_focus: "content", //焦点ID
directionality: 'ltr', // ltr 文本流从左到右 rtl从右到左,默认ltr
browser_spellcheck: true, // 使用浏览器拼写检查 默认false
language_url: '/languages/fi.js', // 编辑器语言地址
nowrap: true, // 编辑器内容禁止换行,默认为false
object_resizing: false, // 允许图像,表格或媒体对象调整大小,默认为true
selector: '#content', // 选择器 指定哪些可以做为编辑器
theme: 'modern', // 主题 默认modern
theme_url: '/mytheme/mytheme.js', // 主题 url
skin: 'lightgray', // 皮肤,默认lightgray
skin_url: '/css/mytinymceskin', // 皮肤 url
language: 'zh_cn', // 语言
inline: true, //编辑器悬浮, 默认为false
plugins: [
'advlist autolink lists link image charmap print preview hr anchor pagebreak',
'searchreplace visualblocks visualchars code fullscreen',
'insertdatetime media nonbreaking save table contextmenu directionality',
'emoticons template paste'
], // 插件列表 逗号或空格分隔的字符串,或者字符串数组
external_plugins: {
"myplugin": "/myplugins/myplugin.js"
}, // 扩展插件 指TinyMCE的plugins目录以外的插件
convert_fonts_to_spans: 'false', // 转换字体元素为SPAN标签,默认为true
extended_valid_elements: "img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]",
// 不允许使用的元素类型
valid_elements: "a[href|target=_blank],strong/b,div[align],br", // 允许的元素类型
font_formats: "Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;AkrutiKndPadmini=Akpdmi-n",
// 字体集
fontsize_formats: "8pt 10pt 12pt 14pt 18pt 24pt 36pt", // 字号
custom_undo_redo_levels: 10, // 允许撤消次数
document_base_url: "http://www.site.com/path1/",
URL
image_advtab: true, // 高级图像编辑
autoresize_min_height: 100, // 编辑器最小高度
autoresize_max_height: 500, // 编辑器最大高度
toolbar1: 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image', // 工具条1
toolbar2: 'print preview media | forecolor backcolor emoticons', // 工具条2
templates: [{
title: 'Test template 1',
content: 'Test 1'
}, {
title: 'Test template 2',
content: 'Test 2'
}], // 模板设置
statusbar: true|false, // 是否显示状态栏
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment