2011-10-26

CKEditor + KCFinder 筆記

CKEditor 的 config.js 中加入
config.filebrowserBrowseUrl = 'lib/kcfinder/browse.php?type=files';
config.filebrowserImageBrowseUrl = 'lib/kcfinder/browse.php?type=images';
config.filebrowserFlashBrowseUrl = 'lib/kcfinder/browse.php?type=flash';
config.filebrowserUploadUrl = 'lib/kcfinder/upload.php?type=files';
config.filebrowserImageUploadUrl = 'lib/kcfinder/upload.php?type=images';
config.filebrowserFlashUploadUrl = 'lib/kcfinder/upload.php?type=flash';
KCFinder 的 config.php 設定 session,user 登入後再設定 $_SESSION['mysite']['KCFINDER']['disabled'] = false;
'_sessionVar' => &$_SESSION['mysite']['KCFINDER'],
要放在 jQuery UI 的 dialog 中時忘記遇到什麼問題,後來改成在 dialog open 時才將 ckeditor 載入,dialog close 時再清掉。
$("#dialog-news").dialog({
  open: function () {
    $(this).find('textarea').ckeditor({height:360});
  },
  close: function () {
    $(this).find('textarea').val('').ckeditorGet().destroy();
  }
});
嵌入 KCFinder (例如按下某個 button 後跳出 KCFinder browser 的視窗,選擇檔案後返回)
$('#dialog-news button[name="attach"]').click(function(){
  window.KCFinder = {
    callBack: function(url) {
      window.KCFinder = null;
        $('#dialog-news input[name="link"]').val('.'+url);
      }
    };
  window.open('lib/kcfinder/browse.php?type=files&dir=files/attachment', 'kcfinder_textbox',
    'status=0, toolbar=0, location=0, menubar=0, directories=0, ' +
    'resizable=1, scrollbars=0, width=800, height=600'
  );
  return false;
});
KCFinder 上傳檔案改成 time stamp 加檔名,修改 core/uploader.php 中 public function upload()
$filename = date('YmdHis') . '-' . $this->normalizeFilename($file['name']);
  $target = file::getInexistantFilename($dir . $filename);

2011-10-15

WGet 2.8.2 (patch 7)

Bugs Fixed
  • 修正 moko、pixnet 問題

2011-08-04

WGet 2.8.2 (patch 6)

Bugs Fixed
  • 修正 pixnet 新版面抓取與分析錯誤問題

2011-03-30

WGet 2.8.2 (patch 5)

WGet 2.8.2 (patch 5)

Bugs Fixed
  • 修正 pchome 部分相簿會導致 wget 當掉
  • 修正 pchome 部分相簿列出不完整
  • 修正 xuite 相簿全為密碼相簿時無法列出
  • 修正 yam 帳號含大寫字母的相簿無法下載

2011-03-11

WGet 2.8.2 (patch 4)

WGet 2.8.2 (patch 4)

Bugs Fixed
  • 修正部分 yam 相簿無法瀏覽與下載
  • 修正 pixnet 新版面抓取與分析錯誤問題
  • 修正 pixnet 新版面項目ID與原本不同造成重複下載問題
  • 修正 pixnet 使用專屬網址之帳號無法下載
Notes
  • pixnet 新版面目前僅針對有回報錯誤的帳號測試,不保證全部帳號都沒問題,遇到有問題的請留言告知。

2011-03-03

用 TreeCtrl 做 notebook widget

和上一篇的 menu widget 一樣,因為 ttk::notebook 太醜,且 tab 那行不能再放其他的 widget,只好又自己用 TreeCtrl 打造。本來想說要做 tab 並不難,定義好 tab 的 element 和 style,每個 tab 當做一個 tree item 即可,不過我想要做的是像 FireFox 3.6 一樣的 tab,花了不少時間才搞定。

tab 的底線部分:selected 的 tab item 可以用 open s,其他的 tab item 就完整 outline,但是沒有 tab 的地方也要有底線。很不幸的是 tree widget 能夠設定 border,但和其他的 widget 一樣不能指定哪些方向要有 border。我想到的解法是用貼底圖的方式,先建立一個 1x1 的灰色圖形,用 -bgimage 指定,並設定 -bgimageanchor s -bgimagetile x,這樣就可以在 tree widget 的底部畫出一條線。

與 tab 同行的 widget:直覺得想法是放一個 item,其 style 是由 window element組成,但有個麻煩的地方是這個 item 寬度必須塞滿全部剩餘的空間。目前還不知道如何抓到 item 的寬度,只能每次 resize 時用 tree 寬度減掉固定寬度的 tab 算出來再更新 item 寬度,不過這太麻煩了不考慮。另一個想到的是在其中放一個超長字串的 text element 並設定成 -draw flase,靠這字串去把寬度撐開,有興趣的可以試看看可不可行。我最後採用的是用兩個 tree widget 來做,tree2 固定寬度,tree1 塞滿 x,目前看起來還沒什麼大問題。

2011-03-02

WGet 2.8.2 (patch 3)

WGet 2.8.2 (patch 3)

Bugs Fixed
  • 修正部分 moko 相簿無法找出全部相簿
  • 修正部分 moko 相簿無法顯示相簿縮圖
  • 修正 xuite 相簿中最後一張無法抓到
  • 修正 pixnet 新版面無法列出超過 240 張