首页 > WordPress > HTML在线编辑器 – TinyMCE

HTML在线编辑器 – TinyMCE

2008年4月11日

TinyMCE的官方介绍

TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances. TinyMCE is very easy to integrate into other Content Management Systems.

TinyMCE 是一个开源的免费的功能强大的支持W3C标准格式的所见即所得可视化HTML在线编辑器。在SF.net上的地址为:http://sourceforge.net/projects/tinymce

WordPress采用的就是TinyMCE。TinyMCE的使用非常简单,include一个js文件,然后加一段配置代码就搞定,这比起FCKEditer,FreeTextbox都要简单的多。

下面这段代码是从Wordpress里抠出来的(已经用于另外一个项目),有类似需求的哥们儿可以参考一下:

<!-– tinyMCE –->
<script language=”javascript” type=”text/javascript” src=”../jscripts/tiny_mce/tiny_mce.js”></script>
<script language=”javascript” type=”text/javascript”>
// Notice: The simple theme does not use all options some of them are limited to the advanced theme
tinyMCE.init({
mode : “textareas”,
width : “100%”,
theme : “advanced”,
theme_advanced_buttons1 : “bold, italic, strikethrough, separator, bullist, numlist, outdent, indent, separator, justifyleft, justifycenter, justifyright ,separator, link, unlink, image, wordpress, separator, undo, redo, separator,forecolor,backcolor, separator, code”,
theme_advanced_buttons2 : “”,
theme_advanced_buttons3 : “”,
paste_use_dialog : false,
theme_advanced_resizing : true,
theme_advanced_resize_horizontal : false,
theme_advanced_toolbar_location : “top”,
theme_advanced_toolbar_align : “left”,
theme_advanced_statusbar_location : “bottom”,
dialog_type : “modal”,
entity_encoding : “raw”,
relative_urls : false,
remove_script_host : false,
force_p_newlines : true,
force_br_newlines : false,
convert_newlines_to_brs : false,
remove_linebreaks : true
});
</script>
<!-– /tinyMCE -–>

参数的具体意义从命名上就可以看明白,这里就不做解释了。

很简单,很实用!

相关文章:
随机文章:

SILENCE WordPress 标签:, , ,

  1. 2008年10月15日13:44 | #1

    可以测试一下

  2. 2010年8月7日00:25 | #2

    可以测试测试

  1. 本文目前尚无任何 trackbacks 和 pingbacks.