xheditor HTML编辑器,新闻编辑器初始方法,ajax图片批量上传,添加一个8、13、14px字体

下载一个xheditor-1.1.14 放在web项目Scripts/目录下

将文件夹下xheditor-1.1.14/demos/

的 saveremoteimg.aspx打开 ,

修改 attachDir =“”;为上传图片路径的路径

打开 upload.aspx 页面,一样修改路径

如: 

 

在web页面上初始化 :

 <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="Scripts/xheditor-1.1.14/xheditor-1.1.14-zh-tw.min.js" type="text/javascript"></script>


 

 <script type="text/javascript">
        $(pageInit);
        function pageInit() {
            $('#content').xheditor({ skin: 'vista', urlType: 'abs', forcePasteText: 'true',
                upImgUrl: '!{editorRoot}xheditor_plugins/multiupload/multiupload.html?uploadurl={editorRoot}demos/upload.aspx?immediate=1&ext=1(*.jpg;*.jpeg;*.gif;*.png)',
                upFlashUrl: '!{editorRoot}xheditor_plugins/multiupload/multiupload.html?uploadurl={editorRoot}demos/upload.aspx?immediate=1&ext=1(*.swf)',
              upMediaUrl: '!{editorRoot}xheditor_plugins/multiupload/multiupload.html?uploadurl={editorRoot}demos/upload.aspx?immediate=1&ext=1(*.wmv;*.avi;*.wma;*.mp3;*.mid)',
              upLinkUrl: '!{editorRoot}xheditor_plugins/multiupload/multiupload.html?uploadurl={editorRoot}demos/upload.aspx?immediate=1&ext=1(*.zip;*.rar;*.txt;*.html;*.htm;*.jpg;*.jpge;*.gif)',
              localUrlTest: '/^https?:\/\/[^\/]*?(yxxx\.com)\//i', remoteImgSaveUrl: '../xheditor/saveremoteimg.aspx',
              upImgExt:"jpg,jpeg,gif,png"
               });
        }
</script>


 

<textarea id="content" name="content" rows="12" cols="80" style="width: 80%" runat="server" ></textarea>


 初始化的xheditor 是没有14px这个字体的,此时需要修改xheditor-1.1.14-zh-cn.min.js文件,打开文件查找10px,在其后添加一个14px的一段字符(

{n:'small',s:'8px',t:'\u6781'},{ n: "x-small", s: "10px", t: "\u6781\u5c0f" }, { n: "xx-small", s: "12px", t: "\u7279\u5c0f" },{n:"xxx-small",s:"13px",t:"\u5f88\u5c0f"}, { n: "xxxx-small", s: "14px", t: "\u5fae\u5c0f" }

)  如:

 

添加字体:隶书( 如要添加其他字体,只需参考

CSS 中文字体的Unicode码 :http://blog.sina.com.cn/s/blog_4990aec60100qluo.html

)


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

下一秒_待续

如有帮到您,给个赞赏(^.^)

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值