亚洲一区2区三区|2020国产无码|日本视频9999|欧美三区四区四区区|超碰小说人人爽亚洲|国产精品3P电影|亚洲综合无码色区|久久tlri深 射|在线免费有码视频|久艹精品中文在线

玩改車

標(biāo)題: 品牌空間后臺(tái)編輯器升級(jí)至xhEditor v1.1.14 [打印本頁(yè)]

作者: 書生    時(shí)間: 2012-7-27 23:10
標(biāo)題: 品牌空間后臺(tái)編輯器升級(jí)至xhEditor v1.1.14
鑒于品牌空間后臺(tái)的編輯器功能較差,并且非常不穩(wěn)定,我們決定把這個(gè)編輯器升級(jí)!本來(lái)是打算使用百度的uEditor來(lái)的,只是后來(lái)發(fā)現(xiàn)品牌空間官方對(duì)編輯器做了一些修改,很難融合到其它編輯器中了,所以,只好將該編輯器升級(jí)至最新的版本,以提升功能和使用體驗(yàn)。
品牌空間使用的是xhEditor,版本還是1.0的RC版本。目前最新版本為:xhEditor v1.1.14??梢栽谶@個(gè)地址下載:
http://xheditor.com/download
下載以后:
1、將src\xheditor-1.1.14-zh-cn.js文件,重命名到:\static\js\editor\xheditor-zh-cn.js;
2、將xheditor_skin目錄和xheditor_emot,復(fù)制到\static\js\editor\ 目錄下;
3、修改\static\js\editor\xheditor-zh-cn.js 文件:
文件頭部增加函數(shù):
function switchImgbutton(contid) {
        $("#e_cont").load(admincpfilename+'?action=ajax_editor&cont='+contid);
        $("#e_image_ctrl a").removeClass('current');
        $("#e_btn_"+contid).addClass('current');
}

找到var htmlImg變量聲明,修改為:
if(enablealbum == 1) {
        var htmlImg = '<div style="width:550px; opacity:1; padding:5px 0;"><ul id="e_image_ctrl" class="imguptype" style="cursor: move;"><li><a id="e_btn_www" class="current" hidefocus="true" href="javascript:;">網(wǎng)絡(luò)圖片</a></li><li><a id="e_btn_albumlist" hidefocus="true" href="javascript:;" class="">相冊(cè)圖片</a></li><li><a id="e_btn_imgattachlist" hidefocus="true" href="javascript:;" class="">圖片列表</a></li><li><a id="e_btn_multi" hidefocus="true" href="javascript:;" class="">批量上傳</a></li></ul><div id="e_cont"></div></div>';
} else {
        var htmlImg = '<div style="width:550px; opacity:1; padding:5px 0;"><ul id="e_image_ctrl" class="imguptype" style="cursor: move;"><li><a id="e_btn_www" class="current" hidefocus="true" href="javascript:;">網(wǎng)絡(luò)圖片</a></li></ul><div id="e_cont"></div></div>';
}

在this.showImg=function()函數(shù)的末尾增加:
//編輯器上傳,品牌空間功能專用圖片工具;
$(function() { switchImgbutton('www');});

4、修改E:\source\adminfunc\editor_ajax_img.func.php文件
將其中2部分如下代碼:
var msgeditor;
msgeditor=$("#message")[0].editor;
修改為:
var msgeditor;
msgeditor = $("#message").xheditor();
//新版本的xheditor獲取方式與之前不同,必須修改,否則無(wú)法獲取editor。

其實(shí),到現(xiàn)在為止,編輯器已經(jīng)可以使用了,只是還是之前的一些功能,要想把所有功能開放出來(lái),需要如下操作:
5、修改\source\adminfunc\brandpost.func.php文件
將如下代碼:
<textarea cols=\"100\" id=\"{$showarr[name]}\" name=\"{$showarr[name]}\" rows=\"20\" style=\"width:600px;\" class=\"xheditor {tools:'Bold,Italic,Underline,Strikethrough,FontSize,FontColor,BackColor,Separator,Align,List,Separator,Link,Img,About',skin:'default'}\">{$showarr[value]}</textarea>
修改為:
<textarea cols=\"100\" id=\"{$showarr[name]}\" name=\"{$showarr[name]}\" rows=\"20\" style=\"width:800px;\" class=\"xheditor-mfull\">{$showarr[value]}</textarea>

為了方便大家修改,我們把需要替換和修改的文件重新打包,下載地址如下:
http://115.com/file/bed43n50#
[wangaiche.com]_xhEditor1.1.14_with_brand_files.zip
文章由玩改車(http://wangaiche.com) 技術(shù)支持團(tuán)隊(duì)原創(chuàng),轉(zhuǎn)載請(qǐng)注明來(lái)源。






歡迎光臨 玩改車 (http://www.beclighting.com.cn/) Powered by Discuz! X3.5