hippohtmlarea.js
来自「Hippo CMS是一个以信息为中心的开源内容管理系统。Hippo CMS目标是」· JavaScript 代码 · 共 583 行 · 第 1/2 页
JS
583 行
HTMLArea.loadPlugin("Expander");
HTMLArea.loadPlugin("HTMLAreaFocus");
HTMLArea.loadPlugin("Floater");
HTMLArea.loadPlugin("DisableParagraphs");
HTMLArea.loadPlugin("EnterParagraphs");
HTMLArea.loadPlugin("EnterBlock");
HTMLArea.loadPlugin("ContextMenu");
function initCtype(id)
{
var editor = new HTMLArea(id);
var config = editor.config; // create new config object
config.height = "50px";
config.width = "600px";
/*config.pageStyle = "@import url(/cforms/resources/htmlarea/hippohtmlarea2.css);";*/
config.pageStyle = "body{ font-family:verdana,arial,helvetica,sans-serif; font-size:small; color:#000000; padding:0px; font-weight: bold;}"+
"a:link { color:#003399; text-decoration:none ;font-weight:bold;}a:active { color:#CC0000; text-decoration:none }a:visited { color:#003399; text-decoration:none }a:hover { color:#FF6600; text-decoration:underline }";
config.toolbar = [
['bold','italic'],
];
editor.registerPlugin("Floater");
editor.registerPlugin("HTMLAreaFocus");
editor.registerPlugin("DisableParagraphs");
editor.registerPlugin("ContextMenu");
editor.generate();
}
function initWtype(id)
{
var editor = new HTMLArea(id);
var config = editor.config; // create new config object
var browser = getBrowser();
if (browser=='ie')
{
config.height = "200px";
config.width = "600px";
}
else
{
config.height = "200px";
config.width = "595px";
}
config.pageStyle = "body { font-family:verdana,arial,helvetica,sans-serif; font-size: 0.8em; color:#000000; padding:0px; }"+
"a {color:#003399;} a:link { color:#003399; text-decoration:none ;font-weight:bold;} a:active { color:#CC0000; text-decoration:none } a:visited { color:#003399; text-decoration:none } a:hover { color:#FF6600; text-decoration:underline } div.tintbox{background-color:#FFFFee;}";
config.registerButton("tintbox", "Insert Tintbox", "/cforms/resources/htmlarea/images/ed_tintbox.gif", false, function(editor) {editor.surroundHTML("<div class='tintbox'>", "</div>");});
config.toolbar = [
["fontsize", "space","separator","bold","italic","underline","strikethrough","separator","subscript", "superscript","separator","copy", "cut", "space", "pastespecial","undo", "redo"
],
["justifyleft", "justifycenter", "justifyright","separator","insertorderedlist", "insertunorderedlist","separator","forecolor","separator","createlink","inserttable","separator","inserthorizontalrule","tintbox"]
];
config.fontsize = {
"1 (8 pt)": "1",
"2 (10 pt)": "2",
"3 (12 pt)": "3"
};
editor.registerPlugin("Expander");
editor.registerPlugin("HTMLAreaFocus");
editor.registerPlugin("Floater");
editor.registerPlugin("ContextMenu");
editor.registerPlugin("EnterParagraphs");
editor.generate();
}
function initStype(id)
{
var editor = new HTMLArea(id);
var config = editor.config; // create new config object
var browser = getBrowser();
if (browser=='ie')
{
config.height = "200px";
config.width = "400px";
}
else
{
config.height = "200px";
config.width = "355px";
}
config.pageStyle = "body { font-family:verdana,arial,helvetica,sans-serif; font-size: 0.8em; color:#000000; padding:0px; }"+
"a {color:#003399;} a:link { color:#003399; text-decoration:none ;font-weight:bold;} a:active { color:#CC0000; text-decoration:none } a:visited { color:#003399; text-decoration:none } a:hover { color:#FF6600; text-decoration:underline } div.tintbox{background-color:#FFFFee;}";
config.registerButton("tintbox", "Insert Tintbox", "/cforms/resources/htmlarea/images/ed_tintbox.gif", false, function(editor) {editor.surroundHTML("<div class='tintbox'>", "</div>");});
config.toolbar = [
["fontsize", "space","separator","bold","italic","underline","strikethrough","separator","subscript", "superscript","separator","copy", "cut", "space", "pastespecial","undo", "redo","space", "space", "space", "space", "space", "space", "space", "space", "space", "space", "space"
],
["justifyleft", "justifycenter", "justifyright","separator",
"insertorderedlist", "insertunorderedlist","separator","forecolor","separator","createlink","inserttable","separator","inserthorizontalrule","tintbox","insertimage"
],
["space","space","space","space","space"],
["space","space","space","space","space"]
];
config.fontsize = {
"1 (8 pt)": "1",
"2 (10 pt)": "2",
"3 (12 pt)": "3"
};
editor.registerPlugin("Expander");
editor.registerPlugin("Floater2");
editor.registerPlugin("ContextMenu");
editor.registerPlugin("EnterParagraphs");
editor.generate();
}
function initS1type(id)
{
var editor = new HTMLArea(id);
var config = editor.config; // create new config object
config.height = "200px";
config.width = "220px";
config.pageStyle = "body { font-family:verdana,arial,helvetica,sans-serif; font-size: 0.8em; color:#000000; padding:0px; }"+
"a {color:#003399;} a:link { color:#003399; text-decoration:none ;font-weight:bold;} a:active { color:#CC0000; text-decoration:none } a:visited { color:#003399; text-decoration:none } a:hover { color:#FF6600; text-decoration:underline } div.tintbox{background-color:#FFFFee;}";
config.toolbar = [
["fontsize", "space","bold","italic","underline","strikethrough","separator","subscript", "superscript"
],
["copy", "cut", "space", "pastespecial","undo", "redo","separator","justifyleft", "justifycenter", "justifyright"],
[
"insertorderedlist", "insertunorderedlist","separator","forecolor","separator","createlink","inserttable","separator","inserthorizontalrule","insertimage"
]
];
config.fontsize = {
"1 (8 pt)": "1",
"2 (10 pt)": "2",
"3 (12 pt)": "3"
};
editor.registerPlugin("Expander");
editor.registerPlugin("Floater2");
editor.registerPlugin("ContextMenu");
editor.registerPlugin("EnterParagraphs");
editor.generate();
}
function initTCtype(id)
{
var editor = new HTMLArea(id);
var config = editor.config; // create new config object
var browser = getBrowser();
if (browser=='ie')
{
config.height = "200px";
config.width = "414px";
}
else
{
config.height = "200px";
config.width = "420px";
}
config.pageStyle = "body { background-color:white;font-family:verdana,arial,helvetica,sans-serif; font-size: 0.8em; color:#000000; padding:0px; }"+
"a {color:#003399;} a:link { color:#003399; text-decoration:none ;font-weight:bold;} a:active { color:#CC0000; text-decoration:none } a:visited { color:#003399; text-decoration:none } a:hover { color:#FF6600; text-decoration:underline }";
config.toolbar = [
["bold","italic","underline","separator","insertorderedlist", "insertunorderedlist","createlink","inserttable","separator","copy", "cut", "space", "pastespecial","undo", "redo"],
];
editor.registerPlugin("Expander");
editor.registerPlugin("Floater");
editor.registerPlugin("HTMLAreaFocus");
editor.registerPlugin("ContextMenu");
editor.registerPlugin("EnterParagraphs");
editor.generate();
}
function initXtype(id)
{
var editor = new HTMLArea(id);
var config = editor.config; // create new config object
config.height = "50px";
config.width = "600px";
/*
config.pageStyle = "@import url(/cforms/resources/htmlarea/hippohtmlarea.css);";
*/
config.pageStyle = "body { font-family:verdana,arial,helvetica,sans-serif; font-size: 0.7em; color:#888888; padding:0px; }"+
"a:link { color:#003399; text-decoration:none ;font-weight:bold;}a:active { color:#CC0000; text-decoration:none }a:visited { color:#003399; text-decoration:none }a:hover { color:#FF6600; text-decoration:underline }";
config.toolbar = [
["bold","italic","separator","copy", "cut", "pastespecial", "space", "undo", "redo"],
];
editor.registerPlugin("Floater");
editor.registerPlugin("HTMLAreaFocus");
editor.registerPlugin("ContextMenu");
editor.registerPlugin("DisableParagraphs");
editor.generate();
}
function initXRtype(id)
{
var editor = new HTMLArea(id);
var config = editor.config; // create new config object
config.height = "50px";
config.width = "600px";
/*
config.pageStyle = "@import url(/cforms/resources/htmlarea/hippohtmlarea.css);";
*/
config.pageStyle = "body { background-color:#FFFFee;font-family:verdana,arial,helvetica,sans-serif; font-size: 0.7em; color:#888888; padding:0px; }"+
"a:link { color:#003399; text-decoration:none ;font-weight:bold;}a:active { color:#CC0000; text-decoration:none }a:visited { color:#003399; text-decoration:none }a:hover { color:#FF6600; text-decoration:underline }";
config.toolbar = [
["bold","italic","separator","copy", "cut", "pastespecial", "space", "undo", "redo"],
];
editor.registerPlugin("Floater");
editor.registerPlugin("HTMLAreaFocus");
editor.registerPlugin("DisableParagraphs");
editor.registerPlugin("ContextMenu");
editor.generate();
}
function initFtype(id)
{
var editor = new HTMLArea(id);
var config = editor.config; // create new config object
config.height = "200px";
config.width = "600px";
/*
config.pageStyle = "@import url(/cforms/resources/htmlarea/hippohtmlarea.css);";
*/
config.pageStyle = "body { font-family:verdana,arial,helvetica,sans-serif; font-size: 0.8em; color:#000000; padding:0px; }"+
"a {color:#003399;} a:link { color:#003399; text-decoration:none ;font-weight:bold;} a:active { color:#CC0000; text-decoration:none } a:visited { color:#003399; text-decoration:none } a:hover { color:#FF6600; text-decoration:underline }";
config.toolbar = [
["bold","italic","underline","separator","insertorderedlist", "insertunorderedlist","createlink","inserttable","separator","copy", "cut", "space", "pastespecial","undo", "redo"],
];
editor.registerPlugin("Expander");
editor.registerPlugin("HTMLAreaFocus");
editor.registerPlugin("Floater");
editor.registerPlugin("EnterParagraphs");
editor.registerPlugin("ContextMenu");
editor.generate();
}
function initFRtype(id)
{
var editor = new HTMLArea(id);
var config = editor.config; // create new config object
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?