From: paul Date: Thu, 23 Jun 2016 01:15:53 +0000 (+0000) Subject: unify css, increase responsiveness by reducing server communication X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=9f7782b085e44a2ecb656674f48be0e2b20fc31c;p=lobster unify css, increase responsiveness by reducing server communication svn path=/trunk/; revision=116 --- diff --git a/static/common.css b/static/common.css new file mode 100644 index 0000000..fa8528c --- /dev/null +++ b/static/common.css @@ -0,0 +1,50 @@ +* { + font-family: sans-serif; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + z-index: 0; +} +body { + background: #EEE; + margin: 0; + padding: 2.5em 0 0 0; +} +.NAVIGATION { + position: fixed; + top: 0; + display: inline-block; + border-style: none solid solid solid; + border-width: 0 1px 1px 1px; + border-radius: 0 0 4px 4px; + margin: 0 auto auto 3%; + padding: .5em 1ex .5em 1ex; + background: #FFF; + z-index: 1; +} +.NAVIGATION a { + color: #008; + border: solid 1px #BBF; + margin: .5em .5ex .25em .5ex; + padding: .2em 3ex .2em 3ex; + background: #EFF; +} +.NAVIGATION a:hover { + border-width: 2px 1px 2px 1px; + background: #F3FFFF; +} + +.trailbtn { display: none; } +.trailbtn + .trailbox { display: none; } +.trailbtn:checked + .trailbox { display: inline-block; } +.trailbtn:checked + .trailbox + .trailbtn { display: block; } +.trailbtn:checked + .trailbox + .trailbtn:before { + display: block; content: '+'; + width: 3ex; text-align: center; + margin-top: .25em; padding: .25em 0; + background-color: #FFF; + border-width: 1px; border-style: solid; +} +.trailbtn:checked + .trailbox + .trailbtn:checked, +.trailbtn:checked { display: none; } + diff --git a/templates/edit_prescription.sh b/templates/edit_prescription.sh index 285739a..dac7270 100755 --- a/templates/edit_prescription.sh +++ b/templates/edit_prescription.sh @@ -121,11 +121,11 @@ cat <' + printf '' else - printf '' + printf '' fi - printf '

+ printf '

diff --git a/templates/frame.html.sh b/templates/frame.html.sh index 4c6cb1d..53c7269 100755 --- a/templates/frame.html.sh +++ b/templates/frame.html.sh @@ -27,45 +27,9 @@ cat < $(l10n p_${PAGE}) + diff --git a/templates/prescriptions.css.sh b/templates/prescriptions.css.sh index 9d1baf8..0bf19c1 100755 --- a/templates/prescriptions.css.sh +++ b/templates/prescriptions.css.sh @@ -22,6 +22,20 @@ cat < button[type=submit] { + position: fixed; display: block; + top: 0; left: 15em; + height: 2.25em; padding: 0 3ex; + font-size: 1em; font-weight: bold; + color: #000; background-color: #FDD; + border-width: 1px; border-color: #000; + border-style: none solid solid solid; + border-radius: 0 0 4px 4px; +} +form > button[type=submit]:hover { + background-color: #FEE; +} + input.tab { display: none; } input.tab + label.tab { display: block; } input.tab + label.tab::before { content: '\25b8 \00a0'; float: left;} @@ -251,24 +268,22 @@ label.heading > span.no { .tab > .therapist { width: 30%; } .tab > .signature { width: 20%; } label.tab > .signature { font-size: .75em; } -.tab > .signature > button { display: inline-block; margin: 0; } -/* fieldset.tab > button[type=submit] { width: 5%; text-align: center; margin-left: 5%;} */ -fieldset.tab > button[type=submit] { height: 2em; color: #FFF; font-weight: bold;} -fieldset.tab > button[type=submit]::first-letter { font-size: 1.75em;} -.signature > button[value=pos], -.signature > button[value=neg] { - margin-bottom: .25em; - border: 1px solid black; - height: 1.5em; width: 1.5em; - vertical-align: top; +.signature > input[type=checkbox] { + display: inline; + font-weight: bold; + font-size: 1.25em; +} +.signature > input[type=checkbox]:before { + display: block; width: 1.25em; + margin: -.125em 0 0 -.5ex; background-color: #FFF; - color: #000; - white-space: nowrap; + text-align: center; + content: "\00a0 \00a0 \00a0"; +} +.signature > input[type=checkbox]:checked::before { + content: "\2713"; } -.signature > input[type=checkbox] {display: none;} -.signature > button[value=neg]::before { padding: 0 1ex 0 .25ex; content: "\2713"; } -.signature > button[value=pos]::before { padding: 0 1ex 0 .25ex; content: "\00a0 \00a0 \00a0"; } input.tab + label.tab > input.date, input.tab + label.tab > input.therapist { @@ -283,12 +298,11 @@ input.tab:checked + label.tab > span.therapist { display: none; } - div.tab { border: 2px solid #333; border-top-width: 1px; margin-top: -1px; - padding: .25em .5ex; + padding: .25em .5ex 1em .5ex; } div.tab > fieldset.note { border: none; @@ -296,7 +310,7 @@ div.tab > fieldset.note { } div.tab > fieldset.note > textarea { display: block; - width: 95%; height: 8em; + width: 93%; height: 8em; margin: -8em 0 .5em 2em; font: normal 1em sans-serif; } @@ -310,7 +324,7 @@ div.tab > fieldset.note > input.color[value="#A0A"]:checked ~ textarea { backgro div.tab > fieldset.note > input.color[value="#AA0"]:checked ~ textarea { background-color: #FF8; } div.tab > fieldset.note > input.color[value="#FFF"]:checked ~ textarea { background-color: #FFF; } -div.tab > button.delete {float: right; display: inline-block;} +div.tab > button.delete {float: right; display: inline-block; margin-top: -1em;} EOF # vi:set filetype=css: 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: