summaryrefslogtreecommitdiff
path: root/src/hypnotisml.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'src/hypnotisml.lisp')
-rw-r--r--src/hypnotisml.lisp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/hypnotisml.lisp b/src/hypnotisml.lisp
index b70a8a8..13e4bab 100644
--- a/src/hypnotisml.lisp
+++ b/src/hypnotisml.lisp
@@ -105,7 +105,7 @@
(defun elem-query-selector (elem)
"Returns a CSS query selector string for the ELEM. ELEMs can be
uniquely quried in the dom by passing string to .querySelector()"
- (format nil "[data-hypno-id=~s]" (elem-id elem)))
+ (format nil "[data-hypno-id='~a']" (elem-id elem)))
(defun style (elem property)
(a:when-let (style (elem-style elem))
@@ -600,13 +600,15 @@ E.g. :1/2, :1, :3/4"
,@contents))))
-;;; Parenscript
+;;; PARENSCRIPT
-(ps:defpsmacro $$ (elem)
+(ps:defpsmacro js.elem (elem)
`(ps:chain document (query-selector (ps:lisp (elem-query-selector ,elem)))))
-(ps:defpsmacro $$replace (elem innerhtml)
+(ps:defpsmacro js.replace (elem innerhtml)
(let ((template (ps:ps-gensym)))
`(let ((,template (ps:chain document (create-element "template"))))
(setf (ps:@ ,template inner-h-t-m-l) ,innerhtml)
(ps:chain ($$ ,elem) (replace-with (ps:@ ,template content))))))
+
+