替换文本:
对齐方式: 默认 左对齐 右对齐 顶端 居中 基线 底边
宽 度: 高 度:
边框大小:
水平间距: 垂直间距:
';
var htmlFlash='
动画文件:
宽 度: 高 度:
';
var htmlMedia='
媒体文件:
宽 度: 高 度:
';
var htmlTable='
行 数: 列 数:
标题单元:
宽 度: 高 度:
边框大小:
表格间距: 表格填充:
对齐方式: 默认 左对齐 居中 右对齐
表格标题:
';
var htmlAbout='
xhEditor v1.1.13 (build 120304)
xhEditor是基于jQuery开发的跨平台轻量可视化XHTML编辑器,基于LGPL 开源协议发布。
Copyright © xhEditor.com . All rights reserved.
';
var itemEmots={'default':{name:'默认',width:24,height:24,line:7,list:{'smile':'微笑','tongue':'吐舌头','titter':'偷笑','laugh':'大笑','sad':'难过','wronged':'委屈','fastcry':'快哭了','cry':'哭','wail':'大哭','mad':'生气','knock':'敲打','curse':'骂人','crazy':'抓狂','angry':'发火','ohmy':'惊讶','awkward':'尴尬','panic':'惊恐','shy':'害羞','cute':'可怜','envy':'羡慕','proud':'得意','struggle':'奋斗','quiet':'安静','shutup':'闭嘴','doubt':'疑问','despise':'鄙视','sleep':'睡觉','bye':'再见'}}};
var arrTools={Cut:{t:'剪切 (Ctrl+X)'},Copy:{t:'复制 (Ctrl+C)'},Paste:{t:'粘贴 (Ctrl+V)'},Pastetext:{t:'粘贴文本',h:isIE?0:1},Blocktag:{t:'段落标签',h:1},Fontface:{t:'字体',h:1},FontSize:{t:'字体大小',h:1},Bold:{t:'加粗 (Ctrl+B)',s:'Ctrl+B'},Italic:{t:'斜体 (Ctrl+I)',s:'Ctrl+I'},Underline:{t:'下划线 (Ctrl+U)',s:'Ctrl+U'},Strikethrough:{t:'删除线'},FontColor:{t:'字体颜色',h:1},BackColor:{t:'背景颜色',h:1},SelectAll:{t:'全选 (Ctrl+A)'},Removeformat:{t:'删除文字格式'},Align:{t:'对齐',h:1},List:{t:'列表',h:1},Outdent:{t:'减少缩进'},Indent:{t:'增加缩进'},Link:{t:'超链接 (Ctrl+L)',s:'Ctrl+L',h:1},Unlink:{t:'取消超链接'},Anchor:{t:'锚点',h:1},Img:{t:'图片',h:1},Flash:{t:'Flash动画',h:1},Media:{t:'多媒体文件',h:1},Hr:{t:'插入水平线'},Emot:{t:'表情',s:'ctrl+e',h:1},Table:{t:'表格',h:1},Source:{t:'源代码'},Preview:{t:'预览'},Print:{t:'打印 (Ctrl+P)',s:'Ctrl+P'},Fullscreen:{t:'全屏编辑 (Esc)',s:'Esc'}};
var toolsThemes={
mini:'Bold,Italic,Underline,Strikethrough,|,Align,List,|,Link,Img',
simple:'Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,|,Align,List,Outdent,Indent,|,Link,Img,Emot',
full:'Cut,Copy,Paste,Pastetext,|,Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,SelectAll,Removeformat,|,Align,List,Outdent,Indent,|,Link,Unlink,Anchor,Img,Flash,Media,Hr,Emot,Table,|,Source,Preview,Print,Fullscreen'};
toolsThemes.mfull=toolsThemes.full.replace(/\|(,Align)/i,'/$1');
var arrDbClick={'a':'Link','img':'Img','embed':'Embed'},uploadInputname='filedata';
var arrEntities={'<':'<','>':'>','"':'"','®':'®','©':'©'};//实体
var regEntities=/[<>"®©]/g;
var xheditor=function(textarea,options)
{
var _this=this,_text=textarea,_jText=$(_text),_jForm=_jText.closest('form'),_jTools,_jArea,_win,_jWin,_doc,_jDoc;
var bookmark;
var bInit=false,bSource=false,bFullscreen=false,bCleanPaste=false,outerScroll,bShowBlocktag=false,sLayoutStyle='',ev=null,timer,bDisableHoverExec=false,bQuickHoverExec=false;
var lastPoint=null,lastAngle=null;//鼠标悬停显示
var editorHeight=0;
var settings=_this.settings=$.extend({},xheditor.settings,options );
var plugins=settings.plugins,strPlugins=[];
if(plugins)
{
arrTools=$.extend({},arrTools,plugins);
$.each(plugins,function(n){strPlugins.push(n);});
strPlugins=strPlugins.join(',');
}
if(settings.tools.match(/^\s*(m?full|simple|mini)\s*$/i))
{
var toolsTheme=toolsThemes[$.trim(settings.tools)];
settings.tools=(settings.tools.match(/m?full/i)&&plugins)?toolsTheme.replace('Table','Table,'+strPlugins):toolsTheme;//插件接在full的Table后面
}
//如需删除关于按钮,请往官方网站购买商业授权:http://xheditor.com/service
//在未购买商业授权的情况下私自去除xhEditor的版权信息,您将得不到官方提供的任何技术支持和BUG反馈服务,并且我们将对您保留法律诉讼的权利
//请支持开源项目
if(!settings.tools.match(/(^|,)\s*About\s*(,|$)/i))settings.tools+=',About';
settings.tools=settings.tools.split(',');
if(settings.editorRoot)editorRoot=settings.editorRoot;
if(bAir===false)editorRoot=getLocalUrl(editorRoot,'abs');
if(settings.urlBase)settings.urlBase=getLocalUrl(settings.urlBase,'abs');
//基本控件名
var idCSS='xheCSS_'+settings.skin,idContainer='xhe'+xCount+'_container',idTools='xhe'+xCount+'_Tool',idIframeArea='xhe'+xCount+'_iframearea',idIframe='xhe'+xCount+'_iframe',idFixFFCursor='xhe'+xCount+'_fixffcursor';
var headHTML='',bodyClass='',skinPath=editorRoot+'xheditor_skin/'+settings.skin+'/',arrEmots=itemEmots,urlType=settings.urlType,urlBase=settings.urlBase,emotPath=settings.emotPath,emotPath=emotPath?emotPath:editorRoot+'xheditor_emot/',selEmotGroup='';
arrEmots=$.extend({},arrEmots,settings.emots);
emotPath=getLocalUrl(emotPath,'rel',urlBase?urlBase:null);//返回最短表情路径
bShowBlocktag=settings.showBlocktag;
if(bShowBlocktag)bodyClass+=' showBlocktag';
var arrShortCuts=[];
this.init=function()
{
//加载样式表
if($('#'+idCSS).length===0)$('head').append('
');
//初始化编辑器
var textareaWidth=_jText.outerWidth(),textareaHeight=_jText.outerHeight();
var editorWidth = settings.width || _text.style.width || (textareaWidth>10?textareaWidth:0);
editorHeight = settings.height || _text.style.height || (textareaHeight>10?textareaHeight:150);//默认高度
if(is(editorWidth,'number'))editorWidth+='px';
if(is(editorHeight,'string'))editorHeight=editorHeight.replace(/[^\d]+/g,'');
//编辑器CSS背景
var editorBackground=settings.background || _text.style.background;
//工具栏内容初始化
var arrToolsHtml=['
'],tool,cn,regSeparator=/\||\//i;
$.each(settings.tools,function(i,n)
{
if(n.match(regSeparator))arrToolsHtml.push('
');
if(n==='|')arrToolsHtml.push('
');
else if(n==='/')arrToolsHtml.push('
');
else
{
tool=arrTools[n];
if(!tool)return;
if(tool.c)cn=tool.c;
else cn='xheIcon xheBtn'+n;
arrToolsHtml.push('
'+tool.t+' ');
if(tool.s)_this.addShortcuts(tool.s,n);
}
if(n.match(regSeparator))arrToolsHtml.push('
');
});
arrToolsHtml.push('
');
_jText.after($('
'));
_jTools=$('#'+idTools);_jArea=$('#'+idIframeArea);
headHTML='
';
var loadCSS=settings.loadCSS;
if(loadCSS)
{
if(is(loadCSS,'array'))for(var i in loadCSS)headHTML+='
';
else
{
if(loadCSS.match(/\s*';
iframeHTML+='