diff --git a/clog-element-common.lisp b/clog-element-common.lisp
index 6529e61..ab55ec5 100644
--- a/clog-element-common.lisp
+++ b/clog-element-common.lisp
@@ -8,6 +8,74 @@
(cl:in-package :clog)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Implementation - clog-a
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defclass clog-a (clog-element)()
+ (:documentation "CLOG A, anchor, Objects."))
+
+;;;;;;;;;;;;;;
+;; create-a ;;
+;;;;;;;;;;;;;;
+
+(defgeneric create-a (clog-obj &key link content target auto-place)
+ (: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)
+place-inside-bottom-of CLOG-OBJ.
+
+ Target of link, name of a frame or:
+ _blank = new window
+ _top = top most frame (full browser window)
+ _parent = parent frame or window
+ _self = current frame or window"))
+
+(defmethod create-a ((obj clog-obj)
+ &key (link "")
+ (content "")
+ (target "_self")
+ (auto-place t))
+ (create-child obj (format nil "~A"
+ (escape-string target)
+ (escape-string link)
+ (escape-string content))
+ :clog-type 'clog-a
+ :auto-place auto-place))
+
+;;;;;;;;;;
+;; link ;;
+;;;;;;;;;;
+
+(defgeneric link (clog-a)
+ (:documentation "Get/Setf the HREF link of the anchor."))
+
+(defmethod link ((obj clog-a))
+ (property obj "href"))
+
+(defgeneric set-link (clog-a value)
+ (:documentation "Set link VALUE for CLOG-A"))
+
+(defmethod set-link ((obj clog-a) value)
+ (setf (property obj "href") value))
+(defsetf link set-link)
+
+;;;;;;;;;;;;
+;; target ;;
+;;;;;;;;;;;;
+
+(defgeneric target (clog-a)
+ (:documentation "Get/Setf the link target of the anchor."))
+
+(defmethod target ((obj clog-a))
+ (property obj "target"))
+
+(defgeneric set-target (clog-a value)
+ (:documentation "Set target VALUE for CLOG-A"))
+
+(defmethod set-target ((obj clog-a) value)
+ (setf (property obj "target") value))
+(defsetf target set-target)
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-br
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -19,13 +87,49 @@
;; create-br ;;
;;;;;;;;;;;;;;;
-(defgeneric create-br (clog-obj &key content auto-place)
+(defgeneric create-br (clog-obj &key auto-place)
(: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"))
-(defmethod create-br ((obj clog-obj) &key (content "") (auto-place t))
- (create-child obj (format nil "
" (escape-string content))
- :clog-type 'clog-br))
+(defmethod create-br ((obj clog-obj) &key (auto-place t))
+ (create-child obj "
" :clog-type 'clog-br :auto-place auto-place))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Implementation - clog-button
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defclass clog-button (clog-element)()
+ (:documentation "CLOG Button Objects."))
+
+;;;;;;;;;;;;;;;;;;;
+;; create-button ;;
+;;;;;;;;;;;;;;;;;;;
+
+(defgeneric create-button (clog-obj &key content auto-place)
+ (:documentation "Create a new CLOG-Button as child of CLOG-OBJ with :CONTENT
+(default \"\") and if :AUTO-PLACE (default t) place-inside-bottom-of
+CLOG-OBJ"))
+
+(defmethod create-button ((obj clog-obj) &key (content "") (auto-place t))
+ (create-child obj (format nil "" (escape-string content))
+ :clog-type 'clog-button :auto-place auto-place))
+
+;;;;;;;;;;;;;;;
+;; disabledp ;;
+;;;;;;;;;;;;;;;
+
+(defgeneric disabledp (clog-button)
+ (:documentation "Get/Setf disabled status of button."))
+
+(defmethod disabledp ((obj clog-button))
+ (js-true-p (property obj "disabled")))
+
+(defgeneric set-disabledp (clog-button value)
+ (:documentation "Set editable VALUE for CLOG-BUTTON"))
+
+(defmethod set-disabledp ((obj clog-button) value)
+ (setf (property obj "disabled") (p-true-js value)))
+(defsetf disabledp set-editable)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-div
@@ -45,7 +149,7 @@ CLOG-OBJ"))
(defmethod create-div ((obj clog-obj) &key (content "") (auto-place t))
(create-child obj (format nil "
~A
" (escape-string content)) - :clog-type 'clog-p)) + :clog-type 'clog-p :auto-place auto-place)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -106,5 +249,5 @@ CLOG-OBJ")) (defmethod create-span ((obj clog-obj) &key (content "") (auto-place t)) (create-child obj (format nil "~A" (escape-string content)) - :clog-type 'clog-span)) + :clog-type 'clog-span :auto-place auto-place)) diff --git a/clog.lisp b/clog.lisp index f0416a4..803b442 100644 --- a/clog.lisp +++ b/clog.lisp @@ -232,10 +232,26 @@ application." (first-child generic-function) (next-sibling generic-function)) -(defsection @clog-element (:title "Common CLOG Elements") +(defsection @clog-element-common (:title "Common CLOG Elements") + "CLOG-A - Class for CLOG Anchors" + (clog-a class) + (create-a generic-function) + (link generic-function) + (target generic-function) + "CLOG-BR - Class for CLOG Line Breaks" (clog-br class) (create-br generic-function) + + "CLOG-BUTTON - Class for CLOG Buttons" + (clog-button class) + (create-button generic-function) + (disabledp generic-function) + + "CLOG-IMG - Class for CLOG Imgs" + (clog-img class) + (create-img generic-function) + (url-src generic-function) "CLOG-Div - Class for CLOG Divs" (clog-div class) diff --git a/doc/clog-manual.html b/doc/clog-manual.html index 8ce2581..c2989ff 100644 --- a/doc/clog-manual.html +++ b/doc/clog-manual.html @@ -39,11 +39,12 @@+
[generic-function] CREATE-CHILD CLOG-OBJ HTML &KEY AUTO-PLACE
+[generic-function] CREATE-CHILD CLOG-OBJ HTML &KEY AUTO-PLACE CLOG-TYPE
-Create a new CLOG-Element from HTML as child of CLOG-OBJ
-and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ
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
+CLOG-OBJ
[generic-function] ATTACH-AS-CHILD CLOG-OBJ HTML-ID
+[generic-function] ATTACH-AS-CHILD CLOG-OBJ HTML-ID &KEY CLOG-TYPE
-Create a new CLOG-Element and attach an existing element with HTML-ID. The
-HTML-ID must be unique.
Create a new CLOG-Element or sub-type of CLOG-TYPE and attach
+an existing element with HTML-ID. The HTML-ID must be unique.
CLOG-Element - Placement
@@ -1502,11 +1504,215 @@ html id than Element_Type will have an ID of undefined and therefore attached to no actualHTML elemen.
+
+
++ +
CLOG-A - Class for CLOG Anchors
[class] CLOG-A CLOG-ELEMENT
+ +CLOG A, anchor, Objects.
[generic-function] CREATE-A CLOG-OBJ &KEY LINK CONTENT TARGET AUTO-PLACE
+ +Create a new CLOG-A as child of CLOG-OBJ with :LINK and
+:CONTENT (default "") and :TARGET ("_self") and if :AUTO-PLACE (default t)
+place-inside-bottom-of CLOG-OBJ.
Target of link, name of a frame or: + _blank = new window + _top = top most frame (full browser window) + _parent = parent frame or window + _self = current frame or window
[generic-function] LINK CLOG-A
+ +Get/Setf the HREF link of the anchor.
[generic-function] TARGET CLOG-A
+ +Get/Setf the link target of the anchor.
CLOG-BR - Class for CLOG Line Breaks
[class] CLOG-BR CLOG-ELEMENT
+ +CLOG BR Objects for line breaks.
[generic-function] CREATE-BR CLOG-OBJ &KEY AUTO-PLACE
+ +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
CLOG-BUTTON - Class for CLOG Buttons
[class] CLOG-BUTTON CLOG-ELEMENT
+ +CLOG Button Objects.
[generic-function] CREATE-BUTTON CLOG-OBJ &KEY CONTENT AUTO-PLACE
+ +Create a new CLOG-Button as child of CLOG-OBJ with :CONTENT
+(default "") and if :AUTO-PLACE (default t) place-inside-bottom-of
+CLOG-OBJ
[generic-function] DISABLEDP CLOG-BUTTON
+ +Get/Setf disabled status of button.
CLOG-IMG - Class for CLOG Imgs
[class] CLOG-IMG CLOG-ELEMENT
+ +CLOG Img Objects.
[generic-function] CREATE-IMG CLOG-OBJ &KEY URL-SRC ALT-TEXT AUTO-PLACE
+ +Create a new CLOG-Img as child of CLOG-OBJ with :CONTENT
+(default "") and if :AUTO-PLACE (default t) place-inside-bottom-of
+CLOG-OBJ. Use width and height properties before placing image to constrain
+image size.
[generic-function] URL-SRC CLOG-IMG
+ +Get/Setf the url-src of the img.
CLOG-Div - Class for CLOG Divs
[class] CLOG-DIV CLOG-ELEMENT
+ +CLOG Div Objects.
[generic-function] CREATE-DIV CLOG-OBJ &KEY CONTENT AUTO-PLACE
+ +Create a new CLOG-Div as child of CLOG-OBJ with :CONTENT
+(default "") and if :AUTO-PLACE (default t) place-inside-bottom-of
+CLOG-OBJ
CLOG-HR - Class for CLOG Hortizontal Rules
[class] CLOG-HR CLOG-ELEMENT
+ +CLOG HR Objects for horizontal rules.
[generic-function] CREATE-HR CLOG-OBJ &KEY AUTO-PLACE
+ +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
+CLOG-OBJ
CLOG-P - Class for CLOG Paragraphs
[class] CLOG-P CLOG-ELEMENT
+ +CLOG P Objects.
[generic-function] CREATE-P CLOG-OBJ &KEY CONTENT AUTO-PLACE
+ +Create a new CLOG-P as child of CLOG-OBJ with :CONTENT
+(default "") and if :AUTO-PLACE (default t) place-inside-bottom-of
+CLOG-OBJ
CLOG-Span - Class for CLOG Spans
[class] CLOG-SPAN CLOG-ELEMENT
+ +CLOG Span Objects.
[generic-function] CREATE-SPAN CLOG-OBJ &KEY CONTENT AUTO-PLACE
+ +Create a new CLOG-Span as child of CLOG-OBJ with :CONTENT
+(default "") and if :AUTO-PLACE (default t) place-inside-bottom-of
+CLOG-OBJ
+
-
CLOG-Body - CLOG Body Objects
HTML elemen.
-
CLOG-Window - CLOG Window Objects
ON-ORIENTATION-CHANGE-HANDLER is nil unbind the event.
-
CLOG-Document - CLOG Document Objects
ON-ORIENTATION-CHANGE-HANDLER is nil unbind the event.
-
CLOG-Location - CLOG Location Objects
ON-ORIENTATION-CHANGE-HANDLER is nil unbind the event.
-
CLOG-Navigator - CLOG Navigator Objects