X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=templates%2Ftherapy.html.sh;h=ce97dfb0ea959f6ae1ddef33dd5e2eea34e92b17;hp=05c50fd157f8338afa524c325cfbc568048703d2;hb=9f7782b085e44a2ecb656674f48be0e2b20fc31c;hpb=9b13f7013dd882029ab3cf106d659a48243d910d diff --git a/templates/therapy.html.sh b/templates/therapy.html.sh index 05c50fd..ce97dfb 100755 --- a/templates/therapy.html.sh +++ b/templates/therapy.html.sh @@ -33,8 +33,13 @@ t_session_note(){ *) c7=checked;; esac +if [ "$note_n" -eq 1 -o -n "${tpy[session${session_n}_note${note_n}]}" ]; then + printf '' +else + printf '' +fi cat < +
@@ -54,16 +59,8 @@ t_session(){ sid=session${session_n} if [ "$tpy[${sid}_sigset]" = pos ]; then - sig=neg - sigcheck=checked - elif [ "$tpy[${sid}_sigset]" = neg ]; then - sig=pos - unset sigcheck - elif [ "$tpy[${sid}_signature]" = pos ]; then - sig=neg sigcheck=checked else - sig=pos unset sigcheck fi @@ -76,19 +73,13 @@ cat <${tpy[${sid}_therapist]} + -->
- $(n=1; while [ -n "${tpy[${sid}_note${n}]+x}" ]; do - t_session_note $session_n $n - n=$(($n+1)) - done - printf '' "$sid" "$n" - ) + $( for n in {1..50}; do t_session_note $session_n $n; done ) -
EOF } @@ -202,67 +193,67 @@ cat < - - + image_serialize += " polyline" + image.beginPath() + draw(x, y) +} +function drawstop() { + mouse = 0 + image.closePath() + //dbg.innerHTML = image_serialize + data.value = image_serialize +} + +window.addEventListener( 'mouseup', function() { drawstop() } ) +canvas.addEventListener( 'mousedown', function(e) { drawstart(e.clientX, e.clientY) } ) +canvas.addEventListener( 'mousemove', function(e) { draw(e.clientX, e.clientY) } ) +window.addEventListener( 'touchend', function() { drawstop() } ) +canvas.addEventListener( 'touchstart', function(e) { drawstart(e.touches[0].clientX, e.touches[0].clientY) } ) +canvas.addEventListener( 'touchmove', function(e) { e.preventDefault(); draw(e.touches[0].clientX, e.touches[0].clientY) } ) +--> EOF # vi:set filetype=html: