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