mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-05 18:20:36 -08:00
repl playground added
This commit is contained in:
parent
e475e35237
commit
bcf4ff7e55
4 changed files with 25 additions and 10 deletions
|
|
@ -9,8 +9,8 @@
|
|||
(declare (ignore obj))
|
||||
(when (current-editor-is-lisp app)
|
||||
;; we needed to modify Ace's lisp mode to treat : as part of symbol
|
||||
;; otherwise lookups do not consider the symbols package. I did
|
||||
;; using code mathod but then the automatic replace is only on the symbol
|
||||
;; otherwise lookups do not consider the symbols package. I did try
|
||||
;; using a code method but then the automatic replace was only on the symbol
|
||||
(let* ((p (when (current-control app)
|
||||
(attribute (get-placer (current-control app)) "data-panel-id")))
|
||||
(s (if (eq (current-editor-is-lisp app) t)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@
|
|||
(win (create-gui-window obj :title "CLOG Builder REPL"
|
||||
:top 40 :left 225
|
||||
:width 600 :height 400
|
||||
:client-movement *client-side-movement*)))
|
||||
:client-movement *client-side-movement*))
|
||||
(repl (create-clog-builder-repl (window-content win))))
|
||||
(when *clog-repl-private-console*
|
||||
(let ((pcon (on-open-repl-console obj win)))
|
||||
(setf (window-param win) pcon)
|
||||
|
|
@ -25,8 +26,9 @@
|
|||
(declare (ignore obj))
|
||||
(window-close pcon))))
|
||||
(window-focus win))
|
||||
(set-geometry (create-clog-builder-repl (window-content win))
|
||||
:units "%" :width 100 :height 100)))
|
||||
(setup-lisp-ace (playground repl) (status repl))
|
||||
(setf (clog-ace:theme (playground repl)) "ace/theme/terminal")
|
||||
(set-geometry repl :units "%" :width 100 :height 100)))
|
||||
|
||||
(defun repl-on-create (panel target)
|
||||
(declare (ignore target))
|
||||
|
|
|
|||
2
tools/panel-clog-builder-repl.clog
vendored
2
tools/panel-clog-builder-repl.clog
vendored
|
|
@ -1 +1 @@
|
|||
<data id="I3921490745" data-in-package="clog-tools" data-custom-slots="" data-clog-next-id="4" data-clog-title="clog-builder-repl"></data><input type="TEXT" value="clog-user" data-clog-type="input" data-clog-name="package-div" style="box-sizing: content-box; position: absolute; inset: 0px 0px 338.5px; height: 25px;" placeholder="Current Package" class="w3-black"><div style="--pixel-density: 1; --char-width: 6.60156; box-sizing: content-box; position: absolute; inset: 30px 0px 0px;" class="terminal" data-clog-type="clog-terminal" data-clog-composite-control="t" data-clog-terminal-prompt="> " data-clog-terminal-greetings="CLOG Builder REPL - (clog-repl) or (clog-builder-repl) for GUI using *body*" data-clog-name="terminal" data-on-command="(repl-on-commmand panel target data)" data-on-create="(repl-on-create panel target)"></div>
|
||||
<data id="I3922518133" data-in-package="clog-tools" data-custom-slots="" data-clog-next-id="7" data-clog-title="clog-builder-repl"></data><input type="TEXT" value="clog-user" data-clog-type="input" data-clog-name="package-div" style="box-sizing: content-box; position: absolute; inset: 0px 0px 338.5px; height: 25px;" placeholder="Current Package" class="w3-black"><div style="--pixel-density: 1; --char-width: 6.60156; box-sizing: content-box; position: absolute; top: 30px; right: 0px; left: 0px; height: 170px;" class="terminal" data-clog-type="clog-terminal" data-clog-composite-control="t" data-clog-terminal-prompt="> " data-clog-terminal-greetings="CLOG Builder REPL - (clog-repl) or (clog-builder-repl) for GUI using *body*" data-clog-name="terminal" data-on-command="(repl-on-commmand panel target data)" data-on-create="(repl-on-create panel target)"></div><div style="border: thin solid black; box-sizing: content-box; position: absolute; inset: 200px 0px 20px;" class=" ace_editor ace_hidpi ace-terminal-theme ace-tm" data-clog-type="clog-ace" data-clog-composite-control="t" data-clog-ace-theme="ace/theme/terminal" data-clog-ace-mode="ace/mode/lisp" data-clog-ace-tab-size="2" data-clog-name="playground"></div><div data-clog-type="div" data-clog-name="status" style="box-sizing: content-box; position: absolute; left: 0px; bottom: 0px; right: 0px; height: 20px;" class="w3-black w3-tiny w3-border">status</div>
|
||||
|
|
@ -1,21 +1,28 @@
|
|||
;;;; CLOG Builder generated code - modify original .clog file and rerender
|
||||
(in-package :clog-tools)
|
||||
(defclass clog-builder-repl (clog:clog-panel)
|
||||
((terminal :reader terminal) (package-div :reader package-div)))
|
||||
((status :reader status) (playground :reader playground)
|
||||
(terminal :reader terminal) (package-div :reader package-div)))
|
||||
(defun create-clog-builder-repl
|
||||
(clog-obj &key (hidden nil) (class nil) (html-id nil) (auto-place t))
|
||||
(let ((panel
|
||||
(change-class
|
||||
(clog:create-div clog-obj :content
|
||||
"<input type=\"TEXT\" value=\"clog-user\" style=\"box-sizing: content-box; position: absolute; inset: 0px 0px 338.5px; height: 25px;\" placeholder=\"Current Package\" class=\"w3-black\" id=\"CLOGB3921490709\" data-clog-name=\"package-div\"><div style=\"--pixel-density: 1; --char-width: 6.60156; box-sizing: content-box; position: absolute; inset: 30px 0px 0px;\" class=\"terminal\" id=\"CLOGB3921490710\" data-clog-name=\"terminal\"></div>"
|
||||
"<input type=\"TEXT\" value=\"clog-user\" style=\"box-sizing: content-box; position: absolute; inset: 0px 0px 338.5px; height: 25px;\" placeholder=\"Current Package\" class=\"w3-black\" id=\"CLOGB3922517769\" data-clog-name=\"package-div\"><div style=\"--pixel-density: 1; --char-width: 6.60156; box-sizing: content-box; position: absolute; top: 30px; right: 0px; left: 0px; height: 170px;\" class=\"terminal\" id=\"CLOGB3922517770\" data-clog-name=\"terminal\"></div><div style=\"border: thin solid black; box-sizing: content-box; position: absolute; inset: 200px 0px 22px;\" class=\" ace_editor ace_hidpi ace-terminal-theme ace-tm\" id=\"CLOGB3922517771\" data-clog-name=\"playground\"></div><div id=\"CLOGB39225178996\" style=\"box-sizing: content-box; position: absolute; left: 0px; bottom: 0px; right: 0px; height: 20px;\" class=\"w3-black w3-tiny w3-border\" data-clog-name=\"status\">status</div>"
|
||||
:hidden hidden :class class :html-id html-id
|
||||
:auto-place auto-place)
|
||||
'clog-builder-repl)))
|
||||
(setf (slot-value panel 'status)
|
||||
(attach-as-child clog-obj "CLOGB39225178996" :clog-type
|
||||
'clog:clog-div :new-id t))
|
||||
(setf (slot-value panel 'playground)
|
||||
(attach-as-child clog-obj "CLOGB3922517771" :clog-type
|
||||
'clog-ace:clog-ace-element :new-id t))
|
||||
(setf (slot-value panel 'terminal)
|
||||
(attach-as-child clog-obj "CLOGB3921490710" :clog-type
|
||||
(attach-as-child clog-obj "CLOGB3922517770" :clog-type
|
||||
'clog-terminal:clog-terminal-element :new-id t))
|
||||
(setf (slot-value panel 'package-div)
|
||||
(attach-as-child clog-obj "CLOGB3921490709" :clog-type
|
||||
(attach-as-child clog-obj "CLOGB3922517769" :clog-type
|
||||
'clog:clog-form-element :new-id t))
|
||||
(let ((target (terminal panel)))
|
||||
(declare (ignorable target))
|
||||
|
|
@ -23,6 +30,12 @@
|
|||
"CLOG Builder REPL - (clog-repl) or (clog-builder-repl) for GUI using *body*")
|
||||
(clog-terminal:prompt target "> ")
|
||||
(repl-on-create panel target))
|
||||
(let ((target (playground panel)))
|
||||
(declare (ignorable target))
|
||||
(clog-ace:attach-clog-ace target)
|
||||
(setf (clog-ace:theme target) "ace/theme/terminal")
|
||||
(setf (clog-ace:mode target) "ace/mode/lisp")
|
||||
(setf (clog-ace:tab-size target) 2))
|
||||
(clog-terminal:set-on-command (terminal panel)
|
||||
(lambda (target data)
|
||||
(declare (ignorable target data))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue