logo

Archive for 2 月, 2008


スプーキーズラボのウェブサイトを公開しました

ラボのウェブサイトを公開しました。

スプーキーズラボ

http://labs.spookies.jp

ブログ形式では公開プロダクトの一覧や最新リリースが探しにくいのではということで、別途ウェブサイトを用意しました。

今後はこのブログでは告知のみ、ダウンロードはラボのウェブサイトから行って頂くようになります。

今後ともよろしくお願いします。

シンプルな日時選択ライブラリ protocalendar.js v1.1.3 を公開しました

protocalendar.js v1.1.3 を公開しました。

今回の変更点はコメントで報告して頂いた、2点のバグフィックスのみのリリースです。
【変更点】

*8月9月の判定が正しくできない不具合の修正。

*InputCalendar で時間の初期値が入らない不具合の修正。

【使い方はこちら】
http://labs.spookies.co.jp/static/protocalendar-js-1.1.3/sample/calendar_usage.html

【download はこちら】

http://code.google.com/p/protocalendar/downloads/detail?name=protocalendar-js-1.1.3.zip

【今後の展望】
*Appear 以外のエフェクトに対応。
*スタイルの追加・修正。(いつでも同じように見えるように)

*「閉じる」、「クリア」を表示するオプションの追加。

protocalendar.js 用の cakephp ヘルパメソッド(のひな形)を公開しました

デフォルトで lang:’ja’ を使っているため、日付フォーマットが yyyy/mm/dd になるように小細工をしています。

また、オプションは lang, startYear, endYear のみ有効になっています。

function dateInput($fieldName, $htmlAttributes = array(), $calOptions = array(), $return = false, $typeModel = true) {
  if (!isset($htmlAttributes['value'])) {
    $date = $this->tagValue($fieldName);
    if ($date) {
      $htmlAttributes['value'] = date('Y/m/d', strtotime($date));
    }
  }
  $result = $this->input($fieldName, $htmlAttributes, $return);  

  if(!empty($htmlAttributes['id'])){
    $styleId = $htmlAttributes['id'];
  }else if($typeModel == true){
    $this->setFormTag($fieldName);
    $styleId = $this->model . Inflector::camelize($this->field);
  }else{
    $this->field = $fieldName;
    $styleId = $this->field;
  }  

  $script = "  InputCalendar.createOnLoaded('{$styleId}', {";
  $lang = !empty($calOptions['lang']) ? "lang:{$calOptions['lang']} " : "lang:'ja'";
  $script .= $lang;
  if (!empty($calOptions['startYear'])) {
    $script .= ", startYear:{$calOptions['startYear']} ";
  }
  if (!empty($calOptions['endYear'])) {
    $script .= ", endYear:{$calOptions['endYear']} ";
  }
  $script .= "});";  

  if (AUTO_OUTPUT && $return == false) {
    echo $result;
    echo $this->Javascript->codeBlock($script, false);
  } else {
    return ($result . $this->Javascript->codeBlock($script, false));
  }
}

©2007 spookies