+Trace function, +Constants
[lineal.git] / src / webui / index.lisp
blobeb8948f8135d8dab471f84732fbef6d3e49b2134
2 ;V Insert javascript tags.V
3 (defmacro js-tag (s . body)
4 `(progn
5 (princ "<script type=\"text/javascript\">" ,s)
6 ,@body
7 (princ "</script>" ,s)))
9 ;V Easily insert parenscript.V
10 (defmacro ps-tag (s . body)
11 `(js-tag ,s (princ (ps ,@body) ,s)))
13 (defmacro jsfile (s file)
14 `(progn
15 (princ "<script type=\"text/javascript\" src=\"/jsfiles/" ,s)
16 (princ ,file ,s)
17 (princ ".js\"></script>" ,s)))
19 ;V URL: /recall_vrbl
20 ;V Get a variable out of memory.V
21 (defun web-recall-vrbl ()
22 (recall-vrbl (parameter "name"))
23 "varible wiped")
25 (defun calcupage-link (strm)
26 (with-html-output
27 (strm)
28 (:a :href "/calcupage-infix" "Calculate things")
29 " the regular way, or in "
30 (:a :href "/calcupage-prefix" "lisp style") "."))
32 ;V URL: /
33 ;V The main page.V
34 (defun front-page ()
35 (with-html-output-to-string
36 (s nil :prologue t)
37 (:html
38 (:head (:title "Welcome to Lineal v0.1.6"))
39 (:body
40 (:form
41 :name "optionForm"
42 :action (ps-inline
43 (setf window.location
44 document.option-form.action-menu.value))
45 (:div
46 (:a :href "/input_matrix" "Create and edit")
47 " vectors and matrices" :br
48 (calcupage-link s) :br
49 (unless (boundp 'lineal.devvars::no-save-restore)
50 (with-html-output
51 (s) (:a :href "/save_restore" "Save/Restore") " Session" :br))
52 "Browse the "
53 (:a :href "/doc/index.html" "documentation")
54 " (you really should)" :br
55 (when (boundp 'lineal.devvars::reload-page)
56 (with-html-output
57 (s) (:a :href "/reload" "Reload for changes") :br))
58 :br (:a :href "/COPYING.txt"
59 "This software is subject to the MIT License")))))))