Commit aa110dfe069ac9230790a499a1a7f8207ae5f9f5
- Date: Tue Apr 08 20:42:08 +0000 2008
- Committer: Andy Chambers (Andy Chambers achambers.home@gmail.com)
- Author: Andy Chambers (Andy Chambers achambers.home@gmail.com)
- Commit SHA1: aa110dfe069ac9230790a499a1a7f8207ae5f9f5
- Tree SHA1: f07fa684c149e76c82bbb1d8fefbb7819a0fdd92
don't send updates for input elements (browser already knows about these)
Commit diff
| |   |
| 26 | 26 | (class :initarg :class :accessor cls :initform nil) |
| 27 | 27 | (title :initarg :title :accessor title :initform nil) |
| 28 | 28 | (style :initarg :style :accessor style :initform nil) |
| 29 | (send :initarg :send :accessor send :initform t) |
| 29 | 30 | (dirtyp :initarg :dirtyp :accessor dirtyp :initform nil) |
| 30 | 31 | (xhtml :initarg :xhtml :accessor xhtml :initform nil |
| 31 | 32 | :unchanged-if 'string=))) |
| … | … | |
| 40 | 40 | (#\Newline nil) |
| 41 | 41 | (otherwise (princ char s)))))) |
| 42 | 42 | |
| 43 | (defmethod do-send (self new old) |
| 44 | (bwhen (s (send self)) |
| 45 | (case s |
| 46 | ((t) t) |
| 47 | (:once (not old)) |
| 48 | (otherwise (funcall s self new old))))) |
| 49 | |
| 50 | (defmethod do-send ((self input) new old) |
| 51 | (not old)) |
| 52 | |
| 43 | 53 | (defobserver xhtml ((self html)) |
| 44 | | (when new-value |
| 54 | (when (and new-value (do-send self new-value old-value)) |
| 45 | 55 | (trc nil "new xhtml for" self) |
| 46 | 56 | (assert (u^ web-app)) |
| 47 | 57 | (push (cons self (format nil "$(\"#~a\").replaceWith(\"~a\")" (^id) |
| toggle raw diff |
--- a/html.lisp
+++ b/html.lisp
@@ -26,6 +26,7 @@ See the Lisp Lesser GNU Public License for more details.
(class :initarg :class :accessor cls :initform nil)
(title :initarg :title :accessor title :initform nil)
(style :initarg :style :accessor style :initform nil)
+ (send :initarg :send :accessor send :initform t)
(dirtyp :initarg :dirtyp :accessor dirtyp :initform nil)
(xhtml :initarg :xhtml :accessor xhtml :initform nil
:unchanged-if 'string=)))
@@ -39,8 +40,18 @@ See the Lisp Lesser GNU Public License for more details.
(#\Newline nil)
(otherwise (princ char s))))))
+(defmethod do-send (self new old)
+ (bwhen (s (send self))
+ (case s
+ ((t) t)
+ (:once (not old))
+ (otherwise (funcall s self new old)))))
+
+(defmethod do-send ((self input) new old)
+ (not old))
+
(defobserver xhtml ((self html))
- (when new-value
+ (when (and new-value (do-send self new-value old-value))
(trc nil "new xhtml for" self)
(assert (u^ web-app))
(push (cons self (format nil "$(\"#~a\").replaceWith(\"~a\")" (^id) |