---
title: "TinyMCE与Domino集成"
author: "carysun"
date: "2008-02-03T12:27:00Z"
tags: []
slug: "tinymce-domino"
draft: false
lastmod: "2008-02-03T12:27:00Z"
id: 463320
url: "https://carysun.iteye.com/blog/463320"
---

TinyMCE与Domino集成  
一：TinyMCE简介  
 TinyMCE是一个轻量级的基于浏览器的所见即所得编辑器，由JavaScript写成。它对IE6+和Firefox1.5+都有着非常良好的支持。能够满足大部分网站的需求，并且功能配置灵活简单。另一特点是加载速度非常快，而且可以让用户自由的定制，TinyMCE是一个根据LGPL license发布的自由软件，你可以把它用于商业应用。

二：与domino集成  
1. 将下面文件解压缩后，将tiny\_mce文件放在服务器目录下，例如（webhtml\\js\\tiny\_mce）  
    [http://tinymce.moxiecode.com](http://tinymce.moxiecode.com)处下载  
2. 在你要使用的系统中创建子表单，子表单内嵌HTML内容如下（红色标记需根据服务器做相应更改）  
&lt;html&gt;  
&lt;head&gt;  
&lt;title&gt; TinyMCE与Domino集成&lt;/title&gt;  
&lt;!-- TinyMCE --&gt;  
&lt;script language="javascript" type="text/javascript" src="/webhtml/js/tiny\_mce/tiny\_mce.js" temp\_src="/webhtml/js/tiny\_mce/tiny\_mce.js"&gt;&lt;/script&gt;  
&lt;script language="javascript" type="text/javascript"&gt;  
tinyMCE.init({  
  mode : "textareas",  
  theme : "advanced",  
  elements:"elm1",  
      
  plugins : "table,save,advhr,advimage,advlink,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,-emotions,fullpage",  
  theme\_advanced\_buttons1\_add\_before : "save,newdocument,separator",  
  theme\_advanced\_buttons1\_add : "fontselect,fontsizeselect",  
  theme\_advanced\_buttons2\_add : "separator,insertdate,inserttime,preview,separator,forecolor,backcolor",  
  theme\_advanced\_buttons2\_add\_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator",  
  theme\_advanced\_buttons3\_add\_before : "tablecontrols,separator",  
  theme\_advanced\_buttons3\_add : "emotions,iespell,flash,advhr,separator,print,separator,ltr,rtl,separator,fullscreen,fullpage",  
  theme\_advanced\_toolbar\_location : "top",  
  theme\_advanced\_toolbar\_align : "left",  
  theme\_advanced\_path\_location : "bottom",  
  content\_css : "example\_full.css",  
     plugin\_insertdate\_dateFormat : "%Y-%m-%d",  
     plugin\_insertdate\_timeFormat : "%H:%M:%S",  
  extended\_valid\_elements : "hr\[class|width|size|noshade],font\[face|size|color|style],span\[class|align|style]",  
  external\_link\_list\_url : "example\_link\_list.js",  
  external\_image\_list\_url : "example\_image\_list.js",  
  flash\_external\_list\_url : "example\_flash\_list.js",  
    
  file\_browser\_callback : "fileBrowserCallBack",  
  theme\_advanced\_resize\_horizontal : false,  
  theme\_advanced\_resizing : true,  
  apply\_source\_formatting : true  
 });

 function fileBrowserCallBack(field\_name, url, type, win)  
  {  
  // This is where you insert your custom filebrowser logic  
  var o=win.document.getElementById("filedia");  
         o.click();  
  win.document.getElementById(field\_name).value=o.value;  
           }  
&lt;/script&gt;  
&lt;script language="javascript" type="text/javascript" src="/webhtml/js/tiny\_mce/plugins/emotions/editor\_plugin.js" temp\_src="/webhtml/js/tiny\_mce/plugins/emotions/editor\_plugin.js"&gt;&lt;/script&gt;  
&lt;script language="javascript" type="text/javascript"&gt;tinyMCE.setPluginBaseURL('emotions','/webhtml/js/tiny\_mce/plugins/emotions');&lt;/script&gt;  
&lt;/head&gt;  
&lt;body topmargin="0"&gt;  
 [&lt; RTF域（将域HTML标记中样式进行定制例如 height: 100%; width:100%;）  
&lt;/body&gt;  
&lt;/html&gt;  
3.在你要使用该编辑器的表单中插入该子表单即可。  
三：说明  
1.编辑器的工具按钮可以根据需要定制。  
2.这里只采用了最简单的方法，使用RTF域，这里可以有其他的灵活方式  
3.&lt;：这个在RTF域前可以解释html（没有这个在页面输出html代码）