April 17th, 2008
TinyMCE 搭配 PHP GZIP Compressor 1.0.9 的問題
Category: 整站程序, Author: humker, Popularity: 1%在 templates/admin 的
editpost.template 以及 newpost.template 中
+ <script type="text/javascript" src="js/tinymce/tiny_mce.js"></script>
<script type="text/javascript" src="js/tinymce/tiny_mce_gzip.js"></script>
<script type="text/javascript" src="js/tinymce/tiny_mce-plog.js"></script>
也就是事先呼叫原本的 tiny_mce.js
這問題就解決了..
修改方式: 把 TinyMCE 由 2.0.6 換成 2.0.8 版, 順便把 TinyMCE compressor PHP 由 1.0.8 換成 1.0.9 版. 這個 compressor 雖然只有更改一個小版號, 不過, 似乎是大幅改寫過, 設定的方式也改變了. 新的設定方式剛開始看不太懂, 所以當時就直接採用舊的方式, 直接把 tiny_mce_gzip.php 載入來使用, 那時並沒有發現有什麼問題. PS:個人網誌設定 網誌設定
啟用所見即所得(WYSIWYG)文章編輯。
今天早上, 發現在設定 link 的 popup 視窗不會出來, 把載入的 tiny_mce_gzip.php 改成 tiny_mce.js 就可以使用. 就試著使用新的設定方式, 改成載入 tiny_mce_gzip.js, 然後再先呼叫 tinyMCE_GZ.init(), 然後才是原本的 tinyMCE.init(), 結果, 情形一樣. 後來想在 LifeType 的 template 中, 加上 tinyMCE_GZ.init() 的參數, 不過, 所使用的 {} 方式, 與 smarty 的設定有衝突, 所以就直接修改 tiny_mce_gzip.js 的內容. 不過, 結果仍然一樣.
後來試了很久, 終於發現, 如果有使用到那個 plugin, 就必須在 tiny_mce-plog.js 中的 plugins 設定, 與 tiny_mce_gzip.js 中的 plugins 設定都有才能正常使用.
目前就把 LifeType 的 newpost.template, editpost.template 中的 tiny_mce.js (或 tiny_mce_gzip.php) 改成 tiny_mce_gzip.js, 然後在 tiny_mce_gzip.js 的最後, 加上:
tinyMCE_GZ.init({});
然後把 tiny_mce_gzip.js 中的 plugins 設定, 改成與 tiny_mce-plog.js 中的設定一樣 (languages, themes 也是). 另外, 如果想把這個 gzip 檔案給 cache 起來, 就把 disk_cache 設為 true, 這樣子在 tinymce 的目錄下, 會產生一個 tiny_mce_xxxxxxx.gz 的檔案 (所以, 你的 web 執行者必須有權限可以寫入), 如果那些 js 檔案沒有異動, 會重複使用這個檔案.
這樣子處理之後, 目前看起來運作似乎是正常的了.
ps:記得要啟用 ->個人網誌設定-> 網誌設定->啟用所見即所得(WYSIWYG)文章編輯。
原帖地址:http://netflow.kmseh.gov.tw/blog/post/1/7
总是感觉tinymce压不压缩没什么感觉,今天在装一个插件时遇到了这个帖子,没有给目录写权限,生成不来压缩文件。
插件是blockquote,现在在压缩下还是显示不了,慢慢考虑吧。
http://sourceforge.net/tracker/index.php?func=detail&aid=1498692&group_id=103281&atid=738747
相关文章
Tags:tinymce.
评论数量(0) | Add Comments
本文网址:http://www.humker.com/2008/04/17/tinymce-php-gzip-compressor/