TinyMCE使用说明[原]

来源:百度文库 编辑:神马文学网 时间:2024/03/29 13:37:44
Friday, 19. May 2006, 10:49:14
JavaScript,Software
TinyMCE是一款开源的所见即所得的可视化在线编辑器
官方网站
现在的最新版本是:2.0.6.1
advanced模式
simple模式
下载这个里面我把简体中文GB2312和UTF8两种语言都加进去了的,配置后直接使用就可以了。
+-docs 帮助文档
+-examples 几个例子(多看看别人的例子可以学到很多东东)
+-jscripts 使用的时候只需要这一部分,程序主体
+-+-tiny_mce
+-+-+-langs 语言
+-+-+-plugins 插件
+-+-+-themes 主题
+-+-+-utils 组件
文件里的_src都是源文件,因为它的使用的文件都把中间的空格删掉了,看起来头大,这些文件都不是必须的。
使用方法:
....
这样就可以把ID为a的div替换成编辑器,这里有个注意的就是最后一个参数后面不要加","
几个常用的参数说明:(在压缩包的docs里有详细的介绍)
mode: textareas/specific_textareas/exact
textareas: 替换当前页的所有textarea为编辑器
specific_textareas: 不是很明白(特定的textarea??),要配合 textarea_trigger使用
exact: 替换指定ID的div或者textarea为编辑器,要配合elements使用。如例子里说的。
theme: advanced/simple
advanced: 高级模式,功能比较多一点。(默认)
simple: 基本模式,只有基本的功能。
plugins:advhr/advimage/advlink/contextmenu/emotions/flash/autosave/style/layer/iespell/insertdatetime/paste/preview/print/save/noneditable/spellchecker/searchreplace/table/zoom/directionality/fullscreen/fullpage/inlinepopups/fullpage
这些是自带的一些插件,看名字基本上都能明白它的功能。在网站上还有一些其它功能的插件,可以自己去下,放在插件目录下就可以了。
("-"加上可以让MCE不试图从插件目录加载这个插件,如plugins : "table,contextmenu,paste,-externalplugin")
language: en/zh_cn/zh_cn_utf8……
设置使用的语言,网站上也有的下,需要注意的是中文简体和繁体都有两种uft8的,要确定你使用的页面的编码。
(eg:language : "en")
width:
height:
设置编辑器的宽度和高度
relative_urls: false/true,(默认:true)
remove_script_host: false/true,(默认:true)
(eg:relative_urls: false,
remove_script_host: false
这样内容会使用绝对路径,也就是会加上域名。)
theme_advanced_toolbar_location: top/bottom(默认:bottom)
theme_advanced_toolbar_align: left/center/right(默认:center)
theme_advanced_buttons<1-n>
theme_advanced_buttons<1-n>_add
theme_advanced_buttons<1-n>_add_before
这里是advanced主题下的几个设置
theme_advanced_toolbar_location,theme_advanced_toolbar_align,theme_advanced_statusbar_location 分别设置工具栏的位置,对齐方式,状态栏的位置
theme_advanced_buttons<1-n>设置第N排的按钮
theme_advanced_buttons<1-n>_add 添加一个按钮到第N排的后面
theme_advanced_buttons<1-n>_add_before 添加一个按钮到第N排的前面
(eg:theme_advanced_buttons3 : ‘‘,
theme_advanced_buttons2_add : "insertdate,inserttime",
theme_advanced_buttons2_add_before : "zoom"
这样就是第三排为空,也就是不显示,在第二排后面加入了插入日期和时间,第二排开始插入缩放)
这是一些基础的东西,可以设置的还有一大篇,有兴趣可以看看它的文档,还有就是例子。