📄 webeditor.ftl
字号:
<#--图片的基础地址-->
<#assign btnImg="${base}/theme/p-simple/img/editor/button" />
<#--关联字段-->
<#assign fieldName="${parameters.name?replace('.', '_')}" />
<#--文本编辑器的ID-->
<#assign webEditor="${fieldName}_webEditor" />
<#include "/${parameters.templateDir}/p-simple/hidden.ftl" />
<#--
<iframe id="eWebEditor" src="${base}/admin/cms/editor.do?editor=${parameters.name}" frameborder="0"
scrolling="no" width="${parameters.width!'100%'}" height="${parameters.height!300}"></iframe>
-->
<script type="text/javascript">
$(function(){
${fieldName}_obj = new Pn.Editor({
styleEditorHeader:'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><link href="${base}/theme/p-simple/css/editor/editor_area.css" type="text/css" rel="stylesheet"></head><body></body></html>',
styleMenuHeader:"<head><link href='${base}/theme/p-simple/css/editor/menu_area.css' type='text/css' rel='stylesheet'></head><body scroll='no' onConTextMenu='event.returnValue=false;'>",
autoDetectPasteFromWord:true,
sInitMode:"EDIT",
sLinkFieldName:"${parameters.name}",
sWebEditorName:"${webEditor}"
});
});
</script>
<div name="editorContainer">
<div name="toolbar" class="p-editor-toolbar">
<select class="TBGen" onChange="${fieldName}_obj.format('FormatBlock',this[this.selectedIndex].value);this.selectedIndex=0">
<option selected="true">段落样式</option>
<option value="<P>">普通</option>
<option value="<H1>">标题一</option>
<option value="<H2>">标题二</option>
<option value="<H3>">标题三</option>
<option value="<H4>">标题四</option>
<option value="<H5>">标题五</option>
<option value="<p>">标题六</option>
<option value="<dd>">段落</option>
<option value="<H4>">定义</option>
<option value="<dt>">术语定义</option>
<option value="<dir>">目录列表</option>
<option value="<menu>">菜单列表</option>
<option value="<PRE>">已编排格式</option>
</select>
<select class="TBGen" onChange="${fieldName}_obj.format('fontname',this[this.selectedIndex].value);this.selectedIndex=0">
<option selected="true">字体</option>
<option value="黑体">黑体</option>
<option value="楷体_GB2312">楷体</option>
<option value="仿宋_GB2312">仿宋</option>
<option value="隶书">隶书</option>
<option value="幼圆">幼圆</option>
<option value="Arial">Arial</option>
<option value="Arial Black">Arial Black</option>
<option value="Arial Narrow">Arial Narrow</option>
<option value="Brush Script MT">Brush Script MT</option>
<option value="Century Gothic">Century Gothic</option>
<option value="Comic Sans MS">Comic Sans MS</option>
<option value="Courier">Courier</option>
<option value="Courier New">Courier New</option>
<option value="MS Sans Serif">MS Sans Serif</option>
<option value="Times New Roman">Times New Roman</option>
<option value="Verdana">Verdana</option>
<option value="Wide Latin">Wide Latin</option>
<option value="Wingdings">Wingdings</option>
</select>
<select class="TBGen" onChange="${fieldName}_obj.format('fontsize',this[this.selectedIndex].value);this.selectedIndex=0">
<option selected="true">字号</option>
<option value="7">一号</option>
<option value="6">二号</option>
<option value="5">三号</option>
<option value="4">四号</option>
<option value="3">五号</option>
<option value="2">六号</option>
<option value="1">七号</option>
</select>
<img class="p-editor-mouse-normal" title="粗体" onClick="${fieldName}_obj.format('bold')" onMouseOver="$(this).attr('class','p-editor-mouse-over');" onMouseOut="$(this).attr('class','p-editor-mouse-normal');" onMouseDown="$(this).attr('class','p-editor-mouse-down');" onMouseUp="$(this).attr('class','p-editor-mouse-normal');" src="${btnImg}/bold.gif"/><#t/>
<img class="p-editor-mouse-normal" title="斜体" onClick="${fieldName}_obj.format('italic')" onMouseOver="$(this).attr('class','p-editor-mouse-over');" onMouseOut="$(this).attr('class','p-editor-mouse-normal');" onMouseDown="$(this).attr('class','p-editor-mouse-down');" onMouseUp="$(this).attr('class','p-editor-mouse-normal');" src="${btnImg}/italic.gif"/><#t/>
<img class="p-editor-mouse-normal" title="下划线" onClick="${fieldName}_obj.format('underline')" onMouseOver="$(this).attr('class','p-editor-mouse-over');" onMouseOut="$(this).attr('class','p-editor-mouse-normal');" onMouseDown="$(this).attr('class','p-editor-mouse-down');" onMouseUp="$(this).attr('class','p-editor-mouse-normal');" src="${btnImg}/underline.gif"/><#t/>
<img class="p-editor-mouse-normal" title="左对齐" onClick="${fieldName}_obj.format('justifyleft')" onMouseOver="$(this).attr('class','p-editor-mouse-over');" onMouseOut="$(this).attr('class','p-editor-mouse-normal');" onMouseDown="$(this).attr('class','p-editor-mouse-down');" onMouseUp="$(this).attr('class','p-editor-mouse-normal');" src="${btnImg}/justifyleft.gif"/><#t/>
<img class="p-editor-mouse-normal" title="居中对齐" onClick="${fieldName}_obj.format('justifycenter')" onMouseOver="$(this).attr('class','p-editor-mouse-over');" onMouseOut="$(this).attr('class','p-editor-mouse-normal');" onMouseDown="$(this).attr('class','p-editor-mouse-down');" onMouseUp="$(this).attr('class','p-editor-mouse-normal');" src="${btnImg}/justifycenter.gif"/><#t/>
<img class="p-editor-mouse-normal" title="右对齐" onClick="${fieldName}_obj.format('justifyright')" onMouseOver="$(this).attr('class','p-editor-mouse-over');" onMouseOut="$(this).attr('class','p-editor-mouse-normal');" onMouseDown="$(this).attr('class','p-editor-mouse-down');" onMouseUp="$(this).attr('class','p-editor-mouse-normal');" src="${btnImg}/justifyright.gif"/><#t/>
<img class="p-editor-mouse-normal" title="插入图片" onClick="${fieldName}_obj.showDialog('${base}/theme/p-simple/editor/img_upload.html?editor=${webEditor}&uploadAction=${parameters.uploadAction!}', 600, 300, true)" onMouseOver="$(this).attr('class','p-editor-mouse-over');" onMouseOut="$(this).attr('class','p-editor-mouse-normal');" onMouseDown="$(this).attr('class','p-editor-mouse-down');" onMouseUp="$(this).attr('class','p-editor-mouse-normal');" src="${btnImg}/img.gif"/><#t/>
<img class="p-editor-mouse-normal" title="插入FLASH" onClick="${fieldName}_obj.showDialog('${base}/theme/p-simple/editor/flash_upload.html?editor=${webEditor}&uploadAction=${parameters.uploadAction!}', 600, 300, true)" onMouseOver="$(this).attr('class','p-editor-mouse-over');" onMouseOut="$(this).attr('class','p-editor-mouse-normal');" onMouseDown="$(this).attr('class','p-editor-mouse-down');" onMouseUp="$(this).attr('class','p-editor-mouse-normal');" src="${btnImg}/flash.gif"/><#t/>
<img class="p-editor-mouse-normal" title="插入文档" onClick="${fieldName}_obj.showDialog('${base}/theme/p-simple/editor/doc_upload.html?editor=${webEditor}&uploadAction=${parameters.uploadAction!}', 600, 300, true)" onMouseOver="$(this).attr('class','p-editor-mouse-over');" onMouseOut="$(this).attr('class','p-editor-mouse-normal');" onMouseDown="$(this).attr('class','p-editor-mouse-down');" onMouseUp="$(this).attr('class','p-editor-mouse-normal');" src="${btnImg}/file.gif"/><#t/>
<img class="p-editor-mouse-normal" title="插入超级链接" onClick="${fieldName}_obj.format('CreateLink')" onMouseOver="$(this).attr('class','p-editor-mouse-over');" onMouseOut="$(this).attr('class','p-editor-mouse-normal');" onMouseDown="$(this).attr('class','p-editor-mouse-down');" onMouseUp="$(this).attr('class','p-editor-mouse-normal');" src="${btnImg}/createlink.gif"/><#t/>
<img class="p-editor-mouse-normal" title="取消超级链接" onClick="${fieldName}_obj.format('UnLink')" onMouseOver="$(this).attr('class','p-editor-mouse-over');" onMouseOut="$(this).attr('class','p-editor-mouse-normal');" onMouseDown="$(this).attr('class','p-editor-mouse-down');" onMouseUp="$(this).attr('class','p-editor-mouse-normal');" src="${btnImg}/unlink.gif"/><#t/>
<img class="p-editor-mouse-normal" title="字体颜色" onClick="${fieldName}_obj.showDialog('${base}/theme/p-simple/editor/select_color.html?action=forecolor', 280, 250, true)" onMouseOver="$(this).attr('class','p-editor-mouse-over');" onMouseOut="$(this).attr('class','p-editor-mouse-normal');" onMouseDown="$(this).attr('class','p-editor-mouse-down');" onMouseUp="$(this).attr('class','p-editor-mouse-normal');" src="${btnImg}/forecolor.gif"/><#t/>
<img class="p-editor-mouse-normal" title="插入分页标签" onClick="${fieldName}_obj.insert('page')" onMouseOver="$(this).attr('class','p-editor-mouse-over');" onMouseOut="$(this).attr('class','p-editor-mouse-normal');" onMouseDown="$(this).attr('class','p-editor-mouse-down');" onMouseUp="$(this).attr('class','p-editor-mouse-normal');" src="${btnImg}/page.gif"/><#t/>
</div>
<div name="content">
<iframe id="${webEditor}" marginheight="1" marginwidth="1" width="${parameters.width!'100%'}" height="${parameters.height!300}" scrolling="yes"></iframe>
</div>
<div name="modeButton" class="p-editor-statusbar">
<img id="${webEditor}_CODE" class="p-editor-statusbar-off" onclick="${fieldName}_obj.setMode('CODE')" border="0" src="${btnImg}/modecode.gif" width="50" height="15" align="absmiddle"/>
<img id="${webEditor}_EDIT" class="p-editor-statusbar-off" onclick="${fieldName}_obj.setMode('EDIT')" border="0" src="${btnImg}/modeedit.gif" width="50" height="15" align="absmiddle"/>
<img id="${webEditor}_VIEW" class="p-editor-statusbar-off" onclick="${fieldName}_obj.setMode('VIEW')" border="0" src="${btnImg}/modepreview.gif" width="50" height="15" align="absmiddle"/>
</div>
<div id="eWebEditor_Temp_HTML" style="VISIBILITY: hidden; OVERFLOW: hidden; POSITION: absolute; WIDTH: 1px; HEIGHT: 1px"></div>
</div>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -