save of next-id

This commit is contained in:
David Botton 2022-01-23 18:36:47 -05:00
parent 68b65e9c82
commit 8b461624bb
3 changed files with 15 additions and 11 deletions

View file

@ -971,13 +971,13 @@ and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
;; create-term ;; ;; create-term ;;
;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;
(defgeneric create-term (clog-definition-list (defgeneric create-term (clog-obj
&key content &key content
hidden class html-id auto-place) hidden class html-id auto-place)
(:documentation "Create a new CLOG-Term as child of CLOG-OBJ (:documentation "Create a new CLOG-Term as child of CLOG-OBJ
and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ")) and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
(defmethod create-term ((obj clog-definition-list) (defmethod create-term ((obj clog-obj)
&key (hidden nil) &key (hidden nil)
(content "") (content "")
(class nil) (class nil)
@ -1006,12 +1006,12 @@ and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
;; create-description ;; ;; create-description ;;
;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;
(defgeneric create-description (clog-definition-list (defgeneric create-description (clog-obj
&key hidden content class html-id auto-place) &key hidden content class html-id auto-place)
(:documentation "Create a new CLOG-Description as child of CLOG-OBJ (:documentation "Create a new CLOG-Description as child of CLOG-OBJ
and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ")) and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
(defmethod create-description ((obj clog-definition-list) (defmethod create-description ((obj clog-obj)
&key (content "") &key (content "")
(hidden nil) (hidden nil)
(class nil) (class nil)

View file

@ -884,8 +884,8 @@
:description "Definition Term" :description "Definition Term"
:clog-type clog:clog-term :clog-type clog:clog-term
:create clog:create-term :create clog:create-term
:create-type :element
:create-content "Term" :create-content "Term"
:create-type :element
:properties (,@*props-element*)) :properties (,@*props-element*))
`(:name "dd" `(:name "dd"
:description "Definition Description" :description "Definition Description"

View file

@ -284,16 +284,15 @@ not a temporary attached one when using select-control."
(getf l :tag) (getf l :control))) (getf l :tag) (getf l :control)))
*import-types*)))) *import-types*))))
(clog::js-execute parent tmp)) (clog::js-execute parent tmp))
(let* ((data (first-child parent)) (let* ((data (first-child content))
(name (attribute data "data-clog-title")) (name (attribute data "data-clog-title"))
(next-id (attribute data "data-clog-next-id"))) (next-id (attribute data "data-clog-next-id")))
(when next-id
(unless (equalp name "undefined")
(setf-next-id next-id)))
(when name (when name
(unless (equalp next-id "undefined")
(setf-next-id content next-id)))
(unless (equalp name "undefined") (unless (equalp name "undefined")
(setf (attribute parent "data-clog-name") name) (setf (attribute content "data-clog-name") name)
(destroy data)))) (destroy data)))
(labels ((add-siblings (control) (labels ((add-siblings (control)
(let (dct) (let (dct)
(loop (loop
@ -753,6 +752,8 @@ of controls and double click to select control."
(create-child content "<data />" (create-child content "<data />"
:html-id (format nil "I~A" panel-uid)))) :html-id (format nil "I~A" panel-uid))))
(place-inside-top-of content data) (place-inside-top-of content data)
(setf (attribute data "data-clog-next-id")
(attribute content "data-clog-next-id"))
(setf (attribute data "data-clog-title") (setf (attribute data "data-clog-title")
(attribute content "data-clog-name")) (attribute content "data-clog-name"))
(write-file (inner-html content) fname) (write-file (inner-html content) fname)
@ -839,6 +840,7 @@ of controls and double click to select control."
(remhash (format nil "~A-win" panel-uid) *app-sync-hash*) (remhash (format nil "~A-win" panel-uid) *app-sync-hash*)
;; setup window and page ;; setup window and page
(setf-next-id content 1)
(setf (attribute content "data-clog-name") panel-name) (setf (attribute content "data-clog-name") panel-name)
(setf (title (html-document body)) panel-name) (setf (title (html-document body)) panel-name)
(setf (window-title win) panel-name) (setf (window-title win) panel-name)
@ -939,6 +941,8 @@ of controls and double click to select control."
(create-child content "<data />" (create-child content "<data />"
:html-id (format nil "I~A" panel-uid)))) :html-id (format nil "I~A" panel-uid))))
(place-inside-top-of content data) (place-inside-top-of content data)
(setf (attribute data "data-clog-next-id")
(attribute content "data-clog-next-id"))
(setf (attribute data "data-clog-title") (setf (attribute data "data-clog-title")
(attribute content "data-clog-name")) (attribute content "data-clog-name"))
(write-file (inner-html content) fname) (write-file (inner-html content) fname)