nested copy and paste

This commit is contained in:
David Botton 2022-01-30 15:16:41 -05:00
parent 31ee855ed0
commit 9f5d1b9df7

View file

@ -12,7 +12,7 @@
(defclass builder-app-data () (defclass builder-app-data ()
((copy-buf ((copy-buf
:accessor copy-buf :accessor copy-buf
:initform "" :initform nil
:documentation "Copy buffer") :documentation "Copy buffer")
(next-panel-id (next-panel-id
:accessor next-panel-id :accessor next-panel-id
@ -812,7 +812,8 @@ z.html()"
(write-file (js-query content (write-file (js-query content
(format nil (format nil
"var z=~a.clone();~ "var z=~a.clone();~
z.find('*').each(function(){if($(this).attr('id').substring(0,5)=='CLOGB'){$(this).removeAttr('id')}});~ z.find('*').each(function(){if($(this).attr('id') !== undefined && ~
if($(this).attr('id').substring(0,5)=='CLOGB'){$(this).removeAttr('id')}});~
z.html()" z.html()"
(clog::jquery content))) (clog::jquery content)))
fname) fname)
@ -881,12 +882,13 @@ z.html()"
(js-query content (js-query content
(format nil (format nil
"var z=~a.clone(); z=$('<div />').append(z);~ "var z=~a.clone(); z=$('<div />').append(z);~
z.find('*').each(function(){if($(this).attr('id').substring(0,5)=='CLOGB'){$(this).removeAttr('id')}});~ z.find('*').each(function(){if($(this).attr('id') !== undefined && ~
$(this).attr('id').substring(0,5)=='CLOGB'){$(this).removeAttr('id')}});~
z.html()" z.html()"
(clog::jquery (current-control app)))))))) (clog::jquery (current-control app))))))))
(set-on-click btn-paste (lambda (obj) (set-on-click btn-paste (lambda (obj)
(declare (ignore obj)) (declare (ignore obj))
(unless (eq (copy-buf app) "") (when (copy-buf app)
(let ((control (create-control content content (let ((control (create-control content content
`(:name "custom" `(:name "custom"
:clog-type clog:clog-element :clog-type clog:clog-element
@ -1059,12 +1061,13 @@ z.html()"
(js-query content (js-query content
(format nil (format nil
"var z=~a.clone(); z=$('<div />').append(z);~ "var z=~a.clone(); z=$('<div />').append(z);~
z.find('*').each(function(){if($(this).attr('id').substring(0,5)=='CLOGB'){$(this).removeAttr('id')}});~ z.find('*').each(function(){if($(this).attr('id') !== undefined && ~
$(this).attr('id').substring(0,5)=='CLOGB'){$(this).removeAttr('id')}});~
z.html()" z.html()"
(clog::jquery (current-control app)))))))) (clog::jquery (current-control app))))))))
(set-on-click btn-paste (lambda (obj) (set-on-click btn-paste (lambda (obj)
(declare (ignore obj)) (declare (ignore obj))
(unless (eq (copy-buf app) "") (when (copy-buf app)
(let ((control (create-control content content (let ((control (create-control content content
`(:name "custom" `(:name "custom"
:clog-type clog:clog-element :clog-type clog:clog-element