diff --git a/racket-webview.rkt b/racket-webview.rkt index 1548b55..d36f324 100644 --- a/racket-webview.rkt +++ b/racket-webview.rkt @@ -1025,7 +1025,7 @@ ; (list styles) ; styles))) ) - (let* ((js-code (with-selector sel + (let ((js-code (with-selector sel (λ (id el) (let ((cl (eval cl)) (r '())) @@ -1036,10 +1036,10 @@ (set! (js-ref r st) (js-ref stl st))))) (send console log r) (return (list (list 'id id) - (list 'style (send Object entries r)))))) - )) - (r (webview-call-js wv js-code)) - ) + (list 'style (send Object entries r)))))))) + ) + (displayln js-code) + (let ((r (webview-call-js wv js-code))) ; (format ; (js-code ; "function(id, el) {" @@ -1052,24 +1052,24 @@ ; " return { id: id, style: r };" ; "}") cl)) ; ))) - ;(displayln (format "~a: ~a" r js-code)) - (if (eq? r #f) - #f - (let ((h (hash-ref r 'with-ids))) - (let ((l (map (λ (e) - (let ((id-rec (car e)) - (style-rec (cadr e))) - (cons (string->symbol (cadr id-rec)) - (make-hash (map (λ (e) (cons (car e) (cadr e))) (cadr style-rec))) - ) - )) h))) - ;(displayln (format "l = ~a" l)) - ;(write l)(newline) + (display "Result: ") (write r) (newline) + (if (eq? r #f) + #f + (let ((h (hash-ref r 'with-ids))) + (let ((l (map (λ (e) + (let ((id-rec (car e)) + (style-rec (cadr e))) + (cons (string->symbol (cadr id-rec)) + (make-hash (map (λ (e) (cons (car e) (cadr e))) (cadr style-rec))) + ) + )) h))) + (displayln (format "l = ~a" l)) + (write l)(newline) ; l = ((volume-meter . #hash((display . none)))) ; ((volume-meter . #hash(("display" . "none")))) - (if (symbol? selector) - (cdr (car l)) - l)))) + (if (symbol? selector) + (cdr (car l)) + l))))) ) ) )