歡迎光臨, 訪客. 請先 登入註冊一個帳號.
四月 29, 2024, 06:09:50 上午
19595 文章 在 3865 主題 由 4580 會員
最新註冊會員: aa123aa1
LifeType 中文開發論壇  |  開發  |  核心補強  |  TinyMCE的問題, 修改Insert Resource的HTML語法 « 上篇主題 下篇主題 »
頁: [1]
作者 主題: TinyMCE的問題, 修改Insert Resource的HTML語法  (閱讀 9708 次)
hsuzy
新手見習
*
文章: 41


檢視個人資料
« 於: 十一月 24, 2005, 11:27:16 下午 »

我已經將編輯器改成 TinyMCE, 使用也正常
用Insert Resource插入圖片 出現的html語法是像是
程式碼:
<a href="http://xxx.xxx/blog/resserver.php?blogId=2&resource=xxx.jpg"><img border="0" src="http://xxx.xxx/blog/resserver.php?blogId=2&resource=xxx.jpg&mode=preview" alt="xxxx" /></a>
因為我的習慣是將圖片向右對齊, 所以插入圖片後又用 edit image鍵, 改成 right, 而且<a title="xxxx"> 也會有描述
於是我想在 insert resource 就做這些處理..我研究一下原始碼
修改
js/tinymce/jscripts/tiny_mce/tiny_mce-plog-resourcelist.js
程式碼:
function _generateResourceLink( dest, blogId, type, resourceName, resourceDesc, preview, mimeType, resId )
{
    var htmlCode = '';
    if( type == 1 ) {
    // if the resource is an image, check the second parameter to see wether we'd like
    // to show the preview with a link to the real size image or the real image
    // inlined with the text
    if( preview == 1 ) {
    htmlCode = '<a id="res_' + resId+ '" href="'+plogBaseUrl+'/resserver.php?blogId='+blogId+'&amp;resource='+encodeURIComponent(resourceName)+'" type="'+mimeType+'">';
    htmlCode += '<img style="margin: 5px;" border="0" align="right" alt="'+resourceDesc+'" src="'+plogBaseUrl+'/resserver.php?blogId='+blogId+'&amp;resource='+encodeURIComponent(resourceName)+'&amp;mode=preview" />';
    htmlCode += '</a>';
    }
else if ( preview == 2 ) {
------------------------省略
}
我修改 htmlCode += 那幾行, 竟然沒有反應, 我最後乾脆把  tiny_mce-plog-resourcelist.js 改檔名
結果在編輯文章也沒發生錯誤, 我改錯地方了嗎??
已記錄
markwu
系統管理員
超級會員
*****
文章: 3928


Mark Wu


檢視個人資料 個人網站
« 回覆文章 #1 於: 十一月 24, 2005, 11:34:19 下午 »

你打開 http cache  嗎?如果有,這是因為 http cache 所導致的問題,通常必須先關掉 Browser 再從新打開 browser 才會看到變化。

我建議修改時把這些 cache 都關掉,你才不會在那邊搞不清楚到底改了沒。

** BTW, 你是只加上 align="right" 是嗎?

Mark
已記錄

hsuzy
新手見習
*
文章: 41


檢視個人資料
« 回覆文章 #2 於: 十一月 25, 2005, 12:18:29 上午 »

謝謝 mark , 解決了..

原來firefox關掉沒有用, 要
已記錄
markwu
系統管理員
超級會員
*****
文章: 3928


Mark Wu


檢視個人資料 個人網站
« 回覆文章 #3 於: 十一月 25, 2005, 12:21:55 上午 »

不客氣,因為我也常常發生這樣的問題。

所以在調教任何 web application 時,把 cache  disable 是一定要的啦! 微笑

Mark
已記錄

頁: [1]
LifeType 中文開發論壇  |  開發  |  核心補強  |  TinyMCE的問題, 修改Insert Resource的HTML語法 « 上篇主題 下篇主題 »
    前往: