#lang s-exp "../../lang/wescheme.rkt"
"more-jsworld.rkt"
(big-bang empty
(to-draw-page
(lambda (x)
(list (js-div '(("id" "div")))
(list (js-text (string-append "hello")))))
(lambda (x)
`((,(string-append "div") ,(list (string-append "border") (string-append "3px black solid"))))))
(stop-when (lambda (x) true)))
(local [
(define (refresh w form-val)
form-val)
(define input-node
(js-input (string-append "text") refresh '(("id" "myname"))))
(define (draw w)
(list (js-div)
(list (js-div) (list (js-text (format "I see: ~s~n" w))))
(list (js-div) (list input-node))))
(define (draw-css w)
'())]
(big-bang ""
(to-draw-page draw draw-css)
(stop-when (lambda (x) true))))
(define true-f (lambda (x) true))
(let ([draw (lambda (w)
(list (js-img (string-append
"http://racket-lang.org/logo.png"))))])
(big-bang 0
(to-draw-page draw)
(stop-when true-f)))
(local [
(define (select-house w an-option)
an-option)
(define a-select-element
(js-select (list (string-append "")
(string-append "Gryffindor")
"Hufflepuff"
"Ravenclaw"
(string-append "Slytherin"))
select-house))
(define (draw w)
(list (js-div)
(list a-select-element)
(list (js-text (format "House: ~a" w)))))
(define (draw-css w)
'())]
(big-bang ""
(to-draw-page draw draw-css)
(stop-when true-f)))
(big-bang 0
(stop-when (lambda (x) true))
(to-draw-page (lambda (x)
(list (js-div)
(list
(js-input "checkbox"
(lambda (x y) x)
'(("checked" true)))) (list
(js-input "checkbox"
(lambda (x y) x)
'(("checked" false)))) (list
(js-input "checkbox"
(lambda (x y) x)
'(("value" true)))) (list
(js-input "checkbox"
(lambda (x y) x)
'(("value" false)))))) (lambda (x) empty)))