Commit 759451c5 authored by Dave Cooper's avatar Dave Cooper

Merge branch 'devo' of https://gitlab.common-lisp.net/gendl/gendl into devo

parents 6cf09a39 c6d4f301
((("19" "29") ("Agile KOM 2")) (("19" "39") ("Agile KOM")))
\ No newline at end of file
((("20" "00") ("Test description")) (("20" "00") ("Description of task")) (("20" "00") ("Description of task")) (("20" "00") ("Description of task")) (("20" "00") ("Description of task")) (("20" "00") ("Description of task")) (("20" "00") ("Description of task")) (("0" "3") ("Description of task")) (("0" "3") ("Description of task")) (("0" "3") ("Description of task")))
\ No newline at end of file
((("20" "00") ("Test")) (("20" "00") ("Test")) (("20" "00") ("Test")))
\ No newline at end of file
((("19" "44") ("timer dev")))
\ No newline at end of file
......@@ -15,31 +15,58 @@
(main-sheet-body (with-cl-who-string ()
(:div :id "content"
(:script :src "https://code.jquery.com/jquery-2.1.4.min.js")
(:script :src "/timer-static/scripts.js")
(str (the timer-header main-div))
(str (the timer-form-min form-control))
(str (the timer-form-sec form-control))
(:br)
(str (the timer-button main-div))
(:hr)
(str (the journal-form-name form-control))
(:br)
(str (the journal-form-descr form-control))
(str (the journal-button main-div))
(str (the timer-form-min form-control-string))
(str (the timer-form-sec form-control-string))
(str (the timer-section main-div))
(str (the journal-section main-div))
(:br)
(str (the journal-entries-display main-div)))))
(additional-header-content
(with-cl-who-string ()
(:link :href "/timer-static/style/styles.css"
:rel "stylesheet"
:type "text/css"))))
:type "text/css")
((:script :type "text/javascript") (str (the report-to-mother)))))
(report-to-mother (format nil "
function reportToMother ()
{~a}"
(the (gdl-ajax-call :form-controls (list (the timer-form-min)
(the timer-form-sec)))))))
:objects
; Header that says "TIMER"
((timer-header :type 'sheet-section
:inner-html (with-cl-who-string ()
(:h1 :id "header" "timer")))
(timer-section :type 'sheet-section
:inner-html (with-cl-who-string ()
(:br)
(str (the start-button form-control-string))
(str (the pause-button form-control-string))))
(journal-section :type 'sheet-section
:inner-html (with-cl-who-string ()
(:hr)
(str (the journal-form-name form-control-string))
(:br)
(str (the journal-form-descr form-control-string))
(:br)
(str (the journal-button form-control-string))))
; Form for the timer.
(timer-form-min :type 'text-form-control
:default "20"
......@@ -48,39 +75,44 @@
:default "00"
:size 2)
; Form for the name and description (journal)
(start-button :type 'button-form-control
:onclick (format nil "timerStart('~a','~a')"
(symbol-name (the timer-form-min id))
(symbol-name (the timer-form-sec id)))
:label "Start")
(pause-button :type 'button-form-control
:onclick (format nil "timerPause()")
:label "Pause")
;; Form for the name and description (journal)
;; FLAG -- make these into lookup items (menu-form-control or combo box).
(journal-form-name :type 'text-form-control
:id "journal-name"
:default "Name")
(journal-form-descr :type 'text-form-control
:id "journal-descr"
:default "Description of task")
; Button that says "START"
(timer-button :type 'sheet-section
:inner-html (with-cl-who-string ()
((:button :onclick
(concatenate 'string
"timerStart('"
(symbol-name (the timer-form-min id))
"','"
(symbol-name (the timer-form-sec id))
"')"))
"Start")))
(journal-button :type 'sheet-section
:inner-html (with-cl-who-string ()
((:button :onclick (the (gdl-ajax-call
:form-controls (list (the timer-form-min)
(the timer-form-sec)
(the journal-form-name)
(the journal-form-descr))
:function-key :record-journal-entry)))
"Record entry")))
; Displays journal entries
(journal-button :type 'button-form-control
:id "journal-button"
:onclick (the (gdl-ajax-call
:form-controls (list (the timer-form-min)
(the timer-form-sec)
(the journal-form-name)
(the journal-form-descr))
:function-key :record-journal-entry))
:label "Record entry")
;; Displays journal entries
(journal-entries-display :type 'sheet-section
:inner-html (progn (the force-update-flag)
(with-cl-who-string ()
(fmt "Previous entries: ~{<p>~a</p>~}"
(fmt "Previous entries: ~{<div class='journal-entry'>~{<div class='journal-time'>~{~a min ~a secs~}</div>~%<div class='journal-descr'>~{~a ~}</div>~%~}</div>~}"
(the read-journal-entry))))))
:functions
......
......@@ -5,6 +5,9 @@ var timerStarted = false;
var start_min, start_sec;
var min_id, sec_id;
function timerPause() {clearInterval(interval); timerStarted = false;}
function timerStart(minid, secid) {
if (timerStarted) {
......@@ -34,6 +37,8 @@ function countDown() {
minutes--;
}
reportToMother();
if (minutes==0 && seconds==0) {
clearInterval(interval);
timerStarted = false;
......@@ -49,4 +54,25 @@ function countDown() {
document.getElementById(min_id).value = minutes;
document.getElementById(sec_id).value = seconds;
}
\ No newline at end of file
}
// Code for allowing journal entries to be repeated easily.
// Journal entry changes color on hover,
// contents get placed into the form on click.
$(document).ready(function(){
$(document).on("mouseenter", ".journal-entry", function(){
$(this).css('color', 'blue');
$(this).css('cursor', 'pointer');
});
$(document).on("mouseleave", ".journal-entry", function(){
$(this).css('color', '#000');
});
$(document).on("click", ".journal-entry", function(){
alert($("#journal-descr").val());
$("#journal-descr").val($(this).find(".journal-descr").html());
});
});
body {
padding: 0;
margin: 0;
margin-left: 10%;
margin-right: 10%;
font-family: "Arial";
}
#content {
text-align: center;
width: 400px;
margin-left: auto;
margin-right: auto;
}
input {
......@@ -25,4 +29,21 @@ button {
}
button:hover {
background-color: #ccc;
}
.journal-entry {
padding: 10px;
border-radius: 15px;
border: 2px solid #eee;
background-color: #eee;
margin: 5px;
}
.journal-time {
font-weight: bold;
margin-left: auto;
margin-right: auto;
}
.journal-descr {
margin-left: auto;
margin-right: auto;
}
\ No newline at end of file
......@@ -109,7 +109,8 @@ written consent from Genworks International.")
pdf-path pdftex-path)))))
(define-object assembly (com.genworks.dom:assembly)
:input-slots ((data *data*)))
:input-slots ((data *data*)
(style-url "tutorial.css")))
(publish :path "/dom-doc"
......@@ -118,11 +119,44 @@ written consent from Genworks International.")
(defun make-html (&key (output-directory (merge-pathnames "tmp/" (user-homedir-pathname)))
(output-file-namestring "tutorial.html"))
(output-file-namestring "tutorial.html"))
(ensure-directories-exist output-directory)
(initialize-data)
(let ((self (make-object 'assembly)))
(let ((output-path (merge-pathnames output-file-namestring output-directory)))
(with-format (html-format output-path) (write-the cl-who-out))
output-path)))
(defun make-css (&key (output-directory (merge-pathnames "tmp/" (user-homedir-pathname)))
(output-file-namestring "tutorial.css"))
(let ((output-path (merge-pathnames output-file-namestring output-directory))
(css-string
(reduce
(lambda (x y)
(concatenate 'string x y))
(mapcar
(lambda (style)
(format nil "~a{~a}"
(car style)
(format nil "~{~a~}"
(mapcar (lambda (pair)
(format nil "~a:~a;"
(car pair)
(cadr pair)))
(cdr style)))))
*styles*))))
(with-open-file (stream output-path
:direction :output
:if-exists :overwrite
:if-does-not-exist :create)
(format stream css-string))))
(defun make-html-and-css (&key (output-directory (merge-pathnames "tmp/" (user-homedir-pathname)))
(html-output-file-namestring "tutorial.html")
(css-output-file-namestring "tutorial.css"))
(make-html :output-directory output-directory
:output-file-namestring html-output-file-namestring)
(make-css :output-directory output-directory
:output-file-namestring css-output-file-namestring))
\ No newline at end of file
(in-package :gendl-doc)
(defparameter *styles*
'(
(body
(font-family "\'Arial\'")
(margin-left "10%")
(margin-right "10%"))
(a
(color "#666")
(text-decoration "none"))
("a:hover"
(color "#ccc"))
(pre
(background-color "#eee")
(padding "10px")
(border-radius "5px")
(font-family "monospace"))
(tt
(background-color "#eee"))
(div>ol
(border-left "6px solid #eee")
(margin "20px"))
(li
(margin "3px"))
("li li"
(font-size "90%"))
(dl
(margin-left "35px"))
(dt
(font-weight "bold"))))
\ No newline at end of file
......@@ -17,5 +17,5 @@
(:gdl "source/understanding-gendl")
(:gdl "source/advanced-common-lisp") (:gdl "source/advanced-gendl")
(:file "source/tasty-environment") (:file "source/gendl-geometry")
(:file "source/custom-user-interfaces")
(:file "source/custom-user-interfaces") (:file "source/styles")
(:file "source/bibliography") (:file "source/assembly")))
......@@ -209,12 +209,25 @@
(when (find-package :gendl) (in-package :gdl-user)))" *gendl-home*))
;;
;; DAP -- user can also setq this in ~/.emacs-gdl
;;
(defvar user-startup-string "")
(defun load-and-or-start-gendl ()
(setq slime-enable-evaluate-in-emacs t)
(slime-repl)
(insert gdl-startup-string)
(slime-repl-return)
(end-of-buffer))
(end-of-buffer)
;;
;; DAP -- Added to support user-startup-string
;;
(slime-repl-return)
(insert user-startup-string)
(slime-repl-return)
)
......@@ -332,6 +345,16 @@
(goto-char (point-max))
(insert gdl-startup-string)
(fi:inferior-lisp-newline)
(end-of-buffer)
;;
;; DAP - Added to support user-startup-string
;;
(end-of-buffer)
(goto-char (point-max))
(insert user-startup-string)
(fi:inferior-lisp-newline)
(end-of-buffer)))
......
......@@ -34,7 +34,12 @@ Defaults to nil."
primary? nil)
("String. You can use this to specify a user-defined class for the form-control. Defaults to nil, which means no class attribute will be generated."
class nil))
class nil)
("Keyword symbol. The ID attribute for this tag. Defaults to (the field-name)."
id (the field-name))
)
:computed-slots
(
......@@ -66,8 +71,7 @@ Previously known as form-control-string. Default is the form-control-string."
("Keyword symbol. The ID attribute for this tag. Defaults to (the field-name)."
id (the field-name))))
))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment