can now optionally specify the id used for an element

This commit is contained in:
David Botton 2021-02-01 21:40:47 -05:00
parent 73bc5bf10f
commit 3d7dc17cd3
7 changed files with 272 additions and 155 deletions

View file

@ -242,15 +242,11 @@ the default route for '/' to establish web-socket connections and static files
located at STATIC-ROOT. If BOOT-FILE is nil no initial clog-path's will be located at STATIC-ROOT. If BOOT-FILE is nil no initial clog-path's will be
setup, use clog-path to add. The on-connect-handler needs to indentify the setup, use clog-path to add. The on-connect-handler needs to indentify the
path by querying the browser. See PATH-NAME (CLOG-LOCATION)." path by querying the browser. See PATH-NAME (CLOG-LOCATION)."
(set-on-connect on-connect-handler) (set-on-connect on-connect-handler)
(when boot-file (when boot-file
(set-clog-path "/" boot-file)) (set-clog-path "/" boot-file))
(setf *app* (setf *app*
(lack:builder (lack:builder
(lambda (app) (lambda (app)
(lambda (env) (lambda (env)
;; Special handling of "clog paths" ;; Special handling of "clog paths"
@ -260,36 +256,28 @@ path by querying the browser. See PATH-NAME (CLOG-LOCATION)."
(let ((file (uiop:subpathname static-root clog-path))) (let ((file (uiop:subpathname static-root clog-path)))
(with-open-file (stream file :direction :input (with-open-file (stream file :direction :input
:if-does-not-exist nil) :if-does-not-exist nil)
(let ((page-data (make-string (file-length stream))) (let ((page-data (make-string (file-length stream)))
(post-data)) (post-data))
(read-sequence page-data stream) (read-sequence page-data stream)
;; Check if post method response ;; Check if post method response
(when (equal (getf env :content-type) (when (equal (getf env :content-type)
"application/x-www-form-urlencoded") "application/x-www-form-urlencoded")
(setf post-data (make-string (getf env :content-length))) (setf post-data (make-string (getf env :content-length)))
(read-sequence post-data (getf env :raw-body))) (read-sequence post-data (getf env :raw-body)))
`(200 (:content-type "text/html") `(200 (:content-type "text/html")
(,(if post-data (,(if post-data
(concatenate 'string page-data (concatenate 'string page-data
(format nil "<script>clog['post-data']='~A'</script>" (format nil "<script>clog['post-data']='~A'</script>"
post-data)) post-data))
page-data))))))) page-data)))))))
;; Pass the handling on next rule ;; Pass the handling on next rule
(t (funcall app env)))))) (t (funcall app env))))))
(:static :path (lambda (path) (:static :path (lambda (path)
(cond ((ppcre:scan "^(?:/clog$)" path) nil) (cond ((ppcre:scan "^(?:/clog$)" path) nil)
(t path))) (t path)))
:root static-root) :root static-root)
(lambda (env) (lambda (env)
(clog-server env)))) (clog-server env))))
(setf *client-handler* (clack:clackup *app* :address host :port port)) (setf *client-handler* (clack:clackup *app* :address host :port port))
(format t "HTTP listening on : ~A:~A~%" host port) (format t "HTTP listening on : ~A:~A~%" host port)
(format t "HTML Root : ~A~%" static-root) (format t "HTML Root : ~A~%" static-root)

View file

@ -8,7 +8,6 @@
(cl:in-package :clog) (cl:in-package :clog)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-document ;; Implementation - clog-document
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View file

