htmlarea.js

来自「Hippo CMS是一个以信息为中心的开源内容管理系统。Hippo CMS目标是」· JavaScript 代码 · 共 67 行

JS
67
字号
/*
* Copyright 2001-2007 Hippo (www.hippo.nl)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*   http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
HTMLArea.loadPlugin("Expander");
HTMLArea.loadPlugin("ContextMenu");
HTMLArea.loadPlugin("TableOperations");
HTMLArea.loadPlugin("LangMarks");
HTMLArea.loadPlugin("InsertDoclink");
HTMLArea.loadPlugin("InsertImage");
HTMLArea.loadPlugin("InsertLink");
HTMLArea.loadPlugin("FullScreen");

var GLOBAL_PAGESTYLE		= 
    "body,table {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #002B4E; text-align:left;}"+
		 "a {color:#003399; text-decoration:none;} a:link { color:#003399; text-decoration:none;} a:active { color:#003399; text-decoration:none;} a:visited { color:#003399; text-decoration:none;} a:hover { color:#003399; text-decoration:none;}"+
		 "table{background-color:lightgrey;} table td{background-color:white; padding:1px;}";

var htmlareaStyling = "";

function myDemoHtmlArea(id)
{

  var editor = new HTMLArea(id);
	 
	var config = editor.config; // create new config object
	 
	config.height = "200px";
	config.width = "600px";
	
	config.pageStyle = GLOBAL_PAGESTYLE;
	config.statusBar = false;

 	config.toolbar = [
	  ["formatblock"],
    ["separator","bold","italic","underline"],
    ["separator","copy", "cut", "space","undo", "redo"],
	  ["separator","insertorderedlist", "insertunorderedlist"],
	  ["separator","createlink","inserttable"],
	  ["separator","killword","clearfonts","removeformat"],
	  ["separator","inserthorizontalrule","insertimage","htmlmode","showhelp"]		  
	];
	
	editor.registerPlugin("FullScreen");
	editor.registerPlugin("LangMarks");
  editor.registerPlugin("Expander");
  editor.registerPlugin("ContextMenu");
  editor.registerPlugin("TableOperations");
  editor.registerPlugin("InsertDoclink");

  /* 
    BACKWARD INCOMPATIBLE WITH 6.03.xx: 
    return the editor instead of generating it!!
  */
  return editor;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?