Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

2008-03-01 Katsutoshi Itoh <cut-sea@kahua.org>

	* Change: keep clause can get #f which mean as no keep/collect.

--

M    ChangeLog
M    src/kahua/server.scm
M    doc/Modules/kahua.elem.ja


git-svn-id: svn+ssh://svn.kahua.org/var/local/repos/kahua/Kahua/trunk@3265 4e392e78-dc3f-dc11-8fd5-00188bfc9ac4
  • Loading branch information...
commit 12f87948b6a698b9623962fa22e1595a175759c5 1 parent 8faebe6
Katsutoshi Itoh authored
1  ChangeLog
... ... @@ -1,5 +1,6 @@
1 1 2008-03-01 Katsutoshi Itoh <cut-sea@kahua.org>
2 2
  3 + * Change: keep clause can get #f which mean as no keep/collect.
3 4 * Change: doc/Modules/kahua.elem.ja
4 5 modify document at keep clause section.
5 6 * Change: keep clause can get symbol or string data.
3  doc/Modules/kahua.elem.ja
@@ -113,6 +113,7 @@ Example: (define (my-part n)
113 113 入力状態や選択状態を保持するために働きます。
114 114 保持したデータはparts-contで挿し換えられるノードを除いて、
115 115 サーバサイドで全て自動バインドされます。
  116 +もちろんname属性を持たないノードもコンテキストを保持できません。
116 117 また、(keep #t)節をHTML中に含めた時、Kahuaプログラマは
117 118 kahua-client-context-refとkahua-client-context-ref*の2つのAPIが意味を持ちます。
118 119 これらのAPIを使うとクライアントサイドでの入力中のテキストデータや
@@ -122,6 +123,8 @@ kahua-client-context-refとkahua-client-context-ref*の2つのAPIが意味を持
122 123 #tとした場合にはこれら6種類全てが指定されたものとみなします。
123 124 複数のタイプを対象にしたい場合には(keep 'text "textarea" 'checkbox)
124 125 のように指定してください。
  126 +keep節を指定しない場合には(keep #f)された場合と同じ意味に扱われます。
  127 +すなわちどのタイプのコンテキストも保持しません。
125 128
126 129
127 130 次の'cont'の亜種は他のアプリケーションワーカーの制御に渡ります。
35 src/kahua/server.scm
@@ -1388,6 +1388,7 @@ function x_kahua_collect_client_context_without(me,id,types){
1388 1388 ;; 'keep' clause generate javascript and into HTML script tag.
1389 1389 ;; The script code keep client side input/textarea/select's state.
1390 1390 ;; And auto binding these values without parts-cont's replaced node.
  1391 +;; Of course, no name node couldn't keep the context.
1391 1392 ;; And when html include (keep #t) clause, Kahua programmer can call
1392 1393 ;; kahua-client-context-ref and kahua-client-context-ref* at server side.
1393 1394 ;; these API can return client side input or selected values.
@@ -1397,6 +1398,8 @@ function x_kahua_collect_client_context_without(me,id,types){
1397 1398 ;; It's specified by symbol or string as value of keep clause.
1398 1399 ;; For instance, (keep 'text "textarea" 'checkbox ...).
1399 1400 ;; When #t is incldued, this means specify all 6 types.
  1401 +;; If you set keep clause, which mean (keep #f) , so no types are
  1402 +;; kept/collected anywhere.
1400 1403 ;;
1401 1404 ;; Next variation of 'cont' can be used to pass the control to other
1402 1405 ;; application server:
@@ -1607,13 +1610,15 @@ function x_kahua_collect_client_context_without(me,id,types){
1607 1610
1608 1611 (define (auxs&attrs->js auxs attrs)
1609 1612 (define (types->js-array lst)
1610   - (if (memq #t lst)
1611   - "['textarea','checkbox','radio','text','password','select']"
1612   - (string-append "[" (string-join
1613   - (map (lambda (typ)
1614   - #`"',(string-downcase (x->string typ))'")
1615   - lst) ",")
1616   - "]")))
  1613 + (cond ((memq #t lst)
  1614 + "['textarea','checkbox','radio','text','password','select']")
  1615 + ((memq #f lst) "[]")
  1616 + (else
  1617 + (string-append "[" (string-join
  1618 + (map (lambda (typ)
  1619 + #`"',(string-downcase (x->string typ))'")
  1620 + lst) ",")
  1621 + "]"))))
1617 1622 (let* ((keep? (assq-ref auxs 'keep))
1618 1623 (tid (or (assq-ref-car auxs 'target) "x-kahua-dummy"))
1619 1624 (onclick (assq-ref-car attrs 'onclick))
@@ -1680,13 +1685,15 @@ function x_kahua_collect_client_context_without(me,id,types){
1680 1685
1681 1686 (define (auxs&attrs->js auxs attrs)
1682 1687 (define (types->js-array lst)
1683   - (if (memq #t lst)
1684   - "['textarea','checkbox','radio','text','password','select']"
1685   - (string-append "[" (string-join
1686   - (map (lambda (typ)
1687   - #`"',(string-downcase (x->string typ))'")
1688   - lst) ",")
1689   - "]")))
  1688 + (cond ((memq #t lst)
  1689 + "['textarea','checkbox','radio','text','password','select']")
  1690 + ((memq #f lst) "[]")
  1691 + (else
  1692 + (string-append "[" (string-join
  1693 + (map (lambda (typ)
  1694 + #`"',(string-downcase (x->string typ))'")
  1695 + lst) ",")
  1696 + "]"))))
1690 1697 (let* ((keep? (assq-ref auxs 'keep))
1691 1698 (tid (or (assq-ref-car auxs 'target) "x-kahua-dummy"))
1692 1699 (onsubmit (assq-ref-car attrs 'onsubmit))

0 comments on commit 12f8794

Please sign in to comment.
Something went wrong with that request. Please try again.