Monday, June 19, 2006

xinha rocks

ya, tiny_mce sucks, fckeditor sucks. they chomp the flash param when we insert an flash object.

but xinha rocks.
when u need to pick up one html editor. I suggest u have a try of xinha.

and try a demo at http://www.zorpia.com/cgi/myjournals.cgi?action=new_journal
Thursday, June 15, 2006

graduate from ZJUT

After the commencement at 6.18, I'll be graduated from ZJUT.
It's sad to separate from my lovely classmate.

but it's happy to see my girl within 4 days. I miss her very much.

God bless us.
Wednesday, June 07, 2006

DBIx::Class + TT sucks, javascript sucks

DBIx::Class ++ TT sucks.

ok, assuming that we get a record like this:
my $topic = $c->model('DBIC')->resultset('Topic')->search( { topic_id => $topic_id } )->first;
$topic->{post_on} = &format_date($topic->post_on);
now TT has two [% topic.post_on %], one is $topic->{post_on}, another one is $topic->post_on.
TT will fetch the "$topic->post_on" but ingore the $topic->{post_on}.
if we need TT fetch the "$topic->{post_on}", we have two ways:
1. $topic->{_column_data}->{post_on} = &format_date($topic->post_on);
2. $topic->{post_on_date} = &format_date($topic->post_on); [% topic.post_on_date %]

javascript sucks.

IE will complain at:
var myAjax = new Ajax.Request( url, {
method: 'get',
parameters: pars,
onSuccess: showCityResponse,
onFailure: reportCityError,
} );

but Firefox will not.
The reason is "onFailure: reportCityError," chomp the last ","
"onFailure: reportCityError" will work.

It's hard to debug under IE, and Firefox has "FireBug". Thank God.
Saturday, June 03, 2006

Catalyst::View::TT has a render

Catalyst::View::TT 从 0.23 起将多了一个函数叫做 render. 一个最常见的用法是:
   $c->email(
header => [
To => 'me@localhost',
Subject => 'A TT Email',
],
body => $c->view('TT')->render($c, 'email.tt', {
additional_template_paths => [ $c->config->{root} . '/email_templates'],
email_tmpl_param1 => 'foo'
}
),
);
以前我们经常得用 SubRequest 来做这事。
可看起来 render 似乎更干净一些。:)