Add download attribute to create-a

This commit is contained in:
Bruno Cichon 2023-01-20 19:26:04 +01:00
parent 1a9535d278
commit b1d0326181
No known key found for this signature in database
GPG key ID: DA2004473258B1E2
2 changed files with 22 additions and 1 deletions

View file

@ -36,11 +36,12 @@ place-inside-bottom-of CLOG-OBJ.
&key (link "#") &key (link "#")
(content "") (content "")
(target "_self") (target "_self")
(download nil)
(style nil) (style nil)
(hidden nil) (hidden nil)
(class nil) (class nil)
(html-id nil) (auto-place t)) (html-id nil) (auto-place t))
(create-child obj (format nil "<a~@[~a~]~@[~a~] target='~A' href='~A'>~A</a>" (create-child obj (format nil "<a~@[~a~]~@[~a~]~@[~a~] target='~A' href='~A'>~A</a>"
(when class (when class
(format nil " class='~A'" (format nil " class='~A'"
(escape-string class :html t))) (escape-string class :html t)))
@ -48,6 +49,9 @@ place-inside-bottom-of CLOG-OBJ.
(format nil " style='~@[~a~]~@[~a~]'" (format nil " style='~@[~a~]~@[~a~]'"
(when hidden "visibility:hidden;") (when hidden "visibility:hidden;")
style)) style))
(when download
(format nil " download='~A'"
(escape-string download :html t)))
(escape-string target :html t) (escape-string target :html t)
(escape-string link :html t) (escape-string link :html t)
content) content)
@ -87,6 +91,22 @@ place-inside-bottom-of CLOG-OBJ.
(defmethod (setf target) (value (obj clog-a)) (defmethod (setf target) (value (obj clog-a))
(setf (property obj "target") value)) (setf (property obj "target") value))
;;;;;;;;;;;;;;
;; download ;;
;;;;;;;;;;;;;;
(defgeneric download (clog-a)
(:documentation "Get/Setf the download name of the anchor."))
(defmethod download ((obj clog-a))
(property obj "download"))
(defgeneric (setf download) (value clog-a)
(:documentation "Set download VALUE for CLOG-A"))
(defmethod (setf download) (value (obj clog-a))
(setf (property obj "download") value))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - clog-br ;; Implementation - clog-br
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View file

@ -394,6 +394,7 @@ embedded in a native template application.)"
(create-a generic-function) (create-a generic-function)
(link generic-function) (link generic-function)
(target generic-function) (target generic-function)
(download generic-function)
"CLOG-BR - Class for CLOG Line Breaks" "CLOG-BR - Class for CLOG Line Breaks"
(clog-br class) (clog-br class)