<html>
<head>
<meta http-equiv="Content=Type" content="text/html;charset=uft-8">
<?php
if(strpos($_SERVER["HTTP_USER_AGENT"],"MSIE"))
 echo "<script language=JavaScript src='scripts/editor.js'></script>";
else
 echo "<script language=JavaScript src='script/moz/editor.js'></script>";
?>
</head>
<body>
<form method="post" action="post.php" id="Form1" onsubmit="document.getElementById('inpContent').value=oEdit1.getHTMLBody();">
<script>
 
var oEdit1 = new InnovaEditor("oEdit1");
 oEdit1.RENDER(
"<H1>Hello World</H1>");//RENDER是显示的意思
 
</script>
 
<input type="hidden" name="inpCintent" id="inpContent">
 
<input type="submit" value="submit">
</form>
</body>
</html>
 
<html>
<head>
<meta http-equiv="Content=Type" content="text/html;charset=uft-8">
<?php
if(strpos($_SERVER["HTTP_USER_AGENT"],"MSIE"))
 echo "<script language=JavaScript src='scripts/editor.js'></script>";
else
 echo "<script language=JavaScript src='script/moz/editor.js'></script>";
?>
</head>
<body>
<pre id="idTemporary" name="idTemporary" style="display:none">
<?php
if(isset($_POST["inpContent"])){
 $sContent = stripslashes($_POST['inpContent']);
 echo htmlentities($sContent);
 }
?>
</pre>
<form method="post" action="post.php" id="Form1">
<script>
 
var oEdit1 = new InnovaEditor("oEdit1");
 oEdit1.RENDER(document.getElementById(
"idTemporary").innerHTML);
</script>
<input type="button" value="提交" onclick="submitForm()">
</form>
</body>
</html>

加入CSS样式

 

<script>
 
var oEdit1 = new InnovaEditor("oEdit1");
 oEdit1.arrStyle 
= [["BODY",false,"","background:steelblue;color:white;font-family:Verdana,Arial,Helvetica;"],
    [
"a:link",false,"","color:white;font-weight:bold;"],
    [
"a:active",false,"","color:white;font-weight;"],
    [
"a:visited",false,"","color:whitesmoke;font-weight:bold;"]];
 oEdit1.RENDER(
"<h1>Hello world!</h1>");
</script>

使用外部样式

 

oEdit1.css = "style/test.css";

选择格式的代码

<script>
 
var oEdit1 = new InnovaEditor("oEdit1");
 oEdit1.btnstyle 
= true;
 oEdit1.arrStyle 
= [
  [
".HeadlineGray",true,"Headline Gray","font-family:Verdana,Arial,Helvetica;font-size:25px;color:#999999;font-weight:bold;"],
  [
".CodeForeground",true,"Code Foreground","font-family:Courier New;"],
  [
".CodeInText",true,"Code In Text","font-family:Courier New;font-weight:bold;"],
  [
".ImportantWords",true,"Important Words","font-weight:bold;"],
  [
".Highlight",true,"Highlight","color:red;"],
  [
"P.para1",true,"Paragraph 1","color:red;"],
  [
"P.para2",true,"Paragraph 2","color:steelblue;"],
  [
"BODY",false,"","font-family:Verdana, Arial, Helvetica;font-size:x-small;"],
  [
"a:link",false,"","color: rgb(204, 0, 0);"],
  [
"a:active",false,"","color: rgb(255, 0, 0);"],
  [
"a:visited",false,"","color: rgb(204, 51, 0);"];
oEdit1.RENDER(
"");
</script>


 设置所有属性

oEdit1.features = ["Preview","Save","Fullscreen","Print","Search","StyleAndFormatting",

"TextFotmating","ListFormatting","BoxFormatting","FontNamr",

"FontSize","|","Cut","Copy","Paste","PasteWord","PasteText",

"|","Undo","Redo","|","Bold","Italic","Underline","JustifyLeft",

"JustifyCenter","JustifyRight","JustifyFull","BRK","Numbering",

"Bullets","Indent","Outdent","|","ForeColor","BackColor",

"|","Bookmark","Hyperlink","Image","Flash","Media","|","Table",

"Border","Guidelines","Absolute","|","Charcters","Line",

"Form","Clean","XHTML Source"]

自定义按钮

<script>
 var oEdit1 = new InnovaEditor("oEdit1");
 oEdit1.arrCustomButtons = [
  ["CustomName1","alert('command 1 here.')","Caption 1 here","btnCustom.gif"],
  ["CustomName2","alert(\"command '2' here.\")","Caption 1 here","btnCustom.gif"],
  ["CustomName3","alert('command \"3\" here.')"],
 oEdit1.features = ["Preview","Fullscreen","CustomName1","CustomName2","CustomName3"];
 oEdit1.RENDER("Hello World!!");
</script>

加入语言文件transition

<script language=JavaScript src='scripts/language/german/editor_lang.js'></script>

相关引用:

相关使用列表
1.Display显示
属性
width
height
feature设置编辑器工具栏按钮
方法
RENDER
focus
事件
onFullScreen全屏显示
onNormalScreen正常显示
2 Document文档
属性
publishingPath设置路径
css 设置外部样式文件
arrStyle设置样式规则
initialRefresh刷新(编辑器启动以后)
方法
loadHTML 装载HTML Body only 的内容到编辑器
putHTML 装载全部HTML的内容到编辑器
getHTML 取得全部HTML内容
getHTMLBody 取得Body以内内容
getXHTML 取得使用XHTML规则的内容
getXHTMLBody 取得Body以内的使用XHTML规则的内容
3 Editing Features 编辑特色
属性
arrParagraph 设置段落样式表
arrFontName 设置字体样式表
arrFontSize 设置字体大小样式表
arrCustomTag 设置自定义标签样式表
customColors 设置取色器自定义/附加的颜色表
useTagSelector 显示/隐藏 标签选择器
TagselectorPosition 设置默认 标签选择器的位置
arrCustomButtons 指定自 定义/附加 编辑器工具栏按钮
useBR 使用<br>换行
useDIV 使用<div>或 <p>换行默认使用<div>
方法
insertHTML
insertLink
事件
onSave 要使用这个按钮 请把btnSave设置为 “true”
4 Toolbar Buttons 编辑器工具栏按钮
属性
btnSave
btnPreview
btnFullScreen
btnPrint
btnSearch
btnSpellCheck
btnTextFormatting
btnListFormatting
btnBoxFormatting
btnParagraphFormatting
btnParagraphFormatting
btnCssText
btnStyles
btnParagraph
btnFontName
btnFontSize
btnCut
btnCopy
btnPaste
btnPasteWord
btnPasteText
btnUndo
btnRedo
btnBold
btnItalic
btnUnderline
btnStrikethrough
btnSuperscript
btnSubscript
btnJustyLeft
btnJustyCenter
btnJustyRight
btnJustyFull
btnNumering
btnBullets
btnIndent
btnOutdent
btnLTR
btnRTL
btnForeColr
btnBackColor
btnHyperlink
btnBookmark
btnCharacters
btnCustomTags
btnImage
btnFlash
btnMedia
btnTable
btnGuidelines
btnAbsolute
btnLine
btnForm
btnClean
btnHTNLFullSource
btnHTMLSource
btnXHTMLSource
btnClearAll
5 CMS-related features CMS-相关的特色
属性
cmdAssetManager 附加的媒体管理器
btnInternalLink
cmdInternalLink
btnCustomObject
cmdCustomObject
---------------------

posted on 2006-12-31 10:34  old3ds  阅读(555)  评论(0)    收藏  举报