Commit 7f194bfb authored by Dave Cooper's avatar Dave Cooper
Browse files

grouped the inputs in timer app. Added pause button to timer app.

parent 46a137fa
((("19" "44") ("timer dev")))
\ No newline at end of file
......@@ -17,22 +17,23 @@
(:div :id "content"
(: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))
(str (the timer-button main-div))
(str (the journal-form-name form-control))
(str (the journal-form-descr form-control))
(str (the journal-button main-div))
(str (the timer-section main-div))
(str (the journal-section main-div))
(str (the journal-entries-display main-div)))))
(with-cl-who-string ()
(:link :href "/timer-static/style/styles.css"
:rel "stylesheet"
:type "text/css"))))
:type "text/css")))
(report-to-mother (format nil "
function reportToMother (seconds, minutes)
(the (gdl-ajax-call :function-key :report-from-timer
:arguments (list "seconds" "minutes"))))))
; Header that says "TIMER"
......@@ -40,6 +41,27 @@
:inner-html (with-cl-who-string ()
(:h1 :id "header" "timer")))
(timer-section :type 'sheet-section
:inner-html (with-cl-who-string ()
(str (the timer-form-min form-control-string))
(str (the timer-form-sec form-control-string))
(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 ()
(str (the journal-form-name form-control-string))
(str (the journal-form-descr form-control-string))
(str (the journal-button form-control-string))))
; Form for the timer.
(timer-form-min :type 'text-form-control
:default "20"
......@@ -48,35 +70,37 @@
: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
:default "Name")
(journal-form-descr :type 'text-form-control
:default "Description of task")
; Button that says "START"
(timer-button :type 'sheet-section
:inner-html (with-cl-who-string ()
((:button :onclick
(concatenate 'string
(symbol-name (the timer-form-min id))
(symbol-name (the timer-form-sec id))
(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
: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 ()
......@@ -5,6 +5,8 @@ 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 +36,8 @@ function countDown() {
reportToMother(seconds, minutes);
if (minutes==0 && seconds==0) {
timerStarted = false;
......@@ -49,4 +53,4 @@ function countDown() {
document.getElementById(min_id).value = minutes;
document.getElementById(sec_id).value = seconds;
\ No newline at end of file
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