`
vsxp
  • 浏览: 5149 次
  • 性别: Icon_minigender_1
  • 来自: 怀化
最近访客 更多访客>>
社区版块
存档分类
最新评论

xheditor编辑器特色修改

阅读更多

 

一、增加深度处理WORD格式保留P居中/居右:<p style="text-align:center;">|<p style="text-align:right;">

56行 cleanPaste:2(深度处理word等格式)

 

if(2===b)switch(e){

 后加:

case "p":if("style"===c)return(d=d.replace(/"|&quot;/ig,"'").replace(/\s*([^:]+)\s*:\s*(.*?)(;|$)/ig,function(a,b,c){return/^(center|right)$/i.test(c)?b+":"+c+";":""}).replace(/^\s+|\s+$/g,""))?" "+c+'="'+d+'"':"";break;

--------------------------------------------------------------------

二、增加深度处理WORD格式(cleanPaste:2)对表格table进行替换处理

 

a=a.replace(/(<(\/?)(tr|td)(?:\s+[^>]+)?>)[^<>]+/ig,function(a,b,c,d){return!c&&/^td$/i.test(d)?a:b})}return a};

 前加入

 

a=a.replace(/<table[^>]*?>/ig,'<table style="BORDER-COLLAPSE:collapse" collapse="" bordercolor="#111111" cellspacing="" cellpadding="2" border="1">');

--------------------------------------------------------------------

三、处理掉p后面的空格(&nbsp;):<p>&nbsp;&nbsp;&nbsp;中华人民共和国</p>

59行

 

return a=a.replace(/<\/(strong|b|u|strike|em|i)>((?:\s|<br\/?>|&nbsp;)*?)<\1(\s+[^>]*?)?>/ig,"$2")};

 前加:

a=a.replace(/>(\s|&nbsp;)+([^<]+)</ig,">$2<");

 

-----------------------------------------------------------------------

四、上传多个附件时,自动在每个附件前加“附件:”标识(<br />\u9644\u4ef6\uff1a)并以“<br />”前置换行

 

Z.push('<br />\u9644\u4ef6\uff1a'+c)//多个附件

d.pasteHTML('<br />\u9644\u4ef6\uff1a<a href="#xhe_tmpurl">'+f+"</a>")//单个附件

 

var g='<a href="xhe_tmpurl"',Z=[];""!==c&&(g+=' target="'+c+'"');for(var g=g+">xhe_tmptext</a>",f=""!==w?w:f?f:a,h=0,pb=b.length;h<pb;h++)a=b[h],""!==a&&(a=a.split("||"),c=g,c=c.replace("xhe_tmpurl",a[0]),c=c.replace("xhe_tmptext",a[1]?a[1]:f),Z.push('<br />\u9644\u4ef6\uff1a'+c));d.pasteHTML(Z.join("&nbsp;"))}else a=b[0].split("||"),f||(f=a[0]),f=a[1]?a[1]:""!==w?"":f?f:a[0],0===i.length?(f?d.pasteHTML('<br />\u9644\u4ef6\uff1a<a href="#xhe_tmpurl">'+f+"</a>"):d._exec("createlink","#xhe_tmpurl"),

-----------------------------------------------------------------------

五、上传多张图片时,自动在每个图片前以“<br />”前置换行(后面加&nbsp;是为了输入图片说明)

 

t.push('<br />'+k+'<br />&nbsp;')//多张图片

d.pasteHTML('<br /><img src="'+a[0]+'#xhe_tmpurl" /><br />&nbsp;')//单张图片

 

for(v in g)a=g[v],""!==a&&(a=a.split("||"),k=u,k=k.replace("xhe_tmpurl",a[0]),a[1]&&(k='<a href="'+a[1]+'" target="_blank">'+k+"</a>"),t.push('<br />'+k+'<br />&nbsp;'));d.pasteHTML(t.join("&nbsp;"))}else 1===g.length&&(a=g[0],""!==a&&(a=a.split("||"),0===b.length&&(d.pasteHTML('<br /><img src="'+a[0]+'#xhe_tmpurl" /><br />&nbsp;'),b=e('img[src$="#xhe_tmpurl"]',l)),L(b,"src",a[0]),""!==k&&b.attr("alt",k),

-----------------------------------------------------------------------

六、修改“超级链接”=》“附件/超级链接”

\u8d85\u94fe\u63a5 => \u9644\u4ef6/\u8d85\u94fe\u63a5

-----------------------------------------------------------------------

七、删除关于

找到相关的about

-----------------------------------------------------------------------

八、压缩每个html标签(TAG)之间的换行(\r\n)和按级缩进TAB(\t)

 

function s(){H.push("\r\n");if(0<v)for(var a=v;a--;)H.push("\t")}

 换成

function s(){H.push("");if(0<v)for(var a=v;a--;)H.push("")}
 

 

----------------------------------------------------------------------

iframe的SWF上传实现中文  附件(*.doc;*.txt)

xheditor_plugins/multiupload/multiupload.html23行

ext=ext.match(/([^\(]+?)\s*\(\s*([^\)]+?)\s*\)/i);后添加

ext[1]=ext[1]=='file'?'附件':'图片';//置换成中文

分享到:
评论

相关推荐

    用于xheditor编辑器上传功能的配置文件

    用于xheditor编辑器上传功能的配置文件 upload.aspx,直接下载拷贝到项目根目录下即可。 里面的该行: string attachdir ="../upload"; 是上传路径,根据实际引用xheditor的页面位置,要进行相应的修改,要不然无法...

    xheditor-1.1.7 编辑器插件

    xheditor-1.1.7 编辑器插件 包含xheditor所含关键文件及jquery,导入web工程即可使用

    xheditor编辑器实现图片上传

    基于轻量级的JQuery的xheditor编辑器+jsp实现图上传功能

    xheditor文本编辑器插件制作html编辑器使用代码

    xheditor文本编辑器插件制作html编辑器使用代码 xheditor文本编辑器插件制作html编辑器使用代码

    xheditor 编辑器

    xheditor 编辑器

    xhEditor编辑器V1.17示例webform

    xhEditor编辑器V1.17示例webform.rar xhEditor编辑器V1.17示例webform.rarxhEditor编辑器V1.17示例webform.rar

    xheditor-1.1.1编辑器下载

    xheditor编辑器.................xheditor编辑器.................xheditor编辑器.................xheditor编辑器.................xheditor编辑器.................

    xhEditor编辑器

    例如:&lt;textarea name="content" class="xheditor"&gt;test经过以上步骤,你就已经成功的将xhEditor编辑器安装在你的网页中。若需要学习更多xhEditor编辑器的使用技术,请参阅:xhEditor进阶使用。

    xheditor 在线编辑器

    xheditor-1.1.4 在线编辑器 自己感觉很不错!

    xheditor编辑器asp.net源码

    xheditor编辑器 VS2008的一个demo,可以实现上传、粘贴表情、粘贴图片

    xheditor在线编辑器 修改版

    修改多处引用 每次都要手动的写入大量的JS 2 .统一上传路径 3 .上传的文件信息保存到数据库 且返回文件Id 及名称 4 .增加Google地图 插入图片 5 .上传附件及Google地图 为自定义的插件开发 使用 C# 语言的可以...

    xhEditor在线编辑器完整实例

    xhEditor在线编辑器完整实例,可直接运行

    xhEditor编辑器V0.97示例webform.rar

    xhEditor编辑器V0.97示例webform.rar

    xheditor 文本编辑器插件

    xheditor 文本编辑器插件.web开发 的文本编辑器。

    最好最轻便的编辑器xheditor简易配置实例

    我已配置好,直接使用就可以了,最好最轻便的编辑器xheditor,支持ajax本地上传文件【上传格式也很方便的自定义】,绝对错不了~~~

    xhEditor编辑器 v0.9.3 繁体中文 v0.9.3

    xhEditor是一个基于jQuery开发的简单迷你并且高效的可视化XHTML编辑器...修改:class属性初始化模式增加两个值:xheditor-mini和xheditor-simple,分别调用迷你版和简单版编辑器界面 修改:一些图片和接口上的细小调整

    xheditor文本编辑器

    Fckeditor太大,加载很慢。于是xheditor便开始出现在人们的视野里。可能你还不知道xheditor是什么,其实你...目前,创络科技正致力于整合优化后的xheditor到我们的后台系统,使客户可以更加容易、快速的编辑网站内容。

    xheditor编辑器

    xheditor编辑器,1.0RC版,已经支持图片上传了。

    xhEditor编辑器v1.2.2简体中文

    xhEditor是一个基于jQuery开发的简单迷你并且高效的在线可视化HTML编辑器,基于网络访问并且兼容IE 6.0 ,Firefox 3.0 ,Opera 9.6 ,Chrome 1.0 ,Safari 3.22 。 xhEditor完全基于Javascript开发,您可以应用在任何的...

Global site tag (gtag.js) - Google Analytics