找到editor_base.js,替换以下函数,测试完毕,写的比较匆忙,有啥错误,包涵:效果如下:http://uchome.watchina.net/space-363-do-blog-id-435.html
下次写如何在编辑器里增加删除线。
function createFlash(e, show) {
/**
* 视频FLASH(支持youtube引用)
* by www.watchina.net
*/
if(typeof show == 'undefined') {
var flashtag = '';
var vObj = $('videoUrl');
var sFlash = vObj.value;
if ((sFlash!=null) && (sFlash!="http://")){
setCaret();
var sFlashType = $('vtype').value;
if(sFlashType==1) {
flashtag = '[flash=media]';
} else if(sFlashType==2) {
flashtag = '[flash=real]';
} else {
flashtag = '[flash]';
}
//modi by admin 2010-09-01 judege youtube case Start
if(sFlash.indexOf("youtube.com")> 0){
var sFlashTemp=sFlash.replace('watch?v=','v/' );//替换成实际的形式
//整个的场合,第二个参数不知道为什么不能被替换,用2个来实现
var templateUrl1 = '<object width="425" height="350"><param name="movie" value="{1}"></param><param name="wmode" value="transparent"></param>';
var templateUrl2 = '<embed src="{1}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>';
var stringFlash1 = templateUrl1.replace('{1}',sFlashTemp);
var stringFlash2 = templateUrl2.replace('{1}',sFlashTemp);
//相结合后,填入insertHTML
var stringFlash =
stringFlash1 + stringFlash2;
format("insertHTML", stringFlash);
} else {//flash case 原来的部分
format("insertHTML", flashtag + sFlash + '[/flash]');
}
//modi by admin 2010-09-01 judege youtube case End
}
fHide($('createSwf'));
vObj.value = 'http://';
} else {
if(gIsIE){
var e = window.event;
}
getCaret();
var dvSwfBox = $("createSwf");
var iX = e.clientX;
var iY = e.clientY;
dvSwfBox.style.display = "";
dvSwfBox.style.left = (iX-350) + "px";
dvSwfBox.style.top = 33 + "px";
}
}
|