2011年2月26日土曜日

jquery.jsonengine.js メモ

<div class="_je_message">
<span class="query">&sort=_createdAt.desc</span>
</div>

$._GET   (option, success, error);
$._POST  (option, success, error);
$._PUT   (option, success, error);
$._DELETE(option, success, error);

$('._je_messages')._LOAD();

$('._je_messages')._GET   ($('._je_messages_form'), success, error);
$('._je_messages')._POST  ($('._je_messages_form'), success, error);
$('._je_messages')._PUT   ($('._je_messages_form'), success, error);
$('._je_messages')._DELETE($('._je_messages_form'), success, error);

$('._je_messages')._GET   ($('._je_messages_search'), success, error);

$('._je_messages_listform');
$('._je_messages')._POST($('._je_messages_jsonform'), success, error);


多分この形に落ち着くと思う。

命名規則はhtmlタグのクラス名で。

<div class="_je_xxx"/>

クラス名の先頭に”_je_”と付いているエレメントがjqueryプラグイン用。”xxx”はjsonengineのdocType名を表す。

<span class="_je_query"/>
<span class="query"/>

クラス名”_je_message”の配下にあるクラス名”query”はjsonengineに対して_LOAD()が実行される場合に渡されるクエリ文字列を示す。つまり$('._je_messages')._LOAD();の実行はhtmlに記載された情報を元にされる。_LOAD()が実行されるとレスポンスが<div/>タグ内に表示される。どの様な表示形式にするかはまだ未定。単純なhtmlドキュメントが挿入されてユーザーのスタイルシートで自由に表現出来るようにしたい。あとダブルクリックでリロードするとか、

_je_xxx_form

末尾に_formが付いている要素はdocTypeのデータを入力するフォームエレメントを表す。

_je_xxx_search

末尾に_searchが付いている要素は検索式を入力するフォームエレメントを表す。

以上が近々実装出来る機能。

_je_xxx_listformと_je_xxx_jsonformは将来的に実装したい物。listformはGoogle taskみたいなリスト形式のデータが扱えるやつ。jsonformはオブジェクトリテラル形式のデータ入力を支援するフォーム。これらの機能はウィジェット的な形式で提供する事になると思う。

0 件のコメント:

コメントを投稿