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

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

查看: 3047|回復(fù): 0
打印 上一主題 下一主題

品牌空間后臺編輯器升級至xhEditor v1.1.14

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
發(fā)表于 2012-7-27 23:10:24 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
鑒于品牌空間后臺的編輯器功能較差,并且非常不穩(wěn)定,我們決定把這個編輯器升級!本來是打算使用百度的uEditor來的,只是后來發(fā)現(xiàn)品牌空間官方對編輯器做了一些修改,很難融合到其它編輯器中了,所以,只好將該編輯器升級至最新的版本,以提升功能和使用體驗。
品牌空間使用的是xhEditor,版本還是1.0的RC版本。目前最新版本為:xhEditor v1.1.14??梢栽谶@個地址下載:
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="">相冊圖片</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獲取方式與之前不同,必須修改,否則無法獲取editor。

其實,到現(xiàn)在為止,編輯器已經(jīng)可以使用了,只是還是之前的一些功能,要想把所有功能開放出來,需要如下操作:
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ù)支持團隊原創(chuàng),轉(zhuǎn)載請注明來源。

北京途寧網(wǎng)絡(luò) 版權(quán)所有© 2011-2021 京ICP備12025735號-24 

京公網(wǎng)安備 11010502030663號

GMT+8, 2025-8-9 03:33 , Processed in 0.026186 second(s), 25 queries .

快速回復(fù) 返回頂部 返回列表