From 5fbbd5cda1d1bcd38b34699cf5d941163d2c4433 Mon Sep 17 00:00:00 2001 From: "Mr. Lemmywinks - git is ridiculous" Date: Fri, 18 Aug 2023 23:22:00 -0700 Subject: [PATCH] Made sure every single tutorial page had page title set to "Tutorial xx" as appropriate. The purpose of the updates is to make it easy for anyone to open up a tutorial and see which one was loaded up by looking at the page title. --- tutorial/01-tutorial.lisp | 2 ++ tutorial/02-tutorial.lisp | 2 +- tutorial/03-tutorial.lisp | 2 +- tutorial/04-tutorial.lisp | 2 +- tutorial/05-tutorial.lisp | 2 +- tutorial/06-tutorial.lisp | 2 +- tutorial/07-tutorial.lisp | 2 +- tutorial/08-tutorial.lisp | 2 +- tutorial/09-tutorial.lisp | 2 +- tutorial/11-tutorial.lisp | 9 +++++++-- tutorial/12-tutorial.lisp | 1 + tutorial/15-tutorial.lisp | 1 + tutorial/16-tutorial.lisp | 2 +- tutorial/17-tutorial.lisp | 2 +- tutorial/18-tutorial.lisp | 1 + tutorial/19-tutorial.lisp | 1 + tutorial/20-tutorial.lisp | 1 + tutorial/21-tutorial.lisp | 1 + tutorial/27-tutorial.lisp | 1 + tutorial/29-tutorial.lisp | 1 + tutorial/30-tutorial.lisp | 1 + tutorial/31-tutorial.lisp | 1 + tutorial/32-tutorial.lisp | 1 + 23 files changed, 30 insertions(+), 12 deletions(-) diff --git a/tutorial/01-tutorial.lisp b/tutorial/01-tutorial.lisp index 2e29232..591ea6b 100644 --- a/tutorial/01-tutorial.lisp +++ b/tutorial/01-tutorial.lisp @@ -9,6 +9,8 @@ (defun on-new-window (body) ; Define the function called on-new-window "On-new-window handler." ; Optional docstring to describe function + (setf (title (html-document body)) "Tutorial 01") ;; set the page title + (let ((hello-element ; hello-element is a local variable that ; will be bound to our new CLOG-Element diff --git a/tutorial/02-tutorial.lisp b/tutorial/02-tutorial.lisp index a1b526c..5912a27 100644 --- a/tutorial/02-tutorial.lisp +++ b/tutorial/02-tutorial.lisp @@ -7,7 +7,7 @@ (defun on-new-window (body) "On-new-window handler." ;; Give your app a name that appears in the browser tab/window - (setf (title (html-document body)) "Tutorial 2") + (setf (title (html-document body)) "Tutorial 02") ;; The CLOG-body object gives you access to a number of other CLOG-Objects ;; ;; (html-document body) is the CLOG-Document object ~ These are aproximately diff --git a/tutorial/03-tutorial.lisp b/tutorial/03-tutorial.lisp index 95ea392..941b2c4 100644 --- a/tutorial/03-tutorial.lisp +++ b/tutorial/03-tutorial.lisp @@ -6,7 +6,7 @@ (defun on-new-window (body) "On-new-window handler." - (setf (title (html-document body)) "Tutorial 3") + (setf (title (html-document body)) "Tutorial 03") (let ((hello-element (create-section body :h1 :content "Hello World! (click me!)"))) (let ((x 0)) diff --git a/tutorial/04-tutorial.lisp b/tutorial/04-tutorial.lisp index 3194c64..7e5b09e 100644 --- a/tutorial/04-tutorial.lisp +++ b/tutorial/04-tutorial.lisp @@ -9,7 +9,7 @@ ; RGB is a helper function for color (defun on-new-window (body) "On-new-window handler." - (setf (title (html-document body)) "Tutorial 4") + (setf (title (html-document body)) "Tutorial 04") ;; 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) diff --git a/tutorial/05-tutorial.lisp b/tutorial/05-tutorial.lisp index e4cb2b1..0d325f0 100644 --- a/tutorial/05-tutorial.lisp +++ b/tutorial/05-tutorial.lisp @@ -13,7 +13,7 @@ (defun on-new-window (body) "On-new-window handler." - (setf (title (html-document body)) "Tutorial 5") + (setf (title (html-document body)) "Tutorial 05") (set-on-click (create-section body :h1 :content "Hello World! (click me!)") 'my-on-click) (setf (connection-data-item body "changer") diff --git a/tutorial/06-tutorial.lisp b/tutorial/06-tutorial.lisp index 460bfda..720f571 100644 --- a/tutorial/06-tutorial.lisp +++ b/tutorial/06-tutorial.lisp @@ -26,7 +26,7 @@ (defun on-new-window (body) "On-new-window handler." - (setf (title (html-document body)) "Tutorial 6") + (setf (title (html-document body)) "Tutorial 06") (set-on-click (create-section body :h1 :content "(click me to start!)") 'my-on-click)) diff --git a/tutorial/07-tutorial.lisp b/tutorial/07-tutorial.lisp index 11e0065..916216c 100644 --- a/tutorial/07-tutorial.lisp +++ b/tutorial/07-tutorial.lisp @@ -12,7 +12,7 @@ (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") + (setf (title (html-document body)) "Tutorial 07") ;; Show a "splash" screen (setf (hiddenp (prog1 (create-section body :h2 diff --git a/tutorial/08-tutorial.lisp b/tutorial/08-tutorial.lisp index ddaa190..ff11b06 100644 --- a/tutorial/08-tutorial.lisp +++ b/tutorial/08-tutorial.lisp @@ -62,7 +62,7 @@ (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 (title (html-document body)) "Tutorial 8") + (setf (title (html-document body)) "Tutorial 08") (let* ((div1 (create-div body)) (div2 (create-div div1)) (div3 (create-div div2)) diff --git a/tutorial/09-tutorial.lisp b/tutorial/09-tutorial.lisp index 53db020..3f4d1f6 100644 --- a/tutorial/09-tutorial.lisp +++ b/tutorial/09-tutorial.lisp @@ -5,7 +5,7 @@ (in-package :clog-tut-9) (defun on-new-window (body) - (setf (title (html-document body)) "Tutorial 9") + (setf (title (html-document body)) "Tutorial 09") ;; When doing extensive setup of a page using connection cache ;; reduces rountrip traffic and speeds setup. (with-connection-cache (body) diff --git a/tutorial/11-tutorial.lisp b/tutorial/11-tutorial.lisp index d6eab4c..089d89d 100644 --- a/tutorial/11-tutorial.lisp +++ b/tutorial/11-tutorial.lisp @@ -36,7 +36,7 @@ (in-package :clog-tut-11) (defun on-new-window (body) - ;; This will turn on debug output in the browser console. + ;; This will turn on debug output in the browser console. (debug-mode body) ;; Setup form (let* ((form (attach-as-child body "form1" :clog-type 'clog-form)) @@ -67,7 +67,12 @@ ;; 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) - (set-on-click scary-button #'on-click-scary)))) + (set-on-click scary-button #'on-click-scary))) + + (setf (title (html-document body)) "Tutorial 11") ;; set the page title + + + ) (defun start-tutorial () "Start tutorial." diff --git a/tutorial/12-tutorial.lisp b/tutorial/12-tutorial.lisp index c2b6aa3..f7d64e2 100644 --- a/tutorial/12-tutorial.lisp +++ b/tutorial/12-tutorial.lisp @@ -24,6 +24,7 @@ (in-package :clog-tut-12) (defun on-main (body) + (setf (title (html-document body)) "Tutorial 12") ;; set the page title (let ((sb (create-style-block body))) (add-style sb :element "a" '(("color" :orange) ("text-decoration" :none))) diff --git a/tutorial/15-tutorial.lisp b/tutorial/15-tutorial.lisp index aed0a6a..bcb2f4e 100644 --- a/tutorial/15-tutorial.lisp +++ b/tutorial/15-tutorial.lisp @@ -6,6 +6,7 @@ ;;; Brief demonstration of multimedia (defun on-new-window (body) + (setf (title (html-document body)) "Tutorial 15") ;; set the page title (let* ((vid (create-video body :source "https://www.w3schools.com/html/mov_bbb.mp4")) (tmp (create-br body)) (vpl (create-button body :content ">")) diff --git a/tutorial/16-tutorial.lisp b/tutorial/16-tutorial.lisp index 1dcb52a..958a03e 100644 --- a/tutorial/16-tutorial.lisp +++ b/tutorial/16-tutorial.lisp @@ -14,7 +14,7 @@ (load-script (html-document body) "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js") (load-script (html-document body) "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js") ;; Root page setup - (setf (title (html-document body)) "Hello Boostrap") + (setf (title (html-document body)) "Tutorial 16: Hello Boostrap") (let* ((nav (create-section body :nav :class "nav")) ;; Nav Bar (l1 (create-a nav :content "link1" :class "nav-link")) diff --git a/tutorial/17-tutorial.lisp b/tutorial/17-tutorial.lisp index e37c772..996f75f 100644 --- a/tutorial/17-tutorial.lisp +++ b/tutorial/17-tutorial.lisp @@ -13,7 +13,7 @@ (load-css (html-document body) "https://www.w3schools.com/w3css/4/w3.css") (load-css (html-document body) "https://www.w3schools.com/lib/w3-theme-teal.css") ;; Setup page - (setf (title (html-document body)) "Hello W3.CSS") + (setf (title (html-document body)) "Tutorial 17: 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 diff --git a/tutorial/18-tutorial.lisp b/tutorial/18-tutorial.lisp index 15b871f..760e759 100644 --- a/tutorial/18-tutorial.lisp +++ b/tutorial/18-tutorial.lisp @@ -6,6 +6,7 @@ ;; Demonstrate drag and drop (defun on-new-window (body) + (setf (title (html-document body)) "Tutorial 18") ;; set the page title (let* ((target1 (create-div body)) (target2 (create-div body)) (object (create-div target1)) diff --git a/tutorial/19-tutorial.lisp b/tutorial/19-tutorial.lisp index 93dc852..25ae0ce 100644 --- a/tutorial/19-tutorial.lisp +++ b/tutorial/19-tutorial.lisp @@ -10,6 +10,7 @@ ;;; collapsible trees that we will use for this tutorial. (defun on-new-window (body) + (setf (title (html-document body)) "Tutorial 19") ;; set the page title ;; 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") diff --git a/tutorial/20-tutorial.lisp b/tutorial/20-tutorial.lisp index a2d5890..e1a2874 100644 --- a/tutorial/20-tutorial.lisp +++ b/tutorial/20-tutorial.lisp @@ -54,6 +54,7 @@ (in-package :clog-tut-20) (defun on-new-window (body) + (setf (title (html-document body)) "Tutorial 20") ;; set the page title (clog-toggler:init-toggler body) ;; Now we build our CLOG-Toggler ;; All create-functions also allow setting the :html-id instead of diff --git a/tutorial/21-tutorial.lisp b/tutorial/21-tutorial.lisp index 5f14f7e..a21f9de 100644 --- a/tutorial/21-tutorial.lisp +++ b/tutorial/21-tutorial.lisp @@ -50,6 +50,7 @@ on the drop-root.")) (in-package :clog-tut-21) (defun on-new-window (body) + (setf (title (html-document body)) "Tutorial 21") ;; set the page title (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")) diff --git a/tutorial/27-tutorial.lisp b/tutorial/27-tutorial.lisp index 9baded4..a189c5c 100644 --- a/tutorial/27-tutorial.lisp +++ b/tutorial/27-tutorial.lisp @@ -7,6 +7,7 @@ (in-package :clog-tut-27) (defun on-new-window (body) + (setf (title (html-document body)) "Tutorial 27") ;; set the page title (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))) diff --git a/tutorial/29-tutorial.lisp b/tutorial/29-tutorial.lisp index fcdbb9f..3058502 100644 --- a/tutorial/29-tutorial.lisp +++ b/tutorial/29-tutorial.lisp @@ -12,6 +12,7 @@ (my-count :accessor my-count :initform 500))) (defun on-new-window (body) + (setf (title (html-document body)) "Tutorial 29") ;; set the page title (let* ((lisp-obj (make-instance 'my-class)) (i1 (create-form-element body :text :label (create-label body :content "Form value:"))) diff --git a/tutorial/30-tutorial.lisp b/tutorial/30-tutorial.lisp index 22ffc31..91c7cae 100644 --- a/tutorial/30-tutorial.lisp +++ b/tutorial/30-tutorial.lisp @@ -12,6 +12,7 @@ (defun init-site (body) (clog-web-initialize body) + (setf (title (html-document body)) "Tutorial 30") ;; set the page title (create-web-site body ;; use the default theme :theme 'clog-web:default-theme diff --git a/tutorial/31-tutorial.lisp b/tutorial/31-tutorial.lisp index 8ad2264..65f9301 100644 --- a/tutorial/31-tutorial.lisp +++ b/tutorial/31-tutorial.lisp @@ -66,6 +66,7 @@ "Setup the website, called on each url switch" ;; Initialize the clog-web environment (clog-web-initialize body) + (setf (title (html-document body)) "Tutorial 31") ;; set the page title ;; Instantly reload other windows open on authentication change (set-on-authentication-change body (lambda (body) (url-replace (location body) "/"))) diff --git a/tutorial/32-tutorial.lisp b/tutorial/32-tutorial.lisp index fc61f28..cd8b948 100644 --- a/tutorial/32-tutorial.lisp +++ b/tutorial/32-tutorial.lisp @@ -88,6 +88,7 @@ "Setup the website, called on each url switch" ;; Initialize the clog-web environment (clog-web-initialize body) + (setf (title (html-document body)) "Tutorial 32") ;; set the page title ;; Instantly reload other windows open on authentication change (set-on-authentication-change body (lambda (body) (url-replace (location body) "/")))