@ -19,7 +19,8 @@
;; create-a ;; ;; create-a ;;
;;;;;;;;;;;;;; ;;;;;;;;;;;;;;
(defgeneric create-a (clog-obj &key link content target class auto-place) (defgeneric create-a (clog-obj
&key link content target class html-id auto-place)
(:documentation "Create a new CLOG-A as child of CLOG-OBJ with :LINK and (:documentation "Create a new CLOG-A as child of CLOG-OBJ with :LINK and
:CONTENT (default \"\") and :TARGET (\"_self\") and if :AUTO-PLACE (default t) :CONTENT (default \"\") and :TARGET (\"_self\") and if :AUTO-PLACE (default t)
place-inside-bottom-of CLOG-OBJ. place-inside-bottom-of CLOG-OBJ.
@ -35,7 +36,7 @@ place-inside-bottom-of CLOG-OBJ.
(content "") (content "")
(target "_self") (target "_self")
(class nil) (class nil)
(auto-place t)) (html-id nil) (auto-place t))
(create-child obj (format nil "<a~A target='~A' href='~A'>~A</a>" (create-child obj (format nil "<a~A target='~A' href='~A'>~A</a>"
(if class (if class
(format nil " class='~A'" (format nil " class='~A'"
@ -44,7 +45,8 @@ place-inside-bottom-of CLOG-OBJ.
(escape-string target) (escape-string target)
(escape-string link) (escape-string link)
(escape-string content)) (escape-string content))
:clog-type 'clog-a :clog-type 'clog-a
:html-id html-id
:auto-place auto-place)) :auto-place auto-place))
;;;;;;;;;; ;;;;;;;;;;
@ -92,17 +94,21 @@ place-inside-bottom-of CLOG-OBJ.
;; create-br ;; ;; create-br ;;
;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;
(defgeneric create-br (clog-obj &key class auto-place) (defgeneric create-br (clog-obj &key class html-id auto-place)
(:documentation "Create a new CLOG-BR as child of CLOG-OBJ that creates a (:documentation "Create a new CLOG-BR as child of CLOG-OBJ that creates a
line break and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ")) line break and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
(defmethod create-br ((obj clog-obj) &key (class nil) (auto-place t)) (defmethod create-br ((obj clog-obj) &key (class nil)
(html-id nil)
(auto-place t))
(create-child obj (format nil "<br~A/>" (create-child obj (format nil "<br~A/>"
(if class (if class
(format nil " class='~A'" (format nil " class='~A'"
(escape-string class)) (escape-string class))
"")) ""))
:clog-type 'clog-br :auto-place auto-place)) :clog-type 'clog-br
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-button ;; Implementation - clog-button
@ -115,20 +121,24 @@ line break and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
;; create-button ;; ;; create-button ;;
;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;
(defgeneric create-button (clog-obj &key content class auto-place) (defgeneric create-button (clog-obj &key content class html-id auto-place)
(:documentation "Create a new CLOG-Button as child of CLOG-OBJ with :CONTENT (:documentation "Create a new CLOG-Button as child of CLOG-OBJ with :CONTENT
(default \"\") and if :AUTO-PLACE (default t) place-inside-bottom-of (default \"\") and if :AUTO-PLACE (default t) place-inside-bottom-of
CLOG-OBJ")) CLOG-OBJ"))
(defmethod create-button ((obj clog-obj) (defmethod create-button ((obj clog-obj) &key (content "")
&key (content "") (class nil) (auto-place t)) (class nil)
(html-id nil)
(auto-place t))
(create-child obj (format nil "<button~A>~A</button>" (create-child obj (format nil "<button~A>~A</button>"
(if class (if class
(format nil " class='~A'" (format nil " class='~A'"
(escape-string class)) (escape-string class))
"") "")
(escape-string content)) (escape-string content))
:clog-type 'clog-button :auto-place auto-place)) :clog-type 'clog-button
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;
;; disabledp ;; ;; disabledp ;;
@ -158,19 +168,23 @@ CLOG-OBJ"))
;; create-div ;; ;; create-div ;;
;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
(defgeneric create-div (clog-obj &key content class auto-place) (defgeneric create-div (clog-obj &key content class html-id auto-place)
(:documentation "Create a new CLOG-Div as child of CLOG-OBJ with :CONTENT (:documentation "Create a new CLOG-Div as child of CLOG-OBJ with :CONTENT
(default \"\") and if :AUTO-PLACE (default t) place-inside-bottom-of (default \"\") and if :AUTO-PLACE (default t) place-inside-bottom-of
CLOG-OBJ")) CLOG-OBJ"))
(defmethod create-div ((obj clog-obj) (defmethod create-div ((obj clog-obj) &key (content "")
&key (content "") (class nil) (auto-place t)) (class nil)
(html-id nil)
(auto-place t))
(create-child obj (format nil "<div~A>~A</div>" (create-child obj (format nil "<div~A>~A</div>"
(if class (if class
(format nil " class='~A'" (escape-string class)) (format nil " class='~A'" (escape-string class))
"") "")
(escape-string content)) (escape-string content))
:clog-type 'clog-div :auto-place auto-place)) :clog-type 'clog-div
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-hr ;; Implementation - clog-hr
@ -183,18 +197,22 @@ CLOG-OBJ"))
;; create-hr ;; ;; create-hr ;;
;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;
(defgeneric create-hr (clog-obj &key class auto-place) (defgeneric create-hr (clog-obj &key class html-id auto-place)
(:documentation "Create a new CLOG-HR as child of CLOG-OBJ that creates a (:documentation "Create a new CLOG-HR as child of CLOG-OBJ that creates a
horizontal rule (line) and if :AUTO-PLACE (default t) place-inside-bottom-of horizontal rule (line) and if :AUTO-PLACE (default t) place-inside-bottom-of
CLOG-OBJ")) CLOG-OBJ"))
(defmethod create-hr ((obj clog-obj) &key (class nil) (auto-place t)) (defmethod create-hr ((obj clog-obj) &key (class nil)
(html-id nil)
(auto-place t))
(create-child obj (format nil "<hr~A/>" (create-child obj (format nil "<hr~A/>"
(if class (if class
(format nil " class='~A'" (format nil " class='~A'"
(escape-string class)) (escape-string class))
"")) ""))
:clog-type 'clog-hr :auto-place auto-place)) :clog-type 'clog-hr
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-img ;; Implementation - clog-img
@ -207,7 +225,8 @@ CLOG-OBJ"))
;; create-img ;; ;; create-img ;;
;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
(defgeneric create-img (clog-obj &key url-src alt-text class auto-place) (defgeneric create-img (clog-obj
&key url-src alt-text class html-id auto-place)
(:documentation "Create a new CLOG-Img as child of CLOG-OBJ with :URL-SRC (:documentation "Create a new CLOG-Img as child of CLOG-OBJ with :URL-SRC
(default \"\") and :ALT-TEXT (default \"\") if :AUTO-PLACE (default t) (default \"\") and :ALT-TEXT (default \"\") if :AUTO-PLACE (default t)
place-inside-bottom-of CLOG-OBJ. Use width and height properties before place-inside-bottom-of CLOG-OBJ. Use width and height properties before
@ -217,6 +236,7 @@ placing image to constrain image size."))
(url-src "") (url-src "")
(alt-text "") (alt-text "")
(class nil) (class nil)
(html-id nil)
(auto-place t)) (auto-place t))
(create-child obj (format nil "<img~A src='~A' alt='~A'>)" (create-child obj (format nil "<img~A src='~A' alt='~A'>)"
(if class (if class
@ -225,7 +245,9 @@ placing image to constrain image size."))
"") "")
(escape-string url-src) (escape-string url-src)
(escape-string alt-text)) (escape-string alt-text))
:clog-type 'clog-img :auto-place auto-place)) :clog-type 'clog-img
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;; ;;;;;;;;;;;;;
;; url-src ;; ;; url-src ;;
@ -274,6 +296,7 @@ placing image to constrain image size."))
(defgeneric create-meter (clog-obj &key value high low maximum minimum optimum (defgeneric create-meter (clog-obj &key value high low maximum minimum optimum
class class
html-id
auto-place) auto-place)
(:documentation "Create a new CLOG-Meter as child of CLOG-OBJ with VALUE (:documentation "Create a new CLOG-Meter as child of CLOG-OBJ with VALUE
(default 0) HIGH (default 100) LOW (default 0) MAXIMUM (default 100) MINIMUM (default 0) HIGH (default 100) LOW (default 0) MAXIMUM (default 100) MINIMUM
@ -288,6 +311,7 @@ place-inside-bottom-of CLOG-OBJ."))
(minimum 0) (minimum 0)
(optimum 50) (optimum 50)
(class nil) (class nil)
(html-id nil)
(auto-place t)) (auto-place t))
(create-child obj (format nil (create-child obj (format nil
"<meter value=~A high=~A low=~A max=~A min=~A optimum=~A~A/>" "<meter value=~A high=~A low=~A max=~A min=~A optimum=~A~A/>"
@ -296,7 +320,9 @@ place-inside-bottom-of CLOG-OBJ."))
(format nil " class='~A'" (format nil " class='~A'"
(escape-string class)) (escape-string class))
"")) ""))
:clog-type 'clog-meter :auto-place auto-place)) :clog-type 'clog-meter
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;; ;;;;;;;;;;;
;; value ;; ;; value ;;
@ -411,7 +437,8 @@ place-inside-bottom-of CLOG-OBJ."))
;; create-progress-bar ;; ;; create-progress-bar ;;
;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;
(defgeneric create-progress-bar (clog-obj &key value maximum class auto-place) (defgeneric create-progress-bar (clog-obj
&key value maximum class html-id auto-place)
(:documentation "Create a new CLOG-Progress-Bar as child of CLOG-OBJ with (:documentation "Create a new CLOG-Progress-Bar as child of CLOG-OBJ with
VALUE (default 0) MAXIMUM (default 100) and if :AUTO-PLACE (default t) VALUE (default 0) MAXIMUM (default 100) and if :AUTO-PLACE (default t)
place-inside-bottom-of CLOG-OBJ.")) place-inside-bottom-of CLOG-OBJ."))
@ -419,13 +446,16 @@ place-inside-bottom-of CLOG-OBJ."))
(defmethod create-progress-bar ((obj clog-obj) &key (value 0) (defmethod create-progress-bar ((obj clog-obj) &key (value 0)
(maximum 100) (maximum 100)
(class nil) (class nil)
(html-id nil)
(auto-place t)) (auto-place t))
(create-child obj (format nil "<progress value=~A max=~A />" value maximum (create-child obj (format nil "<progress value=~A max=~A />" value maximum
(if class (if class
(format nil " class='~A'" (format nil " class='~A'"
(escape-string class)) (escape-string class))
"")) ""))
:clog-type 'clog-progress-bar :auto-place auto-place)) :clog-type 'clog-progress-bar
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;; ;;;;;;;;;;;
;; value ;; ;; value ;;
@ -472,20 +502,24 @@ place-inside-bottom-of CLOG-OBJ."))
;; create-p ;; ;; create-p ;;
;;;;;;;;;;;;;; ;;;;;;;;;;;;;;
(defgeneric create-p (clog-obj &key content class auto-place) (defgeneric create-p (clog-obj &key content class html-id auto-place)
(:documentation "Create a new CLOG-P as child of CLOG-OBJ with :CONTENT (:documentation "Create a new CLOG-P as child of CLOG-OBJ with :CONTENT
(default \"\") and if :AUTO-PLACE (default t) place-inside-bottom-of (default \"\") and if :AUTO-PLACE (default t) place-inside-bottom-of
CLOG-OBJ")) CLOG-OBJ"))
(defmethod create-p ((obj clog-obj) (defmethod create-p ((obj clog-obj) &key (content "")
&key (content "") (class nil) (auto-place t)) (class nil)
(html-id nil)
(auto-place t))
(create-child obj (format nil "<p~A>~A</p>" (create-child obj (format nil "<p~A>~A</p>"
(if class (if class
(format nil " class='~A'" (format nil " class='~A'"
(escape-string class)) (escape-string class))
"") "")
(escape-string content)) (escape-string content))
:clog-type 'clog-p :auto-place auto-place)) :clog-type 'clog-p
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -499,20 +533,23 @@ CLOG-OBJ"))
;; create-span ;; ;; create-span ;;
;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;
(defgeneric create-span (clog-obj &key content class auto-place) (defgeneric create-span (clog-obj &key content class html-id auto-place)
(:documentation "Create a new CLOG-Span as child of CLOG-OBJ with CONTENT (:documentation "Create a new CLOG-Span as child of CLOG-OBJ with CONTENT
and if :AUTO-PLACE (default t) place-inside-bottom-of and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
CLOG-OBJ"))
(defmethod create-span ((obj clog-obj) (defmethod create-span ((obj clog-obj) &key (content "")
&key (content "") (class nil) (auto-place t)) (class nil)
(html-id nil)
(auto-place t))
(create-child obj (format nil "<span~A>~A</span>" (create-child obj (format nil "<span~A>~A</span>"
(if class (if class
(format nil " class='~A'" (format nil " class='~A'"
(escape-string class)) (escape-string class))
"") "")
(escape-string content)) (escape-string content))
:clog-type 'clog-span :auto-place auto-place)) :clog-type 'clog-span
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-section ;; Implementation - clog-section
@ -529,7 +566,8 @@ CLOG-OBJ"))
:p :pre :section :blockquote :h1 :h2 :h3 :h4 :h5 :h6 :p :pre :section :blockquote :h1 :h2 :h3 :h4 :h5 :h6
:hgroup)) :hgroup))
(defgeneric create-section (clog-obj section &key content class auto-place) (defgeneric create-section (clog-obj section
&key content class html-id auto-place)
(:documentation "Create a new CLOG-Section of section type as child of (:documentation "Create a new CLOG-Section of section type as child of
CLOG-OBJ with CONTENT and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ with CONTENT and if :AUTO-PLACE (default t) place-inside-bottom-of
CLOG-OBJ")) CLOG-OBJ"))
@ -537,7 +575,7 @@ CLOG-OBJ"))
(defmethod create-section ((obj clog-obj) section (defmethod create-section ((obj clog-obj) section
&key (content "") &key (content "")
(class nil) (class nil)
(auto-place t)) (html-id nil) (auto-place t))
(create-child obj (format nil "<~A~A>~A</~A>" (create-child obj (format nil "<~A~A>~A</~A>"
section section
(if class (if class
@ -546,7 +584,9 @@ CLOG-OBJ"))
"") "")
(escape-string content) (escape-string content)
section) section)
:clog-type 'clog-section :auto-place auto-place)) :clog-type 'clog-section
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-phrase ;; Implementation - clog-phrase
@ -563,7 +603,8 @@ CLOG-OBJ"))
:marked :del :ins :s :q :big :small :time :tt :cite :marked :del :ins :s :q :big :small :time :tt :cite
:i :b :u :sub :su)) :i :b :u :sub :su))
(defgeneric create-phrase (clog-obj phrase &key content class auto-place) (defgeneric create-phrase (clog-obj phrase
&key content class html-id auto-place)
(:documentation "Create a new CLOG-Phrase of phrase type as child of (:documentation "Create a new CLOG-Phrase of phrase type as child of
CLOG-OBJ with CONTENT and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ with CONTENT and if :AUTO-PLACE (default t) place-inside-bottom-of
CLOG-OBJ")) CLOG-OBJ"))
@ -571,6 +612,7 @@ CLOG-OBJ"))
(defmethod create-phrase ((obj clog-obj) phrase (defmethod create-phrase ((obj clog-obj) phrase
&key (content "") &key (content "")
(class nil) (class nil)
(html-id nil)
(auto-place t)) (auto-place t))
(create-child obj (format nil "<~A~A>~A</~A>" (create-child obj (format nil "<~A~A>~A</~A>"
phrase phrase
@ -580,7 +622,9 @@ CLOG-OBJ"))
"") "")
(escape-string content) (escape-string content)
phrase) phrase)
:clog-type 'clog-phrase :auto-place auto-place)) :clog-type 'clog-phrase
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -594,18 +638,20 @@ CLOG-OBJ"))
;; create-ordered-list ;; ;; create-ordered-list ;;
;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;
(defgeneric create-ordered-list (clog-obj &key class auto-place) (defgeneric create-ordered-list (clog-obj &key class html-id auto-place)
(:documentation "Create a new CLOG-Ordered-List as child of CLOG-OBJ (:documentation "Create a new CLOG-Ordered-List 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-ordered-list ((obj clog-obj) (defmethod create-ordered-list ((obj clog-obj)
&key (class nil) (auto-place t)) &key (class nil) (html-id nil) (auto-place t))
(create-child obj (format nil "<ol~A/>" (create-child obj (format nil "<ol~A/>"
(if class (if class
(format nil " class='~A'" (format nil " class='~A'"
(escape-string class)) (escape-string class))
"")) ""))
:clog-type 'clog-ordered-list :auto-place auto-place)) :clog-type 'clog-ordered-list
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;
;; list-kind ;; ;; list-kind ;;
@ -662,18 +708,21 @@ is outside."))
;; create-unordered-list ;; ;; create-unordered-list ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defgeneric create-unordered-list (clog-obj &key class auto-place) (defgeneric create-unordered-list (clog-obj &key class html-id auto-place)
(:documentation "Create a new CLOG-Unordered-List as child of CLOG-OBJ (:documentation "Create a new CLOG-Unordered-List 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-unordered-list ((obj clog-obj) &key (class nil) (defmethod create-unordered-list ((obj clog-obj) &key (class nil)
(html-id nil)
(auto-place t)) (auto-place t))
(create-child obj (format nil "<ul~A/>" (create-child obj (format nil "<ul~A/>"
(if class (if class
(format nil " class='~A'" (format nil " class='~A'"
(escape-string class)) (escape-string class))
"")) ""))
:clog-type 'clog-unordered-list :auto-place auto-place)) :clog-type 'clog-unordered-list
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-list-item ;; Implementation - clog-list-item
@ -686,20 +735,22 @@ and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
;; create-list-item ;; ;; create-list-item ;;
;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;
(defgeneric create-list-item (clog-obj &key content class auto-place) (defgeneric create-list-item (clog-obj &key content class html-id auto-place)
(:documentation "Create a new CLOG-List-Item as child of CLOG-OBJ (:documentation "Create a new CLOG-List-Item 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-list-item ((obj clog-obj) &key (content "") (defmethod create-list-item ((obj clog-obj) &key (content "")
(class nil) (class nil)
(auto-place t)) (html-id nil) (auto-place t))
(create-child obj (format nil "<li~A>~A</li>" (create-child obj (format nil "<li~A>~A</li>"
(if class (if class
(format nil " class='~A'" (format nil " class='~A'"
(escape-string class)) (escape-string class))
"") "")
(escape-string content)) (escape-string content))
:clog-type 'clog-list-item :auto-place auto-place)) :clog-type 'clog-list-item
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;; item-value ;; ;; item-value ;;
@ -729,18 +780,21 @@ and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
;; create-definition-list ;; ;; create-definition-list ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defgeneric create-definition-list (clog-obj &key class auto-place) (defgeneric create-definition-list (clog-obj &key class html-id auto-place)
(:documentation "Create a new CLOG-Definition-List as child of CLOG-OBJ (:documentation "Create a new CLOG-Definition-List 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-definition-list ((obj clog-obj) &key (class nil) (defmethod create-definition-list ((obj clog-obj) &key (class nil)
(html-id nil)
(auto-place t)) (auto-place t))
(create-child obj (format nil "<dl~A/>" (create-child obj (format nil "<dl~A/>"
(if class (if class
(format nil " class='~A'" (format nil " class='~A'"
(escape-string class)) (escape-string class))
"")) ""))
:clog-type 'clog-definition-list :auto-place auto-place)) :clog-type 'clog-definition-list
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-term ;; Implementation - clog-term
@ -753,21 +807,22 @@ and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
;; create-term ;; ;; create-term ;;
;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;
(defgeneric create-term (clog-definition-list &key content class auto-place) (defgeneric create-term (clog-definition-list
&key content 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-definition-list)
&key (content "") &key (content "")
(class nil) (class nil)
(auto-place t)) (html-id nil) (auto-place t))
(create-child obj (format nil "<dt>~A</dt>" (create-child obj (format nil "<dt>~A</dt>"
(escape-string content) (escape-string content)
(if class (if class
(format nil " class='~A'" (format nil " class='~A'"
(escape-string class)) (escape-string class))
"")) ""))
:clog-type 'clog-term :auto-place auto-place)) :clog-type 'clog-term :html-id html-id :auto-place auto-place))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-description ;; Implementation - clog-description
@ -781,13 +836,14 @@ and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;
(defgeneric create-description (clog-definition-list (defgeneric create-description (clog-definition-list
&key content class auto-place) &key 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-definition-list)
&key (content "") &key (content "")
(class nil) (class nil)
(html-id nil)
(auto-place t)) (auto-place t))
(create-child obj (format nil "<dd>~A</dd>" (create-child obj (format nil "<dd>~A</dd>"
(escape-string content) (escape-string content)
@ -795,7 +851,9 @@ and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
(format nil " class='~A'" (format nil " class='~A'"
(escape-string class)) (escape-string class))
"")) ""))
:clog-type 'clog-description :auto-place auto-place)) :clog-type 'clog-description
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-table ;; Implementation - clog-table
@ -808,18 +866,20 @@ and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
;; create-table ;; ;; create-table ;;
;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;
(defgeneric create-table (clog-obj &key class auto-place) (defgeneric create-table (clog-obj &key class html-id auto-place)
(:documentation "Create a new CLOG-Table as child of CLOG-OBJ (:documentation "Create a new CLOG-Table 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-table ((obj clog-obj) (defmethod create-table ((obj clog-obj)
&key (class nil) (auto-place t)) &key (class nil) (html-id nil) (auto-place t))
(create-child obj (format nil "<table~A/>" (create-child obj (format nil "<table~A/>"
(if class (if class
(format nil " class='~A'" (format nil " class='~A'"
(escape-string class)) (escape-string class))
"")) ""))
:clog-type 'clog-table :auto-place auto-place)) :clog-type 'clog-table
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-table-row ;; Implementation - clog-table-row
@ -832,18 +892,20 @@ and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
;; create-table-row ;; ;; create-table-row ;;
;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;
(defgeneric create-table-row (clog-obj &key class auto-place) (defgeneric create-table-row (clog-obj &key class html-id auto-place)
(:documentation "Create a new CLOG-Table-Row as child of CLOG-OBJ (:documentation "Create a new CLOG-Table-Row 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-table-row ((obj clog-obj) (defmethod create-table-row ((obj clog-obj)
&key (class nil) (auto-place t)) &key (class nil) (html-id nil) (auto-place t))
(create-child obj (format nil "<tr~A/>" (create-child obj (format nil "<tr~A/>"
(if class (if class
(format nil " class='~A'" (format nil " class='~A'"
(escape-string class)) (escape-string class))
"")) ""))
:clog-type 'clog-table-row :auto-place auto-place)) :clog-type 'clog-table-row
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-table-column ;; Implementation - clog-table-column
@ -860,6 +922,7 @@ and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
column-span column-span
row-span row-span
class class
html-id
auto-place) auto-place)
(:documentation "Create a new CLOG-Table-Column as child of CLOG-OBJ (:documentation "Create a new CLOG-Table-Column 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"))
@ -868,6 +931,7 @@ and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
(column-span 1) (column-span 1)
(row-span 1) (row-span 1)
(class nil) (class nil)
(html-id nil)
(auto-place t)) (auto-place t))
(create-child obj (format nil "<td colspan=~A rowspan=~A~A>~A</td>" (create-child obj (format nil "<td colspan=~A rowspan=~A~A>~A</td>"
column-span column-span
@ -877,7 +941,9 @@ and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
(escape-string class)) (escape-string class))
"") "")
(escape-string content)) (escape-string content))
:clog-type 'clog-table-column :auto-place auto-place)) :clog-type 'clog-table-column
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-table-heading ;; Implementation - clog-table-heading
@ -891,18 +957,20 @@ and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;
(defgeneric create-table-heading (clog-obj &key content (defgeneric create-table-heading (clog-obj &key content
column-span column-span
row-span row-span
class class
auto-place) html-id
auto-place)
(:documentation "Create a new CLOG-Table-Heading as child of CLOG-OBJ (:documentation "Create a new CLOG-Table-Heading 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-table-heading ((obj clog-obj) &key (content "") (defmethod create-table-heading ((obj clog-obj) &key (content "")
(column-span 1) (column-span 1)
(row-span 1) (row-span 1)
(class nil) (class nil)
(auto-place t)) (html-id nil)
(auto-place t))
(create-child obj (format nil "<th colspan=~A rowspan=~A~A>~A</th>" (create-child obj (format nil "<th colspan=~A rowspan=~A~A>~A</th>"
column-span column-span
row-span row-span
@ -911,7 +979,9 @@ and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
(escape-string class)) (escape-string class))
"") "")
(escape-string content)) (escape-string content))
:clog-type 'clog-table-heading :auto-place auto-place)) :clog-type 'clog-table-heading
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-table-head ;; Implementation - clog-table-head
@ -924,18 +994,20 @@ and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
;; create-table-head ;; ;; create-table-head ;;
;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;
(defgeneric create-table-head (clog-obj &key class auto-place) (defgeneric create-table-head (clog-obj &key class html-id auto-place)
(:documentation "Create a new CLOG-Table-Head as child of CLOG-OBJ (:documentation "Create a new CLOG-Table-Head 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-table-head ((obj clog-obj) (defmethod create-table-head ((obj clog-obj)
&key (class nil) (auto-place t)) &key (class nil) (html-id nil) (auto-place t))
(create-child obj (format nil "<thead~A/>" (create-child obj (format nil "<thead~A/>"
(if class (if class
(format nil " class='~A'" (format nil " class='~A'"
(escape-string class)) (escape-string class))
"")) ""))
:clog-type 'clog-table-head :auto-place auto-place)) :clog-type 'clog-table-head
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-table-body ;; Implementation - clog-table-body
@ -948,18 +1020,20 @@ and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
;; create-table-body ;; ;; create-table-body ;;
;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;
(defgeneric create-table-body (clog-obj &key class auto-place) (defgeneric create-table-body (clog-obj &key class html-id auto-place)
(:documentation "Create a new CLOG-Table-Body as child of CLOG-OBJ (:documentation "Create a new CLOG-Table-Body 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-table-body ((obj clog-obj) (defmethod create-table-body ((obj clog-obj)
&key (class nil) (auto-place t)) &key (class nil) (html-id nil) (auto-place t))
(create-child obj (format nil "<tbody~A/>" (create-child obj (format nil "<tbody~A/>"
(if class (if class
(format nil " class='~A'" (format nil " class='~A'"
(escape-string class)) (escape-string class))
"")) ""))
:clog-type 'clog-table-body :auto-place auto-place)) :clog-type 'clog-table-body
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-table-caption ;; Implementation - clog-table-caption
@ -972,19 +1046,25 @@ and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
;; create-table-caption ;; ;; create-table-caption ;;
;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;
(defgeneric create-table-caption (clog-obj &key content class auto-place) (defgeneric create-table-caption (clog-obj
&key content class html-id auto-place)
(:documentation "Create a new CLOG-Table-Caption as child of CLOG-OBJ (:documentation "Create a new CLOG-Table-Caption 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-table-caption ((obj clog-obj) (defmethod create-table-caption ((obj clog-obj)
&key (content "") (class nil) (auto-place t)) &key (content "")
(class nil)
(html-id nil)
(auto-place t))
(create-child obj (format nil "<caption~A/>~A</caption>" (create-child obj (format nil "<caption~A/>~A</caption>"
(if class (if class
(format nil " class='~A'" (format nil " class='~A'"
(escape-string class)) (escape-string class))
"") "")
(escape-string content)) (escape-string content))
:clog-type 'clog-table-caption :auto-place auto-place)) :clog-type 'clog-table-caption
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-table-footer ;; Implementation - clog-table-footer
@ -997,18 +1077,20 @@ and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
;; create-table-footer ;; ;; create-table-footer ;;
;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;
(defgeneric create-table-footer (clog-obj &key class auto-place) (defgeneric create-table-footer (clog-obj &key class html-id auto-place)
(:documentation "Create a new CLOG-Table-Footer as child of CLOG-OBJ (:documentation "Create a new CLOG-Table-Footer 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-table-footer ((obj clog-obj) (defmethod create-table-footer ((obj clog-obj)
&key (class nil) (auto-place t)) &key (class nil) (html-id nil) (auto-place t))
(create-child obj (format nil "<tfoot~A/>" (create-child obj (format nil "<tfoot~A/>"
(if class (if class
(format nil " class='~A'" (format nil " class='~A'"
(escape-string class)) (escape-string class))
"")) ""))
:clog-type 'clog-table-footer :auto-place auto-place)) :clog-type 'clog-table-footer
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-table-column-group ;; Implementation - clog-table-column-group
@ -1021,18 +1103,20 @@ and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
;; create-table-column-group ;; ;; create-table-column-group ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defgeneric create-table-column-group (clog-obj &key class auto-place) (defgeneric create-table-column-group (clog-obj &key class html-id auto-place)
(:documentation "Create a new CLOG-Table-Column-Group as child of CLOG-OBJ (:documentation "Create a new CLOG-Table-Column-Group 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-table-column-group ((obj clog-obj) (defmethod create-table-column-group ((obj clog-obj)
&key (class nil) (auto-place t)) &key (class nil) (html-id nil) (auto-place t))
(create-child obj (format nil "<colgroup~A/>" (create-child obj (format nil "<colgroup~A/>"
(if class (if class
(format nil " class='~A'" (format nil " class='~A'"
(escape-string class)) (escape-string class))
"")) ""))
:clog-type 'clog-table-column-group :auto-place auto-place)) :clog-type 'clog-table-column-group
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-table-column-group-item ;; Implementation - clog-table-column-group-item
@ -1045,17 +1129,23 @@ and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ"))
;; create-table-column-group-item ;; ;; create-table-column-group-item ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defgeneric create-table-column-group-item (clog-obj (defgeneric create-table-column-group-item
&key column-span class auto-place) (clog-obj
&key column-span class html-id auto-place)
(:documentation "Create a new CLOG-Table-Column-Group-Item as child of CLOG-OBJ (:documentation "Create a new CLOG-Table-Column-Group-Item 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-table-column-group-item ((obj clog-obj) (defmethod create-table-column-group-item ((obj clog-obj)
&key (column-span 1) (class nil) (auto-place t)) &key (column-span 1)
(class nil)
(html-id nil)
(auto-place t))
(create-child obj (format nil "<col span=~A~A/>" (create-child obj (format nil "<col span=~A~A/>"
column-span column-span
(if class (if class
(format nil " class='~A'" (format nil " class='~A'"
(escape-string class)) (escape-string class))
"")) ""))
:clog-type 'clog-table-column-group-item :auto-place auto-place)) :clog-type 'clog-table-column-group-item
:html-id html-id
:auto-place auto-place))

View file

@ -29,12 +29,17 @@ element objects."))
;; create-with-html ;; ;; create-with-html ;;
;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;
(defun create-with-html (connection-id html &key (clog-type 'clog-element)) (defun create-with-html (connection-id html
"Create a new clog-element and attach it to HTML on CONNECTION-ID. There must be &key (clog-type 'clog-element) (html-id nil))
a single outer block that will be set to an internal id. The returned CLOG-Element "Create a new clog-element and attach it to HTML on
requires placement or will not be visible, ie. place-after, etc. as it exists in CONNECTION-ID. There must be a single outer block that will be set to
the javascript clog[] but is not in the DOM. (private)" an internal id. The returned CLOG-Element requires placement or will
(let ((web-id (cc:generate-id))) not be visible, ie. place-after, etc. as it exists in the javascript
clog[] but is not in the DOM. If HTML-ID is nil one is generated.
(private)"
(let ((web-id (if html-id
html-id
(cc:generate-id))))
(cc:execute (cc:execute
connection-id connection-id
(format nil (format nil
@ -61,14 +66,17 @@ CONNECTION-ID to it and then return it. The HTML-ID must be unique. (private)"
;; create-child ;; ;; create-child ;;
;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;
(defgeneric create-child (clog-obj html &key auto-place clog-type) (defgeneric create-child (clog-obj html &key html-id auto-place clog-type)
(:documentation "Create a new CLOG-Element or sub-type of CLOG-TYPE from HTML (:documentation "Create a new CLOG-Element or sub-type of CLOG-TYPE from HTML
as child of CLOG-OBJ and if :AUTO-PLACE (default t) place-inside-bottom-of as child of CLOG-OBJ and if :AUTO-PLACE (default t) place-inside-bottom-of
CLOG-OBJ")) CLOG-OBJ. If HTML-ID is nil one will be generated."))
(defmethod create-child ((obj clog-obj) html &key (auto-place t) (defmethod create-child ((obj clog-obj) html &key (html-id nil)
(auto-place t)
(clog-type 'clog-element)) (clog-type 'clog-element))
(let ((child (create-with-html (connection-id obj) html :clog-type clog-type))) (let ((child (create-with-html (connection-id obj) html
:clog-type clog-type
:html-id html-id)))
(if auto-place (if auto-place
(place-inside-bottom-of obj child) (place-inside-bottom-of obj child)
child))) child)))

View file

@ -37,14 +37,14 @@
(defclass clog-form (clog-element)() (defclass clog-form (clog-element)()
(:documentation "CLOG Form Objecs is the base class for all html forms.")) (:documentation "CLOG Form Objecs is the base class for all html forms."))
;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;
;; create-form ;; ;; create-form ;;
;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;
(deftype from-method-type () '(members :get :post :none)) (deftype from-method-type () '(members :get :post :none))
(defgeneric create-form (clog-obj &key action method target class auto-place) (defgeneric create-form (clog-obj
&key action method target class html-id auto-place)
(:documentation "Create a new CLOG-Form as child of CLOG-OBJ that organizes (:documentation "Create a new CLOG-Form as child of CLOG-OBJ that organizes
a collection of form elements in to a single form if :AUTO-PLACE (default t) a collection of form elements in to a single form if :AUTO-PLACE (default t)
place-inside-bottom-of CLOG-OBJ. In CLOG a form's on-submit handler should be place-inside-bottom-of CLOG-OBJ. In CLOG a form's on-submit handler should be
@ -59,6 +59,7 @@ action."))
(method :none) (method :none)
(target "_self") (target "_self")
(class nil) (class nil)
(html-id nil)
(auto-place t)) (auto-place t))
(create-child obj (format nil "<form action='~A' ~A target='~A'/>" (create-child obj (format nil "<form action='~A' ~A target='~A'/>"
action action
@ -67,9 +68,10 @@ action."))
(format nil "method='~A'" method)) (format nil "method='~A'" method))
target target
(if class (if class
(format nil " class='~A'" (escape-string class)) (format nil " class='~A'"
(escape-string class))
"")) ""))
:clog-type 'clog-form :auto-place auto-place)) :clog-type 'clog-form :html-id html-id :auto-place auto-place))
;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;
;; form-element-count ;; ;; form-element-count ;;
@ -172,13 +174,17 @@ elements."))
:file :hidden :image :month :number :password :radio :range :file :hidden :image :month :number :password :radio :range
:reset :search :submit :tel :text :time :url :week)) :reset :search :submit :tel :text :time :url :week))
(defgeneric create-form-element (clog-obj element-type &key name value label) (defgeneric create-form-element (clog-obj element-type
&key name value label html-id)
(:documentation "Create a new clog-form-element as child of CLOG-OBJ. (:documentation "Create a new clog-form-element as child of CLOG-OBJ.
It is importamt that clog-form-elements are a child or descendant of a It is importamt that clog-form-elements are a child or descendant of a
clog-form in the DOM. The radio ELEMENT-TYPE groups by NAME.")) clog-form in the DOM. The radio ELEMENT-TYPE groups by NAME."))
(defmethod create-form-element ((obj clog-obj) element-type (defmethod create-form-element ((obj clog-obj) element-type
&key (name nil) (value nil) (label nil)) &key (name nil)
(value nil)
(label nil)
(html-id nil))
(let ((element (create-child (let ((element (create-child
obj (format nil "<input type='~A'~A~A/>" obj (format nil "<input type='~A'~A~A/>"
(escape-string element-type) (escape-string element-type)
@ -188,7 +194,9 @@ clog-form in the DOM. The radio ELEMENT-TYPE groups by NAME."))
(if name (if name
(format nil " name='~A'" name) (format nil " name='~A'" name)
"")) ""))
:clog-type 'clog-form-element :auto-place t))) :clog-type 'clog-form-element
:html-id html-id
:auto-place t)))
(when label (when label
(label-for label element)) (label-for label element))
element)) element))
@ -370,8 +378,6 @@ group called NAME."))
(format nil "$('input:radio[name=~A]:checked').val()" (format nil "$('input:radio[name=~A]:checked').val()"
name))) name)))
;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;; name-value ;; ;; name-value ;;
;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
@ -642,16 +648,18 @@ virtual keyboards."))
;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;
(defgeneric create-label (clog-obj &key content label-for) (defgeneric create-label (clog-obj &key content label-for html-id)
(:documentation "Create a new clog-label as child of CLOG-OBJ.")) (:documentation "Create a new clog-label as child of CLOG-OBJ."))
(defmethod create-label ((obj clog-obj) &key (content "") (label-for nil)) (defmethod create-label ((obj clog-obj) &key (content "")
(label-for nil)
(html-id nil))
(create-child obj (format nil "<label for='~A'>~A</label>" (create-child obj (format nil "<label for='~A'>~A</label>"
(if label-for (if label-for
(html-id label-for) (html-id label-for)
"") "")
(escape-string content)) (escape-string content))
:clog-type 'clog-label :auto-place t)) :clog-type 'clog-label :html-id html-id :auto-place t))
;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;
;; label-for ;; ;; label-for ;;
@ -663,7 +671,6 @@ virtual keyboards."))
(defmethod label-for ((obj clog-label) element) (defmethod label-for ((obj clog-label) element)
(setf (attribute obj "for") (html-id element))) (setf (attribute obj "for") (html-id element)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-fieldset ;; Implementation - clog-fieldset
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -675,16 +682,15 @@ virtual keyboards."))
;; create-fieldset ;; ;; create-fieldset ;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;
(defgeneric create-fieldset (clog-obj &key legend html-id)
(defgeneric create-fieldset (clog-obj &key legend)
(:documentation "Create a new clog-fieldset as child of CLOG-OBJ.")) (:documentation "Create a new clog-fieldset as child of CLOG-OBJ."))
(defmethod create-fieldset ((obj clog-obj) &key (legend nil)) (defmethod create-fieldset ((obj clog-obj) &key (legend nil) (html-id nil))
(create-child obj (format nil "<fieldset>~A</fieldset>" (create-child obj (format nil "<fieldset>~A</fieldset>"
(if legend (if legend
(format nil "<legend>~A</legend>" legend) (format nil "<legend>~A</legend>" legend)
"")) ""))
:clog-type 'clog-fieldset :auto-place t)) :clog-type 'clog-fieldset :html-id html-id :auto-place t))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-data-list ;; Implementation - clog-data-list
@ -697,12 +703,15 @@ virtual keyboards."))
;; create-data-list ;; ;; create-data-list ;;
;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;
(defgeneric create-data-list (clog-obj &key data-list) (defgeneric create-data-list (clog-obj &key data-list html-id)
(:documentation "Create a new clog-data-list as child of CLOG-OBJ and (:documentation "Create a new clog-data-list as child of CLOG-OBJ and
optionally fill in with contents of data-list.")) optionally fill in with contents of data-list."))
(defmethod create-data-list ((obj clog-obj) &key (data-list nil)) (defmethod create-data-list ((obj clog-obj) &key (data-list nil) (html-id nil))
(let ((element (create-child obj "<datalist />" :clog-type 'clog-data-list :auto-place t))) (let ((element (create-child obj "<datalist />"
:clog-type 'clog-data-list
:html-id html-id
:auto-place t)))
(when data-list (when data-list
(add-options element data-list)) (add-options element data-list))
element)) element))
@ -740,7 +749,8 @@ optionally fill in with contents of data-list."))
;; create-text-area ;; ;; create-text-area ;;
;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;
(defgeneric create-text-area (clog-obj &key columns rows name value label) (defgeneric create-text-area (clog-obj
&key columns rows name value label html-id)
(:documentation "Create a new clog-text-area as child of CLOG-OBJ.")) (:documentation "Create a new clog-text-area as child of CLOG-OBJ."))
(defmethod create-text-area ((obj clog-obj) (defmethod create-text-area ((obj clog-obj)
@ -748,12 +758,13 @@ optionally fill in with contents of data-list."))
(rows 2) (rows 2)
(name "") (name "")
(value "") (value "")
(label nil)) (label nil)
(html-id nil))
(let ((element (let ((element
(create-child obj (create-child obj
(format nil "<textarea name='~A' cols='~A' rows='~A'>~A</textarea>" (format nil "<textarea name='~A' cols='~A' rows='~A'>~A</textarea>"
name columns rows (escape-string value)) name columns rows (escape-string value))
:clog-type 'clog-text-area :auto-place t))) :clog-type 'clog-text-area :html-id html-id :auto-place t)))
(when label (when label
(label-for label element)) (label-for label element))
@ -837,7 +848,6 @@ optionally fill in with contents of data-list."))
(defmethod disable-resize ((obj clog-text-area)) (defmethod disable-resize ((obj clog-text-area))
(setf (resizable obj) :none)) (setf (resizable obj) :none))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-select ;; Implementation - clog-select
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -849,10 +859,14 @@ optionally fill in with contents of data-list."))
;; create-select ;; ;; create-select ;;
;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;
(defgeneric create-select (clog-obj &key name multiple label) (defgeneric create-select (clog-obj &key name multiple label html-id)
(:documentation "Create a new clog-select as child of CLOG-OBJ.")) (:documentation "Create a new clog-select as child of CLOG-OBJ."))
(defmethod create-select ((obj clog-obj) &key (name nil) (multiple nil) (label nil)) (defmethod create-select ((obj clog-obj)
&key (name nil)
(multiple nil)
(label nil)
(html-id nil))
(let ((element (create-child (let ((element (create-child
obj (format nil "<select~A~A/>" obj (format nil "<select~A~A/>"
(if multiple (if multiple
@ -861,7 +875,7 @@ optionally fill in with contents of data-list."))
(if name (if name
(format nil " name='~A'" name) (format nil " name='~A'" name)
"")) ""))
:clog-type 'clog-select :auto-place t))) :clog-type 'clog-select :html-id html-id :auto-place t)))
(when label (when label
(label-for label element)) (label-for label element))
element)) element))
@ -901,14 +915,16 @@ optionally fill in with contents of data-list."))
;; create-option ;; ;; create-option ;;
;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;
(defgeneric create-option (clog-obj &key content value selected disabled) (defgeneric create-option (clog-obj
&key content value selected disabled html-id)
(:documentation "Create a new clog-option as child of CLOG-OBJ.")) (:documentation "Create a new clog-option as child of CLOG-OBJ."))
(defmethod create-option ((obj clog-obj) &key (defmethod create-option ((obj clog-obj) &key
(content "") (content "")
(value nil) (value nil)
(selected nil) (selected nil)
(disabled nil)) (disabled nil)
(html-id nil))
(create-child obj (format nil "<option~A~A~A>~A</option>" (create-child obj (format nil "<option~A~A~A>~A</option>"
(if selected (if selected
" selected" " selected"
@ -920,7 +936,7 @@ optionally fill in with contents of data-list."))
(format nil " value='~A'" value) (format nil " value='~A'" value)
"") "")
content) content)
:clog-type 'clog-option :auto-place t)) :clog-type 'clog-option :html-id html-id :auto-place t))
;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;
;; selectedp ;; ;; selectedp ;;
@ -950,15 +966,15 @@ optionally fill in with contents of data-list."))
;; create-optgroup ;; ;; create-optgroup ;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;
(defgeneric create-optgroup (clog-obj &key content disabled) (defgeneric create-optgroup (clog-obj &key content disabled html-id)
(:documentation "Create a new clog-optgroup as child of CLOG-OBJ.")) (:documentation "Create a new clog-optgroup as child of CLOG-OBJ."))
(defmethod create-optgroup ((obj clog-obj) &key (defmethod create-optgroup ((obj clog-obj) &key (content "")
(content "") (disabled nil)
(disabled nil)) (html-id nil))
(create-child obj (format nil "<optgroup label='~A'~A/>" (create-child obj (format nil "<optgroup label='~A'~A/>"
content content
(if disabled (if disabled
" disabled" " disabled"
"")) ""))
:clog-type 'clog-optgroup :auto-place t)) :clog-type 'clog-optgroup :html-id html-id :auto-place t))

View file

@ -123,7 +123,8 @@
;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;
(defgeneric playback-ended-p (clog-multimedia) (defgeneric playback-ended-p (clog-multimedia)
(:documentation "Get/Setf true of Media position has reached end of its duration.")) (:documentation "Get/Setf true of Media position has reached end of its
duration."))
(defmethod playback-ended-p ((obj clog-multimedia)) (defmethod playback-ended-p ((obj clog-multimedia))
(js-true-p (property obj "ended"))) (js-true-p (property obj "ended")))
@ -151,7 +152,8 @@ Common values - 1.0 normal, 0.5 half speed, -1.0 reverse"))
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;
(defgeneric ready-to-play-p (clog-multimedia) (defgeneric ready-to-play-p (clog-multimedia)
(:documentation "Get/Setf true of Media position has reached end of its duration.")) (:documentation "Get/Setf true of Media position has reached end of its
duration."))
(defmethod ready-to-play-p ((obj clog-multimedia)) (defmethod ready-to-play-p ((obj clog-multimedia))
(js-true-p (property obj "readyState"))) (js-true-p (property obj "readyState")))
@ -588,6 +590,7 @@ HANDLER is nil unbind the event."))
autoplay autoplay
autoloop autoloop
muted muted
html-id
auto-place) auto-place)
(:documentation "Create a CLOG Audio control")) (:documentation "Create a CLOG Audio control"))
@ -598,11 +601,13 @@ HANDLER is nil unbind the event."))
(autoplay nil) (autoplay nil)
(autoloop nil) (autoloop nil)
(muted nil) (muted nil)
(html-id nil)
(auto-place t)) (auto-place t))
(create-child obj (format nil "<audio~A~A~A~A~A~A/>" (create-child obj (format nil "<audio~A~A~A~A~A~A/>"
(if (equal source "") (if (equal source "")
"" ""
(format nil " src='~A'" (escape-string source))) (format nil " src='~A'"
(escape-string source)))
(if controls (if controls
" controls" " controls"
"") "")
@ -618,7 +623,9 @@ HANDLER is nil unbind the event."))
(if muted (if muted
" muted" " muted"
"")) ""))
:clog-type 'clog-audio :auto-place auto-place)) :clog-type 'clog-audio
:html-id html-id
:auto-place auto-place))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -636,6 +643,7 @@ HANDLER is nil unbind the event."))
autoplay autoplay
autoloop autoloop
muted muted
html-id
auto-place) auto-place)
(:documentation "Create a CLOG video control")) (:documentation "Create a CLOG video control"))
@ -647,11 +655,13 @@ HANDLER is nil unbind the event."))
(autoplay nil) (autoplay nil)
(autoloop nil) (autoloop nil)
(muted nil) (muted nil)
(html-id nil)
(auto-place t)) (auto-place t))
(create-child obj (format nil "<video~A~A~A~A~A~A~A/>" (create-child obj (format nil "<video~A~A~A~A~A~A~A/>"
(if (equal source "") (if (equal source "")
"" ""
(format nil " src='~A'" (escape-string source))) (format nil " src='~A'"
(escape-string source)))
(if controls (if controls
" controls" " controls"
"") "")
@ -660,7 +670,8 @@ HANDLER is nil unbind the event."))
"") "")
(if (equal poster "") (if (equal poster "")
"" ""
(format nil " poster='~A'" (escape-string poster))) (format nil " poster='~A'"
(escape-string poster)))
(if autoplay (if autoplay
" autoplay" " autoplay"
"") "")
@ -670,5 +681,7 @@ HANDLER is nil unbind the event."))
(if muted (if muted
" muted" " muted"
"")) ""))
:clog-type 'clog-video :auto-place auto-place)) :clog-type 'clog-video
:html-id html-id
:auto-place auto-place))

View file

@ -31,11 +31,14 @@
(defmethod create-toggler ((obj clog-obj) &key (content "") (defmethod create-toggler ((obj clog-obj) &key (content "")
(class nil) (class nil)
(html-id nil)
(auto-place t)) (auto-place t))
(let ((new-obj (create-unordered-list obj :class class (let ((new-obj (create-unordered-list obj :class class
:html-if html-id
:auto-place auto-place))) :auto-place auto-place)))
;; Using change-class we can reuse the parent clog-obj's create ;; Using change-class we can reuse the parent clog-unordered-lists's
;; method and it's initialization. ;; create method and it's initialization. Otherwise we can use
;; create-child and the needed html.
(change-class new-obj 'clog-toggler) (change-class new-obj 'clog-toggler)
new-obj)) new-obj))