Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
Showing with 25 additions and 14 deletions.
  1. +1 −0  ChangeLog
  2. +3 −0  doc/Modules/kahua.elem.ja
  3. +21 −14 src/kahua/server.scm
View
1  ChangeLog
@@ -1,5 +1,6 @@
2008-03-01 Katsutoshi Itoh <cut-sea@kahua.org>
+ * Change: keep clause can get #f which mean as no keep/collect.
* Change: doc/Modules/kahua.elem.ja
modify document at keep clause section.
* Change: keep clause can get symbol or string data.
View
3  doc/Modules/kahua.elem.ja
@@ -113,6 +113,7 @@ Example: (define (my-part n)
入力状態や選択状態を保持するために働きます。
保持したデータはparts-contで挿し換えられるノードを除いて、
サーバサイドで全て自動バインドされます。
+もちろんname属性を持たないノードもコンテキストを保持できません。
また、(keep #t)節をHTML中に含めた時、Kahuaプログラマは
kahua-client-context-refとkahua-client-context-ref*の2つのAPIが意味を持ちます。
これらのAPIを使うとクライアントサイドでの入力中のテキストデータや
@@ -122,6 +123,8 @@ kahua-client-context-refとkahua-client-context-ref*の2つのAPIが意味を持
#tとした場合にはこれら6種類全てが指定されたものとみなします。
複数のタイプを対象にしたい場合には(keep 'text "textarea" 'checkbox)
のように指定してください。
+keep節を指定しない場合には(keep #f)された場合と同じ意味に扱われます。
+すなわちどのタイプのコンテキストも保持しません。
次の'cont'の亜種は他のアプリケーションワーカーの制御に渡ります。
View
35 src/kahua/server.scm
@@ -1388,6 +1388,7 @@ function x_kahua_collect_client_context_without(me,id,types){
;; 'keep' clause generate javascript and into HTML script tag.
;; The script code keep client side input/textarea/select's state.
;; And auto binding these values without parts-cont's replaced node.
+;; Of course, no name node couldn't keep the context.
;; And when html include (keep #t) clause, Kahua programmer can call
;; kahua-client-context-ref and kahua-client-context-ref* at server side.
;; these API can return client side input or selected values.
@@ -1397,6 +1398,8 @@ function x_kahua_collect_client_context_without(me,id,types){
;; It's specified by symbol or string as value of keep clause.
;; For instance, (keep 'text "textarea" 'checkbox ...).
;; When #t is incldued, this means specify all 6 types.
+;; If you set keep clause, which mean (keep #f) , so no types are
+;; kept/collected anywhere.
;;
;; Next variation of 'cont' can be used to pass the control to other
;; application server:
@@ -1607,13 +1610,15 @@ function x_kahua_collect_client_context_without(me,id,types){
(define (auxs&attrs->js auxs attrs)
(define (types->js-array lst)
- (if (memq #t lst)
- "['textarea','checkbox','radio','text','password','select']"
- (string-append "[" (string-join
- (map (lambda (typ)
- #`"',(string-downcase (x->string typ))'")
- lst) ",")
- "]")))
+ (cond ((memq #t lst)
+ "['textarea','checkbox','radio','text','password','select']")
+ ((memq #f lst) "[]")
+ (else
+ (string-append "[" (string-join
+ (map (lambda (typ)
+ #`"',(string-downcase (x->string typ))'")
+ lst) ",")
+ "]"))))
(let* ((keep? (assq-ref auxs 'keep))
(tid (or (assq-ref-car auxs 'target) "x-kahua-dummy"))
(onclick (assq-ref-car attrs 'onclick))
@@ -1680,13 +1685,15 @@ function x_kahua_collect_client_context_without(me,id,types){
(define (auxs&attrs->js auxs attrs)
(define (types->js-array lst)
- (if (memq #t lst)
- "['textarea','checkbox','radio','text','password','select']"
- (string-append "[" (string-join
- (map (lambda (typ)
- #`"',(string-downcase (x->string typ))'")
- lst) ",")
- "]")))
+ (cond ((memq #t lst)
+ "['textarea','checkbox','radio','text','password','select']")
+ ((memq #f lst) "[]")
+ (else
+ (string-append "[" (string-join
+ (map (lambda (typ)
+ #`"',(string-downcase (x->string typ))'")
+ lst) ",")
+ "]"))))
(let* ((keep? (assq-ref auxs 'keep))
(tid (or (assq-ref-car auxs 'target) "x-kahua-dummy"))
(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.