+ :title "About"
+ :content "
-
<%= (@ sys-name) %>
-
<%= (@ sys-name) %>
-
A New App
+
<%= (@ sys-name) %>
+
<%= (@ sys-name) %>
+
A New App
(c) 2022 - Some One "
- :hidden t
- :width 200
- :height 200)))
+ :hidden t
+ :width 200
+ :height 200)))
(window-center about)
(setf (visiblep about) t)
(set-on-window-can-size about (lambda (obj)
- (declare (ignore obj))()))))
+ (declare (ignore obj))()))))
(defclass app-data ()
((data
@@ -35,18 +35,18 @@
(setf (connection-data-item body "app-data") app)
(setf (title (html-document body)) "New App")
(clog-gui-initialize body)
- (add-class body "w3-teal")
+ (add-class body "w3-teal")
(let* ((menu-bar (create-gui-menu-bar body))
- (icon-item (create-gui-menu-icon menu-bar :on-click 'on-help-about))
- (file-item (create-gui-menu-drop-down menu-bar :content "File"))
- (file-new (create-gui-menu-item file-item :content "New Window" :on-click 'on-file-new))
- (help-item (create-gui-menu-drop-down menu-bar :content "Help"))
- (help-about (create-gui-menu-item help-item :content "About" :on-click 'on-help-about))
- (full-screen (create-gui-menu-full-screen menu-bar)))
+ (icon-item (create-gui-menu-icon menu-bar :on-click 'on-help-about))
+ (file-item (create-gui-menu-drop-down menu-bar :content "File"))
+ (file-new (create-gui-menu-item file-item :content "New Window" :on-click 'on-file-new))
+ (help-item (create-gui-menu-drop-down menu-bar :content "Help"))
+ (help-about (create-gui-menu-item help-item :content "About" :on-click 'on-help-about))
+ (full-screen (create-gui-menu-full-screen menu-bar)))
(declare (ignore icon-item file-new help-about full-screen)))))
(defun start-app ()
(initialize 'on-new-window
:static-root (merge-pathnames "./www/"
- (asdf:system-source-directory :<%= (@ sys-name) %>)))
+ (asdf:system-source-directory :<%= (@ sys-name) %>)))
(open-browser))
diff --git a/templates/projects/clog-plugin/tmpl-tools.lisp.lt b/templates/projects/clog-plugin/tmpl-tools.lisp.lt
index 61a1313..04e86a4 100644
--- a/templates/projects/clog-plugin/tmpl-tools.lisp.lt
+++ b/templates/projects/clog-plugin/tmpl-tools.lisp.lt
@@ -3,37 +3,37 @@
(progn
(clog-tools:add-supported-controls
(list '(:name "group"
- :description "<%= (@ sys-name) %> Controls"
- :create nil
- :create-type nil
- :events nil
- :properties nil)
- `(;; unique name to control used to identify it the .clog xml
+ :description "<%= (@ sys-name) %> Controls"
+ :create nil
+ :create-type nil
+ :events nil
+ :properties nil)
+ `(;; unique name to control used to identify it the .clog xml
:name "<%= (@ sys-name) %>"
- ;; how control appears in builder control list
- :description "<%= (@ sys-name) %>"
- ;; the common lisp type of the control
- :clog-type <%= (@ sys-name) %>:<%= (@ sys-name) %>-element
- ;; the create-function used to create the function
- ;; at _design time_ at run time only clog:attach-as-child is used
- ;; any initialization at _run time_ is done with :on-setup below.
- :create <%= (@ sys-name) %>:create-<%= (@ sys-name) %>-element
- ;; clog has the following create-types
- ;; :base - create
- ;; :element - create create-content
- ;; :form - create create-param create-value
- ;; :text-area - create create-value
- ;; :custom-query - create (ask user for string)
- ;; :custom - create create-content
- :create-type :base
- ;; setup the control at _design time_ and custom attributes
- :setup ,(lambda (control content control-record)
+ ;; how control appears in builder control list
+ :description "<%= (@ sys-name) %>"
+ ;; the common lisp type of the control
+ :clog-type <%= (@ sys-name) %>:<%= (@ sys-name) %>-element
+ ;; the create-function used to create the function
+ ;; at _design time_ at run time only clog:attach-as-child is used
+ ;; any initialization at _run time_ is done with :on-setup below.
+ :create <%= (@ sys-name) %>:create-<%= (@ sys-name) %>-element
+ ;; clog has the following create-types
+ ;; :base - create
+ ;; :element - create create-content
+ ;; :form - create create-param create-value
+ ;; :text-area - create create-value
+ ;; :custom-query - create (ask user for string)
+ ;; :custom - create create-content
+ :create-type :base
+ ;; setup the control at _design time_ and custom attributes
+ :setup ,(lambda (control content control-record)
(declare (ignore content) (ignore control-record))
- ;; default custom attribute values and events at design time
+ ;; default custom attribute values and events at design time
- ;; tell the builder this is a composite control, ie made of multiple
- ;; controls
- (setf (attribute control "data-clog-composite-control") "t"))
+ ;; tell the builder this is a composite control, ie made of multiple
+ ;; controls
+ (setf (attribute control "data-clog-composite-control") "t"))
;; code to run at _run time_ after all controls attached to panel
:on-setup ,(lambda (control control-record)
(declare (ignore control control-record))
@@ -43,17 +43,17 @@
;; :on-load ,(lambda (control control-record)
;; (declare (ignore control-record))
;; ;; code to attach functionality if your create for design time
- ;; )
- ;; events handled
+ ;; )
+ ;; events handled
:events (,@clog-tools::*events-element*)
- ;; properties handled
- :properties (,@clog-tools::*props-location*
- ,@clog-tools::*props-with-height*
- ,@clog-tools::*props-text*
- ,@clog-tools::*props-css*
- ,@clog-tools::*props-colors*
- ,@clog-tools::*props-display*
- ,@clog-tools::*props-flex-item*
- ,@clog-tools::*props-nav*
- ,@clog-tools::*props-contents*))))
+ ;; properties handled
+ :properties (,@clog-tools::*props-location*
+ ,@clog-tools::*props-with-height*
+ ,@clog-tools::*props-text*
+ ,@clog-tools::*props-css*
+ ,@clog-tools::*props-colors*
+ ,@clog-tools::*props-display*
+ ,@clog-tools::*props-flex-item*
+ ,@clog-tools::*props-nav*
+ ,@clog-tools::*props-contents*))))
(format t "~%<%= (@ SYS-NAME) %> installed in CLOG Builder"))
diff --git a/templates/projects/clog-plugin/tmpl.lisp.lt b/templates/projects/clog-plugin/tmpl.lisp.lt
index ea04c00..a3edc57 100644
--- a/templates/projects/clog-plugin/tmpl.lisp.lt
+++ b/templates/projects/clog-plugin/tmpl.lisp.lt
@@ -1,9 +1,9 @@
(defpackage #:<%= (@ sys-name) %>
(:use #:cl #:clog)
(:export <%= (@ sys-name) %>-element
- create-<%= (@ sys-name) %>-element
+ create-<%= (@ sys-name) %>-element
init-<%= (@ sys-name) %>
- attach-<%= (@ sys-name) %>
+ attach-<%= (@ sys-name) %>
start-test))
(in-package :<%= (@ sys-name) %>)
@@ -19,17 +19,17 @@
(:documentation "Create a new <%= (@ sys-name) %>-element as child of CLOG-OBJ."))
(defmethod create-<%= (@ sys-name) %>-element ((obj clog:clog-obj)
- &key
- (hidden nil)
- (class nil)
- (html-id nil)
- (auto-place t))
+ &key
+ (hidden nil)
+ (class nil)
+ (html-id nil)
+ (auto-place t))
"Create control - used at design time and in code"
(let ((new-obj (create-div obj
- :class class
- :hidden hidden
- :html-id html-id
- :auto-place auto-place)))
+ :class class
+ :hidden hidden
+ :html-id html-id
+ :auto-place auto-place)))
(set-geometry new-obj :width 200 :height 100)
(change-class new-obj '<%= (@ sys-name) %>-element)
(attach-<%= (@ sys-name) %> new-obj)
@@ -75,11 +75,11 @@
;; Use the panel-box-layout to center horizontally
;; and vertically our div on the screen.
(let* ((layout (create-panel-box-layout body))
- (test (create-<%= (@ sys-name) %>-element (center-panel layout))))
+ (test (create-<%= (@ sys-name) %>-element (center-panel layout))))
(center-children (center-panel layout))))
(defun start-test ()
(initialize 'on-test-<%= (@ sys-name) %>
:static-root (merge-pathnames "./www/"
- (asdf:system-source-directory :<%= (@ sys-name) %>)))
+ (asdf:system-source-directory :<%= (@ sys-name) %>)))
(open-browser))
diff --git a/templates/projects/clog-web-site/tmpl.asd.lt b/templates/projects/clog-web-site/tmpl.asd.lt
index 670ab9a..56fb8c0 100644
--- a/templates/projects/clog-web-site/tmpl.asd.lt
+++ b/templates/projects/clog-web-site/tmpl.asd.lt
@@ -10,4 +10,3 @@
(asdf:defsystem #:<%= (@ sys-name) %>/tools
:depends-on (#:<%= (@ sys-name) %> #:clog/tools) ; add clog plugins here as #:plugin/tools for design time
:components ())
-
diff --git a/templates/projects/clog-web-site/tmpl.lisp.lt b/templates/projects/clog-web-site/tmpl.lisp.lt
index 7e36479..427126d 100644
--- a/templates/projects/clog-web-site/tmpl.lisp.lt
+++ b/templates/projects/clog-web-site/tmpl.lisp.lt
@@ -25,13 +25,13 @@
; Menu Menu Item URL Handler Actions Auth
(defparameter *menu* `(("Features" (("Home" "/")
- ("Login" "/login" on-login :login)
- ("Signup" "/signup" on-signup :signup)
- ("Change Password" "/pass" on-new-pass :change-password)
- ("Content" "/content" on-main :content)
- ("Logout" "/logout" on-logout :logout)))
- ("Admin" (("User List" "/users" on-users :users)))
- ("Help" (("About" "/content/about"))))
+ ("Login" "/login" on-login :login)
+ ("Signup" "/signup" on-signup :signup)
+ ("Change Password" "/pass" on-new-pass :change-password)
+ ("Content" "/content" on-main :content)
+ ("Logout" "/logout" on-logout :logout)))
+ ("Admin" (("User List" "/users" on-users :users)))
+ ("Help" (("About" "/content/about"))))
"Setup website menu")
(defun start-app (&key (port 8080))
@@ -40,8 +40,8 @@
(add-authorization '(:guest :member) '(:content-show-comments))
(add-authorization '(:guest) '(:login :signup))
(add-authorization '(:member) '(:logout
- :change-password
- :content-comment))
+ :change-password
+ :content-comment))
(add-authorization '(:editor) '(:content-edit))
(add-authorization '(:admin) '(:users :content-admin))
;; Setup database connection
@@ -58,20 +58,20 @@
(create-base-tables *sql-connection*)
;; A main page was added, but let's also add an about page:
(dbi:do-sql
- *sql-connection*
- (sql-insert* "content" `(:key "about"
- :title "About"
- :value "All about this site."
- :createdate (,*sqlite-timestamp*))))))
+ *sql-connection*
+ (sql-insert* "content" `(:key "about"
+ :title "About"
+ :value "All about this site."
+ :createdate (,*sqlite-timestamp*))))))
;; Setup clog
(initialize 'on-main
:port port
- :long-poll-first t
- :extended-routing t
+ :long-poll-first t
+ :extended-routing t
:static-root (merge-pathnames "./www/"
- (asdf:system-source-directory :<%= (@ sys-name) %>))
- :boot-function (clog-web-meta
- "Some meta data about site"))
+ (asdf:system-source-directory :<%= (@ sys-name) %>))
+ :boot-function (clog-web-meta
+ "Some meta data about site"))
(clog-web-routes-from-menu *menu*)
;; see clog/WEBSITE.md for directions on installing this as a webserver
(open-browser))
@@ -87,27 +87,27 @@
(clog-web-initialize body)
;; Instantly reload other windows open on authentication change
(set-on-authentication-change body (lambda (body)
- (url-replace (location body) "/")))
+ (url-replace (location body) "/")))
;; Initialzie the clog-web-site environment
(let ((profile (get-profile body *sql-connection*)))
(create-web-site body
- :settings '(:color-class "w3-blue-gray"
- :border-class ""
- :signup-link "/signup"
- :login-link "/login")
- :profile profile
- ;; We define the roles simply if logged out a :guest
- ;; if logged in a :member and if username is admin
- ;; a :member, :editor and :admin.
- :roles (if profile
- (if (equalp "admin"
- (getf profile :|username|))
- '(:member :editor :admin)
- '(:member))
- '(:guest))
- :title "This site"
- :footer "(c) 2022 Someone"
- :logo nil)))
+ :settings '(:color-class "w3-blue-gray"
+ :border-class ""
+ :signup-link "/signup"
+ :login-link "/login")
+ :profile profile
+ ;; We define the roles simply if logged out a :guest
+ ;; if logged in a :member and if username is admin
+ ;; a :member, :editor and :admin.
+ :roles (if profile
+ (if (equalp "admin"
+ (getf profile :|username|))
+ '(:member :editor :admin)
+ '(:member))
+ '(:guest))
+ :title "This site"
+ :footer "(c) 2022 Someone"
+ :logo nil)))
;;
;; URL Path Handlers
@@ -119,14 +119,14 @@
(create-web-page
body
:login `(:menu ,*menu*
- :on-submit ,(lambda (obj)
- (if (login body *sql-connection*
- (name-value obj "username")
- (name-value obj "password"))
- (url-replace (location body) "/")
- (clog-web-alert obj "Invalid" "The username and password are invalid."
- :time-out 3
- :place-top t))))
+ :on-submit ,(lambda (obj)
+ (if (login body *sql-connection*
+ (name-value obj "username")
+ (name-value obj "password"))
+ (url-replace (location body) "/")
+ (clog-web-alert obj "Invalid" "The username and password are invalid."
+ :time-out 3
+ :place-top t))))
:authorize t))
(defun on-logout (body)
@@ -136,45 +136,45 @@
(defun on-signup (body)
(init-site body)
(create-web-page body
- :signup `(:menu ,*menu*
- :content ,(lambda (body)
- (sign-up body *sql-connection*)))
- :authorize t))
+ :signup `(:menu ,*menu*
+ :content ,(lambda (body)
+ (sign-up body *sql-connection*)))
+ :authorize t))
(defun on-main (body)
(init-site body)
(create-web-page body :index `(:menu ,*menu*
- :content ,(clog-web-content *sql-connection*
- :comment-table "content"))))
+ :content ,(clog-web-content *sql-connection*
+ :comment-table "content"))))
(defun on-users (body)
(init-site body)
(create-web-page body :users
- `(:menu ,*menu*
- :content ,(lambda (body)
- (let ((users (dbi:fetch-all
- (dbi:execute
- (dbi:prepare
- *sql-connection*
- "select * from users")))))
- (dolist (user users)
- (let* ((box (create-div body))
- (suser (create-span box :content (getf user :|username|)))
- (rbut (create-button box :content "Reset Password"
- :class "w3-margin-left")))
- (declare (ignore suser))
- (set-on-click rbut (lambda (obj)
- (declare (ignore obj))
- (reset-password *sql-connection*
- (getf user :|username|))
- (setf (disabledp rbut) t)
- (setf (text rbut) "Done"))))))))
- :authorize t))
+ `(:menu ,*menu*
+ :content ,(lambda (body)
+ (let ((users (dbi:fetch-all
+ (dbi:execute
+ (dbi:prepare
+ *sql-connection*
+ "select * from users")))))
+ (dolist (user users)
+ (let* ((box (create-div body))
+ (suser (create-span box :content (getf user :|username|)))
+ (rbut (create-button box :content "Reset Password"
+ :class "w3-margin-left")))
+ (declare (ignore suser))
+ (set-on-click rbut (lambda (obj)
+ (declare (ignore obj))
+ (reset-password *sql-connection*
+ (getf user :|username|))
+ (setf (disabledp rbut) t)
+ (setf (text rbut) "Done"))))))))
+ :authorize t))
(defun on-new-pass (body)
(init-site body)
(create-web-page body
- :change-password `(:menu ,*menu*
- :content ,(lambda (body)
- (change-password body *sql-connection*)))
- :authorize t))
+ :change-password `(:menu ,*menu*
+ :content ,(lambda (body)
+ (change-password body *sql-connection*)))
+ :authorize t))
diff --git a/templates/projects/clog-web/README.md b/templates/projects/clog-web/README.md
index cb67874..884a69e 100644
--- a/templates/projects/clog-web/README.md
+++ b/templates/projects/clog-web/README.md
@@ -6,4 +6,3 @@ This is a project to do ... something.
## License
Specify license here
-
diff --git a/templates/projects/clog-web/tmpl.asd.lt b/templates/projects/clog-web/tmpl.asd.lt
index 670ab9a..56fb8c0 100644
--- a/templates/projects/clog-web/tmpl.asd.lt
+++ b/templates/projects/clog-web/tmpl.asd.lt
@@ -10,4 +10,3 @@
(asdf:defsystem #:<%= (@ sys-name) %>/tools
:depends-on (#:<%= (@ sys-name) %> #:clog/tools) ; add clog plugins here as #:plugin/tools for design time
:components ())
-
diff --git a/templates/projects/clog-web/tmpl.lisp.lt b/templates/projects/clog-web/tmpl.lisp.lt
index 0bca3e2..e3a6d28 100644
--- a/templates/projects/clog-web/tmpl.lisp.lt
+++ b/templates/projects/clog-web/tmpl.lisp.lt
@@ -12,9 +12,9 @@
(let* ((layout (create-panel-box-layout body)))
(center-children (center-panel layout))
(create-div (center-panel layout) :content "Hello")))
-
+
(defun start-app ()
(initialize 'on-new-window
:static-root (merge-pathnames "./www/"
- (asdf:system-source-directory :<%= (@ sys-name) %>)))
+ (asdf:system-source-directory :<%= (@ sys-name) %>)))
(open-browser))
diff --git a/templates/projects/clog/tmpl.asd.lt b/templates/projects/clog/tmpl.asd.lt
index 670ab9a..56fb8c0 100644
--- a/templates/projects/clog/tmpl.asd.lt
+++ b/templates/projects/clog/tmpl.asd.lt
@@ -10,4 +10,3 @@
(asdf:defsystem #:<%= (@ sys-name) %>/tools
:depends-on (#:<%= (@ sys-name) %> #:clog/tools) ; add clog plugins here as #:plugin/tools for design time
:components ())
-
diff --git a/templates/projects/clog/tmpl.lisp.lt b/templates/projects/clog/tmpl.lisp.lt
index a799acc..df989bd 100644
--- a/templates/projects/clog/tmpl.lisp.lt
+++ b/templates/projects/clog/tmpl.lisp.lt
@@ -10,9 +10,9 @@
(let* ((layout (create-panel-box-layout body)))
(center-children (center-panel layout))
(create-div (center-panel layout) :content "Hello")))
-
+
(defun start-app ()
(initialize 'on-new-window
:static-root (merge-pathnames "./www/"
- (asdf:system-source-directory :<%= (@ sys-name) %>)))
+ (asdf:system-source-directory :<%= (@ sys-name) %>)))
(open-browser))
diff --git a/test/test-clog-connection.lisp b/test/test-clog-connection.lisp
index 9b24862..e8f3b9b 100644
--- a/test/test-clog-connection.lisp
+++ b/test/test-clog-connection.lisp
@@ -26,9 +26,9 @@
(defun test ()
(print "Init connection")
(clog-connection:initialize #'on-connect
- :static-root (merge-pathnames "./static-files/"
- (asdf:system-source-directory :clog))
- :boot-file "/debug.html")
+ :static-root (merge-pathnames "./static-files/"
+ (asdf:system-source-directory :clog))
+ :boot-file "/debug.html")
(print "Open browser")
(clog:open-browser)
)
diff --git a/test/test-clog.lisp b/test/test-clog.lisp
index 0aed4ac..2e5f432 100644
--- a/test/test-clog.lisp
+++ b/test/test-clog.lisp
@@ -23,43 +23,43 @@
(set-on-click tmp (lambda (obj) (alert (window win) "clicked")))
(setf (box-sizing tmp) :border-box)
(setf (width tmp) 300)
- (setf (height tmp) 50)
+ (setf (height tmp) 50)
(set-border (create-child win
- (format nil "
~A "
- (gethash "connection-id" (connection-data win))))
- "4px" :dotted "blue")
+ (format nil "
~A "
+ (gethash "connection-id" (connection-data win))))
+ "4px" :dotted "blue")
(setf *last-obj* (create-child win "
******** "))
(set-on-mouse-enter *last-obj*
- (lambda (obj)
- (setf (property *last-obj* "innerHTML") "Inside")))
+ (lambda (obj)
+ (setf (property *last-obj* "innerHTML") "Inside")))
(set-on-mouse-leave *last-obj*
- (lambda (obj)
- (setf (property *last-obj* "innerHTML") "Outside")))
+ (lambda (obj)
+ (setf (property *last-obj* "innerHTML") "Outside")))
(set-on-mouse-click *last-obj*
- (lambda (obj data)
- (print data)))
+ (lambda (obj data)
+ (print data)))
(set-on-mouse-move *last-obj*
- (lambda (obj data)
- (format t "x=~A Y=~A~%" (getf data ':x) (getf data ':y))))
+ (lambda (obj data)
+ (format t "x=~A Y=~A~%" (getf data ':x) (getf data ':y))))
(set-on-key-down win
- (lambda (obj data)
- (print data)) :disable-default t)
+ (lambda (obj data)
+ (print data)) :disable-default t)
(create-div win :content "Hello World! p")
(create-div win :content "Hello World! div")
- (create-br win)
+ (create-br win)
(create-span win :content "Hello World! span")
- (create-hr win)
+ (create-hr win)
(create-a win :link "http://www.google.com" :content "Link" :target "new")
(setf (title (html-document win)) "CLOG Test App")
(print (title (html-document win)))
(create-img win :url-src "https://common-lisp.net/static/imgs/lisplogo_flag2_128.png"
- :alt-text "Lisp Flag")
+ :alt-text "Lisp Flag")
(setf (value (create-meter win)) 20)
(setf (value (create-progress-bar win)) 10)
(create-section win :h3 :content "a header")
(create-phrase win :i :content "I am italic")
-
+
(setf tmp (create-ordered-list win))
(setf (list-kind tmp) :hebrew)
(create-list-item tmp :content "list item 1")
@@ -68,17 +68,17 @@
(setf (list-location tmp) :inside)
(create-hr win)
-
+
(let* ((tbl (create-table win))
- (cap (create-table-caption tbl :content "My Table"))
- (rw))
+ (cap (create-table-caption tbl :content "My Table"))
+ (rw))
(set-border tbl :thin :solid :black)
(dotimes (y 10)
- (setf rw (create-table-row tbl))
- (dotimes (x 6)
- (create-table-column rw :content (format nil "~A X ~A" x y)))))
+ (setf rw (create-table-row tbl))
+ (dotimes (x 6)
+ (create-table-column rw :content (format nil "~A X ~A" x y)))))
))
(defun test ()
diff --git a/tools/clog-builder-settings.lisp b/tools/clog-builder-settings.lisp
index dd21a77..0bcbbb2 100644
--- a/tools/clog-builder-settings.lisp
+++ b/tools/clog-builder-settings.lisp
@@ -94,8 +94,8 @@
(defparameter *props-location*
`((:name "top"
:setup ,(lambda (control td1 td2)
- (declare (ignore control td1))
- (add-class td2 "clog-prop-top"))
+ (declare (ignore control td1))
+ (add-class td2 "clog-prop-top"))
:get ,(lambda (control)
(if (equal (positioning control) "static")
"n/a"
@@ -104,8 +104,8 @@
(setf (top control) (text obj))))
(:name "left"
:setup ,(lambda (control td1 td2)
- (declare (ignore control td1))
- (add-class td2 "clog-prop-left"))
+ (declare (ignore control td1))
+ (add-class td2 "clog-prop-left"))
:get ,(lambda (control)
(if (equal (positioning control) "static")
"n/a"
@@ -114,8 +114,8 @@
(setf (left control) (text obj))))
(:name "bottom"
:setup ,(lambda (control td1 td2)
- (declare (ignore control td1))
- (add-class td2 "clog-prop-bottom"))
+ (declare (ignore control td1))
+ (add-class td2 "clog-prop-bottom"))
:get ,(lambda (control)
(if (equal (positioning control) "static")
"n/a"
@@ -124,8 +124,8 @@
(setf (bottom control) (text obj))))
(:name "right"
:setup ,(lambda (control td1 td2)
- (declare (ignore control td1))
- (add-class td2 "clog-prop-right"))
+ (declare (ignore control td1))
+ (add-class td2 "clog-prop-right"))
:get ,(lambda (control)
(if (equal (positioning control) "static")
"n/a"
@@ -145,9 +145,9 @@
"fixed"))
(set-on-change dd (lambda (obj)
(declare (ignore obj))
- (when (equalp (value dd) "static")
- (setf (top control) "")
- (setf (left control) ""))
+ (when (equalp (value dd) "static")
+ (setf (top control) "")
+ (setf (left control) ""))
(setf (positioning control) (value dd))
(set-geometry (get-placer control)
:top (position-top control)
@@ -160,16 +160,16 @@
(defparameter *props-with-height*
`((:name "width"
:setup ,(lambda (control td1 td2)
- (declare (ignore control td1))
- (add-class td2 "clog-prop-width"))
+ (declare (ignore control td1))
+ (add-class td2 "clog-prop-width"))
:set ,(lambda (control obj)
(setf (width control) (text obj)))
:get ,(lambda (control)
(width control)))
(:name "height"
:setup ,(lambda (control td1 td2)
- (declare (ignore control td1))
- (add-class td2 "clog-prop-height"))
+ (declare (ignore control td1))
+ (add-class td2 "clog-prop-height"))
:set ,(lambda (control obj)
(setf (height control) (text obj)))
:get ,(lambda (control)
@@ -341,8 +341,8 @@
(defparameter *props-css*
`((:name "css classes"
:setup ,(lambda (control td1 td2)
- (declare (ignore control td1))
- (add-class td2 "clog-prop-class"))
+ (declare (ignore control td1))
+ (add-class td2 "clog-prop-class"))
:get ,(lambda (control)
(property control "className"))
:set ,(lambda (control obj)
@@ -487,200 +487,200 @@
(defparameter *props-w3css*
`((:name "Add Color Class"
:setup ,(lambda (control td1 td2)
- (declare (ignore td1))
- (let ((dd (create-select td2)))
- (add-select-options dd `("" "w3-amber" "w3-aqua" "w3-blue" "w3-light-blue"
- "w3-brown" "w3-cyan" "w3-blue-grey" "w3-green"
- "w3-light-green" "w3-indigo" "w3-khaki" "w3-lime"
- "w3-orange" "w3-deep-orange" "w3-pink" "w3-purple"
- "w3-deep-purple" "w3-red" "w3-sand" "w3-teal"
- "w3-yellow" "w3-white" "w3-black" "w3-grey"
- "w3-light-grey" "w3-dark-grey" "w3-pale-red"
- "w3-pale-green" "w3-pale-yellow" "w3-pale-blue"))
- (set-on-change dd (lambda (obj)
- (declare (ignore obj))
- (add-class control (value dd))
- (set-property-display control "class" (css-class-name control))))
- nil)))
+ (declare (ignore td1))
+ (let ((dd (create-select td2)))
+ (add-select-options dd `("" "w3-amber" "w3-aqua" "w3-blue" "w3-light-blue"
+ "w3-brown" "w3-cyan" "w3-blue-grey" "w3-green"
+ "w3-light-green" "w3-indigo" "w3-khaki" "w3-lime"
+ "w3-orange" "w3-deep-orange" "w3-pink" "w3-purple"
+ "w3-deep-purple" "w3-red" "w3-sand" "w3-teal"
+ "w3-yellow" "w3-white" "w3-black" "w3-grey"
+ "w3-light-grey" "w3-dark-grey" "w3-pale-red"
+ "w3-pale-green" "w3-pale-yellow" "w3-pale-blue"))
+ (set-on-change dd (lambda (obj)
+ (declare (ignore obj))
+ (add-class control (value dd))
+ (set-property-display control "class" (css-class-name control))))
+ nil)))
(:name "Add Text Color Class"
:setup ,(lambda (control td1 td2)
- (declare (ignore td1))
- (let ((dd (create-select td2)))
- (add-select-options dd `("" "w3-text-amber" "w3-text-aqua" "w3-text-blue" "w3-text-light-blue"
- "w3-text-brown" "w3-text-cyan" "w3-text-blue-grey" "w3-text-green"
- "w3-text-light-green" "w3-text-indigo" "w3-text-khaki" "w3-text-lime"
- "w3-text-orange" "w3-text-deep-orange" "w3-text-pink" "w3-text-purple"
- "w3-text-deep-purple" "w3-text-red" "w3-text-sand" "w3-text-teal"
- "w3-text-yellow" "w3-text-white" "w3-text-black" "w3-text-grey"
- "w3-text-light-grey" "w3-text-dark-grey" "w3-text-pale-red"
- "w3-text-pale-green" "w3-text-pale-yellow" "w3-text-pale-blue"))
- (set-on-change dd (lambda (obj)
- (declare (ignore obj))
- (add-class control (value dd))
- (set-property-display control "class" (css-class-name control))))
- nil)))
+ (declare (ignore td1))
+ (let ((dd (create-select td2)))
+ (add-select-options dd `("" "w3-text-amber" "w3-text-aqua" "w3-text-blue" "w3-text-light-blue"
+ "w3-text-brown" "w3-text-cyan" "w3-text-blue-grey" "w3-text-green"
+ "w3-text-light-green" "w3-text-indigo" "w3-text-khaki" "w3-text-lime"
+ "w3-text-orange" "w3-text-deep-orange" "w3-text-pink" "w3-text-purple"
+ "w3-text-deep-purple" "w3-text-red" "w3-text-sand" "w3-text-teal"
+ "w3-text-yellow" "w3-text-white" "w3-text-black" "w3-text-grey"
+ "w3-text-light-grey" "w3-text-dark-grey" "w3-text-pale-red"
+ "w3-text-pale-green" "w3-text-pale-yellow" "w3-text-pale-blue"))
+ (set-on-change dd (lambda (obj)
+ (declare (ignore obj))
+ (add-class control (value dd))
+ (set-property-display control "class" (css-class-name control))))
+ nil)))
(:name "Add Hover Text Color Class"
:setup ,(lambda (control td1 td2)
- (declare (ignore td1))
- (let ((dd (create-select td2)))
- (add-select-options dd `("" "w3-hover-text-amber" "w3-hover-text-aqua" "w3-hover-text-blue" "w3-hover-text-light-blue"
- "w3-hover-text-brown" "w3-hover-text-cyan" "w3-hover-text-blue-grey" "w3-hover-text-green"
- "w3-hover-text-light-green" "w3-hover-text-indigo" "w3-hover-text-khaki" "w3-hover-text-lime"
- "w3-hover-text-orange" "w3-hover-text-deep-orange" "w3-hover-text-pink" "w3-hover-text-purple"
- "w3-hover-text-deep-purple" "w3-hover-text-red" "w3-hover-text-sand" "w3-hover-text-teal"
- "w3-hover-text-yellow" "w3-hover-text-white" "w3-hover-text-black" "w3-hover-text-grey"
- "w3-hover-text-light-grey" "w3-hover-text-dark-grey" "w3-hover-text-pale-red"
- "w3-hover-text-pale-green" "w3-hover-text-pale-yellow" "w3-hover-text-pale-blue"))
- (set-on-change dd (lambda (obj)
- (declare (ignore obj))
- (add-class control (value dd))
- (set-property-display control "class" (css-class-name control))))
- nil)))
+ (declare (ignore td1))
+ (let ((dd (create-select td2)))
+ (add-select-options dd `("" "w3-hover-text-amber" "w3-hover-text-aqua" "w3-hover-text-blue" "w3-hover-text-light-blue"
+ "w3-hover-text-brown" "w3-hover-text-cyan" "w3-hover-text-blue-grey" "w3-hover-text-green"
+ "w3-hover-text-light-green" "w3-hover-text-indigo" "w3-hover-text-khaki" "w3-hover-text-lime"
+ "w3-hover-text-orange" "w3-hover-text-deep-orange" "w3-hover-text-pink" "w3-hover-text-purple"
+ "w3-hover-text-deep-purple" "w3-hover-text-red" "w3-hover-text-sand" "w3-hover-text-teal"
+ "w3-hover-text-yellow" "w3-hover-text-white" "w3-hover-text-black" "w3-hover-text-grey"
+ "w3-hover-text-light-grey" "w3-hover-text-dark-grey" "w3-hover-text-pale-red"
+ "w3-hover-text-pale-green" "w3-hover-text-pale-yellow" "w3-hover-text-pale-blue"))
+ (set-on-change dd (lambda (obj)
+ (declare (ignore obj))
+ (add-class control (value dd))
+ (set-property-display control "class" (css-class-name control))))
+ nil)))
(:name "Add Border Class"
:setup ,(lambda (control td1 td2)
- (declare (ignore td1))
- (let ((dd (create-select td2)))
- (add-select-options dd `("" "w3-border" "w3-border-top" "w3-border-right" "w3-border-bottom"
- "w3-border-left" "w3-border-0" "w3-bottombar" "w3-leftbar"
- "w3-rightbar" "w3-topbar"))
- (set-on-change dd (lambda (obj)
- (declare (ignore obj))
- (add-class control (value dd))
- (set-property-display control "class" (css-class-name control))))
- nil)))
+ (declare (ignore td1))
+ (let ((dd (create-select td2)))
+ (add-select-options dd `("" "w3-border" "w3-border-top" "w3-border-right" "w3-border-bottom"
+ "w3-border-left" "w3-border-0" "w3-bottombar" "w3-leftbar"
+ "w3-rightbar" "w3-topbar"))
+ (set-on-change dd (lambda (obj)
+ (declare (ignore obj))
+ (add-class control (value dd))
+ (set-property-display control "class" (css-class-name control))))
+ nil)))
(:name "Add Border Color Class"
:setup ,(lambda (control td1 td2)
- (declare (ignore td1))
- (let ((dd (create-select td2)))
- (add-select-options dd `("" "w3-border-amber" "w3-border-aqua" "w3-border-blue" "w3-border-light-blue"
- "w3-border-brown" "w3-border-cyan" "w3-border-blue-grey" "w3-border-green"
- "w3-border-light-green" "w3-border-indigo" "w3-border-khaki" "w3-border-lime"
- "w3-border-orange" "w3-border-deep-orange" "w3-border-pink" "w3-border-purple"
- "w3-border-deep-purple" "w3-border-red" "w3-border-sand" "w3-border-teal"
- "w3-border-yellow" "w3-border-white" "w3-border-black" "w3-border-grey"
- "w3-border-light-grey" "w3-border-dark-grey" "w3-border-pale-red"
- "w3-border-pale-green" "w3-border-pale-yellow" "w3-border-pale-blue"))
- (set-on-change dd (lambda (obj)
- (declare (ignore obj))
- (add-class control (value dd))
- (set-property-display control "class" (css-class-name control))))
- nil)))
+ (declare (ignore td1))
+ (let ((dd (create-select td2)))
+ (add-select-options dd `("" "w3-border-amber" "w3-border-aqua" "w3-border-blue" "w3-border-light-blue"
+ "w3-border-brown" "w3-border-cyan" "w3-border-blue-grey" "w3-border-green"
+ "w3-border-light-green" "w3-border-indigo" "w3-border-khaki" "w3-border-lime"
+ "w3-border-orange" "w3-border-deep-orange" "w3-border-pink" "w3-border-purple"
+ "w3-border-deep-purple" "w3-border-red" "w3-border-sand" "w3-border-teal"
+ "w3-border-yellow" "w3-border-white" "w3-border-black" "w3-border-grey"
+ "w3-border-light-grey" "w3-border-dark-grey" "w3-border-pale-red"
+ "w3-border-pale-green" "w3-border-pale-yellow" "w3-border-pale-blue"))
+ (set-on-change dd (lambda (obj)
+ (declare (ignore obj))
+ (add-class control (value dd))
+ (set-property-display control "class" (css-class-name control))))
+ nil)))
(:name "Add Hover Border Color Class"
:setup ,(lambda (control td1 td2)
- (declare (ignore td1))
- (let ((dd (create-select td2)))
- (add-select-options dd `("" "w3-hover-border-amber" "w3-hover-border-aqua" "w3-hover-border-blue" "w3-hover-border-light-blue"
- "w3-hover-border-brown" "w3-hover-border-cyan" "w3-hover-border-blue-grey" "w3-hover-border-green"
- "w3-hover-border-light-green" "w3-hover-border-indigo" "w3-hover-border-khaki" "w3-hover-border-lime"
- "w3-hover-border-orange" "w3-hover-border-deep-orange" "w3-hover-border-pink" "w3-hover-border-purple"
- "w3-hover-border-deep-purple" "w3-hover-border-red" "w3-hover-border-sand" "w3-hover-border-teal"
- "w3-hover-border-yellow" "w3-hover-border-white" "w3-hover-border-black" "w3-hover-border-grey"
- "w3-hover-border-light-grey" "w3-hover-border-dark-grey" "w3-hover-border-pale-red"
- "w3-hover-border-pale-green" "w3-hover-border-pale-yellow" "w3-hover-border-pale-blue"))
- (set-on-change dd (lambda (obj)
- (declare (ignore obj))
- (add-class control (value dd))
- (set-property-display control "class" (css-class-name control))))
- nil)))
+ (declare (ignore td1))
+ (let ((dd (create-select td2)))
+ (add-select-options dd `("" "w3-hover-border-amber" "w3-hover-border-aqua" "w3-hover-border-blue" "w3-hover-border-light-blue"
+ "w3-hover-border-brown" "w3-hover-border-cyan" "w3-hover-border-blue-grey" "w3-hover-border-green"
+ "w3-hover-border-light-green" "w3-hover-border-indigo" "w3-hover-border-khaki" "w3-hover-border-lime"
+ "w3-hover-border-orange" "w3-hover-border-deep-orange" "w3-hover-border-pink" "w3-hover-border-purple"
+ "w3-hover-border-deep-purple" "w3-hover-border-red" "w3-hover-border-sand" "w3-hover-border-teal"
+ "w3-hover-border-yellow" "w3-hover-border-white" "w3-hover-border-black" "w3-hover-border-grey"
+ "w3-hover-border-light-grey" "w3-hover-border-dark-grey" "w3-hover-border-pale-red"
+ "w3-hover-border-pale-green" "w3-hover-border-pale-yellow" "w3-hover-border-pale-blue"))
+ (set-on-change dd (lambda (obj)
+ (declare (ignore obj))
+ (add-class control (value dd))
+ (set-property-display control "class" (css-class-name control))))
+ nil)))
(:name "Add Round Class"
:setup ,(lambda (control td1 td2)
- (declare (ignore td1))
- (let ((dd (create-select td2)))
- (add-select-options dd `("" "w3-circle" "w3-round-small" "w3-round" "w3-round-medium"
- "w3-round-large" "w3-round-xlarge" "w3-round-xxlarge"))
- (set-on-change dd (lambda (obj)
- (declare (ignore obj))
- (add-class control (value dd))
- (set-property-display control "class" (css-class-name control))))
- nil)))
+ (declare (ignore td1))
+ (let ((dd (create-select td2)))
+ (add-select-options dd `("" "w3-circle" "w3-round-small" "w3-round" "w3-round-medium"
+ "w3-round-large" "w3-round-xlarge" "w3-round-xxlarge"))
+ (set-on-change dd (lambda (obj)
+ (declare (ignore obj))
+ (add-class control (value dd))
+ (set-property-display control "class" (css-class-name control))))
+ nil)))
(:name "Add 3D Class"
:setup ,(lambda (control td1 td2)
- (declare (ignore td1))
- (let ((dd (create-select td2)))
- (add-select-options dd `("" "w3-card" "w3-card-2" "w3-card-4" "w3-hover-shadow" "w3-hoverable" "w3-hover-none"))
- (set-on-change dd (lambda (obj)
- (declare (ignore obj))
- (add-class control (value dd))
- (set-property-display control "class" (css-class-name control))))
- nil)))
+ (declare (ignore td1))
+ (let ((dd (create-select td2)))
+ (add-select-options dd `("" "w3-card" "w3-card-2" "w3-card-4" "w3-hover-shadow" "w3-hoverable" "w3-hover-none"))
+ (set-on-change dd (lambda (obj)
+ (declare (ignore obj))
+ (add-class control (value dd))
+ (set-property-display control "class" (css-class-name control))))
+ nil)))
(:name "Add Visibility Class"
:setup ,(lambda (control td1 td2)
- (declare (ignore td1))
- (let ((dd (create-select td2)))
- (add-select-options dd `("" "w3-opacity" "w3-opacity-min" "w3-opacity-max"
- "w3-grayscale" "w3-grayscale-min" "w3-grayscale-max"
- "w3-sepia" "w3-sepia-min" "w3-sepia-max"
- "w3-hover-opacity" "w3-hover-grayscale" "w3-hover-sepia"
- "w3-hover-opacity-off"))
- (set-on-change dd (lambda (obj)
- (declare (ignore obj))
- (add-class control (value dd))
- (set-property-display control "class" (css-class-name control))))
- nil)))
+ (declare (ignore td1))
+ (let ((dd (create-select td2)))
+ (add-select-options dd `("" "w3-opacity" "w3-opacity-min" "w3-opacity-max"
+ "w3-grayscale" "w3-grayscale-min" "w3-grayscale-max"
+ "w3-sepia" "w3-sepia-min" "w3-sepia-max"
+ "w3-hover-opacity" "w3-hover-grayscale" "w3-hover-sepia"
+ "w3-hover-opacity-off"))
+ (set-on-change dd (lambda (obj)
+ (declare (ignore obj))
+ (add-class control (value dd))
+ (set-property-display control "class" (css-class-name control))))
+ nil)))
(:name "Add Font Class"
:setup ,(lambda (control td1 td2)
- (declare (ignore td1))
- (let ((dd (create-select td2)))
- (add-select-options dd `("" "w3-serif" "w3-sans-serif" "w3-cursive" "w3-monospace"
- "w3-wide"))
- (set-on-change dd (lambda (obj)
- (declare (ignore obj))
- (add-class control (value dd))
- (set-property-display control "class" (css-class-name control))))
- nil)))
+ (declare (ignore td1))
+ (let ((dd (create-select td2)))
+ (add-select-options dd `("" "w3-serif" "w3-sans-serif" "w3-cursive" "w3-monospace"
+ "w3-wide"))
+ (set-on-change dd (lambda (obj)
+ (declare (ignore obj))
+ (add-class control (value dd))
+ (set-property-display control "class" (css-class-name control))))
+ nil)))
(:name "Add Size Class"
:setup ,(lambda (control td1 td2)
- (declare (ignore td1))
- (let ((dd (create-select td2)))
- (add-select-options dd `("" "w3-tiny" "w3-small" "w3-medium" "w3-large"
- "w3-xlarge" "w3-xxlarge" "w3-xxxlarge" "w3-jumbo"))
- (set-on-change dd (lambda (obj)
- (declare (ignore obj))
- (add-class control (value dd))
- (set-property-display control "class" (css-class-name control))))
- nil)))
+ (declare (ignore td1))
+ (let ((dd (create-select td2)))
+ (add-select-options dd `("" "w3-tiny" "w3-small" "w3-medium" "w3-large"
+ "w3-xlarge" "w3-xxlarge" "w3-xxxlarge" "w3-jumbo"))
+ (set-on-change dd (lambda (obj)
+ (declare (ignore obj))
+ (add-class control (value dd))
+ (set-property-display control "class" (css-class-name control))))
+ nil)))
(:name "Add Alignmnet Class"
:setup ,(lambda (control td1 td2)
- (declare (ignore td1))
- (let ((dd (create-select td2)))
- (add-select-options dd `("" "w3-mobile" "w3-responsive"
- "w3-left-align" "w3-right-align" "w3-justify"
- "w3-center" "w3-right" "w3-left" "w3-top" "w3-bottom" "w3-block"
- "w3-bar" "w3-bar-block" "w3-bar-item" "w3-sidebar"
- "w3-show-inline-block" "w3-dropdown-hover"
- "w3-dropdown-click" "w3-collapse"
- "w3-hide-small" "w3-hide-medium" "w3-hide-large"))
- (set-on-change dd (lambda (obj)
- (declare (ignore obj))
- (add-class control (value dd))
- (set-property-display control "class" (css-class-name control))))
- nil)))
+ (declare (ignore td1))
+ (let ((dd (create-select td2)))
+ (add-select-options dd `("" "w3-mobile" "w3-responsive"
+ "w3-left-align" "w3-right-align" "w3-justify"
+ "w3-center" "w3-right" "w3-left" "w3-top" "w3-bottom" "w3-block"
+ "w3-bar" "w3-bar-block" "w3-bar-item" "w3-sidebar"
+ "w3-show-inline-block" "w3-dropdown-hover"
+ "w3-dropdown-click" "w3-collapse"
+ "w3-hide-small" "w3-hide-medium" "w3-hide-large"))
+ (set-on-change dd (lambda (obj)
+ (declare (ignore obj))
+ (add-class control (value dd))
+ (set-property-display control "class" (css-class-name control))))
+ nil)))
(:name "Add Margins/Padding Class"
:setup ,(lambda (control td1 td2)
- (declare (ignore td1))
- (let ((dd (create-select td2)))
- (add-select-options dd `("" "w3-margin" "w3-margin-top" "w3-margin-right"
- "w3-margin-bottom" "w3-margin-left" "w3-section"
- "w3-padding" "w3-padding-small" "w3-padding-large"
- "w3-padding-16" "w3-padding-24" "w3-padding-32"
- "w3-padding-48" "w3-padding-64"))
- (set-on-change dd (lambda (obj)
- (declare (ignore obj))
- (add-class control (value dd))
- (set-property-display control "class" (css-class-name control))))
- nil)))
+ (declare (ignore td1))
+ (let ((dd (create-select td2)))
+ (add-select-options dd `("" "w3-margin" "w3-margin-top" "w3-margin-right"
+ "w3-margin-bottom" "w3-margin-left" "w3-section"
+ "w3-padding" "w3-padding-small" "w3-padding-large"
+ "w3-padding-16" "w3-padding-24" "w3-padding-32"
+ "w3-padding-48" "w3-padding-64"))
+ (set-on-change dd (lambda (obj)
+ (declare (ignore obj))
+ (add-class control (value dd))
+ (set-property-display control "class" (css-class-name control))))
+ nil)))
(:name "Add Animation Class"
:setup ,(lambda (control td1 td2)
- (declare (ignore td1))
- (let ((dd (create-select td2)))
- (add-select-options dd `("" "w3-animate-top" "w3-animate-bottom" "w3-animate-left"
- "w3-animate-right" "w3-animate-opacity" "w3-animate-zoom"
- "w3-animate-fading" "w3-animate-input" "w3-spin"))
- (set-on-change dd (lambda (obj)
- (declare (ignore obj))
- (add-class control (value dd))
- (set-property-display control "class" (css-class-name control))))
- nil)))))
+ (declare (ignore td1))
+ (let ((dd (create-select td2)))
+ (add-select-options dd `("" "w3-animate-top" "w3-animate-bottom" "w3-animate-left"
+ "w3-animate-right" "w3-animate-opacity" "w3-animate-zoom"
+ "w3-animate-fading" "w3-animate-input" "w3-spin"))
+ (set-on-change dd (lambda (obj)
+ (declare (ignore obj))
+ (add-class control (value dd))
+ (set-property-display control "class" (css-class-name control))))
+ nil)))))
(defparameter *events-multimedia*
'((:name "on-media-abort"
@@ -880,12 +880,12 @@
:create-content ""
:setup ,(lambda (control content control-record)
(declare (ignore content control-record))
- (set-geometry control :width 200 :height 28)
- (setf (display control) :flex)
- (setf (flex-direction control) :row))
+ (set-geometry control :width 200 :height 28)
+ (setf (display control) :flex)
+ (setf (flex-direction control) :row))
:events (,@*events-element*)
:properties (,@*props-flex*
- ,@*props-element*))
+ ,@*props-element*))
`(:name "flex-row-rev"
:description "Row Reverse Align"
:clog-type clog:clog-div
@@ -894,12 +894,12 @@
:create-content ""
:setup ,(lambda (control content control-record)
(declare (ignore content control-record))
- (set-geometry control :width 200 :height 28)
- (setf (display control) :flex)
- (setf (flex-direction control) :row-reverse))
+ (set-geometry control :width 200 :height 28)
+ (setf (display control) :flex)
+ (setf (flex-direction control) :row-reverse))
:events (,@*events-element*)
:properties (,@*props-flex*
- ,@*props-element*))
+ ,@*props-element*))
`(:name "flex-col"
:description "Column Align"
:clog-type clog:clog-div
@@ -908,12 +908,12 @@
:create-content ""
:setup ,(lambda (control content control-record)
(declare (ignore content control-record))
- (set-geometry control :width 100 :height 200)
- (setf (display control) :flex)
- (setf (flex-direction control) :column))
+ (set-geometry control :width 100 :height 200)
+ (setf (display control) :flex)
+ (setf (flex-direction control) :column))
:events (,@*events-element*)
:properties (,@*props-flex*
- ,@*props-element*))
+ ,@*props-element*))
`(:name "flex-col-rev"
:description "Column Reverse Align"
:clog-type clog:clog-div
@@ -922,12 +922,12 @@
:create-content ""
:setup ,(lambda (control content control-record)
(declare (ignore content control-record))
- (set-geometry control :width 100 :height 200)
- (setf (display control) :flex)
- (setf (flex-direction control) :column-reverse))
+ (set-geometry control :width 100 :height 200)
+ (setf (display control) :flex)
+ (setf (flex-direction control) :column-reverse))
:events (,@*events-element*)
:properties (,@*props-flex*
- ,@*props-element*))
+ ,@*props-element*))
`(:name "flex-center"
:description "Center Align"
:clog-type clog:clog-div
@@ -936,13 +936,13 @@
:create-content ""
:setup ,(lambda (control content control-record)
(declare (ignore content control-record))
- (set-geometry control :width 200 :height 200)
- (setf (display control) :flex)
- (setf (align-items control) :center)
- (setf (justify-content control) :center))
+ (set-geometry control :width 200 :height 200)
+ (setf (display control) :flex)
+ (setf (align-items control) :center)
+ (setf (justify-content control) :center))
:events (,@*events-element*)
:properties (,@*props-flex*
- ,@*props-element*))
+ ,@*props-element*))
'(:name "group"
:description "Basic HTML Controls"
:create nil
@@ -958,19 +958,19 @@
:events (,@*events-element*)
:setup ,(lambda (control content control-record)
(declare (ignore content control-record))
- (setf (attribute control "data-clog-for") ""))
+ (setf (attribute control "data-clog-for") ""))
:on-setup ,(lambda (control control-record)
- (declare (ignore control-record))
- (unless (equal (attribute control "data-clog-for") "")
- (format nil
- "(setf (attribute target \"for\") ~
+ (declare (ignore control-record))
+ (unless (equal (attribute control "data-clog-for") "")
+ (format nil
+ "(setf (attribute target \"for\") ~
(clog:js-query target \"$('[data-clog-name=\\\\'~A\\\\']\').attr('id')\"))"
- (attribute control "data-clog-for"))))
+ (attribute control "data-clog-for"))))
:properties ((:name "for"
:get ,(lambda (control)
- (attribute control "data-clog-for"))
+ (attribute control "data-clog-for"))
:set ,(lambda (control obj)
- (setf (attribute control "data-clog-for") (text obj))
+ (setf (attribute control "data-clog-for") (text obj))
(setf (attribute control "for")
(js-query control (format nil "$(\"[data-clog-name='~A']\").attr('id')"
(text obj))))))
@@ -1483,8 +1483,8 @@
:create clog:create-table
:create-type :base
:setup ,(lambda (control content control-record)
- (declare (ignore content control-record))
- (set-geometry control :width 200 :height 100))
+ (declare (ignore content control-record))
+ (set-geometry control :width 200 :height 100))
:events (,@*events-element*)
:properties (,@*props-base*))
`(:name "tr"
@@ -1914,11 +1914,11 @@
(dbi:connect ~A ~A :database-name ~A))"
(attribute control "data-clog-dbi-dbtype")
(attribute control "data-clog-dbi-dbparams")
- (let ((dbi-name (attribute control "data-clog-dbi-dbname")))
- (if (equal (char dbi-name 0) #\*)
- dbi-name
- (format nil "\"~A\""
- dbi-name)))))
+ (let ((dbi-name (attribute control "data-clog-dbi-dbname")))
+ (if (equal (char dbi-name 0) #\*)
+ dbi-name
+ (format nil "\"~A\""
+ dbi-name)))))
:events (,@*events-element*)
:properties ((:name "database type"
:attr "data-clog-dbi-dbtype")
diff --git a/tools/clog-builder.lisp b/tools/clog-builder.lisp
index 31b61c4..efa287c 100644
--- a/tools/clog-builder.lisp
+++ b/tools/clog-builder.lisp
@@ -152,26 +152,26 @@
"Take a snap shot of panel"
(with-sync-event (content)
(let (snap
- (app (connection-data-item content "builder-app-data")))
+ (app (connection-data-item content "builder-app-data")))
(maphash
(lambda (html-id control)
- (declare (ignore html-id))
- (place-inside-bottom-of hide-loc
- (get-placer control)))
+ (declare (ignore html-id))
+ (place-inside-bottom-of hide-loc
+ (get-placer control)))
(get-control-list app panel-id))
(let ((data
(create-child content "
"
:html-id (format nil "I~A" (get-universal-time)))))
- (place-inside-top-of content data)
- (setf (attribute data "data-in-package")
+ (place-inside-top-of content data)
+ (setf (attribute data "data-in-package")
(attribute content "data-in-package"))
- (setf (attribute data "data-custom-slots")
+ (setf (attribute data "data-custom-slots")
(attribute content "data-custom-slots"))
- (setf (attribute data "data-clog-next-id")
+ (setf (attribute data "data-clog-next-id")
(attribute content "data-clog-next-id"))
- (setf (attribute data "data-clog-title")
+ (setf (attribute data "data-clog-title")
(attribute content "data-clog-name"))
- (setf snap (js-query content
+ (setf snap (js-query content
(format nil
"var z=~a.clone();~
z.find('*').each(function(){~
@@ -180,11 +180,11 @@
$(this).attr('id').substring(0,5)=='CLOGB'){$(this).removeAttr('id')}});~
z.html()"
(jquery content))))
- (destroy data))
+ (destroy data))
(maphash
(lambda (html-id control)
- (declare (ignore html-id))
- (place-after control (get-placer control)))
+ (declare (ignore html-id))
+ (place-after control (get-placer control)))
(get-control-list app panel-id))
snap)))
@@ -227,12 +227,12 @@ create-div's"
(let* ((nfile (pathname-name file))
(afile (cond ((equalp (pathname-name nfile) "tmpl")
(format nil "~A~A.~A" out-dir sys-name (pathname-type nfile)))
- ((equalp (pathname-name nfile) "tmpl-tools")
+ ((equalp (pathname-name nfile) "tmpl-tools")
(format nil "~A~A-tools.~A" out-dir sys-name (pathname-type nfile)))
(t
- (format nil "~A~A" out-dir nfile)))))
- (write-file (funcall (cl-template:compile-template (read-file src-file))
- (list :sys-name sys-name))
+ (format nil "~A~A" out-dir nfile)))))
+ (write-file (funcall (cl-template:compile-template (read-file src-file))
+ (list :sys-name sys-name))
afile)
(when panel
(create-div panel
@@ -270,11 +270,11 @@ create-div's"
replaced."
(dolist (r control-records)
(setf *supported-controls*
- (append (remove-if (lambda (x)
- (unless (equalp (getf x :name) "group")
- (equal (getf x :name) (getf r :name))))
- *supported-controls*)
- (list r)))))
+ (append (remove-if (lambda (x)
+ (unless (equalp (getf x :name) "group")
+ (equal (getf x :name) (getf r :name))))
+ *supported-controls*)
+ (list r)))))
(defun create-control (parent content control-record uid &key custom-query)
"Return a new control based on CONTROL-RECORD as a child of PARENT"
@@ -293,9 +293,9 @@ replaced."
:html-id uid))
((eq create-type :paste)
(let ((c (create-child parent custom-query
- :html-id uid)))
- (setf control-type-name (attribute c "data-clog-type"))
- (when (equalp control-type-name "undefined")
+ :html-id uid)))
+ (setf control-type-name (attribute c "data-clog-type"))
+ (when (equalp control-type-name "undefined")
(setf (attribute c "data-clog-type") "div")
(setf control-type-name "div"))
(let ((cr (control-info control-type-name)))
@@ -358,11 +358,11 @@ replaced."
(let* ((control-record (control-info (value (select-tool app))))
(control-type-name (getf control-record :name))
(positioning (cond ((or (getf data :ctrl-key)
- (getf data :meta-key))
+ (getf data :meta-key))
:static)
- ((getf control-record :positioning)
- (getf control-record :positioning))
- (t
+ ((getf control-record :positioning)
+ (getf control-record :positioning))
+ (t
:absolute)))
(parent (when (getf data :shift-key)
(current-control app)))
@@ -386,12 +386,12 @@ replaced."
(set-geometry control
:left (getf data :x)
:top (getf data :y))
- (unless (equalp (attribute control "data-clog-composite-control") "t")
+ (unless (equalp (attribute control "data-clog-composite-control") "t")
(add-sub-controls control content :win win))
(setup-control content control :win win)
(select-control control)
(on-populate-control-list-win content :win win)
- (jquery-execute (get-placer content) "trigger('clog-builder-snap-shot')")
+ (jquery-execute (get-placer content) "trigger('clog-builder-snap-shot')")
t)
(t
;; panel directly clicked with select tool or no control type to add
@@ -430,12 +430,12 @@ replaced."
(setf (tab-index placer) "-1") ; must have a tab-index to accept keyboard input
(focus placer)
(set-on-key-down placer
- (lambda (obj data)
- (declare (ignore obj))
- (let ((key (getf data :key))
- (ctrl (getf data :ctrl-key))
- (meta (getf data :meta-key))
- (shift (getf data :shift-key)))
+ (lambda (obj data)
+ (declare (ignore obj))
+ (let ((key (getf data :key))
+ (ctrl (getf data :ctrl-key))
+ (meta (getf data :meta-key))
+ (shift (getf data :shift-key)))
(cond ((equal key "ArrowUp")
(if shift
(set-geometry control :height (1- (height control)))
@@ -510,7 +510,7 @@ replaced."
(set-on-event placer "resizestop"
(lambda (obj)
(set-properties-after-geomentry-change obj)
- (jquery-execute placer "trigger('clog-builder-snap-shot')"))
+ (jquery-execute placer "trigger('clog-builder-snap-shot')"))
:cancel-event t)
(set-on-event placer "drag"
(lambda (obj)
@@ -518,7 +518,7 @@ replaced."
(set-geometry control :units ""
:top (top placer)
:left (left placer))
- (set-properties-after-geomentry-change control)))
+ (set-properties-after-geomentry-change control)))
(set-on-event placer "dragstop"
(lambda (obj)
(declare (ignore obj))
@@ -527,7 +527,7 @@ replaced."
:left (left placer))
(set-geometry placer :top (top control)
:left (left control))
- (jquery-execute placer "trigger('clog-builder-snap-shot')")
+ (jquery-execute placer "trigger('clog-builder-snap-shot')")
(set-properties-after-geomentry-change control)))))
(defun set-property-display (control property value)
@@ -751,7 +751,7 @@ not a temporary attached one when using select-control."
"\\\"")
cname
vars
- (reverse creates) ; Insure that on-setup/on-create follow order in tree
+ (reverse creates) ; Insure that on-setup/on-create follow order in tree
(reverse events))))
(maphash (lambda (html-id control)
(declare (ignore html-id))
@@ -1080,7 +1080,7 @@ of controls and double click to select control."
:height 200 :width 645
:has-pinner t :client-movement t))
(content (window-content win))
- status)
+ status)
(setf (control-events-win app) win)
(setf (events-list app) (create-select content :name "clog-events" :class "w3-gray w3-text-white"))
(setf (positioning (events-list app)) :absolute)
@@ -1119,8 +1119,8 @@ of controls and double click to select control."
(setf (width status) "")
(setf (height status) "")
(set-geometry status :height 20 :left 5 :right 5 :bottom 5)
- (js-execute (event-editor app)
- (format nil
+ (js-execute (event-editor app)
+ (format nil
"~A.commands.addCommand({
name: 'find-definition',
bindKey: {win: 'Alt-.', mac: 'Command-.'},
@@ -1146,15 +1146,15 @@ of controls and double click to select control."
});"
(clog-ace::js-ace (event-editor app))
(jquery (event-editor app))))
- (set-on-event-with-data (event-editor app) "clog-find"
- (lambda (obj data)
- (ignore-errors
+ (set-on-event-with-data (event-editor app) "clog-find"
+ (lambda (obj data)
+ (ignore-errors
(let* ((*PACKAGE* (find-package "CLOG-USER"))
(SWANK::*buffer-package* (find-package "CLOG-USER"))
(SWANK::*buffer-readtable* *readtable*)
(loc (swank:find-definitions-for-emacs data)))
- (when loc
- (swank:ed-in-emacs (list (second (second (second (car loc))))
+ (when loc
+ (swank:ed-in-emacs (list (second (second (second (car loc))))
:position (second (third (second (car loc)))))))))))
(set-on-change (event-editor app)
(lambda (obj)
@@ -1179,18 +1179,18 @@ of controls and double click to select control."
(clog-ace::js-ace obj)))))
(unless (equal s "")
(with-input-from-string (i s)
- (ignore-errors
+ (ignore-errors
(let* ((m (read i))
(*PACKAGE* (find-package "CLOG-USER"))
- (SWANK::*buffer-package* (find-package "CLOG-USER"))
+ (SWANK::*buffer-package* (find-package "CLOG-USER"))
(SWANK::*buffer-readtable* *readtable*)
(ms (format nil "~A" m))
r)
(ignore-errors
(setf r (swank::autodoc `(,ms swank::%CURSOR-MARKER%))))
(if r
- (setf r (car r))
- (setf r (swank:operator-arglist ms "CLOG-USER")))
+ (setf r (car r))
+ (setf r (swank:operator-arglist ms "CLOG-USER")))
(setf (advisory-title status) (documentation (find-symbol ms) 'function))
(when r
(setf (text status) (string-downcase r))))))))))
@@ -1266,36 +1266,36 @@ of controls and double click to select control."
(flet ((on-size (obj)
(declare (ignore obj))
(setf sheight (floor (/ (height content) 2)))
- (when (and (> (- sheight adj-size) 5)
- (> (+ (- sheight 10) adj-size) 5))
- (set-geometry pallete :height (- sheight adj-size))
- (set-geometry divider :top (- sheight adj-size))
- (set-geometry control-list :height (+ (- sheight 10) adj-size)))))
+ (when (and (> (- sheight adj-size) 5)
+ (> (+ (- sheight 10) adj-size) 5))
+ (set-geometry pallete :height (- sheight adj-size))
+ (set-geometry divider :top (- sheight adj-size))
+ (set-geometry control-list :height (+ (- sheight 10) adj-size)))))
(set-on-resize (window (connection-body obj)) #'on-size)
(set-on-full-screen-change (html-document (connection-body obj)) #'on-size)
(set-on-orientation-change (window (connection-body obj)) #'on-size)
(set-on-pointer-down divider (lambda (obj data)
- (setf (getf data :client-y) (+ adj-size
- (getf data :client-y)))
- (set-on-pointer-up (connection-body obj)
- (lambda (obj data)
- (declare (ignore data))
- (set-on-pointer-up (connection-body obj) nil)
- (set-on-pointer-move (connection-body obj) nil)))
- (set-on-pointer-move (connection-body obj)
- (lambda (obj new-data)
- (setf adj-size (- (getf data :client-y)
- (getf new-data :client-y)))
- (on-size obj))))
- :capture-pointer t))
+ (setf (getf data :client-y) (+ adj-size
+ (getf data :client-y)))
+ (set-on-pointer-up (connection-body obj)
+ (lambda (obj data)
+ (declare (ignore data))
+ (set-on-pointer-up (connection-body obj) nil)
+ (set-on-pointer-move (connection-body obj) nil)))
+ (set-on-pointer-move (connection-body obj)
+ (lambda (obj new-data)
+ (setf adj-size (- (getf data :client-y)
+ (getf new-data :client-y)))
+ (on-size obj))))
+ :capture-pointer t))
(set-on-click side-panel (lambda (obj)
- (declare (ignore obj))
- (cond (is-hidden
- (setf (width content) "220px")
- (setf is-hidden nil))
- (t
- (setf (width content) "10px")
- (setf is-hidden t)))))))
+ (declare (ignore obj))
+ (cond (is-hidden
+ (setf (width content) "220px")
+ (setf is-hidden nil))
+ (t
+ (setf (width content) "10px")
+ (setf is-hidden t)))))))
(defun on-new-builder-panel (obj)
"Open new panel"
@@ -1307,7 +1307,7 @@ of controls and double click to select control."
:left-width 0 :right-width 0
:top-height 33 :bottom-height 0))
(tool-bar (create-div (top-panel box) :class "w3-center"))
- (btn-class "w3-button w3-white w3-border w3-border-black w3-ripple")
+ (btn-class "w3-button w3-white w3-border w3-border-black w3-ripple")
(btn-copy (create-img tool-bar :alt-text "copy" :url-src img-btn-copy :class btn-class))
(btn-paste (create-img tool-bar :alt-text "paste" :url-src img-btn-paste :class btn-class))
(btn-cut (create-img tool-bar :alt-text "cut" :url-src img-btn-cut :class btn-class))
@@ -1320,8 +1320,8 @@ of controls and double click to select control."
(btn-load (create-img tool-bar :alt-text "load" :url-src img-btn-load :class btn-class))
(content (center-panel box))
(in-simulation nil)
- (undo-chain nil)
- (redo-chain nil)
+ (undo-chain nil)
+ (redo-chain nil)
(file-name "")
(render-file-name "")
(panel-id (html-id content)))
@@ -1398,9 +1398,9 @@ of controls and double click to select control."
z.html()"
(jquery (current-control app)))))
(system-clipboard-write obj (copy-buf app))
- (let ((c (create-text-area (window-content (copy-history-win app))
- :value (copy-buf app)
- :auto-place nil)))
+ (let ((c (create-text-area (window-content (copy-history-win app))
+ :value (copy-buf app)
+ :auto-place nil)))
(place-inside-top-of (window-content (copy-history-win app)) c)
(setf (width c) "100%"))
(maphash
@@ -1488,7 +1488,7 @@ of controls and double click to select control."
(window-focus win)
(when fname
(setf file-name fname)
- (setf render-file-name "")
+ (setf render-file-name "")
(setf (inner-html content)
(read-file fname))
(clrhash (get-control-list app panel-id))
@@ -1689,11 +1689,11 @@ of controls and double click to select control."
z.html()"
(jquery (current-control app)))))
(system-clipboard-write obj (copy-buf app))
- (let ((c (create-text-area (window-content (copy-history-win app))
- :value (copy-buf app)
- :auto-place nil)))
- (place-inside-top-of (window-content (copy-history-win app)) c)
- (setf (width c) "100%"))
+ (let ((c (create-text-area (window-content (copy-history-win app))
+ :value (copy-buf app)
+ :auto-place nil)))
+ (place-inside-top-of (window-content (copy-history-win app)) c)
+ (setf (width c) "100%"))
(maphash
(lambda (html-id control)
(declare (ignore html-id))
@@ -1721,7 +1721,7 @@ of controls and double click to select control."
(setup-control content control :win win)
(select-control control)
(on-populate-control-list-win content :win win)
- (jquery-execute (get-placer content) "trigger('clog-builder-snap-shot')")))))
+ (jquery-execute (get-placer content) "trigger('clog-builder-snap-shot')")))))
;; delete
(del (obj)
(declare (ignore obj))
@@ -1729,7 +1729,7 @@ of controls and double click to select control."
(delete-current-control app panel-id (html-id (current-control app)))
(on-populate-control-properties-win content :win win)
(on-populate-control-list-win content :win win)
- (jquery-execute (get-placer content) "trigger('clog-builder-snap-shot')"))))
+ (jquery-execute (get-placer content) "trigger('clog-builder-snap-shot')"))))
;; set up del/cut/copy/paste handlers
(set-on-copy content #'copy)
(set-on-click btn-copy #'copy)
@@ -1746,7 +1746,7 @@ of controls and double click to select control."
(declare (ignore obj))
(cond (in-simulation
(setf (url-src btn-sim) img-btn-sim)
- (setf (advisory-title btn-sim) "start simulation")
+ (setf (advisory-title btn-sim) "start simulation")
(setf in-simulation nil)
(maphash (lambda (html-id control)
(declare (ignore html-id))
@@ -1754,7 +1754,7 @@ of controls and double click to select control."
(get-control-list app panel-id)))
(t
(setf (url-src btn-sim) img-btn-cons)
- (setf (advisory-title btn-sim) "construction mode")
+ (setf (advisory-title btn-sim) "construction mode")
(deselect-current-control app)
(on-populate-control-properties-win content :win win)
(setf in-simulation t)
@@ -1764,36 +1764,36 @@ of controls and double click to select control."
(get-control-list app panel-id))
(focus (first-child content))))))
(set-on-click btn-undo (lambda (obj)
- (declare (ignore obj))
- (when undo-chain
- (setf (inner-html content)
- (let ((val (pop undo-chain)))
- (push val redo-chain)
- val))
- (clrhash (get-control-list app panel-id))
- (on-populate-loaded-window content :win win)
- (setf (window-title win) (attribute content "data-clog-name"))
- (on-populate-control-properties-win content :win win)
- (on-populate-control-list-win content :win win))))
+ (declare (ignore obj))
+ (when undo-chain
+ (setf (inner-html content)
+ (let ((val (pop undo-chain)))
+ (push val redo-chain)
+ val))
+ (clrhash (get-control-list app panel-id))
+ (on-populate-loaded-window content :win win)
+ (setf (window-title win) (attribute content "data-clog-name"))
+ (on-populate-control-properties-win content :win win)
+ (on-populate-control-list-win content :win win))))
(set-on-event content "clog-builder-snap-shot"
- (lambda (obj)
- (declare (ignore obj))
- (setf redo-chain nil)
- (push (panel-snap-shot content panel-id (bottom-panel box)) undo-chain)
- (when (current-control app)
- (focus (get-placer (current-control app))))))
+ (lambda (obj)
+ (declare (ignore obj))
+ (setf redo-chain nil)
+ (push (panel-snap-shot content panel-id (bottom-panel box)) undo-chain)
+ (when (current-control app)
+ (focus (get-placer (current-control app))))))
(set-on-click btn-redo (lambda (obj)
- (declare (ignore obj))
- (when redo-chain
- (setf (inner-html content)
- (let ((val (pop redo-chain)))
- (push val undo-chain)
- val))
- (clrhash (get-control-list app panel-id))
- (on-populate-loaded-window content :win win)
- (setf (window-title win) (attribute content "data-clog-name"))
- (on-populate-control-properties-win content :win win)
- (on-populate-control-list-win content :win win))))
+ (declare (ignore obj))
+ (when redo-chain
+ (setf (inner-html content)
+ (let ((val (pop redo-chain)))
+ (push val undo-chain)
+ val))
+ (clrhash (get-control-list app panel-id))
+ (on-populate-loaded-window content :win win)
+ (setf (window-title win) (attribute content "data-clog-name"))
+ (on-populate-control-properties-win content :win win)
+ (on-populate-control-list-win content :win win))))
(set-on-click btn-load (lambda (obj)
(declare (ignore obj))
(server-file-dialog win "Load Panel" (directory-namestring file-name)
@@ -1801,17 +1801,17 @@ of controls and double click to select control."
(window-focus win)
(when fname
(setf file-name fname)
- (setf render-file-name "")
+ (setf render-file-name "")
(setf (inner-html content)
(read-file fname))
(clrhash (get-control-list app panel-id))
(on-populate-loaded-window content :win win)
(setf (title (html-document body)) (attribute content "data-clog-name"))
(setf (window-title win) (attribute content "data-clog-name"))
- (on-populate-control-list-win content :win win))))))
+ (on-populate-control-list-win content :win win))))))
(set-on-click btn-save (lambda (obj)
- (when (equal file-name "")
- (setf file-name (format nil "~A.clog" (attribute content "data-clog-name"))))
+ (when (equal file-name "")
+ (setf file-name (format nil "~A.clog" (attribute content "data-clog-name"))))
(server-file-dialog obj "Save Page As.." file-name
(lambda (fname)
(window-focus win)
@@ -1827,12 +1827,12 @@ of controls and double click to select control."
:custom-boot custom-boot)))
(set-on-click btn-rndr
(lambda (obj)
- (when (equal render-file-name "")
- (if (equal file-name "")
- (setf render-file-name (format nil "~A.lisp" (attribute content "data-clog-name")))
- (setf render-file-name (format nil "~A~A.lisp"
- (directory-namestring file-name)
- (pathname-name file-name)))))
+ (when (equal render-file-name "")
+ (if (equal file-name "")
+ (setf render-file-name (format nil "~A.lisp" (attribute content "data-clog-name")))
+ (setf render-file-name (format nil "~A~A.lisp"
+ (directory-namestring file-name)
+ (pathname-name file-name)))))
(server-file-dialog obj "Render As.." render-file-name
(lambda (fname)
(window-focus win)
@@ -1923,7 +1923,7 @@ of controls and double click to select control."
CLOG Builder
(c) 2022 - David Botton "
- img-clog-icon)
+ img-clog-icon)
:width 200
:height 215
:hidden t)))
@@ -1984,9 +1984,9 @@ of controls and double click to select control."
"Open quick start"
(let* ((app (connection-data-item obj "builder-app-data"))
(win (create-gui-window obj :title "Quick Start"
- :top 40 :left 225
- :width 600 :height 400
- :client-movement t)))
+ :top 40 :left 225
+ :width 600 :height 400
+ :client-movement t)))
(create-quick-start (window-content win))))
(defun on-new-builder (body)
@@ -2003,7 +2003,7 @@ of controls and double click to select control."
-9999)
(let* ((menu (create-gui-menu-bar body))
(icon (create-gui-menu-icon menu :image-url img-clog-icon
- :on-click #'on-help-about-builder))
+ :on-click #'on-help-about-builder))
(file (create-gui-menu-drop-down menu :content "Builder"))
(tools (create-gui-menu-drop-down menu :content "Tools"))
(win (create-gui-menu-drop-down menu :content "Window"))
@@ -2070,26 +2070,26 @@ of controls and double click to select control."
(let ((params (form-multipart-data body)))
(create-div body :content params)
(destructuring-bind (stream fname content-type)
- (form-data-item params "filename")
+ (form-data-item params "filename")
(create-div body :content (format nil "filename = ~A - (contents printed in REPL)" fname))
(let ((s (flexi-streams:make-flexi-stream stream))
- (b (make-string 1000))
- (pic-data ""))
- (setf pic-data (format nil "data:~A;base64,~A" content-type
- (with-output-to-string (out)
- (s-base64:encode-base64 s out))))
- (create-img body :url-src pic-data)
- (create-br body)
- (create-div body :content "User the following as a url source:")
- (set-geometry (create-text-area body :value pic-data) :width 500 :height 400)
- (create-br body)
- (create-div body :content (format nil "For example:"))
(setf (inner-html (indicator app))
(cadr (assoc :db-name results)))
- (setf (title (html-document (body app)))
+ (setf (title (html-document (body app)))
(format nil "CLOG DB Admin - ~A" (cadr (assoc :db-name results))))))
:title "Open Database" :height 250)))
-
+
(defun on-db-close (obj)
(let ((app (connection-data-item obj "app-data")))
(when (db-connection app)
@@ -53,7 +53,7 @@
(add-class (body app) "w3-blue-grey")
(destroy (indicator app))
(setf (indicator app) nil)
- (sqlite:disconnect (db-connection app))
+ (sqlite:disconnect (db-connection app))
(setf (db-connection app) nil))
(setf (title (html-document (body app))) "CLOG DB Admin")))
@@ -149,7 +149,7 @@
:on-click-row
(lambda (obj names row)
(edit-record obj app (car data) names row))))))))
-
+
(defun on-help-about (obj)
(let ((about (create-gui-window obj
:title "About"
@@ -163,7 +163,7 @@
:height 215
:hidden t)))
(window-center about)
- (setf (visiblep about) t)
+ (setf (visiblep about) t)
(set-on-window-can-size about (lambda (obj)
(declare (ignore obj))()))))
@@ -173,7 +173,7 @@
(setf (body app) body)
(setf (title (html-document body)) "CLOG DB Admin")
(clog-gui-initialize body)
- (add-class body "w3-blue-grey")
+ (add-class body "w3-blue-grey")
(let* ((menu (create-gui-menu-bar body))
(icon (create-gui-menu-icon menu :on-click #'on-help-about))
(file (create-gui-menu-drop-down menu :content "Database"))
diff --git a/tools/clog-new-app.lisp b/tools/clog-new-app.lisp
index 2168b41..aa487a5 100644
--- a/tools/clog-new-app.lisp
+++ b/tools/clog-new-app.lisp
@@ -25,7 +25,7 @@
(declare (ignore obj))
;; return empty string to prevent nav off page
""))))
-
+
(defun clog-new-app (&key (port 8080) static-root)
"Start clog-new-app."
(if static-root
diff --git a/tutorial/01-tutorial.lisp b/tutorial/01-tutorial.lisp
index 1f15815..2e29232 100644
--- a/tutorial/01-tutorial.lisp
+++ b/tutorial/01-tutorial.lisp
@@ -10,22 +10,22 @@
"On-new-window handler." ; Optional docstring to describe function
(let ((hello-element ; hello-element is a local variable that
- ; will be bound to our new CLOG-Element
-
- ;; This application simply creates a CLOG-Element as a child to the
- ;; CLOG-body object in the browser window.
-
- ;; A CLOG-Element represents a block of HTML (we will see later ways to
- ;; directly create buttons and all sorts of HTML elements in more lisp
- ;; like ways with no knowledge of HTML or javascript. CREATE-CHILD
- ;; allows any html element to be created and returned as a CLOG-Element.
- (create-child body "
Hello World! (click me!) ")))
+ ; will be bound to our new CLOG-Element
+
+ ;; This application simply creates a CLOG-Element as a child to the
+ ;; CLOG-body object in the browser window.
+
+ ;; A CLOG-Element represents a block of HTML (we will see later ways to
+ ;; directly create buttons and all sorts of HTML elements in more lisp
+ ;; like ways with no knowledge of HTML or javascript. CREATE-CHILD
+ ;; allows any html element to be created and returned as a CLOG-Element.
+ (create-child body "
Hello World! (click me!) ")))
(set-on-click hello-element ; Now we set a function to handle clicks
- (lambda (obj) ; In this case we use an anonymous function
- (declare (ignore obj))
- (setf (color hello-element) :green)))))
-
+ (lambda (obj) ; In this case we use an anonymous function
+ (declare (ignore obj))
+ (setf (color hello-element) :green)))))
+
;;; To see all the events one can set and the many properties and styles that
;;; exist, take a look through the CLOG manual or the file clog-element.lisp
diff --git a/tutorial/02-tutorial.lisp b/tutorial/02-tutorial.lisp
index db69665..a1b526c 100644
--- a/tutorial/02-tutorial.lisp
+++ b/tutorial/02-tutorial.lisp
@@ -14,26 +14,26 @@
;; (window body) is the CLOG-Window object ~ the equivelant html
;; (location body) is the CLOG-Location object ~ objects of same name.
;; (navigator body) is the CLOG-Navigator object ~ See the manual or src.
-
- (let ((hello-element
- ;; CREATE-SECTION is a lispier way of creating any of the HTML 5
- ;; section elements:
- ;;
- ;; :address :article :aside :header :main :nav :hgroup
- ;; :p :pre :section :blockquote :h1 :h2 :h3 :h4 :h5 :h6
- ;;
- ;; Take a look at clog-element-common.lisp or the clog-manual
- (create-section body :h1 :content "Hello World! (click me!)")))
-
- (let ((x 0)) ; A closure - each call to on-new-window by
+
+ (let ((hello-element
+ ;; CREATE-SECTION is a lispier way of creating any of the HTML 5
+ ;; section elements:
+ ;;
+ ;; :address :article :aside :header :main :nav :hgroup
+ ;; :p :pre :section :blockquote :h1 :h2 :h3 :h4 :h5 :h6
+ ;;
+ ;; Take a look at clog-element-common.lisp or the clog-manual
+ (create-section body :h1 :content "Hello World! (click me!)")))
+
+ (let ((x 0)) ; A closure - each call to on-new-window by
(set-on-click hello-element ; a new browser window or refresh will
- (lambda (obj) ; create a different version of this closure.
- (declare (ignore obj))
- (incf x)
- (dotimes (n x)
- (create-child body
- (format nil "
Clicked ~A times.
" x))
- (scroll-to (window body) 0 (height body))))))))
+ (lambda (obj) ; create a different version of this closure.
+ (declare (ignore obj))
+ (incf x)
+ (dotimes (n x)
+ (create-child body
+ (format nil "
Clicked ~A times.
" x))
+ (scroll-to (window body) 0 (height body))))))))
(defun start-tutorial ()
"Start turtorial."
diff --git a/tutorial/03-tutorial.lisp b/tutorial/03-tutorial.lisp
index 22f5009..95ea392 100644
--- a/tutorial/03-tutorial.lisp
+++ b/tutorial/03-tutorial.lisp
@@ -6,20 +6,20 @@
(defun on-new-window (body)
"On-new-window handler."
- (setf (title (html-document body)) "Tutorial 3")
+ (setf (title (html-document body)) "Tutorial 3")
(let ((hello-element
- (create-section body :h1 :content "Hello World! (click me!)")))
+ (create-section body :h1 :content "Hello World! (click me!)")))
(let ((x 0))
(set-on-click hello-element
- (lambda (obj)
- (declare (ignorable obj))
- ;; Add to try non-parallel events:
- ;; (with-sync-event (obj)
- (let ((y (incf x)))
- (dotimes (n y)
- (create-p body
- :content (format nil "Clicked ~A times." y))
- (sleep y)))))))) ;)
+ (lambda (obj)
+ (declare (ignorable obj))
+ ;; Add to try non-parallel events:
+ ;; (with-sync-event (obj)
+ (let ((y (incf x)))
+ (dotimes (n y)
+ (create-p body
+ :content (format nil "Clicked ~A times." y))
+ (sleep y)))))))) ;)
;;; Running this version of the last tutorial and clicking quickly on the (click me!)
;;; will demonstrate an important aspect of CLOG, events can happen in _parallel_.
diff --git a/tutorial/04-tutorial.lisp b/tutorial/04-tutorial.lisp
index bbe012d..3194c64 100644
--- a/tutorial/04-tutorial.lisp
+++ b/tutorial/04-tutorial.lisp
@@ -12,9 +12,9 @@
(setf (title (html-document body)) "Tutorial 4")
;; The same handler #'my-on-click is set on both targets
(set-on-click (create-section body :h1 :content "Hello World! (click me!)")
- 'my-on-click)
+ 'my-on-click)
(set-on-click (create-section body :h3 :content "Click me too!")
- 'my-on-click))
+ 'my-on-click))
(defun start-tutorial ()
"Start turtorial."
diff --git a/tutorial/05-tutorial.lisp b/tutorial/05-tutorial.lisp
index 08c351f..e4cb2b1 100644
--- a/tutorial/05-tutorial.lisp
+++ b/tutorial/05-tutorial.lisp
@@ -12,12 +12,12 @@
(setf (color (connection-data-item obj "changer")) "green"))
(defun on-new-window (body)
- "On-new-window handler."
+ "On-new-window handler."
(setf (title (html-document body)) "Tutorial 5")
(set-on-click (create-section body :h1 :content "Hello World! (click me!)")
- 'my-on-click)
+ 'my-on-click)
(setf (connection-data-item body "changer")
- (create-section body :h1 :content "I change")))
+ (create-section body :h1 :content "I change")))
(defun start-tutorial ()
"Start turtorial."
diff --git a/tutorial/06-tutorial.lisp b/tutorial/06-tutorial.lisp
index 7adc752..460bfda 100644
--- a/tutorial/06-tutorial.lisp
+++ b/tutorial/06-tutorial.lisp
@@ -13,12 +13,12 @@
;; valid to close down the event or thread.
(loop
(if (and (validp obj) (connection-data-item obj "isRunning"))
- (progn
- (setf (color obj) :green)
- (sleep 0.3)
- (setf (color obj) :red)
- (sleep 0.3))
- (return))))
+ (progn
+ (setf (color obj) :green)
+ (sleep 0.3)
+ (setf (color obj) :red)
+ (sleep 0.3))
+ (return))))
(setf (connection-data-item obj "isRunning") nil)
(setf (text obj) "(click me to start!)")
(setf (color obj) "black")
@@ -28,7 +28,7 @@
"On-new-window handler."
(setf (title (html-document body)) "Tutorial 6")
(set-on-click (create-section body :h1 :content "(click me to start!)")
- 'my-on-click))
+ 'my-on-click))
(defun start-tutorial ()
"Start turtorial."
diff --git a/tutorial/07-tutorial.lisp b/tutorial/07-tutorial.lisp
index 765704d..11e0065 100644
--- a/tutorial/07-tutorial.lisp
+++ b/tutorial/07-tutorial.lisp
@@ -12,67 +12,67 @@
(defun on-new-window (body)
(handler-case ; Disconnects from the browser can be handled gracefully using the condition system.
(progn
- (setf (title (html-document body)) "Tutorial 7")
- ;; Show a "splash" screen
- (setf (hiddenp (prog1
- (create-section body :h2
- :content "KILL Darth's Tie Fighter - Click on it!")
- (sleep 2))) t)
- ;; Setup main game
- (let* ((mover (create-div body :content "(-o-)"))
- bounds-x bounds-y mover-x mover-y)
- (flet ((set-bounds ()
- (setf bounds-x (width (window body)))
- (setf bounds-y (height (window body)))))
- (set-bounds)
- (setf mover-x (random bounds-x))
- (setf mover-y (random bounds-y))
- ;; Capture browser size changes to adjust playing field
- (set-on-resize (window body)
- (lambda (obj)
- (declare (ignore obj))
- (set-bounds))))
- ;; Setup our "mover". Darth
- (setf (positioning mover) :fixed)
- (set-on-click mover 'on-click)
- ;; Get Darth moving!
- (bordeaux-threads:make-thread ; In addtion to the main task (the on-new-window)
- (lambda () ; and the task created for each event like clicks
- (loop ; threads can be created as needed and used with
- (unless (validp body) ; CLOG.
- (return))
- (when (connection-data-item body "done")
- (return))
-
- (sleep .5)
- (setf (text mover) ")-o-(")
- (sleep .2)
- (setf (text mover) "(-o-)"))
- (setf (inner-html mover) "
GAME OVER "))
+ (setf (title (html-document body)) "Tutorial 7")
+ ;; Show a "splash" screen
+ (setf (hiddenp (prog1
+ (create-section body :h2
+ :content "KILL Darth's Tie Fighter - Click on it!")
+ (sleep 2))) t)
+ ;; Setup main game
+ (let* ((mover (create-div body :content "(-o-)"))
+ bounds-x bounds-y mover-x mover-y)
+ (flet ((set-bounds ()
+ (setf bounds-x (width (window body)))
+ (setf bounds-y (height (window body)))))
+ (set-bounds)
+ (setf mover-x (random bounds-x))
+ (setf mover-y (random bounds-y))
+ ;; Capture browser size changes to adjust playing field
+ (set-on-resize (window body)
+ (lambda (obj)
+ (declare (ignore obj))
+ (set-bounds))))
+ ;; Setup our "mover". Darth
+ (setf (positioning mover) :fixed)
+ (set-on-click mover 'on-click)
+ ;; Get Darth moving!
+ (bordeaux-threads:make-thread ; In addtion to the main task (the on-new-window)
+ (lambda () ; and the task created for each event like clicks
+ (loop ; threads can be created as needed and used with
+ (unless (validp body) ; CLOG.
+ (return))
+ (when (connection-data-item body "done")
+ (return))
+
+ (sleep .5)
+ (setf (text mover) ")-o-(")
+ (sleep .2)
+ (setf (text mover) "(-o-)"))
+ (setf (inner-html mover) "
GAME OVER "))
:name "Darth event loop")
- ;; Check of browser still connected while running game loop
- (loop
- (unless (validp body)
- (return))
- (when (connection-data-item body "done")
- (return))
- (setf (top mover) (unit :px mover-y))
- (setf (left mover) (unit :px mover-x))
- (if (= (random 2) 0)
- (incf mover-y (random 10))
- (decf mover-y (random 10)))
- (if (= (random 2) 0)
- (incf mover-x (random 10))
- (decf mover-x (random 10)))
- (when (< mover-x 0)
- (setf mover-x 0))
- (when (> mover-x bounds-x)
- (setf mover-x bounds-x))
- (when (< mover-y 0)
- (setf mover-y 0))
- (when (> mover-y bounds-y)
- (setf mover-y bounds-y))
- (sleep .02))))
+ ;; Check of browser still connected while running game loop
+ (loop
+ (unless (validp body)
+ (return))
+ (when (connection-data-item body "done")
+ (return))
+ (setf (top mover) (unit :px mover-y))
+ (setf (left mover) (unit :px mover-x))
+ (if (= (random 2) 0)
+ (incf mover-y (random 10))
+ (decf mover-y (random 10)))
+ (if (= (random 2) 0)
+ (incf mover-x (random 10))
+ (decf mover-x (random 10)))
+ (when (< mover-x 0)
+ (setf mover-x 0))
+ (when (> mover-x bounds-x)
+ (setf mover-x bounds-x))
+ (when (< mover-y 0)
+ (setf mover-y 0))
+ (when (> mover-y bounds-y)
+ (setf mover-y bounds-y))
+ (sleep .02))))
(error (c)
(format t "Lost connection.~%~%~A" c))))
diff --git a/tutorial/08-tutorial.lisp b/tutorial/08-tutorial.lisp
index b409d34..ddaa190 100644
--- a/tutorial/08-tutorial.lisp
+++ b/tutorial/08-tutorial.lisp
@@ -21,27 +21,27 @@
(with-sync-event (obj) ; Serialize events to on-mouse-down.
(let ((app (connection-data-item obj "app-data"))) ; Ensure the first event received
(unless (in-drag-p app) ; to drag is the only one, ie only
- (setf (in-drag-p app) t) ; the innermost box is dragged.
- (let* ((mouse-x (getf data :screen-x)) ; Use the screen coordinates not
- (mouse-y (getf data :screen-y)) ; the coordinates relative to the obj
- (obj-top (parse-integer (top obj) :junk-allowed t))
- (obj-left (parse-integer (left obj) :junk-allowed t)))
- (setf (drag-x app) (- mouse-x obj-left))
- (setf (drag-y app) (- mouse-y obj-top))
- (if (eq (getf data :event-type) :touch)
- (progn
- (set-on-touch-move obj 'on-mouse-move)
- (set-on-touch-end obj 'stop-obj-grab)
- (set-on-touch-cancel obj 'on-mouse-leave))
- (progn
- (set-on-mouse-move obj 'on-mouse-move)
- (set-on-mouse-up obj 'stop-obj-grab)
- (set-on-mouse-leave obj 'on-mouse-leave))))))))
+ (setf (in-drag-p app) t) ; the innermost box is dragged.
+ (let* ((mouse-x (getf data :screen-x)) ; Use the screen coordinates not
+ (mouse-y (getf data :screen-y)) ; the coordinates relative to the obj
+ (obj-top (parse-integer (top obj) :junk-allowed t))
+ (obj-left (parse-integer (left obj) :junk-allowed t)))
+ (setf (drag-x app) (- mouse-x obj-left))
+ (setf (drag-y app) (- mouse-y obj-top))
+ (if (eq (getf data :event-type) :touch)
+ (progn
+ (set-on-touch-move obj 'on-mouse-move)
+ (set-on-touch-end obj 'stop-obj-grab)
+ (set-on-touch-cancel obj 'on-mouse-leave))
+ (progn
+ (set-on-mouse-move obj 'on-mouse-move)
+ (set-on-mouse-up obj 'stop-obj-grab)
+ (set-on-mouse-leave obj 'on-mouse-leave))))))))
(defun on-mouse-move (obj data)
(let* ((app (connection-data-item obj "app-data"))
- (x (getf data :screen-x))
- (y (getf data :screen-y)))
+ (x (getf data :screen-x))
+ (y (getf data :screen-y)))
(setf (top obj) (unit :px (- y (drag-y app))))
(setf (left obj) (unit :px (- x (drag-x app))))))
@@ -61,12 +61,12 @@
(defun on-new-window (body)
(let ((app (make-instance 'app-data))) ; Create our "App-Data" for this instance
- (setf (connection-data-item body "app-data") app)) ; of our App.
+ (setf (connection-data-item body "app-data") app)) ; of our App.
(setf (title (html-document body)) "Tutorial 8")
(let* ((div1 (create-div body))
- (div2 (create-div div1))
- (div3 (create-div div2))
- (dir (create-div div1 :content "
Click and drag the boxes ")))
+ (div2 (create-div div1))
+ (div3 (create-div div2))
+ (dir (create-div div1 :content "
Click and drag the boxes ")))
;; Absolute allows fixed positioning relative to parent
(setf (positioning dir) :absolute)
(setf (bottom dir) 0)
@@ -77,7 +77,7 @@
;; sizes
(setf (width div1) 400)
(setf (width div2) 300)
- (setf (width div3) 200)
+ (setf (width div3) 200)
(setf (height div1) 400)
(setf (height div2) 300)
(setf (height div3) 200)
diff --git a/tutorial/09-tutorial.lisp b/tutorial/09-tutorial.lisp
index b64be88..53db020 100644
--- a/tutorial/09-tutorial.lisp
+++ b/tutorial/09-tutorial.lisp
@@ -10,62 +10,62 @@
;; reduces rountrip traffic and speeds setup.
(with-connection-cache (body)
(let* (last-tab
- ;; Note: Since the there is no need to use the tmp objects
- ;; we reuse the same symbol name (tmp) even though the
- ;; compiler can mark those for garbage collection early
- ;; this not an issue as the element is created already
- ;; in the browser window.
- ;;
- ;; See tutorial 33 for a far more elegant approach
- ;; that uses with-clog-create for this type of code
- ;; based layout.
- ;;
- ;; Create tabs and panels
- (t1 (create-button body :content "Tab1"))
- (t2 (create-button body :content "Tab2"))
- (t3 (create-button body :content "Tab3"))
- (tmp (create-br body))
- (p1 (create-div body))
- (p2 (create-div body))
- (p3 (create-div body :content "Panel3 - Type here"))
- ;; Create form for panel 1
- (f1 (create-form p1))
- (fe1 (create-form-element f1 :text
- :label (create-label f1 :content "Fill in blank:")))
- (tmp (create-br f1))
- (fe2 (create-form-element f1 :color :value "#ffffff"
- :label (create-label f1 :content "Pick a color:")))
- (tmp (create-br f1))
- (tmp (create-form-element f1 :submit :value "OK"))
- (tmp (create-form-element f1 :reset :value "Start Again"))
- ;; Create for for panel 2
- (f2 (create-form p2))
- (fs2 (create-fieldset f2 :legend "Stuff"))
- (tmp (create-label fs2 :content "Please type here:"))
- (ta1 (create-text-area fs2 :columns 60 :rows 8 :label tmp))
- (tmp (create-br fs2))
- (rd1 (create-form-element fs2 :radio :name "rd"))
- (tmp (create-label fs2 :content "To Be" :label-for rd1))
- (rd2 (create-form-element fs2 :radio :name "rd"))
- (tmp (create-label fs2 :content "No to Be" :label-for rd2))
- (tmp (create-br fs2))
- (ck1 (create-form-element fs2 :checkbox :name "ck"))
- (tmp (create-label fs2 :content "Here" :label-for ck1))
- (ck2 (create-form-element fs2 :checkbox :name "ck"))
- (tmp (create-label fs2 :content "There" :label-for ck2))
- (tmp (create-br fs2))
- (sl1 (create-select fs2 :label (create-label fs2 :content "Pick one:")))
- (sl2 (create-select fs2 :label (create-label fs2 :content "Pick one:")))
- (sl3 (create-select fs2 :multiple t
- :label (create-label fs2 :content "Pick some:")))
- (o1 (create-option sl3 :content "one"))
- (o2 (create-option sl3 :content "two"))
- (o3 (create-option sl3 :content "three"))
- (og1 (create-optgroup sl3 :content "These are a group"))
- (o4 (create-option og1 :content "four"))
- (o5 (create-option og1 :content "five"))
- (tmp (create-form-element f2 :submit :value "OK"))
- (tmp (create-form-element f2 :reset :value "Start Again")))
+ ;; Note: Since the there is no need to use the tmp objects
+ ;; we reuse the same symbol name (tmp) even though the
+ ;; compiler can mark those for garbage collection early
+ ;; this not an issue as the element is created already
+ ;; in the browser window.
+ ;;
+ ;; See tutorial 33 for a far more elegant approach
+ ;; that uses with-clog-create for this type of code
+ ;; based layout.
+ ;;
+ ;; Create tabs and panels
+ (t1 (create-button body :content "Tab1"))
+ (t2 (create-button body :content "Tab2"))
+ (t3 (create-button body :content "Tab3"))
+ (tmp (create-br body))
+ (p1 (create-div body))
+ (p2 (create-div body))
+ (p3 (create-div body :content "Panel3 - Type here"))
+ ;; Create form for panel 1
+ (f1 (create-form p1))
+ (fe1 (create-form-element f1 :text
+ :label (create-label f1 :content "Fill in blank:")))
+ (tmp (create-br f1))
+ (fe2 (create-form-element f1 :color :value "#ffffff"
+ :label (create-label f1 :content "Pick a color:")))
+ (tmp (create-br f1))
+ (tmp (create-form-element f1 :submit :value "OK"))
+ (tmp (create-form-element f1 :reset :value "Start Again"))
+ ;; Create for for panel 2
+ (f2 (create-form p2))
+ (fs2 (create-fieldset f2 :legend "Stuff"))
+ (tmp (create-label fs2 :content "Please type here:"))
+ (ta1 (create-text-area fs2 :columns 60 :rows 8 :label tmp))
+ (tmp (create-br fs2))
+ (rd1 (create-form-element fs2 :radio :name "rd"))
+ (tmp (create-label fs2 :content "To Be" :label-for rd1))
+ (rd2 (create-form-element fs2 :radio :name "rd"))
+ (tmp (create-label fs2 :content "No to Be" :label-for rd2))
+ (tmp (create-br fs2))
+ (ck1 (create-form-element fs2 :checkbox :name "ck"))
+ (tmp (create-label fs2 :content "Here" :label-for ck1))
+ (ck2 (create-form-element fs2 :checkbox :name "ck"))
+ (tmp (create-label fs2 :content "There" :label-for ck2))
+ (tmp (create-br fs2))
+ (sl1 (create-select fs2 :label (create-label fs2 :content "Pick one:")))
+ (sl2 (create-select fs2 :label (create-label fs2 :content "Pick one:")))
+ (sl3 (create-select fs2 :multiple t
+ :label (create-label fs2 :content "Pick some:")))
+ (o1 (create-option sl3 :content "one"))
+ (o2 (create-option sl3 :content "two"))
+ (o3 (create-option sl3 :content "three"))
+ (og1 (create-optgroup sl3 :content "These are a group"))
+ (o4 (create-option og1 :content "four"))
+ (o5 (create-option og1 :content "five"))
+ (tmp (create-form-element f2 :submit :value "OK"))
+ (tmp (create-form-element f2 :reset :value "Start Again")))
(declare (ignore tmp))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Panel 1 contents
@@ -74,21 +74,21 @@
(setf (requiredp fe1) t)
(setf (size fe1) 60)
(make-data-list fe1 '("Cool Title"
- "Not So Cool Title"
- "Why Not, Another Title"))
+ "Not So Cool Title"
+ "Why Not, Another Title"))
(make-data-list fe2 '("#ffffff"
- "#ff0000"
- "#00ff00"
- "#0000ff"
- "#ff00ff"))
+ "#ff0000"
+ "#00ff00"
+ "#0000ff"
+ "#ff00ff"))
(set-on-submit f1
- (lambda (obj)
- (declare (ignore obj))
- (setf (title (html-document body)) (value fe1))
- (setf (background-color p1) (value fe2))
- (setf (hiddenp f1) t)
- (create-span p1 :content
- "
Your form has been submitted ")))
+ (lambda (obj)
+ (declare (ignore obj))
+ (setf (title (html-document body)) (value fe1))
+ (setf (background-color p1) (value fe2))
+ (setf (hiddenp f1) t)
+ (create-span p1 :content
+ "
Your form has been submitted ")))
(setf (width p1) "100%")
(setf (width p2) "100%")
(setf (width p3) "100%")
@@ -108,30 +108,30 @@
(setf (vertical-align sl3) :top)
(setf (size sl1) 3)
(add-select-options sl1 '("one"
- "two"
- "three"
- "four"
- "five"))
+ "two"
+ "three"
+ "four"
+ "five"))
(add-select-options sl2 '("one"
- "two"
- "three"
- "four"
- "five"))
+ "two"
+ "three"
+ "four"
+ "five"))
(set-on-change sl3 (lambda (obj)
- (declare (ignore obj))
- (when (selectedp o5)
- (alert (window body) "Selected 5"))))
+ (declare (ignore obj))
+ (when (selectedp o5)
+ (alert (window body) "Selected 5"))))
(set-on-submit f2
- (lambda (obj)
- (declare (ignore obj))
- (setf (hiddenp f2) t)
- (create-span p2 :content
- (format nil "
Your form has been submitted:
+ (lambda (obj)
+ (declare (ignore obj))
+ (setf (hiddenp f2) t)
+ (create-span p2 :content
+ (format nil "
Your form has been submitted:
~A
1 - ~A
2 - ~A
3 - ~A"
- (value ta1)
- (value sl1)
- (value sl2)
- (selectedp o2)))))
+ (value ta1)
+ (value sl1)
+ (value sl2)
+ (selectedp o2)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Panel 3 contents
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -140,26 +140,26 @@
;; Tab functionality
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(flet ((select-tab (obj)
- (setf (hiddenp p1) t)
- (setf (hiddenp p2) t)
- (setf (hiddenp p3) t)
- (setf (background-color t1) :lightgrey)
- (setf (background-color t2) :lightgrey)
- (setf (background-color t3) :lightgrey)
- (setf (background-color last-tab) :lightblue)
- (setf (hiddenp obj) nil)
- (focus obj)))
- (setf last-tab t1)
- (select-tab p1)
- (set-on-click t1 (lambda (obj)
- (setf last-tab obj)
- (select-tab p1)))
- (set-on-click t2 (lambda (obj)
- (setf last-tab obj)
- (select-tab p2)))
- (set-on-click t3 (lambda (obj)
- (setf last-tab obj)
- (select-tab p3)))))))
+ (setf (hiddenp p1) t)
+ (setf (hiddenp p2) t)
+ (setf (hiddenp p3) t)
+ (setf (background-color t1) :lightgrey)
+ (setf (background-color t2) :lightgrey)
+ (setf (background-color t3) :lightgrey)
+ (setf (background-color last-tab) :lightblue)
+ (setf (hiddenp obj) nil)
+ (focus obj)))
+ (setf last-tab t1)
+ (select-tab p1)
+ (set-on-click t1 (lambda (obj)
+ (setf last-tab obj)
+ (select-tab p1)))
+ (set-on-click t2 (lambda (obj)
+ (setf last-tab obj)
+ (select-tab p2)))
+ (set-on-click t3 (lambda (obj)
+ (setf last-tab obj)
+ (select-tab p3)))))))
(defun start-tutorial ()
"Start turtorial."
diff --git a/tutorial/10-tutorial.lisp b/tutorial/10-tutorial.lisp
index fa46a83..0b74a91 100644
--- a/tutorial/10-tutorial.lisp
+++ b/tutorial/10-tutorial.lisp
@@ -8,8 +8,8 @@
(defun on-new-window (body)
(setf (title (html-document body)) "Tutorial 10")
(let* ((canvas (create-canvas body :width 600 :height 400))
- (cx (create-context2d canvas)))
- (set-border canvas :thin :solid :black)
+ (cx (create-context2d canvas)))
+ (set-border canvas :thin :solid :black)
(fill-style cx :green)
(fill-rect cx 10 10 150 100)
(fill-style cx :blue)
diff --git a/tutorial/11-tutorial.lisp b/tutorial/11-tutorial.lisp
index 4ee9217..d6eab4c 100644
--- a/tutorial/11-tutorial.lisp
+++ b/tutorial/11-tutorial.lisp
@@ -40,30 +40,30 @@
(debug-mode body)
;; Setup form
(let* ((form (attach-as-child body "form1" :clog-type 'clog-form))
- (good-button (attach-as-child body "button1id"))
- (scary-button (attach-as-child body "button2id")))
+ (good-button (attach-as-child body "button1id"))
+ (scary-button (attach-as-child body "button2id")))
(flet ((on-click-good (obj)
- (declare (ignore obj))
- (let ((alert-div (create-div body)))
- (place-before form alert-div)
- (setf (hiddenp form) t)
- ;; Bootstrap specific markup
- (setf (css-class-name alert-div) "alert alert-success")
- (setf (attribute alert-div "role") "alert")
- ;; We collect the data from the hidden form elements
- ;; using radio-value and name-value (for other types if
- ;; input other than radio buttons) or we could bind each
- ;; control (using ATTACH-AS-CHILD)and seek their value
- ;; directly. See tutorial 17 and to deal with forms in
- ;; the old html page model of "put" and "get"
- (setf (inner-html alert-div)
- (format nil "
radios value : ~A
+ (declare (ignore obj))
+ (let ((alert-div (create-div body)))
+ (place-before form alert-div)
+ (setf (hiddenp form) t)
+ ;; Bootstrap specific markup
+ (setf (css-class-name alert-div) "alert alert-success")
+ (setf (attribute alert-div "role") "alert")
+ ;; We collect the data from the hidden form elements
+ ;; using radio-value and name-value (for other types if
+ ;; input other than radio buttons) or we could bind each
+ ;; control (using ATTACH-AS-CHILD)and seek their value
+ ;; directly. See tutorial 17 and to deal with forms in
+ ;; the old html page model of "put" and "get"
+ (setf (inner-html alert-div)
+ (format nil "
radios value : ~A
textinput value : ~A "
- (radio-value form "radios")
- (name-value form "textinput")))))
- (on-click-scary (obj)
- (declare (ignore obj))
- (reset form)))
+ (radio-value form "radios")
+ (name-value form "textinput")))))
+ (on-click-scary (obj)
+ (declare (ignore obj))
+ (reset form)))
;; We need to override the boostrap default to submit the form html style
(set-on-submit form (lambda (obj)(declare (ignore obj))()))
(set-on-click good-button #'on-click-good)
diff --git a/tutorial/12-tutorial.lisp b/tutorial/12-tutorial.lisp
index f610234..c2b6aa3 100644
--- a/tutorial/12-tutorial.lisp
+++ b/tutorial/12-tutorial.lisp
@@ -26,7 +26,7 @@
(defun on-main (body)
(let ((sb (create-style-block body)))
(add-style sb :element "a" '(("color" :orange)
- ("text-decoration" :none)))
+ ("text-decoration" :none)))
(add-style sb :element "a:hover" '(("background-color" :gray))))
(create-div body :content
"We are in on-main
@@ -44,8 +44,8 @@
(defun on-page1 (body)
(create-div body :content
- (format nil "You are in on-page1 and got here using ~A"
- (path-name (location body)))))
+ (format nil "You are in on-page1 and got here using ~A"
+ (path-name (location body)))))
(defun on-page2 (body)
(create-div body :content "You are in on-page2")
@@ -53,24 +53,24 @@
(defun on-tutorial11 (body)
(let* ((form (attach-as-child body "form1" :clog-type 'clog-form))
- (good-button (attach-as-child body "button1id"))
- (scary-button (attach-as-child body "button2id")))
+ (good-button (attach-as-child body "button1id"))
+ (scary-button (attach-as-child body "button2id")))
(flet ((on-click-good (obj)
- (declare (ignore obj))
- (let ((alert-div (create-div body)))
- (place-before form alert-div)
- (setf (hiddenp form) t)
- ;; Bootstrap specific markup
- (setf (css-class-name alert-div) "alert alert-success")
- (setf (attribute alert-div "role") "alert")
- (setf (inner-html alert-div)
- (format nil "
radios value : ~A
+ (declare (ignore obj))
+ (let ((alert-div (create-div body)))
+ (place-before form alert-div)
+ (setf (hiddenp form) t)
+ ;; Bootstrap specific markup
+ (setf (css-class-name alert-div) "alert alert-success")
+ (setf (attribute alert-div "role") "alert")
+ (setf (inner-html alert-div)
+ (format nil "
radios value : ~A
textinput value : ~A "
- (radio-value form "radios")
- (name-value form "textinput")))))
- (on-click-scary (obj)
- (declare (ignore obj))
- (reset form)))
+ (radio-value form "radios")
+ (name-value form "textinput")))))
+ (on-click-scary (obj)
+ (declare (ignore obj))
+ (reset form)))
;; We need to override the boostrap default to submit the form html style
(set-on-submit form (lambda (obj)(declare (ignore obj))()))
(set-on-click good-button #'on-click-good)
@@ -78,10 +78,10 @@
(defun on-default (body)
(cond ((equalp (path-name (location body))
- "/tutorial/tut-11.html")
- (on-tutorial11 body))
- (t
- (create-div body :content "No dice! What do I do with you?"))))
+ "/tutorial/tut-11.html")
+ (on-tutorial11 body))
+ (t
+ (create-div body :content "No dice! What do I do with you?"))))
(defun add-search-optimizations (path content)
;; The default boot.html that comes with CLOG has template
@@ -92,8 +92,8 @@
;; aware of these type of dynamic sites.
(if (equal path "/")
(funcall (cl-template:compile-template content)
- (list :meta "
"
- :body "Tutorial 12 for CLOG"))
+ (list :meta "
"
+ :body "Tutorial 12 for CLOG"))
content))
(defun start-tutorial ()
@@ -103,9 +103,9 @@
;; for search engine optimization. We choose long-polling-first so
;; our website can be crawled for content by google
(initialize 'on-main
- :long-poll-first t
- :boot-function 'add-search-optimizations
- :extended-routing t)
+ :long-poll-first t
+ :boot-function 'add-search-optimizations
+ :extended-routing t)
;; Navigating to http://127.0.0.1:8080/page1 executes on-page1
;; Since extended-routing is t /page1/any/thing/else also routes to /page1
(set-on-new-window 'on-page1 :path "/page1")
@@ -124,7 +124,7 @@
;; from tutorial 11 and make it the boot-file and execute the same code
;; in (on-tutorial11) as in tutorial 11.
(set-on-new-window 'on-tutorial11 :path "/page3"
- :boot-file "/tutorial/tut-11.html")
+ :boot-file "/tutorial/tut-11.html")
;; Setting a "default" path says that any use of an included boot.js
;; file by static html file will route to this function, in this case on-default
;; which will determine if this is coming from the path used in tutorial
diff --git a/tutorial/13-tutorial.lisp b/tutorial/13-tutorial.lisp
index 07d6226..d25920e 100644
--- a/tutorial/13-tutorial.lisp
+++ b/tutorial/13-tutorial.lisp
@@ -11,5 +11,5 @@
to your ~~/common-lisp directory or other asdf / quicklisp~%~
directory. Then follow the directions in the 13-tutorial/README.md ~%~
directory."
- (merge-pathnames "./tutorial/13-tutorial/hello-clog/"
- (asdf:system-source-directory :clog))))
+ (merge-pathnames "./tutorial/13-tutorial/hello-clog/"
+ (asdf:system-source-directory :clog))))
diff --git a/tutorial/13-tutorial/hello-clog/hello-clog.asd b/tutorial/13-tutorial/hello-clog/hello-clog.asd
index a61a218..a850717 100644
--- a/tutorial/13-tutorial/hello-clog/hello-clog.asd
+++ b/tutorial/13-tutorial/hello-clog/hello-clog.asd
@@ -9,4 +9,3 @@
:serial t
:depends-on (#:clog)
:components ((:file "hello-clog")))
-
diff --git a/tutorial/13-tutorial/hello-clog/hello-clog.lisp b/tutorial/13-tutorial/hello-clog/hello-clog.lisp
index c58adcf..2d1d272 100644
--- a/tutorial/13-tutorial/hello-clog/hello-clog.lisp
+++ b/tutorial/13-tutorial/hello-clog/hello-clog.lisp
@@ -9,6 +9,6 @@
(defun start-app ()
(initialize 'on-new-window
- :static-root (merge-pathnames "./www/"
- (asdf:system-source-directory :hello-clog)))
+ :static-root (merge-pathnames "./www/"
+ (asdf:system-source-directory :hello-clog)))
(open-browser))
diff --git a/tutorial/14-tutorial.lisp b/tutorial/14-tutorial.lisp
index 34b04ed..72f00a5 100644
--- a/tutorial/14-tutorial.lisp
+++ b/tutorial/14-tutorial.lisp
@@ -9,29 +9,29 @@
(defun on-new-window (body)
(setf (title (html-document body)) "Tutorial 14")
(set-on-click (create-button body :content "Set Local Key")
- (lambda (obj)
- (declare (ignore obj))
- (setf (storage-element (window body) :local "my-local-key")
- (get-universal-time))
- (reload (location body))))
+ (lambda (obj)
+ (declare (ignore obj))
+ (setf (storage-element (window body) :local "my-local-key")
+ (get-universal-time))
+ (reload (location body))))
(set-on-click (create-button body :content "Set Session Key")
- (lambda (obj)
- (declare (ignore obj))
- (setf (storage-element (window body) :session "my-session-key")
- (get-universal-time))
- (reload (location body))))
+ (lambda (obj)
+ (declare (ignore obj))
+ (setf (storage-element (window body) :session "my-session-key")
+ (get-universal-time))
+ (reload (location body))))
(set-on-storage (window body)
- (lambda (obj data)
- (declare (ignore obj))
- (create-div body :content
- (format nil "
~A : ~A => ~A
"
- (getf data ':key)
- (getf data ':old-value)
- (getf data ':value)))))
+ (lambda (obj data)
+ (declare (ignore obj))
+ (create-div body :content
+ (format nil "
~A : ~A => ~A
"
+ (getf data ':key)
+ (getf data ':old-value)
+ (getf data ':value)))))
(create-div body :content (format nil
"
Local Storage vs Session Storage
-The value of local storage persists in the browser cache even after the browser
+The value of local storage persists in the browser cache even after the browser
is closed. If you reset this page the session storage key will remain the same,
but opening this page in another window or tab will be a new session. If the
new window came from a click from this window, the session keys (on some
diff --git a/tutorial/15-tutorial.lisp b/tutorial/15-tutorial.lisp
index 5f9a60f..aed0a6a 100644
--- a/tutorial/15-tutorial.lisp
+++ b/tutorial/15-tutorial.lisp
@@ -7,17 +7,17 @@
;;; Brief demonstration of multimedia
(defun on-new-window (body)
(let* ((vid (create-video body :source "https://www.w3schools.com/html/mov_bbb.mp4"))
- (tmp (create-br body))
- (vpl (create-button body :content ">"))
- (vst (create-button body :content "||"))
- (vlc (create-form-element body :input))
- (tmp (create-hr body))
- (aud (create-audio body :source "https://www.w3schools.com/html/horse.ogg"))
- (tmp (create-br body))
- (apl (create-button body :content ">"))
- (ast (create-button body :content "||"))
- (alc (create-form-element body :input))
- (tmp (create-hr body)))
+ (tmp (create-br body))
+ (vpl (create-button body :content ">"))
+ (vst (create-button body :content "||"))
+ (vlc (create-form-element body :input))
+ (tmp (create-hr body))
+ (aud (create-audio body :source "https://www.w3schools.com/html/horse.ogg"))
+ (tmp (create-br body))
+ (apl (create-button body :content ">"))
+ (ast (create-button body :content "||"))
+ (alc (create-form-element body :input))
+ (tmp (create-hr body)))
(declare (ignore tmp))
(set-on-click vpl (lambda (obj)(declare (ignore obj))(play-media vid)))
(set-on-click apl (lambda (obj)(declare (ignore obj))(play-media aud)))
diff --git a/tutorial/16-tutorial.lisp b/tutorial/16-tutorial.lisp
index d90916d..1dcb52a 100644
--- a/tutorial/16-tutorial.lisp
+++ b/tutorial/16-tutorial.lisp
@@ -16,41 +16,41 @@
;; Root page setup
(setf (title (html-document body)) "Hello Boostrap")
(let* ((nav (create-section body :nav :class "nav"))
- ;; Nav Bar
- (l1 (create-a nav :content "link1" :class "nav-link"))
- (l2 (create-a nav :content "link2" :class "nav-link"))
- (l3 (create-a nav :content "link3" :class "nav-link"))
- (l4 (create-a nav :content "link3" :class "nav-link" :link "/page2"))
- ;; Jumbotron message
- (jumbo (create-div body :class "jumbotron text-center"))
- (jname (create-section jumbo :h1 :content "My First Bootstrap Page"))
- (tmp (create-p jumbo :content "Resize this responsive page to see the effect!"))
- ;; Container for three columns of text
- (container (create-div body :class "container"))
- (row (create-div container :class "row"))
- ;; Column 1
- (col1 (create-div row :class "col-sm-4"))
- (tmp (create-section col1 :h3 :content "Column 1"))
- (tmp (create-p col1 :content "Lorem ipsum dolor.."))
- ;; Column 2
- (col2 (create-div row :class "col-sm-4"))
- (tmp (create-section col2 :h3 :content "Column 2"))
- (tmp (create-p col2 :content "Lorem ipsum dolor.."))
- ;; Column 3
- (col3 (create-div row :class "col-sm-4"))
- (tmp (create-section col3 :h3 :content "Column 3"))
- (tmp (create-p col3 :content "Lorem ipsum dolor..")))
+ ;; Nav Bar
+ (l1 (create-a nav :content "link1" :class "nav-link"))
+ (l2 (create-a nav :content "link2" :class "nav-link"))
+ (l3 (create-a nav :content "link3" :class "nav-link"))
+ (l4 (create-a nav :content "link3" :class "nav-link" :link "/page2"))
+ ;; Jumbotron message
+ (jumbo (create-div body :class "jumbotron text-center"))
+ (jname (create-section jumbo :h1 :content "My First Bootstrap Page"))
+ (tmp (create-p jumbo :content "Resize this responsive page to see the effect!"))
+ ;; Container for three columns of text
+ (container (create-div body :class "container"))
+ (row (create-div container :class "row"))
+ ;; Column 1
+ (col1 (create-div row :class "col-sm-4"))
+ (tmp (create-section col1 :h3 :content "Column 1"))
+ (tmp (create-p col1 :content "Lorem ipsum dolor.."))
+ ;; Column 2
+ (col2 (create-div row :class "col-sm-4"))
+ (tmp (create-section col2 :h3 :content "Column 2"))
+ (tmp (create-p col2 :content "Lorem ipsum dolor.."))
+ ;; Column 3
+ (col3 (create-div row :class "col-sm-4"))
+ (tmp (create-section col3 :h3 :content "Column 3"))
+ (tmp (create-p col3 :content "Lorem ipsum dolor..")))
(declare (ignore tmp) (ignore l4))
- (set-on-click l1 (lambda (obj)(declare (ignore obj))(alert (window body) "Clicked link1")))
+ (set-on-click l1 (lambda (obj)(declare (ignore obj))(alert (window body) "Clicked link1")))
(set-on-click l2 (lambda (obj)
- (declare (ignore obj))
- (let* ((alert (create-div body :class "alert alert-warning alert-dismissible fade show"))
- (tmp (create-phrase alert :strong :content "Wow! You clicked link 2"))
- (btn (create-button alert :class "close" :content "× ")))
- (declare (ignore tmp))
- (setf (attribute alert "role") "alert")
- (setf (attribute btn "data-dismiss") "alert")
- (place-after nav alert))))
+ (declare (ignore obj))
+ (let* ((alert (create-div body :class "alert alert-warning alert-dismissible fade show"))
+ (tmp (create-phrase alert :strong :content "Wow! You clicked link 2"))
+ (btn (create-button alert :class "close" :content "× ")))
+ (declare (ignore tmp))
+ (setf (attribute alert "role") "alert")
+ (setf (attribute btn "data-dismiss") "alert")
+ (place-after nav alert))))
(set-on-click l3 (lambda (obj)(declare (ignore obj))(setf (color jname) (rgb 128 128 0))))))
(defun on-page2 (body)
@@ -61,14 +61,14 @@
;; Setup page2
(setf (title (html-document body)) "Hello Boostrap - page2")
(let* ((nav (create-section body :nav :class "nav"))
- ;; Nav Bar
- (l1 (create-a nav :content "link1" :class "nav-link"))
- (l2 (create-a nav :content "link2" :class "nav-link"))
- (l3 (create-a nav :content "link3" :class "nav-link"))
- (l4 (create-a nav :content "page1" :class "nav-link" :link "/"))
- ;; Jumbotron
- (jumbo (create-div body :class "jumbotron text-center"))
- (jname (create-section jumbo :h1 :content "You found Page2")))
+ ;; Nav Bar
+ (l1 (create-a nav :content "link1" :class "nav-link"))
+ (l2 (create-a nav :content "link2" :class "nav-link"))
+ (l3 (create-a nav :content "link3" :class "nav-link"))
+ (l4 (create-a nav :content "page1" :class "nav-link" :link "/"))
+ ;; Jumbotron
+ (jumbo (create-div body :class "jumbotron text-center"))
+ (jname (create-section jumbo :h1 :content "You found Page2")))
(declare (ignore l1) (ignore l2) (ignore l3) (ignore l4) (ignore jname))))
(defun start-tutorial ()
diff --git a/tutorial/17-tutorial.lisp b/tutorial/17-tutorial.lisp
index 28d0a7c..e37c772 100644
--- a/tutorial/17-tutorial.lisp
+++ b/tutorial/17-tutorial.lisp
@@ -15,93 +15,93 @@
;; Setup page
(setf (title (html-document body)) "Hello W3.CSS")
(let* ((header (create-section body :header :class "w3-container w3-card w3-theme"))
- (tmp (create-section header :h1 :content "Explore Forms"))
- ;; Main area of page
- (data-area (create-div body :class "w3-container"))
- (tmp (create-hr data-area))
- ;; This is a traditional "post" form that will submit data
- ;; to a server.
- (fcontainer (create-div data-area :class "w3-container"))
- (tmp (create-section fcontainer :h2 :content "Post Form"))
- (tmp (create-br fcontainer))
- (form1 (create-form fcontainer :method :post :action "/page2"))
- (finput (create-form-element form1 :input :name "yourname" :label
- (create-label form1 :content "Enter name:")))
- (fsubmit (create-form-element form1 :submit))
- (tmp (create-br fcontainer))
- (tmp (create-hr data-area))
- ;; This is a traditional "get" form that will submit data
- ;; to a server.
- (fcontainer (create-div data-area :class "w3-container"))
- (tmp (create-section fcontainer :h2 :content "Get Form"))
- (tmp (create-br fcontainer))
- (form2 (create-form fcontainer :method :get :action "/page3"))
- (finput (create-form-element form2 :input :name "yourname" :label
- (create-label form2 :content "Enter name:")))
- (fsubmit (create-form-element form2 :submit))
- (tmp (create-br fcontainer))
- (tmp (create-hr data-area))
- ;; This is a file upload form that will submit data and files
- ;; to a server.
- (fcontainer (create-div data-area :class "w3-container"))
- (tmp (create-section fcontainer :h2 :content "File Upload Form"))
- (tmp (create-br fcontainer))
- (form4 (create-form fcontainer :method :post
- :encoding "multipart/form-data"
- :action "/page4"))
- (finput (create-form-element form4 :file :name "filename"))
- (fsubmit (create-form-element form4 :submit))
- (tmp (create-br fcontainer))
- (tmp (create-hr data-area))
- ;; This is a CLOG style form, instead of submitting data
- ;; to another page it is dealt with in place.
- (fcontainer (create-div data-area :class "w3-container"))
- (tmp (create-section fcontainer :h2 :content "CLOG Style Form"))
- (tmp (create-br fcontainer))
- (form3 (create-form fcontainer))
- (finput3 (create-form-element form3 :input :name "yourname3" :label
- (create-label form3 :content "Enter name:")))
- (fsubmit3 (create-form-element form3 :submit))
- (tmp (create-br fcontainer))
- (tmp (create-hr data-area))
- (footer (create-section body :footer :class "w3-container w3-theme"))
- (tmp (create-section footer :p :content "(c) All's well that ends well")))
+ (tmp (create-section header :h1 :content "Explore Forms"))
+ ;; Main area of page
+ (data-area (create-div body :class "w3-container"))
+ (tmp (create-hr data-area))
+ ;; This is a traditional "post" form that will submit data
+ ;; to a server.
+ (fcontainer (create-div data-area :class "w3-container"))
+ (tmp (create-section fcontainer :h2 :content "Post Form"))
+ (tmp (create-br fcontainer))
+ (form1 (create-form fcontainer :method :post :action "/page2"))
+ (finput (create-form-element form1 :input :name "yourname" :label
+ (create-label form1 :content "Enter name:")))
+ (fsubmit (create-form-element form1 :submit))
+ (tmp (create-br fcontainer))
+ (tmp (create-hr data-area))
+ ;; This is a traditional "get" form that will submit data
+ ;; to a server.
+ (fcontainer (create-div data-area :class "w3-container"))
+ (tmp (create-section fcontainer :h2 :content "Get Form"))
+ (tmp (create-br fcontainer))
+ (form2 (create-form fcontainer :method :get :action "/page3"))
+ (finput (create-form-element form2 :input :name "yourname" :label
+ (create-label form2 :content "Enter name:")))
+ (fsubmit (create-form-element form2 :submit))
+ (tmp (create-br fcontainer))
+ (tmp (create-hr data-area))
+ ;; This is a file upload form that will submit data and files
+ ;; to a server.
+ (fcontainer (create-div data-area :class "w3-container"))
+ (tmp (create-section fcontainer :h2 :content "File Upload Form"))
+ (tmp (create-br fcontainer))
+ (form4 (create-form fcontainer :method :post
+ :encoding "multipart/form-data"
+ :action "/page4"))
+ (finput (create-form-element form4 :file :name "filename"))
+ (fsubmit (create-form-element form4 :submit))
+ (tmp (create-br fcontainer))
+ (tmp (create-hr data-area))
+ ;; This is a CLOG style form, instead of submitting data
+ ;; to another page it is dealt with in place.
+ (fcontainer (create-div data-area :class "w3-container"))
+ (tmp (create-section fcontainer :h2 :content "CLOG Style Form"))
+ (tmp (create-br fcontainer))
+ (form3 (create-form fcontainer))
+ (finput3 (create-form-element form3 :input :name "yourname3" :label
+ (create-label form3 :content "Enter name:")))
+ (fsubmit3 (create-form-element form3 :submit))
+ (tmp (create-br fcontainer))
+ (tmp (create-hr data-area))
+ (footer (create-section body :footer :class "w3-container w3-theme"))
+ (tmp (create-section footer :p :content "(c) All's well that ends well")))
(declare (ignore tmp) (ignore finput) (ignore fsubmit))
(set-on-click fsubmit3
(lambda (obj)
- (declare (ignore obj))
- (setf (hiddenp data-area) t)
- (place-before footer
- (create-div body
- :content (format nil "yourname3 = using NAME-VALUE ~A or VALUE ~A"
- (name-value form3 "yourname3")
- (value finput3))))))))
+ (declare (ignore obj))
+ (setf (hiddenp data-area) t)
+ (place-before footer
+ (create-div body
+ :content (format nil "yourname3 = using NAME-VALUE ~A or VALUE ~A"
+ (name-value form3 "yourname3")
+ (value finput3))))))))
(defun on-page2 (body)
(let ((params (form-post-data body)))
(create-div body :content params)
(create-div body :content (format nil "yourname = ~A"
- (form-data-item params "yourname")))))
+ (form-data-item params "yourname")))))
(defun on-page3 (body)
(let ((params (form-get-data body)))
(create-div body :content params)
(create-div body :content (format nil "yourname = ~A"
- (form-data-item params "yourname")))))
+ (form-data-item params "yourname")))))
(defun on-page4 (body)
(let ((params (form-multipart-data body)))
(create-div body :content params)
(destructuring-bind (stream fname content-type)
- (form-data-item params "filename")
+ (form-data-item params "filename")
(create-div body :content (format nil "filename = ~A - (contents printed in REPL)" fname))
(let ((s (flexi-streams:make-flexi-stream stream :external-format :utf-8))
- (b (make-string 1000)))
- (loop
- (let ((c (read-sequence b s)))
- (unless (plusp c) (return))
- (princ (subseq b 1 c))))))
+ (b (make-string 1000)))
+ (loop
+ (let ((c (read-sequence b s)))
+ (unless (plusp c) (return))
+ (princ (subseq b 1 c))))))
(delete-multipart-data body)))
(defun start-tutorial ()
diff --git a/tutorial/18-tutorial.lisp b/tutorial/18-tutorial.lisp
index 7f9f721..15b871f 100644
--- a/tutorial/18-tutorial.lisp
+++ b/tutorial/18-tutorial.lisp
@@ -7,10 +7,10 @@
;; Demonstrate drag and drop
(defun on-new-window (body)
(let* ((target1 (create-div body))
- (target2 (create-div body))
- (object (create-div target1))
- (msg (create-div body
- :content "Drag green box to other yellow box")))
+ (target2 (create-div body))
+ (object (create-div target1))
+ (msg (create-div body
+ :content "Drag green box to other yellow box")))
;; Instructions
(setf (positioning msg) :fixed)
(setf (top msg) "125px")
@@ -45,14 +45,14 @@
(set-on-drag-over target1 (lambda (obj)(declare (ignore obj))()))
;; 5 the target on-drop event is set
(set-on-drop target1 (lambda (obj data)
- (declare (ignore obj) (ignore data))
- (place-inside-bottom-of target1 object)))
+ (declare (ignore obj) (ignore data))
+ (place-inside-bottom-of target1 object)))
;; Set up other box 1 also as target for returning drag box
(set-on-drag-over target2 (lambda (obj)(declare (ignore obj))()))
(set-on-drop target2 (lambda (obj data)
- (declare (ignore obj))
- (print (getf data :drag-data))
- (place-inside-bottom-of target2 object)))))
+ (declare (ignore obj))
+ (print (getf data :drag-data))
+ (place-inside-bottom-of target2 object)))))
(defun start-tutorial ()
"Start tutorial."
diff --git a/tutorial/19-tutorial.lisp b/tutorial/19-tutorial.lisp
index e0b3837..93dc852 100644
--- a/tutorial/19-tutorial.lisp
+++ b/tutorial/19-tutorial.lisp
@@ -12,19 +12,19 @@
(defun on-new-window (body)
;; First we need to load jslists' JavaScript file and css
(load-css (html-document body) "/tutorial/jslists/jsLists.css")
- (load-script (html-document body) "/tutorial/jslists/jsLists.js")
+ (load-script (html-document body) "/tutorial/jslists/jsLists.js")
;; Second we need to build an example list. jsLists uses an ordered
;; or unordered list for its data.
(let* ((list-top (create-unordered-list body))
- (item (create-list-item list-top :content "Top of tree"))
- (list-b (create-unordered-list item))
- (item (create-list-item list-b :content "Item 1"))
- (item (create-list-item list-b :content "Item 2"))
- (item (create-list-item list-b :content "Item 3"))
- (item (create-list-item list-b :content "Item 4")))
+ (item (create-list-item list-top :content "Top of tree"))
+ (list-b (create-unordered-list item))
+ (item (create-list-item list-b :content "Item 1"))
+ (item (create-list-item list-b :content "Item 2"))
+ (item (create-list-item list-b :content "Item 3"))
+ (item (create-list-item list-b :content "Item 4")))
(declare (ignore item))
(js-execute body (format nil "JSLists.applyToList('~A', 'ALL');"
- (html-id list-top)))))
+ (html-id list-top)))))
(defun start-tutorial ()
"Start tutorial."
diff --git a/tutorial/20-tutorial.lisp b/tutorial/20-tutorial.lisp
index 4415aa3..a2d5890 100644
--- a/tutorial/20-tutorial.lisp
+++ b/tutorial/20-tutorial.lisp
@@ -5,20 +5,20 @@
(defpackage #:clog-toggler
(:use #:cl #:clog)
(:export clog-toggler
- init-toggler
- create-toggler
- activate))
+ init-toggler
+ create-toggler
+ activate))
(in-package :clog-toggler)
;;; Next we will create a function to initialize the environment
;;; for the component.
(defun init-toggler (body &key (path-to-js "/tutorial/jslists/"))
- "Initialize BODY to use clog-toggler components"
+ "Initialize BODY to use clog-toggler components"
(load-css (html-document body)
- (concatenate 'string path-to-js "jsLists.css"))
+ (concatenate 'string path-to-js "jsLists.css"))
(load-script (html-document body)
- (concatenate 'string path-to-js "jsLists.js")))
+ (concatenate 'string path-to-js "jsLists.js")))
;;; Next we will use the clog-unordered-list as the base for our new
;;; class clog-toggler
@@ -29,11 +29,11 @@
(:documentation "Create a toggler."))
(defmethod create-toggler ((obj clog-obj) &key (class nil)
- (html-id nil)
- (auto-place t))
+ (html-id nil)
+ (auto-place t))
(let ((new-obj (create-unordered-list obj :class class
- :html-id html-id
- :auto-place auto-place)))
+ :html-id html-id
+ :auto-place auto-place)))
;; Using change-class we can re-use the parent clog-unordered-lists's
;; create method and its initialization. Otherwise we can use
;; create-child and the needed html.
@@ -45,8 +45,8 @@
(defmethod activate ((obj clog-toggler))
(js-execute obj (format nil "JSLists.applyToList('~A', 'ALL');"
- (html-id obj))))
-
+ (html-id obj))))
+
(defpackage #:clog-tut-20
(:use #:cl #:clog)
(:export start-tutorial))
@@ -59,12 +59,12 @@
;; All create-functions also allow setting the :html-id instead of
;; using a generated id.
(let* ((toggler (clog-toggler:create-toggler body :html-id "myid"))
- (item (create-list-item toggler :content "Top of tree"))
- (list-b (create-unordered-list item))
- (item (create-list-item list-b :content "Item 1"))
- (item (create-list-item list-b :content "Item 2"))
- (item (create-list-item list-b :content "Item 3"))
- (item (create-list-item list-b :content "Item 4")))
+ (item (create-list-item toggler :content "Top of tree"))
+ (list-b (create-unordered-list item))
+ (item (create-list-item list-b :content "Item 1"))
+ (item (create-list-item list-b :content "Item 2"))
+ (item (create-list-item list-b :content "Item 3"))
+ (item (create-list-item list-b :content "Item 4")))
(declare (ignore item))
(clog-toggler:activate toggler)))
diff --git a/tutorial/21-tutorial.lisp b/tutorial/21-tutorial.lisp
index 5acedaa..5f14f7e 100644
--- a/tutorial/21-tutorial.lisp
+++ b/tutorial/21-tutorial.lisp
@@ -5,8 +5,8 @@
(defpackage #:clog-drop-list
(:use #:cl #:clog)
(:export clog-drop-list
- create-drop-list
- drop-root))
+ create-drop-list
+ drop-root))
(in-package :clog-drop-list)
@@ -25,22 +25,22 @@ on the drop-root."))
(:documentation "Create a drop-list with CONTENT as the top of tree."))
(defmethod create-drop-list ((obj clog-obj) &key (content "")
- (class nil)
- (html-id nil)
- (auto-place t))
+ (class nil)
+ (html-id nil)
+ (auto-place t))
(let* ((new-obj (create-unordered-list obj :class class
- :html-id html-id
- :auto-place auto-place))
- (header (create-list-item new-obj :content content)))
+ :html-id html-id
+ :auto-place auto-place))
+ (header (create-list-item new-obj :content content)))
(change-class new-obj 'clog-drop-list)
(setf (drop-root new-obj) (create-unordered-list header))
(set-on-mouse-down header
- (lambda (obj data)
- (declare (ignore obj data))
- (if (hiddenp (drop-root new-obj))
- (setf (hiddenp (drop-root new-obj)) nil)
- (setf (hiddenp (drop-root new-obj)) t)))
- :cancel-event t) ; prevent event bubble up tree
+ (lambda (obj data)
+ (declare (ignore obj data))
+ (if (hiddenp (drop-root new-obj))
+ (setf (hiddenp (drop-root new-obj)) nil)
+ (setf (hiddenp (drop-root new-obj)) t)))
+ :cancel-event t) ; prevent event bubble up tree
new-obj))
(defpackage #:clog-tut-21
@@ -51,19 +51,19 @@ on the drop-root."))
(defun on-new-window (body)
(let* ((drop-list (clog-drop-list:create-drop-list body :content "Top of tree"))
- (item (create-list-item (clog-drop-list:drop-root drop-list) :content "Item 1"))
- (item (create-list-item (clog-drop-list:drop-root drop-list) :content "Item 2"))
- (item (create-list-item (clog-drop-list:drop-root drop-list) :content "Item 3"))
- (item (create-list-item (clog-drop-list:drop-root drop-list) :content "Item 4"))
- (drop-list2 (clog-drop-list:create-drop-list item :content "Another Drop"))
- (item (create-list-item (clog-drop-list:drop-root drop-list2) :content "Item 1"))
- (item (create-list-item (clog-drop-list:drop-root drop-list2) :content "Item 2"))
- (drop-list3 (clog-drop-list:create-drop-list item :content "Hidden Drop"))
- (item (create-list-item (clog-drop-list:drop-root drop-list3) :content "Item 1"))
- (item (create-list-item (clog-drop-list:drop-root drop-list3) :content "Item 2"))
- (drop-list4 (clog-drop-list:create-drop-list drop-list :content "One more Drop"))
- (item (create-list-item (clog-drop-list:drop-root drop-list4) :content "Item 1"))
- (item (create-list-item (clog-drop-list:drop-root drop-list4) :content "Item 2")))
+ (item (create-list-item (clog-drop-list:drop-root drop-list) :content "Item 1"))
+ (item (create-list-item (clog-drop-list:drop-root drop-list) :content "Item 2"))
+ (item (create-list-item (clog-drop-list:drop-root drop-list) :content "Item 3"))
+ (item (create-list-item (clog-drop-list:drop-root drop-list) :content "Item 4"))
+ (drop-list2 (clog-drop-list:create-drop-list item :content "Another Drop"))
+ (item (create-list-item (clog-drop-list:drop-root drop-list2) :content "Item 1"))
+ (item (create-list-item (clog-drop-list:drop-root drop-list2) :content "Item 2"))
+ (drop-list3 (clog-drop-list:create-drop-list item :content "Hidden Drop"))
+ (item (create-list-item (clog-drop-list:drop-root drop-list3) :content "Item 1"))
+ (item (create-list-item (clog-drop-list:drop-root drop-list3) :content "Item 2"))
+ (drop-list4 (clog-drop-list:create-drop-list drop-list :content "One more Drop"))
+ (item (create-list-item (clog-drop-list:drop-root drop-list4) :content "Item 1"))
+ (item (create-list-item (clog-drop-list:drop-root drop-list4) :content "Item 2")))
(declare (ignore item))
(setf (hiddenp (clog-drop-list:drop-root drop-list3)) t)))
diff --git a/tutorial/22-tutorial.lisp b/tutorial/22-tutorial.lisp
index 2ed8137..92a1a69 100644
--- a/tutorial/22-tutorial.lisp
+++ b/tutorial/22-tutorial.lisp
@@ -15,12 +15,12 @@
(defun on-file-browse (obj)
(let ((win (create-gui-window obj :title "Browse")))
(create-child (window-content win)
- "")))
+ "")))
(defun on-file-drawing (obj)
(let* ((win (create-gui-window obj :title "Drawing"))
- (canvas (create-canvas (window-content win) :width 600 :height 400))
- (cx (create-context2d canvas)))
+ (canvas (create-canvas (window-content win) :width 600 :height 400))
+ (cx (create-context2d canvas)))
(set-border canvas :thin :solid :black)
(fill-style cx :green)
(fill-rect cx 10 10 150 100)
@@ -35,18 +35,18 @@
(defun on-file-movies (obj)
(let* ((win (create-gui-window obj :title "Movie"))
- (movie (create-video (window-content win)
- :source "https://www.w3schools.com/html/mov_bbb.mp4")))
+ (movie (create-video (window-content win)
+ :source "https://www.w3schools.com/html/mov_bbb.mp4")))
(set-geometry movie :units "%" :width 100 :height 100)))
(defun on-file-pinned (obj)
(let ((win (create-gui-window obj :title "Pin me!"
- :has-pinner t
- :keep-on-top t
- :top 200
- :left 0
- :width 200
- :height 200)))
+ :has-pinner t
+ :keep-on-top t
+ :top 200
+ :left 0
+ :width 200
+ :height 200)))
(create-div win :content "I can be pinned. Just click the pin on window bar.")))
(defun on-dlg-alert (obj)
@@ -54,69 +54,69 @@
(defun on-dlg-confirm (obj)
(confirm-dialog obj "Shall we play a game?"
- (lambda (input)
- (if input
- (alert-dialog obj "How about Global Thermonuclear War.")
- (alert-dialog obj "You are no fun!")))
- :ok-text "Yes" :cancel-text "No"))
+ (lambda (input)
+ (if input
+ (alert-dialog obj "How about Global Thermonuclear War.")
+ (alert-dialog obj "You are no fun!")))
+ :ok-text "Yes" :cancel-text "No"))
(defun on-dlg-input (obj)
(input-dialog obj "Would you like to play a game?"
- (lambda (input)
- (alert-dialog obj input))))
+ (lambda (input)
+ (alert-dialog obj input))))
(defun on-dlg-file (obj)
(server-file-dialog obj "Server files" "./" (lambda (fname)
- (alert-dialog obj fname))))
+ (alert-dialog obj fname))))
(defun on-dlg-form (obj)
(form-dialog obj "Please enter your information."
- '(("Title" "title" :select (("Mr." "mr")
- ("Mrs." "mrs" :selected)
- ("Ms." "ms")
- ("Other" "other")))
- ("Eye Color" "color" :radio (("Blue" "blue")
- ("Brown" "brown")
- ("Green" "green" :checked)
- ("Other" "other")))
- ("Send Mail" "send-mail" :checkbox t)
- ("Name" "name" :text "Real Name")
- ("Address" "address")
- ("City" "city")
- ("State" "st")
- ("Zip" "zip")
- ("E-Mail" "email" :email))
- (lambda (results)
- (alert-dialog obj results))
- :height 550))
+ '(("Title" "title" :select (("Mr." "mr")
+ ("Mrs." "mrs" :selected)
+ ("Ms." "ms")
+ ("Other" "other")))
+ ("Eye Color" "color" :radio (("Blue" "blue")
+ ("Brown" "brown")
+ ("Green" "green" :checked)
+ ("Other" "other")))
+ ("Send Mail" "send-mail" :checkbox t)
+ ("Name" "name" :text "Real Name")
+ ("Address" "address")
+ ("City" "city")
+ ("State" "st")
+ ("Zip" "zip")
+ ("E-Mail" "email" :email))
+ (lambda (results)
+ (alert-dialog obj results))
+ :height 550))
(defun on-toast-alert (obj)
(alert-toast obj "Stop!" "To get rid of me, click the X. I have no time-out"))
(defun on-toast-warn (obj)
(alert-toast obj "Warning!" "To get rid of me, click the X. I time-out in 5 seconds"
- :color-class "w3-yellow" :time-out 5))
+ :color-class "w3-yellow" :time-out 5))
(defun on-toast-success (obj)
(alert-toast obj "Success!" "To get rid of me, click the X. I time-out in 2 seconds"
- :color-class "w3-green" :time-out 2))
+ :color-class "w3-green" :time-out 2))
(defun on-help-about (obj)
(let* ((about (create-gui-window obj
- :title "About"
- :content "
+ :title "About"
+ :content "
-
CLOG
-
The Common Lisp Omnificent GUI
-
Tutorial 22
+
CLOG
+
The Common Lisp Omnificent GUI
+
Tutorial 22
(c) 2021 - David Botton "
- :hidden t
- :width 200
- :height 215)))
+ :hidden t
+ :width 200
+ :height 215)))
(window-center about)
(setf (visiblep about) t)
(set-on-window-can-size about (lambda (obj)
- (declare (ignore obj))()))))
+ (declare (ignore obj))()))))
(defun on-new-window (body)
(setf (title (html-document body)) "Tutorial 22")
@@ -125,63 +125,63 @@
(clog-gui-initialize body)
(add-class body "w3-cyan")
(let* ((menu (create-gui-menu-bar body))
- (tmp (create-gui-menu-icon menu :on-click 'on-help-about))
- (file (create-gui-menu-drop-down menu :content "File"))
- (tmp (create-gui-menu-item file :content "Count" :on-click 'on-file-count))
- (tmp (create-gui-menu-item file :content "Browse" :on-click 'on-file-browse))
- (tmp (create-gui-menu-item file :content "Drawing" :on-click 'on-file-drawing))
- (tmp (create-gui-menu-item file :content "Movie" :on-click 'on-file-movies))
- (tmp (create-gui-menu-item file :content "Pinned" :on-click 'on-file-pinned))
- (win (create-gui-menu-drop-down menu :content "Window"))
- (tmp (create-gui-menu-item win :content "Maximize All" :on-click 'maximize-all-windows))
- (tmp (create-gui-menu-item win :content "Normalize All" :on-click 'normalize-all-windows))
- (tmp (create-gui-menu-window-select win))
- (dlg (create-gui-menu-drop-down menu :content "Dialogs"))
- (tmp (create-gui-menu-item dlg :content "Alert Dialog Box" :on-click 'on-dlg-alert))
- (tmp (create-gui-menu-item dlg :content "Input Dialog Box" :on-click 'on-dlg-input))
- (tmp (create-gui-menu-item dlg :content "Confirm Dialog Box" :on-click 'on-dlg-confirm))
- (tmp (create-gui-menu-item dlg :content "Form Dialog Box" :on-click 'on-dlg-form))
- (tmp (create-gui-menu-item dlg :content "Server File Dialog Box" :on-click 'on-dlg-file))
- (tst (create-gui-menu-drop-down menu :content "Toasts"))
- (tmp (create-gui-menu-item tst :content "Alert Toast" :on-click 'on-toast-alert))
- (tmp (create-gui-menu-item tst :content "Warning Toast" :on-click 'on-toast-warn))
- (tmp (create-gui-menu-item tst :content "Success Toast" :on-click 'on-toast-success))
- (help (create-gui-menu-drop-down menu :content "Help"))
- (tmp (create-gui-menu-item help :content "About" :on-click 'on-help-about))
- (tmp (create-gui-menu-full-screen menu)))
+ (tmp (create-gui-menu-icon menu :on-click 'on-help-about))
+ (file (create-gui-menu-drop-down menu :content "File"))
+ (tmp (create-gui-menu-item file :content "Count" :on-click 'on-file-count))
+ (tmp (create-gui-menu-item file :content "Browse" :on-click 'on-file-browse))
+ (tmp (create-gui-menu-item file :content "Drawing" :on-click 'on-file-drawing))
+ (tmp (create-gui-menu-item file :content "Movie" :on-click 'on-file-movies))
+ (tmp (create-gui-menu-item file :content "Pinned" :on-click 'on-file-pinned))
+ (win (create-gui-menu-drop-down menu :content "Window"))
+ (tmp (create-gui-menu-item win :content "Maximize All" :on-click 'maximize-all-windows))
+ (tmp (create-gui-menu-item win :content "Normalize All" :on-click 'normalize-all-windows))
+ (tmp (create-gui-menu-window-select win))
+ (dlg (create-gui-menu-drop-down menu :content "Dialogs"))
+ (tmp (create-gui-menu-item dlg :content "Alert Dialog Box" :on-click 'on-dlg-alert))
+ (tmp (create-gui-menu-item dlg :content "Input Dialog Box" :on-click 'on-dlg-input))
+ (tmp (create-gui-menu-item dlg :content "Confirm Dialog Box" :on-click 'on-dlg-confirm))
+ (tmp (create-gui-menu-item dlg :content "Form Dialog Box" :on-click 'on-dlg-form))
+ (tmp (create-gui-menu-item dlg :content "Server File Dialog Box" :on-click 'on-dlg-file))
+ (tst (create-gui-menu-drop-down menu :content "Toasts"))
+ (tmp (create-gui-menu-item tst :content "Alert Toast" :on-click 'on-toast-alert))
+ (tmp (create-gui-menu-item tst :content "Warning Toast" :on-click 'on-toast-warn))
+ (tmp (create-gui-menu-item tst :content "Success Toast" :on-click 'on-toast-success))
+ (help (create-gui-menu-drop-down menu :content "Help"))
+ (tmp (create-gui-menu-item help :content "About" :on-click 'on-help-about))
+ (tmp (create-gui-menu-full-screen menu)))
(declare (ignore tmp)))
;; Alternatively with-clog-create can be used to declartively create the menu
;; see tutorial 33
;; (with-clog-create body
;; (gui-menu-bar ()
- ;; (gui-menu-icon (:on-click 'on-help-about))
- ;; (gui-menu-drop-down (:content "File")
- ;; (gui-menu-item (:content "Count" :on-click 'on-file-count))
- ;; (gui-menu-item (:content "Browse" :on-click 'on-file-browse))
- ;; (gui-menu-item (:content "Drawing" :on-click 'on-file-drawing))
- ;; (gui-menu-item (:content "Movie" :on-click 'on-file-movies))
- ;; (gui-menu-item (:content "Pinned" :on-click 'on-file-pinned)))
- ;; (gui-menu-drop-down (:content "Window")
- ;; (gui-menu-item (:content "Maximize All" :on-click 'maximize-all-windows))
- ;; (gui-menu-item (:content "Normalize All" :on-click 'normalize-all-windows))
- ;; (gui-menu-window-select ()))
- ;; (gui-menu-drop-down (:content "Dialogs")
- ;; (gui-menu-item (:content "Alert Dialog Box" :on-click 'on-dlg-alert))
- ;; (gui-menu-item (:content "Input Dialog Box" :on-click 'on-dlg-input))
- ;; (gui-menu-item (:content "Confirm Dialog Box" :on-click 'on-dlg-confirm))
- ;; (gui-menu-item (:content "Form Dialog Box" :on-click 'on-dlg-form))
- ;; (gui-menu-item (:content "Server File Dialog Box" :on-click 'on-dlg-file)))
- ;; (gui-menu-drop-down (:content "Toasts")
- ;; (gui-menu-item (:content "Alert Toast" :on-click 'on-toast-alert))
- ;; (gui-menu-item (:content "Warning Toast" :on-click 'on-toast-warn))
- ;; (gui-menu-item (:content "Success Toast" :on-click 'on-toast-success)))
- ;; (gui-menu-drop-down (:content "Help")
- ;; (gui-menu-item (:content "About" :on-click 'on-help-about)))
- ;; (gui-menu-full-screen ())))
+ ;; (gui-menu-icon (:on-click 'on-help-about))
+ ;; (gui-menu-drop-down (:content "File")
+ ;; (gui-menu-item (:content "Count" :on-click 'on-file-count))
+ ;; (gui-menu-item (:content "Browse" :on-click 'on-file-browse))
+ ;; (gui-menu-item (:content "Drawing" :on-click 'on-file-drawing))
+ ;; (gui-menu-item (:content "Movie" :on-click 'on-file-movies))
+ ;; (gui-menu-item (:content "Pinned" :on-click 'on-file-pinned)))
+ ;; (gui-menu-drop-down (:content "Window")
+ ;; (gui-menu-item (:content "Maximize All" :on-click 'maximize-all-windows))
+ ;; (gui-menu-item (:content "Normalize All" :on-click 'normalize-all-windows))
+ ;; (gui-menu-window-select ()))
+ ;; (gui-menu-drop-down (:content "Dialogs")
+ ;; (gui-menu-item (:content "Alert Dialog Box" :on-click 'on-dlg-alert))
+ ;; (gui-menu-item (:content "Input Dialog Box" :on-click 'on-dlg-input))
+ ;; (gui-menu-item (:content "Confirm Dialog Box" :on-click 'on-dlg-confirm))
+ ;; (gui-menu-item (:content "Form Dialog Box" :on-click 'on-dlg-form))
+ ;; (gui-menu-item (:content "Server File Dialog Box" :on-click 'on-dlg-file)))
+ ;; (gui-menu-drop-down (:content "Toasts")
+ ;; (gui-menu-item (:content "Alert Toast" :on-click 'on-toast-alert))
+ ;; (gui-menu-item (:content "Warning Toast" :on-click 'on-toast-warn))
+ ;; (gui-menu-item (:content "Success Toast" :on-click 'on-toast-success)))
+ ;; (gui-menu-drop-down (:content "Help")
+ ;; (gui-menu-item (:content "About" :on-click 'on-help-about)))
+ ;; (gui-menu-full-screen ())))
(set-on-before-unload (window body) (lambda(obj)
- (declare (ignore obj))
- ;; return empty string to prevent nav off page
- "")))
+ (declare (ignore obj))
+ ;; return empty string to prevent nav off page
+ "")))
(defun start-tutorial ()
"Start turtorial."
diff --git a/tutorial/23-tutorial.lisp b/tutorial/23-tutorial.lisp
index 6d4bddc..b3573b7 100644
--- a/tutorial/23-tutorial.lisp
+++ b/tutorial/23-tutorial.lisp
@@ -9,18 +9,18 @@
;; example show a more practical example.
(defun ask (obj)
(let ((result nil)
- (hold (bordeaux-threads:make-semaphore))
- (q-box (create-div obj)))
+ (hold (bordeaux-threads:make-semaphore))
+ (q-box (create-div obj)))
(set-on-click (create-button q-box :content "Yes")
- (lambda (obj)
- (declare (ignore obj))
- (setf result :yes)
- (bordeaux-threads:signal-semaphore hold)))
+ (lambda (obj)
+ (declare (ignore obj))
+ (setf result :yes)
+ (bordeaux-threads:signal-semaphore hold)))
(set-on-click (create-button q-box :content "No")
- (lambda (obj)
- (declare (ignore obj))
- (setf result :no)
- (bordeaux-threads:signal-semaphore hold)))
+ (lambda (obj)
+ (declare (ignore obj))
+ (setf result :no)
+ (bordeaux-threads:signal-semaphore hold)))
(bordeaux-threads:wait-on-semaphore hold :timeout 10)
(destroy q-box)
result))
@@ -31,23 +31,23 @@
(clog-gui-initialize body)
(setf (title (html-document body)) "Tutorial 23")
(set-on-click (create-button body :content
- "Click for my question. You have 10 seconds to answer.")
- (lambda (obj)
- (setf (disabledp obj) t)
- ;; ask returns once an answer is given or times out
- (create-div body :content (ask body))
- ;; once ask returns with its answer (yes no or nil for timeout)
- ;; the next statment is processed to open a dialog
- (let ((hold (bordeaux-threads:make-semaphore)))
- (confirm-dialog body "Are you sure?"
- (lambda (answer)
- (if answer
- (create-div body :content "Great!")
- (create-div body :content "Next time be sure!"))
- (bordeaux-threads:signal-semaphore hold)))
- (bordeaux-threads:wait-on-semaphore hold :timeout 60)
- (create-div body :content "Thank you for answering!")))
- :one-time t))
+ "Click for my question. You have 10 seconds to answer.")
+ (lambda (obj)
+ (setf (disabledp obj) t)
+ ;; ask returns once an answer is given or times out
+ (create-div body :content (ask body))
+ ;; once ask returns with its answer (yes no or nil for timeout)
+ ;; the next statment is processed to open a dialog
+ (let ((hold (bordeaux-threads:make-semaphore)))
+ (confirm-dialog body "Are you sure?"
+ (lambda (answer)
+ (if answer
+ (create-div body :content "Great!")
+ (create-div body :content "Next time be sure!"))
+ (bordeaux-threads:signal-semaphore hold)))
+ (bordeaux-threads:wait-on-semaphore hold :timeout 60)
+ (create-div body :content "Thank you for answering!")))
+ :one-time t))
(defun start-tutorial ()
"Start turtorial."
diff --git a/tutorial/24-tutorial.lisp b/tutorial/24-tutorial.lisp
index e3590dd..75a1763 100644
--- a/tutorial/24-tutorial.lisp
+++ b/tutorial/24-tutorial.lisp
@@ -11,67 +11,67 @@
(clog-web-initialize body)
(setf (title (html-document body)) "Tutorial 24")
(let ((side (create-web-sidebar body :class "w3-animate-right"
- :hidden t))
- (main (create-web-main body)))
+ :hidden t))
+ (main (create-web-main body)))
;; Setup sidebar:
(setf (right side) (unit :px 0))
(add-card-look side)
(set-on-click (create-web-sidebar-item side :content "Close ×"
- :class "w3-teal")
- (lambda (obj)
- (declare (ignore obj))
- (setf (display side) :none)))
+ :class "w3-teal")
+ (lambda (obj)
+ (declare (ignore obj))
+ (setf (display side) :none)))
(set-on-click (create-web-sidebar-item side :content "Google")
- (lambda (obj)
- (declare (ignore obj))
- (setf (url (location body)) "http://google.com")))
+ (lambda (obj)
+ (declare (ignore obj))
+ (setf (url (location body)) "http://google.com")))
(create-web-sidebar-item side :content "item 2")
(create-web-sidebar-item side :content "item 3")
;; Setup main content:
(let* ((com (create-web-compositor main))
- (img (create-img com :url-src "/img/kiarash-mansouri-fzoSNcxqtp8-unsplash.jpg"))
- (btn (create-button com :content "☰"
- :class "w3-button w3-text-white"))
- (txt (create-div com :content "CLOG - Beyond Web Frameworks!"
- :class "w3-center w3-text-white w3-cursive w3-xlarge"))
- (txp (create-img com :url-src "/img/clogwicon.png"))
- (url (create-div com :content "https://github.com/rabbibotton/clog"
- :hidden t
- :class "w3-text-white w3-large")))
+ (img (create-img com :url-src "/img/kiarash-mansouri-fzoSNcxqtp8-unsplash.jpg"))
+ (btn (create-button com :content "☰"
+ :class "w3-button w3-text-white"))
+ (txt (create-div com :content "CLOG - Beyond Web Frameworks!"
+ :class "w3-center w3-text-white w3-cursive w3-xlarge"))
+ (txp (create-img com :url-src "/img/clogwicon.png"))
+ (url (create-div com :content "https://github.com/rabbibotton/clog"
+ :hidden t
+ :class "w3-text-white w3-large")))
;; composite main image
(setf (box-width img) "100%")
(setf (box-height img) "200")
;; composite top-right button to open sidebar
(composite-top-right btn)
(set-on-click btn
- (lambda (obj)
- (declare (ignore obj))
- (setf (display side) :block)))
+ (lambda (obj)
+ (declare (ignore obj))
+ (setf (display side) :block)))
;; composite middle text
(composite-middle txt)
;; composite clog icon
(composite-position txp :top 20 :left 20)
(set-on-click txp (lambda (obj)
- (declare (ignore obj))
- (setf (url (location body)) "https://github.com/rabbibotton/clog")))
+ (declare (ignore obj))
+ (setf (url (location body)) "https://github.com/rabbibotton/clog")))
(composite-top-middle url :padding-class :padding-32)
(set-on-mouse-enter txp (lambda (obj)
- (declare (ignore obj))
- (setf (visiblep url) t)))
+ (declare (ignore obj))
+ (setf (visiblep url) t)))
(set-on-mouse-leave txp (lambda (obj)
- (declare (ignore obj))
- (setf (visiblep url) nil)))
+ (declare (ignore obj))
+ (setf (visiblep url) nil)))
(composite-bottom-middle (create-div com :content "This is a 'compositor' container"
- :class "w3-text-white")))
+ :class "w3-text-white")))
;; Panels
(create-web-panel main :content "
Note: This is a 'panel' container
"
- :class "w3-yellow")
+ :class "w3-yellow")
(create-section (create-web-content main :class "w3-teal")
- :p :content "This is a 'content' container.
+ :p :content "This is a 'content' container.
The container is centered and set to a maximum-width.")
;; Using containers and the 12 column grid
(create-section (create-web-content main)
- :p :content "Try and adjust size of browser to see reactions.
+ :p :content "Try and adjust size of browser to see reactions.
These are in a row container and each is a third of the 12 column grid")
(let ((row (create-web-row main)))
(create-web-container row :content "Grid Container 1" :column-size :third :class "w3-border")
@@ -79,7 +79,7 @@
(create-web-container row :content "Grid Container 3" :column-size :third :class "w3-border"))
;; As before with padding added between columns and some color
(create-section (create-web-content main)
- :p :content "These are in a row container with padding turned on
+ :p :content "These are in a row container with padding turned on
and each is a third of the 12 column grid")
(let ((row (create-web-row main :padding t)))
(create-web-container row :content "Grid Container 1" :column-size :third :class "w3-border w3-red")
@@ -89,13 +89,13 @@
(create-section (create-web-content main) :p :content "These are in an auto-row container")
(let ((row (create-web-auto-row main)))
(create-web-auto-column row :content "Auto Column 1
Auto Column 1
Auto Column 1"
- :vertical-align :middle :class "w3-border")
+ :vertical-align :middle :class "w3-border")
(create-web-auto-column row :content "Auto Column 2" :vertical-align :top :class "w3-border")
(create-web-auto-column row :content "Auto Column 3" :vertical-align :bottom :class "w3-border"))
;; A "code" block
(create-section (create-web-content main) :p :content "This a code block")
(create-web-code main :content
- ";; This is a code block
+ ";; This is a code block
(defun start-tutorial ()
\"Start turtorial.\"
(initialize 'on-new-window)
diff --git a/tutorial/25-tutorial.lisp b/tutorial/25-tutorial.lisp
index 3255be9..9bb1a62 100644
--- a/tutorial/25-tutorial.lisp
+++ b/tutorial/25-tutorial.lisp
@@ -27,41 +27,41 @@
(setf (title (html-document body)) "Tutorial 25")
;; Setup two sections = command and result
(let ((command-section (create-web-content body))
- (results-section (create-web-content body :class "w3-monospace")))
+ (results-section (create-web-content body :class "w3-monospace")))
;; Setup command section
(let* ((form (create-form command-section))
- (command (create-form-element form :text :class "w3-input w3-border"
- :label (create-label form
- :content "Enter Command: ")))
- (button (create-form-element form :submit)))
+ (command (create-form-element form :text :class "w3-input w3-border"
+ :label (create-label form
+ :content "Enter Command: ")))
+ (button (create-form-element form :submit)))
(declare (ignore button))
(set-on-submit form
- (lambda (obj)
- (declare (ignore obj))
- (handler-case
- (progn
- (setf (inner-html results-section)
- (format nil "~A
~A ~A"
- (inner-html results-section)
- (value command)
- (lf-to-br (uiop/run-program:run-program
- (value command)
- :force-shell t :output :string))))
- (setf (scroll-top results-section)
- (scroll-height results-section)))
- (error (c)
- (clog-web-alert command-section "Error" c :time-out 5)))
- (setf (value command) ""))))
+ (lambda (obj)
+ (declare (ignore obj))
+ (handler-case
+ (progn
+ (setf (inner-html results-section)
+ (format nil "~A
~A ~A"
+ (inner-html results-section)
+ (value command)
+ (lf-to-br (uiop/run-program:run-program
+ (value command)
+ :force-shell t :output :string))))
+ (setf (scroll-top results-section)
+ (scroll-height results-section)))
+ (error (c)
+ (clog-web-alert command-section "Error" c :time-out 5)))
+ (setf (value command) ""))))
(setf (overflow results-section) :scroll)
(set-border results-section :thin :solid :black)
(flet ((set-height ()
- (setf (height results-section) (- (inner-height (window body))
- (height command-section)
- 20))))
+ (setf (height results-section) (- (inner-height (window body))
+ (height command-section)
+ 20))))
(set-height)
(set-on-resize (window body) (lambda (obj)
- (declare (ignore obj))
- (set-height))))))
+ (declare (ignore obj))
+ (set-height))))))
(defun start-tutorial ()
"Start turtorial."
diff --git a/tutorial/26-tutorial.lisp b/tutorial/26-tutorial.lisp
index f611af8..8c30266 100644
--- a/tutorial/26-tutorial.lisp
+++ b/tutorial/26-tutorial.lisp
@@ -19,25 +19,25 @@
(setf (title (html-document body)) "Tutorial 26")
;; Install a menu
(let* ((menu (create-web-menu-bar body))
- (icon (create-web-menu-icon menu :on-click (lambda (obj)
- (declare (ignore obj))
- (setf (hash (location body)) "rung2"))))
- (item1 (create-web-menu-item menu :content "item1"
- :on-click (lambda (obj)
- (declare (ignore obj))
- (setf (hash (location body)) "rung2"))))
- (item2 (create-web-menu-item menu :content "item2"
- :on-click (lambda (obj)
- (declare (ignore obj))
- (setf (hash (location body)) "rung2"))))
- (item3 (create-web-menu-item menu :content "item3"
- :on-click (lambda (obj)
- (declare (ignore obj))
- (setf (hash (location body)) "rung2"))))
- (about (create-web-menu-item menu :content "About"
- :on-click (lambda (obj)
- (declare (ignore obj))
- (setf (hash (location body)) "rung2")))))
+ (icon (create-web-menu-icon menu :on-click (lambda (obj)
+ (declare (ignore obj))
+ (setf (hash (location body)) "rung2"))))
+ (item1 (create-web-menu-item menu :content "item1"
+ :on-click (lambda (obj)
+ (declare (ignore obj))
+ (setf (hash (location body)) "rung2"))))
+ (item2 (create-web-menu-item menu :content "item2"
+ :on-click (lambda (obj)
+ (declare (ignore obj))
+ (setf (hash (location body)) "rung2"))))
+ (item3 (create-web-menu-item menu :content "item3"
+ :on-click (lambda (obj)
+ (declare (ignore obj))
+ (setf (hash (location body)) "rung2"))))
+ (about (create-web-menu-item menu :content "About"
+ :on-click (lambda (obj)
+ (declare (ignore obj))
+ (setf (hash (location body)) "rung2")))))
(declare (ignore icon))
(full-row-on-mobile item1)
(full-row-on-mobile item2)
@@ -45,52 +45,52 @@
(add-class about "w3-right"))
;; rung-1
(let* ((first-rung (create-web-compositor body :html-id "rung1"))
- (image (create-img first-rung :url-src "/img/windmills.jpg"
- :class "w3-sepia"))
- (clog-txt (create-div first-rung :content "CLOG
The omnificient gui
+ (image (create-img first-rung :url-src "/img/windmills.jpg"
+ :class "w3-sepia"))
+ (clog-txt (create-div first-rung :content "CLOG
The omnificient gui
desktop
web
mobile"
- :class "w3-text-white w3-xlarge")))
+ :class "w3-text-white w3-xlarge")))
(setf (cursor clog-txt) :pointer)
(set-on-click clog-txt (lambda (obj)
- (declare (ignore obj))
- (setf (display first-rung) :none)
- (setf (hash (location body)) "rung2")))
+ (declare (ignore obj))
+ (setf (display first-rung) :none)
+ (setf (hash (location body)) "rung2")))
(setf (box-width image) "100%")
(setf (text-shadow clog-txt) "2px 2px black")
(composite-top-left clog-txt :padding-class :padding-64))
;; rung-2
(let* ((second-rung (create-web-auto-row body :html-id "rung2"))
- (image-cell (create-web-auto-column second-rung))
- (image (create-img image-cell :url-src "/img/flower-clogs.jpg"))
- (text-cell (create-web-auto-column second-rung :class "w3-cell-top")))
+ (image-cell (create-web-auto-column second-rung))
+ (image (create-img image-cell :url-src "/img/flower-clogs.jpg"))
+ (text-cell (create-web-auto-column second-rung :class "w3-cell-top")))
(hide-on-small-screens image-cell)
(setf (background-color text-cell) (rgb 199 188 160))
(setf (box-width image-cell) "40%")
(setf (box-width image) "100%")
(clog-web-form text-cell
- "
Find out more about CLOG: "
- '(("CLOG for" :clog-for :select (("Desktop" "desktop" :selected)
- ("Web" "web")
- ("Mobile" "mobile")
- ("iot" "iot")))
- ("Name" :name)
- ("E-mail" :email))
- (lambda (data)
- (if (equal (cadr (assoc :email data)) "")
- (clog-web-alert second-rung "Missing E-Mail"
- "Please fill out E-mail" :time-out 2)
- (progn
- (setf (display second-rung) :none)
- (setf (hash (location body)) "rung3")
- (setf (inner-html (attach-as-child body "rung3-answer"))
- (format nil "
Thank you ~A
Your information will
+ "
Find out more about CLOG: "
+ '(("CLOG for" :clog-for :select (("Desktop" "desktop" :selected)
+ ("Web" "web")
+ ("Mobile" "mobile")
+ ("iot" "iot")))
+ ("Name" :name)
+ ("E-mail" :email))
+ (lambda (data)
+ (if (equal (cadr (assoc :email data)) "")
+ (clog-web-alert second-rung "Missing E-Mail"
+ "Please fill out E-mail" :time-out 2)
+ (progn
+ (setf (display second-rung) :none)
+ (setf (hash (location body)) "rung3")
+ (setf (inner-html (attach-as-child body "rung3-answer"))
+ (format nil "
Thank you ~A
Your information will
NOT be sent shortly.(DEMO)"
- (cadr (assoc :name data)))))))))
+ (cadr (assoc :name data)))))))))
;; rung-3
(let* ((third-rung (create-web-compositor body :html-id "rung3"))
- (image (create-img third-rung :url-src "/img/yellow-clogs.jpg"))
- (txt (create-div third-rung :html-id "rung3-answer"
- :class "w3-text-white w3-xlarge")))
+ (image (create-img third-rung :url-src "/img/yellow-clogs.jpg"))
+ (txt (create-div third-rung :html-id "rung3-answer"
+ :class "w3-text-white w3-xlarge")))
(setf (text-shadow txt) "2px 2px black")
(composite-right txt :padding-class :padding-64)
(setf (box-width image) "100%")))
diff --git a/tutorial/27-tutorial.lisp b/tutorial/27-tutorial.lisp
index 85f9da5..a71d1c3 100644
--- a/tutorial/27-tutorial.lisp
+++ b/tutorial/27-tutorial.lisp
@@ -8,11 +8,11 @@
(defun on-new-window (body)
(let* ((console (create-panel-box-layout body :left-width 200 :right-width 0))
- (head (create-div (top-panel console) :content "Image Viewer"))
- (lbox (create-select (left-panel console)))
- (viewer (create-img (center-panel console)))
- (footer (create-div (bottom-panel console)
- :content "(c) 2021 David Botton - BSD 3 Lic.")))
+ (head (create-div (top-panel console) :content "Image Viewer"))
+ (lbox (create-select (left-panel console)))
+ (viewer (create-img (center-panel console)))
+ (footer (create-div (bottom-panel console)
+ :content "(c) 2021 David Botton - BSD 3 Lic.")))
(declare (ignore footer))
;; Setup Top
(setf (background-color (top-panel console)) :teal)
@@ -26,13 +26,13 @@
(setf (size lbox) 2) ;; A size above 1 needed to get listbox
(set-geometry lbox :left 0 :top 0 :bottom 0 :width 200)
(add-select-options lbox '("kiarash-mansouri-fzoSNcxqtp8-unsplash.jpg"
- "windmills.jpg"
- "yellow-clogs.jpg"
- "clogicon.png"))
+ "windmills.jpg"
+ "yellow-clogs.jpg"
+ "clogicon.png"))
(set-on-change lbox (lambda (obj)
- (declare (ignore obj))
- (setf (url-src viewer) (format nil "/img/~A"
- (value lbox)))))
+ (declare (ignore obj))
+ (setf (url-src viewer) (format nil "/img/~A"
+ (value lbox)))))
;; Setup Bottom
(center-children (bottom-panel console) :horizontal nil)))
diff --git a/tutorial/28-tutorial.lisp b/tutorial/28-tutorial.lisp
index d4803ab..3e34475 100644
--- a/tutorial/28-tutorial.lisp
+++ b/tutorial/28-tutorial.lisp
@@ -11,5 +11,5 @@
to your ~~/common-lisp directory or other asdf / quicklisp~%~
directory. Then follow the directions in the 28-tutorial/README.md ~%~
directory."
- (merge-pathnames "./tutorial/28-tutorial/hello-builder/"
- (asdf:system-source-directory :clog))))
+ (merge-pathnames "./tutorial/28-tutorial/hello-builder/"
+ (asdf:system-source-directory :clog))))
diff --git a/tutorial/28-tutorial/hello-builder/hello-builder.asd b/tutorial/28-tutorial/hello-builder/hello-builder.asd
index cd393e3..f2712dc 100644
--- a/tutorial/28-tutorial/hello-builder/hello-builder.asd
+++ b/tutorial/28-tutorial/hello-builder/hello-builder.asd
@@ -9,5 +9,4 @@
:serial t
:depends-on (#:clog)
:components ((:file "hello-builder")
- (:file "hello")))
-
+ (:file "hello")))
diff --git a/tutorial/28-tutorial/hello-builder/hello-builder.lisp b/tutorial/28-tutorial/hello-builder/hello-builder.lisp
index 7df9c44..0757d21 100644
--- a/tutorial/28-tutorial/hello-builder/hello-builder.lisp
+++ b/tutorial/28-tutorial/hello-builder/hello-builder.lisp
@@ -10,6 +10,6 @@
(defun start-app ()
(initialize 'create-hello-page
- :static-root (merge-pathnames "./www/"
- (asdf:system-source-directory :hello-builder)))
+ :static-root (merge-pathnames "./www/"
+ (asdf:system-source-directory :hello-builder)))
(open-browser))
diff --git a/tutorial/29-tutorial.lisp b/tutorial/29-tutorial.lisp
index 8790363..fcdbb9f 100644
--- a/tutorial/29-tutorial.lisp
+++ b/tutorial/29-tutorial.lisp
@@ -13,52 +13,52 @@
(defun on-new-window (body)
(let* ((lisp-obj (make-instance 'my-class))
- (i1 (create-form-element body :text
- :label (create-label body :content "Form value:")))
- (i2 (create-form-element body :text
- :label (create-label body :content "(my-slot lisp-obj) value:")))
- (b1 (create-button body :content "Set (my-slot lisp-obj) Value"))
- (b2 (create-button body :content "Get (my-slot lisp-obj) Value"))
- (tmp (create-br body))
- (t1 (create-div body :content "[counter]"))
- (i3 (create-form-element body :text
- :label (create-label body :content "Change my-count:")))
- (tmp (create-br body))
- (t2 (create-div body :content "'Hello'")))
+ (i1 (create-form-element body :text
+ :label (create-label body :content "Form value:")))
+ (i2 (create-form-element body :text
+ :label (create-label body :content "(my-slot lisp-obj) value:")))
+ (b1 (create-button body :content "Set (my-slot lisp-obj) Value"))
+ (b2 (create-button body :content "Get (my-slot lisp-obj) Value"))
+ (tmp (create-br body))
+ (t1 (create-div body :content "[counter]"))
+ (i3 (create-form-element body :text
+ :label (create-label body :content "Change my-count:")))
+ (tmp (create-br body))
+ (t2 (create-div body :content "'Hello'")))
(declare (ignore tmp))
;; We set up direct relationships between lisp objects and clog objects
;; any change to i1 will change my-slot and any change to my-slot
;; will change i1 and transform it with #'string-upcase
(link-slot-and-form-element lisp-obj my-slot i1
- :transform-to-element #'string-upcase)
+ :transform-to-element #'string-upcase)
;; any change to my-count will change t1
(link-slot-to-element lisp-obj my-count t1)
;; any change to i3 will change my-count
;; and i3's value will be transformed to an integer
(link-form-element-to-slot i3 lisp-obj my-count
- :transform #'parse-integer)
+ :transform #'parse-integer)
;; Clicking on t2 will set my-slot to its text
(link-element-to-slot t2 lisp-obj my-slot :set-event #'set-on-click)
;; This change of my-slot will immediately change in the web page
(setf (my-slot lisp-obj) "First Value")
(set-on-click b1
- (lambda (obj)
- (declare (ignore obj))
- (setf (my-slot lisp-obj) (value i2))))
+ (lambda (obj)
+ (declare (ignore obj))
+ (setf (my-slot lisp-obj) (value i2))))
(set-on-click b2
- (lambda (obj)
- (declare (ignore obj))
- (setf (value i2) (my-slot lisp-obj))))
+ (lambda (obj)
+ (declare (ignore obj))
+ (setf (value i2) (my-slot lisp-obj))))
;; Use jQuery to set all inputs to have a background color
(setf (background-color (create-jquery body "input[type=text]")) :beige)
;; This updates an element on the page by just changing the value of the linked
;; slot and my-count can be adjusted mid loop from web page
(loop
(cond ((> (my-count lisp-obj) 0)
- (decf (my-count lisp-obj))
- (sleep .2))
- (t
- (return))))))
+ (decf (my-count lisp-obj))
+ (sleep .2))
+ (t
+ (return))))))
(defun start-tutorial ()
(initialize 'on-new-window)
diff --git a/tutorial/30-tutorial.lisp b/tutorial/30-tutorial.lisp
index d8dc457..22ffc31 100644
--- a/tutorial/30-tutorial.lisp
+++ b/tutorial/30-tutorial.lisp
@@ -13,19 +13,19 @@
(defun init-site (body)
(clog-web-initialize body)
(create-web-site body
- ;; use the default theme
- :theme 'clog-web:default-theme
- ;; theme settings - in this case w3.css color of menu bar
- :settings '(:color-class "w3-black")
- :title "CLOG - The Common Lisp Omnificent GUI"
- :footer "(c) 2022 David Botton"
- :logo "/img/clog-liz.png"))
+ ;; use the default theme
+ :theme 'clog-web:default-theme
+ ;; theme settings - in this case w3.css color of menu bar
+ :settings '(:color-class "w3-black")
+ :title "CLOG - The Common Lisp Omnificent GUI"
+ :footer "(c) 2022 David Botton"
+ :logo "/img/clog-liz.png"))
;; This is the menu structure
(defparameter *menu* `(("Content" (("Home" "/" on-main)
- ("Content from Lambda" "/lambda" on-lambda)
- ("Content from File" "/readme" on-readme)))
- ("Help" (("About" "/about" on-about)))))
+ ("Content from Lambda" "/lambda" on-lambda)
+ ("Content from File" "/readme" on-readme)))
+ ("Help" (("About" "/about" on-about)))))
;; Page handlers
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -35,38 +35,38 @@
;; We call init-site on every page to load our theme and settings
(init-site body)
(create-web-page body :main `(:menu ,*menu*
- :content "
Welcome to tutorial 30 Any HTML works!")))
+ :content "Welcome to tutorial 30
Any HTML works!")))
;; /readme - get content from a text file
(defun on-readme (body)
(init-site body)
(let ((readme (alexandria:read-file-into-string
- (format nil "~A~A" (asdf:system-source-directory :clog) "README.md"))))
+ (format nil "~A~A" (asdf:system-source-directory :clog) "README.md"))))
(create-web-page body :main `(:menu ,*menu*
- :content ,(format nil "
~A " readme)))))
+ :content ,(format nil "
~A " readme)))))
;; /lambda - use a function to output to the page content
(defun on-lambda (body)
(init-site body)
(create-web-page body :main `(:menu ,*menu*
- :content ,(lambda (obj)
- (create-div obj :content "I am in the content area")))))
+ :content ,(lambda (obj)
+ (create-div obj :content "I am in the content area")))))
;; /about
(defun on-about (body)
(init-site body)
(create-web-page body :main `(:menu ,*menu*
- :content "About Me")))
+ :content "About Me")))
;; Start the webserver
(defun start-tutorial ()
;; Initialize CLOG and the / url path (since / in our menu could just be nil)
(initialize 'on-main
- ;; Use long polling technique so pages are crawled by google
- :long-poll-first t
- ;; Supply some meta info
- :boot-function (clog-web-meta
- "clogpower.com - CLOG - the common lisp omnificent gui"))
+ ;; Use long polling technique so pages are crawled by google
+ :long-poll-first t
+ ;; Supply some meta info
+ :boot-function (clog-web-meta
+ "clogpower.com - CLOG - the common lisp omnificent gui"))
;; clog web helper to set up routes in menu
(clog-web-routes-from-menu *menu*)
(open-browser))
diff --git a/tutorial/31-tutorial.lisp b/tutorial/31-tutorial.lisp
index 83f3ac7..8ad2264 100644
--- a/tutorial/31-tutorial.lisp
+++ b/tutorial/31-tutorial.lisp
@@ -25,11 +25,11 @@
; Menu Menu Item URL Handler Actions Auth
(defparameter *menu* `(("Features" (("Login" "/login" on-login :login)
- ("Signup" "/signup" on-signup :signup)
- ("Main" "/main" on-main :main)
- ("Logout" "/logout" on-logout :logout)))
- ("Admin" (("User List" "/users" on-users :users)))
- ("Help" (("About" "/about" on-about))))
+ ("Signup" "/signup" on-signup :signup)
+ ("Main" "/main" on-main :main)
+ ("Logout" "/logout" on-logout :logout)))
+ ("Admin" (("User List" "/users" on-users :users)))
+ ("Help" (("About" "/about" on-about))))
"Setup website menu")
(defun start-tutorial ()
@@ -51,9 +51,9 @@
(create-base-tables *sql-connection*)))
;; Setup clog, using long polling for web crawlers and some meta info
(initialize 'on-main
- :long-poll-first t
- :boot-function (clog-web-meta
- "clogpower.com - CLOG - the common lisp omnificent gui"))
+ :long-poll-first t
+ :boot-function (clog-web-meta
+ "clogpower.com - CLOG - the common lisp omnificent gui"))
(clog-web-routes-from-menu *menu*)
(open-browser))
@@ -68,24 +68,24 @@
(clog-web-initialize body)
;; Instantly reload other windows open on authentication change
(set-on-authentication-change body (lambda (body)
- (url-replace (location body) "/")))
+ (url-replace (location body) "/")))
;; Initialzie the clog-web-site environment
(let ((profile (get-profile body *sql-connection*)))
(create-web-site body
- :settings '(:color-class "w3-blue-gray"
- :border-class ""
- :signup-link "/signup"
- :login-link "/login")
- :profile profile
- :roles (if profile
- (if (equalp "admin"
- (getf profile :|username|))
- '(:member :admin)
- '(:member))
- '(:guest))
- :title "CLOG - The Common Lisp Omnificent GUI"
- :footer "(c) 2022 David Botton"
- :logo "/img/clog-liz.png")))
+ :settings '(:color-class "w3-blue-gray"
+ :border-class ""
+ :signup-link "/signup"
+ :login-link "/login")
+ :profile profile
+ :roles (if profile
+ (if (equalp "admin"
+ (getf profile :|username|))
+ '(:member :admin)
+ '(:member))
+ '(:guest))
+ :title "CLOG - The Common Lisp Omnificent GUI"
+ :footer "(c) 2022 David Botton"
+ :logo "/img/clog-liz.png")))
;;
;; URL Path Handlers
@@ -97,15 +97,15 @@
(create-web-page
body
:login `(:menu ,*menu*
- :on-submit ,(lambda (obj)
- (if (login body *sql-connection*
- (name-value obj "username")
- (name-value obj "password"))
- ;; url-replace removes login from history stack
- (url-replace (location body) "/main")
- (clog-web-alert obj "Invalid" "The username and password are invalid."
- :time-out 3
- :place-top t))))
+ :on-submit ,(lambda (obj)
+ (if (login body *sql-connection*
+ (name-value obj "username")
+ (name-value obj "password"))
+ ;; url-replace removes login from history stack
+ (url-replace (location body) "/main")
+ (clog-web-alert obj "Invalid" "The username and password are invalid."
+ :time-out 3
+ :place-top t))))
;; don't authorize use of page if logged in
:authorize t))
@@ -116,33 +116,33 @@
(defun on-signup (body)
(init-site body)
(create-web-page body
- :signup `(:menu ,*menu*
- :content ,(lambda (body)
- (sign-up body *sql-connection*)))
- ;; don't authorize use of page if logged in
- :authorize t))
+ :signup `(:menu ,*menu*
+ :content ,(lambda (body)
+ (sign-up body *sql-connection*)))
+ ;; don't authorize use of page if logged in
+ :authorize t))
(defun on-main (body)
(init-site body)
(create-web-page body :main `(:menu ,*menu*
- :content "I am the main page")))
+ :content "I am the main page")))
(defun on-about (body)
(init-site body)
(create-web-page body :about `(:menu ,*menu*
- :content "About Me")))
+ :content "About Me")))
(defun on-users (body)
(init-site body)
(create-web-page body :users
- `(:menu ,*menu*
- :content ,(lambda (body)
- (let ((users (dbi:fetch-all
- (dbi:execute
- (dbi:prepare
- *sql-connection*
- "select * from users")))))
- (dolist (user users)
- (create-div body :content (getf user :|username|))))))
- ;; don't authorize use of page unless you are the admin
- :authorize t))
+ `(:menu ,*menu*
+ :content ,(lambda (body)
+ (let ((users (dbi:fetch-all
+ (dbi:execute
+ (dbi:prepare
+ *sql-connection*
+ "select * from users")))))
+ (dolist (user users)
+ (create-div body :content (getf user :|username|))))))
+ ;; don't authorize use of page unless you are the admin
+ :authorize t))
diff --git a/tutorial/32-tutorial.lisp b/tutorial/32-tutorial.lisp
index e129c2f..fc61f28 100644
--- a/tutorial/32-tutorial.lisp
+++ b/tutorial/32-tutorial.lisp
@@ -32,13 +32,13 @@
; Menu Menu Item URL Handler Actions Auth
(defparameter *menu* `(("Features" (("Home" "/")
- ("Login" "/login" on-login :login)
- ("Signup" "/signup" on-signup :signup)
- ("Change Password" "/pass" on-new-pass :change-password)
- ("Content" "/content" on-main :content)
- ("Logout" "/logout" on-logout :logout)))
- ("Admin" (("User List" "/users" on-users :users)))
- ("Help" (("About" "/content/about"))))
+ ("Login" "/login" on-login :login)
+ ("Signup" "/signup" on-signup :signup)
+ ("Change Password" "/pass" on-new-pass :change-password)
+ ("Content" "/content" on-main :content)
+ ("Logout" "/logout" on-logout :logout)))
+ ("Admin" (("User List" "/users" on-users :users)))
+ ("Help" (("About" "/content/about"))))
"Setup website menu")
(defun start-tutorial ()
@@ -47,8 +47,8 @@
(add-authorization '(:guest :member) '(:content-show-comments))
(add-authorization '(:guest) '(:login :signup))
(add-authorization '(:member) '(:logout
- :change-password
- :content-comment))
+ :change-password
+ :content-comment))
(add-authorization '(:editor) '(:content-edit))
(add-authorization '(:admin) '(:users :content-admin))
;; Setup database connection
@@ -65,17 +65,17 @@
(create-base-tables *sql-connection*)
;; A main page was added, but let's also add an about page:
(dbi:do-sql
- *sql-connection*
- (sql-insert* "content" `(:key "about"
- :title "About Tutorial 32"
- :value "All about me."
- :createdate (,*sqlite-timestamp*))))))
+ *sql-connection*
+ (sql-insert* "content" `(:key "about"
+ :title "About Tutorial 32"
+ :value "All about me."
+ :createdate (,*sqlite-timestamp*))))))
;; Setup clog
(initialize 'on-main
- :long-poll-first t
- :extended-routing t
- :boot-function (clog-web-meta
- "clogpower.com - CLOG - the common lisp omnificent gui"))
+ :long-poll-first t
+ :extended-routing t
+ :boot-function (clog-web-meta
+ "clogpower.com - CLOG - the common lisp omnificent gui"))
(clog-web-routes-from-menu *menu*)
(open-browser))
@@ -90,27 +90,27 @@
(clog-web-initialize body)
;; Instantly reload other windows open on authentication change
(set-on-authentication-change body (lambda (body)
- (url-replace (location body) "/")))
+ (url-replace (location body) "/")))
;; Initialzie the clog-web-site environment
(let ((profile (get-profile body *sql-connection*)))
(create-web-site body
- :settings '(:color-class "w3-blue-gray"
- :border-class ""
- :signup-link "/signup"
- :login-link "/login")
- :profile profile
- ;; We define the roles simply if logged out a :guest
- ;; if logged in a :member and if username is admin
- ;; a :member, :editor and :admin.
- :roles (if profile
- (if (equalp "admin"
- (getf profile :|username|))
- '(:member :editor :admin)
- '(:member))
- '(:guest))
- :title "CLOG - The Common Lisp Omnificent GUI"
- :footer "(c) 2022 David Botton"
- :logo "/img/clog-liz.png")))
+ :settings '(:color-class "w3-blue-gray"
+ :border-class ""
+ :signup-link "/signup"
+ :login-link "/login")
+ :profile profile
+ ;; We define the roles simply if logged out a :guest
+ ;; if logged in a :member and if username is admin
+ ;; a :member, :editor and :admin.
+ :roles (if profile
+ (if (equalp "admin"
+ (getf profile :|username|))
+ '(:member :editor :admin)
+ '(:member))
+ '(:guest))
+ :title "CLOG - The Common Lisp Omnificent GUI"
+ :footer "(c) 2022 David Botton"
+ :logo "/img/clog-liz.png")))
;;
;; URL Path Handlers
@@ -122,14 +122,14 @@
(create-web-page
body
:login `(:menu ,*menu*
- :on-submit ,(lambda (obj)
- (if (login body *sql-connection*
- (name-value obj "username")
- (name-value obj "password"))
- (url-replace (location body) "/")
- (clog-web-alert obj "Invalid" "The username and password are invalid."
- :time-out 3
- :place-top t))))
+ :on-submit ,(lambda (obj)
+ (if (login body *sql-connection*
+ (name-value obj "username")
+ (name-value obj "password"))
+ (url-replace (location body) "/")
+ (clog-web-alert obj "Invalid" "The username and password are invalid."
+ :time-out 3
+ :place-top t))))
:authorize t))
(defun on-logout (body)
@@ -139,45 +139,45 @@
(defun on-signup (body)
(init-site body)
(create-web-page body
- :signup `(:menu ,*menu*
- :content ,(lambda (body)
- (sign-up body *sql-connection*)))
- :authorize t))
+ :signup `(:menu ,*menu*
+ :content ,(lambda (body)
+ (sign-up body *sql-connection*)))
+ :authorize t))
(defun on-main (body)
(init-site body)
(create-web-page body :index `(:menu ,*menu*
- :content ,(clog-web-content *sql-connection*
- :comment-table "content"))))
+ :content ,(clog-web-content *sql-connection*
+ :comment-table "content"))))
(defun on-users (body)
(init-site body)
(create-web-page body :users
- `(:menu ,*menu*
- :content ,(lambda (body)
- (let ((users (dbi:fetch-all
- (dbi:execute
- (dbi:prepare
- *sql-connection*
- "select * from users")))))
- (dolist (user users)
- (let* ((box (create-div body))
- (suser (create-span box :content (getf user :|username|)))
- (rbut (create-button box :content "Reset Password"
- :class "w3-margin-left")))
- (declare (ignore suser))
- (set-on-click rbut (lambda (obj)
- (declare (ignore obj))
- (reset-password *sql-connection*
- (getf user :|username|))
- (setf (disabledp rbut) t)
- (setf (text rbut) "Done"))))))))
- :authorize t))
+ `(:menu ,*menu*
+ :content ,(lambda (body)
+ (let ((users (dbi:fetch-all
+ (dbi:execute
+ (dbi:prepare
+ *sql-connection*
+ "select * from users")))))
+ (dolist (user users)
+ (let* ((box (create-div body))
+ (suser (create-span box :content (getf user :|username|)))
+ (rbut (create-button box :content "Reset Password"
+ :class "w3-margin-left")))
+ (declare (ignore suser))
+ (set-on-click rbut (lambda (obj)
+ (declare (ignore obj))
+ (reset-password *sql-connection*
+ (getf user :|username|))
+ (setf (disabledp rbut) t)
+ (setf (text rbut) "Done"))))))))
+ :authorize t))
(defun on-new-pass (body)
(init-site body)
(create-web-page body
- :change-password `(:menu ,*menu*
- :content ,(lambda (body)
- (change-password body *sql-connection*)))
- :authorize t))
+ :change-password `(:menu ,*menu*
+ :content ,(lambda (body)
+ (change-password body *sql-connection*)))
+ :authorize t))
diff --git a/tutorial/33-tutorial.lisp b/tutorial/33-tutorial.lisp
index 6fdf8c7..6ac0212 100644
--- a/tutorial/33-tutorial.lisp
+++ b/tutorial/33-tutorial.lisp
@@ -28,148 +28,148 @@
;; :bind var
(with-clog-create body
(div ()
- (button (:bind t1 :content "Tab1"))
+ (button (:bind t1 :content "Tab1"))
(button (:bind t2 :content "Tab2"))
(button (:bind t3 :content "Tab3"))
(br ())
-
- ;; Panel 1
+
+ ;; Panel 1
(div (:bind p1)
- ;; Create form for panel 1
- (form (:bind f1)
- (form-element (:bind fe1 :text :label (create-label f1 :content "Fill in blank:")))
- (br ())
- (form-element (:bind fe2 :color :value "#ffffff"
- :label (create-label f1 :content "Pick a color:")))
- (br ())
- (form-element (:submit :value "OK"))
- (form-element (:reset :value "Start Again"))))
-
- ;; Panel 2
+ ;; Create form for panel 1
+ (form (:bind f1)
+ (form-element (:bind fe1 :text :label (create-label f1 :content "Fill in blank:")))
+ (br ())
+ (form-element (:bind fe2 :color :value "#ffffff"
+ :label (create-label f1 :content "Pick a color:")))
+ (br ())
+ (form-element (:submit :value "OK"))
+ (form-element (:reset :value "Start Again"))))
+
+ ;; Panel 2
(div (:bind p2)
- ;; Create form for panel 2
- (form (:bind f2)
- (fieldset (:bind fs2 :legend "Stuff")
- (label (:bind lbl :content "Please type here:"))
- (text-area (:bind ta1 :columns 60 :rows 8 :label lbl))
- (br ())
- (form-element (:bind rd1 :radio :name "rd"))
- (label (:content "To Be" :label-for rd1))
- (form-element (:bind rd2 :radio :name "rd"))
- (label (:content "No to Be" :label-for rd2))
- (br ())
- (form-element (:bind ck1 :checkbox :name "ck"))
- (label (:content "Here" :label-for ck1))
- (form-element (:bind ck2 :checkbox :name "ck"))
- (label (:content "There" :label-for ck2))
- (br ())
- (select (:bind sl1 :label (create-label fs2 :content "Pick one:")))
- (select (:bind sl2 :label (create-label fs2 :content "Pick one:")))
- (select (:bind sl3 :multiple t :label (create-label fs2 :content "Pick some:"))
- (option (:content "one"))
- (option (:bind o2 :content "two"))
- (option (:content "three"))
- (optgroup (:content "These are a group")
- (option (:content "four"))
- (option (:bind o5 :content "five")))))
- (form-element (:submit :value "OK"))
- (form-element (:reset :value "Start Again"))))
-
- ;; Panel 3
- (div (:bind p3 :content "Panel3 - Type here")))
+ ;; Create form for panel 2
+ (form (:bind f2)
+ (fieldset (:bind fs2 :legend "Stuff")
+ (label (:bind lbl :content "Please type here:"))
+ (text-area (:bind ta1 :columns 60 :rows 8 :label lbl))
+ (br ())
+ (form-element (:bind rd1 :radio :name "rd"))
+ (label (:content "To Be" :label-for rd1))
+ (form-element (:bind rd2 :radio :name "rd"))
+ (label (:content "No to Be" :label-for rd2))
+ (br ())
+ (form-element (:bind ck1 :checkbox :name "ck"))
+ (label (:content "Here" :label-for ck1))
+ (form-element (:bind ck2 :checkbox :name "ck"))
+ (label (:content "There" :label-for ck2))
+ (br ())
+ (select (:bind sl1 :label (create-label fs2 :content "Pick one:")))
+ (select (:bind sl2 :label (create-label fs2 :content "Pick one:")))
+ (select (:bind sl3 :multiple t :label (create-label fs2 :content "Pick some:"))
+ (option (:content "one"))
+ (option (:bind o2 :content "two"))
+ (option (:content "three"))
+ (optgroup (:content "These are a group")
+ (option (:content "four"))
+ (option (:bind o5 :content "five")))))
+ (form-element (:submit :value "OK"))
+ (form-element (:reset :value "Start Again"))))
+
+ ;; Panel 3
+ (div (:bind p3 :content "Panel3 - Type here")))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; Panel 1 contents
+ ;; Panel 1 contents
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (setf (place-holder fe1) "type here..")
- (setf (requiredp fe1) t)
- (setf (size fe1) 60)
- (make-data-list fe1 '("Cool Title"
- "Not So Cool Title"
- "Why Not, Another Title"))
- (make-data-list fe2 '("#ffffff"
- "#ff0000"
- "#00ff00"
- "#0000ff"
- "#ff00ff"))
- (set-on-submit f1
- (lambda (obj)
- (declare (ignore obj))
- (setf (title (html-document body)) (value fe1))
- (setf (background-color p1) (value fe2))
- (setf (hiddenp f1) t)
- (create-span p1 :content
- "
Your form has been submitted ")))
- (setf (width p1) "100%")
- (setf (width p2) "100%")
- (setf (width p3) "100%")
- (setf (height p1) 400)
- (setf (height p2) 400)
- (setf (height p3) 400)
- (set-border p1 :thin :solid :black)
- (set-border p2 :thin :solid :black)
- (set-border p3 :thin :solid :black)
+ (setf (place-holder fe1) "type here..")
+ (setf (requiredp fe1) t)
+ (setf (size fe1) 60)
+ (make-data-list fe1 '("Cool Title"
+ "Not So Cool Title"
+ "Why Not, Another Title"))
+ (make-data-list fe2 '("#ffffff"
+ "#ff0000"
+ "#00ff00"
+ "#0000ff"
+ "#ff00ff"))
+ (set-on-submit f1
+ (lambda (obj)
+ (declare (ignore obj))
+ (setf (title (html-document body)) (value fe1))
+ (setf (background-color p1) (value fe2))
+ (setf (hiddenp f1) t)
+ (create-span p1 :content
+ "
Your form has been submitted ")))
+ (setf (width p1) "100%")
+ (setf (width p2) "100%")
+ (setf (width p3) "100%")
+ (setf (height p1) 400)
+ (setf (height p2) 400)
+ (setf (height p3) 400)
+ (set-border p1 :thin :solid :black)
+ (set-border p2 :thin :solid :black)
+ (set-border p3 :thin :solid :black)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; Panel 2 contents
+ ;; Panel 2 contents
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (setf (vertical-align ta1) :top)
- (disable-resize ta1)
- (setf (vertical-align sl1) :top)
- (setf (vertical-align sl2) :top)
- (setf (vertical-align sl3) :top)
- (setf (size sl1) 3)
- (add-select-options sl1 '("one"
- "two"
- "three"
- "four"
- "five"))
- (add-select-options sl2 '("one"
- "two"
- "three"
- "four"
- "five"))
- (set-on-change sl3 (lambda (obj)
- (declare (ignore obj))
- (when (selectedp o5)
- (alert (window body) "Selected 5"))))
- (set-on-submit f2
- (lambda (obj)
- (declare (ignore obj))
- (setf (hiddenp f2) t)
- (create-span p2 :content
- (format nil "
Your form has been submitted:
+ (setf (vertical-align ta1) :top)
+ (disable-resize ta1)
+ (setf (vertical-align sl1) :top)
+ (setf (vertical-align sl2) :top)
+ (setf (vertical-align sl3) :top)
+ (setf (size sl1) 3)
+ (add-select-options sl1 '("one"
+ "two"
+ "three"
+ "four"
+ "five"))
+ (add-select-options sl2 '("one"
+ "two"
+ "three"
+ "four"
+ "five"))
+ (set-on-change sl3 (lambda (obj)
+ (declare (ignore obj))
+ (when (selectedp o5)
+ (alert (window body) "Selected 5"))))
+ (set-on-submit f2
+ (lambda (obj)
+ (declare (ignore obj))
+ (setf (hiddenp f2) t)
+ (create-span p2 :content
+ (format nil "
Your form has been submitted:
~A
1 - ~A
2 - ~A
3 - ~A"
- (value ta1)
- (value sl1)
- (value sl2)
- (selectedp o2)))))
+ (value ta1)
+ (value sl1)
+ (value sl2)
+ (selectedp o2)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; Panel 3 contents
+ ;; Panel 3 contents
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (setf (editablep p3) t)
+ (setf (editablep p3) t)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; Tab functionality
+ ;; Tab functionality
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (flet ((select-tab (obj)
- (setf (hiddenp p1) t)
- (setf (hiddenp p2) t)
- (setf (hiddenp p3) t)
- (setf (background-color t1) :lightgrey)
- (setf (background-color t2) :lightgrey)
- (setf (background-color t3) :lightgrey)
- (setf (background-color last-tab) :lightblue)
- (setf (hiddenp obj) nil)
- (focus obj)))
- (setf last-tab t1)
- (select-tab p1)
- (set-on-click t1 (lambda (obj)
- (setf last-tab obj)
- (select-tab p1)))
- (set-on-click t2 (lambda (obj)
- (setf last-tab obj)
- (select-tab p2)))
- (set-on-click t3 (lambda (obj)
- (setf last-tab obj)
- (select-tab p3))))))))
+ (flet ((select-tab (obj)
+ (setf (hiddenp p1) t)
+ (setf (hiddenp p2) t)
+ (setf (hiddenp p3) t)
+ (setf (background-color t1) :lightgrey)
+ (setf (background-color t2) :lightgrey)
+ (setf (background-color t3) :lightgrey)
+ (setf (background-color last-tab) :lightblue)
+ (setf (hiddenp obj) nil)
+ (focus obj)))
+ (setf last-tab t1)
+ (select-tab p1)
+ (set-on-click t1 (lambda (obj)
+ (setf last-tab obj)
+ (select-tab p1)))
+ (set-on-click t2 (lambda (obj)
+ (setf last-tab obj)
+ (select-tab p2)))
+ (set-on-click t3 (lambda (obj)
+ (setf last-tab obj)
+ (select-tab p3))))))))
(defun start-tutorial ()
"Start turtorial."