Crayon

markdown(text) 追加

showdown.js のソースをざっと読んだ限り、ブラウザ依存どころか、サーバーサイドでも動きそうだったので(window, document を参照していない)、Crayonに追加した。lib/text.js で markdown(text) を追加したので、これで <%= markdown(text) %> が使えるよ…

ドキュメントとフォームのバインディング。

昨日の続きで以下のメソッドをCrayonのlib/form.js に追加。 text_field(doc, path, options); text_area(doc, path, options); date_select(doc, path, options, html_options); Railsの text_field(object, method, options) をぱくらせていただきました。…

フォームからドキュメントのバインディング。

寒くて途中で起きてしまったので、バインディングの続き。hidden_field とか radio_button とか check_box とかも追加したので、今度はフォームからドキュメントのマッピング。こちらは、jQuery のプラグインとして serializeJson メソッドを使えるようにし…

select_date(date, options, html_options) 追加。

lib/form.js を追加してここにフォーム系のライブラリを置くことにした。 <label for="birthday-year">Birthday</label> <div> <%= select_date(new Date("1970/01/01"), { "include_blank" : true }, { "name" : "birthday" }) %> </div> こんな感じでRailsのselect_dateと同じ動きをします。というか、Cou…