[go: nahoru, domu]

Skip to content

Commit

Permalink
add convert to div for html block
Browse files Browse the repository at this point in the history
  • Loading branch information
rabbibotton committed Jul 21, 2022
1 parent 2028bb2 commit 3d4f354
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tools/clog-builder-settings.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,23 @@
nil))))

(defparameter *props-raw-contents*
`((:name "html contents"
`((:name "commands"
:setup ,(lambda (control td1 td2)
(declare (ignore td1))
(let ((d1 (create-text-area td2 :value (escape-string (attribute control "data-original-html") :html t))))
(let ((exp (create-button td2 :content "convert to div")))
(set-on-click exp (lambda (obj)
(setf (attribute control "data-clog-type") "div")
(remove-attribute control "data-original-html")
(remove-attribute control "data-clog-composite-control")
(clog-web-alert obj
"Convert to Div"
"Save and reload panel to access child controls."
:color-class "w3-yellow"))))))
(:name "html contents"
:setup ,(lambda (control td1 td2)
(declare (ignore td1))
(let ((app (connection-data-item td1 "builder-app-data"))
(d1 (create-text-area td2 :value (escape-string (attribute control "data-original-html") :html t))))
(set-on-change d1 (lambda (obj)
(declare (ignore obj))
(setf (attribute control "data-original-html") (value d1))
Expand Down

0 comments on commit 3d4f354

Please sign in to comment.