bulk traverse dom trees

This commit is contained in:
David Botton 2024-06-24 14:02:35 -04:00
parent 0287d16884
commit dbfe0723ce
3 changed files with 123 additions and 106 deletions

View file

@ -460,20 +460,25 @@ not a temporarily attached one when using select-control."
(unless (equalp name "undefined")
(setf (attribute content "data-clog-name") name)
(destroy data))))
(labels ((add-siblings (control)
(let (dct)
(loop
(when (equal (html-id control) "undefined") (return))
(let ((dom (list-of-children parent))
dct)
(labels ((tr (control)
(unless (equal (html-id control) "undefined")
(setf dct (attribute control "data-clog-type"))
(unless (equal dct "undefined")
(change-class control (getf (control-info dct) :clog-type))
(when (getf (control-info dct) :on-load)
(funcall (getf (control-info dct) :on-load) control (control-info dct)))
(setup-control content control :win win)
(unless (equal dct "block")
(add-siblings (first-child control))))
(setf control (next-sibling control))))))
(add-siblings (first-child parent)))))
(change-class control (getf (control-info dct) :clog-type)))
(when (getf (control-info dct) :on-load)
(funcall (getf (control-info dct) :on-load) control (control-info dct)))
(setup-control content control :win win)))
(ll (lst)
(mapcar (lambda (l)
(if (listp l)
(if (listp (first l))
(tr (first l))
(ll l))
(tr l)))
lst)))
(ll dom)))))
;; Panel Windows