diff --git a/source/clog-system.lisp b/source/clog-system.lisp index a9d5b55..39b0fa8 100644 --- a/source/clog-system.lisp +++ b/source/clog-system.lisp @@ -94,11 +94,11 @@ example." (defun set-on-new-window (on-new-window-handler &key (path "/") (boot-file "/boot.html")) - "Set or change the on-new-window handler or set a new one for PATH -using BOOT_FILE. Paths should always begin with a '/'. If PATH is set to -\"default\" will use boot-file when the route can not be determined, ie -a static html file including boot.js that has not been added with this -function. If BOOT-FILE is nil path is removed." + "Set or change the ON-NEW-WINDOW-HANDLER for PATH using +BOOT_FILE. Paths should always begin with a forward slash '/'. If PATH +is set to \"default\" any path without another route and there is no +static file matching the requested path ON-NEW-WINDOW-HANDLER and +BOOT-FILE will be used. If BOOT-FILE is nil path is removed." (clog-connection:set-clog-path path boot-file) (if boot-file (setf (gethash path *url-to-on-new-window*) on-new-window-handler) diff --git a/static-files/tutorial/some-file.html b/static-files/tutorial/some-file.html new file mode 100644 index 0000000..80b0d70 --- /dev/null +++ b/static-files/tutorial/some-file.html @@ -0,0 +1,10 @@ + + + + + + +

I am just a regular file but I include boot.js. I am in the static-root + of the tutorial and demo apps.

+ + diff --git a/tutorial/12-tutorial.lisp b/tutorial/12-tutorial.lisp index 9db40c7..2a8cc2a 100644 --- a/tutorial/12-tutorial.lisp +++ b/tutorial/12-tutorial.lisp @@ -38,6 +38,7 @@
  • /page2 - a CLOG app using an alternative boot file
  • /page3 - tutorial 11 as part of this tutorial
  • /tutorial/tut-11.html - an html file using boot.js +
  • /tutorial/some-file.html - an html file using boot.js
  • '/tutorial/regular-file.html - a regular html file ")) @@ -78,7 +79,7 @@ "/tutorial/tut-11.html") (on-tutorial11 body)) (t - (create-div body :content "No dice!")))) + (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 @@ -117,9 +118,10 @@ (set-on-new-window 'on-tutorial11 :path "/page3" :boot-file "/tutorial/tut-11.html") ;; Setting a "default" path says that any use of an included boot.js - ;; file will route to this function, in this case #'on-default + ;; 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 ;; 11 - "http://127.0.0.1:8080/tutorial/tut-11.html" and if it does - ;; use on-tutorial11, and if not say "No Dice!" + ;; use on-tutorial11, and if not say "No Dice!" such as when one pics + ;; some-file.html which also loads boot.js (set-on-new-window 'on-default :path "default") (open-browser))