]> git.plutz.net Git - confetti/commitdiff
unify css, increase responsiveness by reducing server communication
authorpaul <paul@plutz.net>
Thu, 23 Jun 2016 01:15:53 +0000 (01:15 +0000)
committerpaul <paul@plutz.net>
Thu, 23 Jun 2016 01:15:53 +0000 (01:15 +0000)
svn path=/trunk/; revision=116

static/common.css [new file with mode: 0644]
templates/edit_prescription.sh
templates/frame.html.sh
templates/prescriptions.css.sh
templates/therapy.css.sh
templates/therapy.html.sh

diff --git a/static/common.css b/static/common.css
new file mode 100644 (file)
index 0000000..fa8528c
--- /dev/null
@@ -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; }
+
index 285739aa3f9134ff76acb9b3aa625af6979108cb..dac7270362fcd58998dae5818bf18866380be51f 100755 (executable)
@@ -121,11 +121,11 @@ cat <<END_HTML
 
 $( for n in {0..10}; do
   if [ "$n" -eq 0 -o -n "${mpx[quantity$n]}" -o -n "${mpx[remidy$n]}" -o -n "${mpx[quantity_weekly$n]}" ]; then
 
 $( for n in {0..10}; do
   if [ "$n" -eq 0 -o -n "${mpx[quantity$n]}" -o -n "${mpx[remidy$n]}" -o -n "${mpx[quantity_weekly$n]}" ]; then
-    printf '<input type="checkbox" checked="checked">'
+    printf '<input class="trailbtn" type="checkbox" checked="checked" />'
   else
   else
-    printf '<input type="checkbox">'
+    printf '<input class="trailbtn" type="checkbox" />'
   fi
   fi
-  printf '<p>
+  printf '<p class="trailbox">
     <input class="quantity" name="quantity" placeholder="%s" value="%s">
     <textarea class="remidy" name="remidy" placeholder="%s">%s</textarea>
     <input class="quantity_weekly" name="quantity_weekly" placeholder="%s" value="%s">
     <input class="quantity" name="quantity" placeholder="%s" value="%s">
     <textarea class="remidy" name="remidy" placeholder="%s">%s</textarea>
     <input class="quantity_weekly" name="quantity_weekly" placeholder="%s" value="%s">
index 4c6cb1dcd2663049672f8d784b97c44e1995c4a4..53c72697c491a5f33407deacce43e0f80d2d6988 100755 (executable)
@@ -27,45 +27,9 @@ cat <<EOF
   <head>
     <title>$(l10n p_${PAGE})</title>
     <meta name="viewport" content="width=device-width">
   <head>
     <title>$(l10n p_${PAGE})</title>
     <meta name="viewport" content="width=device-width">
+    <link rel="stylesheet" href="?static=common.css">
     <style type="text/css">
     <!--
     <style type="text/css">
     <!--
-* {
-  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;
-}
-
-/* dynamic page CSS starts here */
 $(debug CSS; [ -x "${CSS}" ] && . "${CSS}")
     -->
     </style>
 $(debug CSS; [ -x "${CSS}" ] && . "${CSS}")
     -->
     </style>
index 9d1baf8fe6e74c744e361cb1fdc96e5829c37a8a..0bf19c105d3d493967d8a4a84565c727d42959d5 100755 (executable)
@@ -22,6 +22,20 @@ cat <<EOF
 /**/
 body {padding-bottom: 3em; }
 
 /**/
 body {padding-bottom: 3em; }
 
+.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; }
+
 .prescription {
   display: inline-block;
   width: 96%; max-width: 460px;
 .prescription {
   display: inline-block;
   width: 96%; max-width: 460px;
@@ -223,21 +237,6 @@ input[name=presctype][value^=altpractition]:checked  ~ fieldset,
   .description #quantity_weekly,
   .description .quantity_weekly { width: 20%; height: 3em; text-align: center;}
 
   .description #quantity_weekly,
   .description .quantity_weekly { width: 20%; height: 3em; text-align: center;}
 
-  .description input[type=checkbox] { display: none; }
-  .description input[type=checkbox] + p { display: none; }
-  .description input:checked + p { display: inline-block; }
-  .description input:checked + p + input { display: block;}
-  .description input:checked + p + input:after {
-     display: block; width: 3ex;
-     background-color: #FFF;
-     border: 1px solid black;
-     margin-top: .25em;
-     text-align: center;
-     content: '+';
-  }
-  .description input:checked + p + input:checked,
-  .description input:checked { display: none; }
-
   .description .indicator_codes {display: inline-block; width: 20%; padding: 0; padding-top: 1.5ex;}
   .description label[for=indicator],
   .description label[for=icd10] { display: block; width: 100%;}
   .description .indicator_codes {display: inline-block; width: 20%; padding: 0; padding-top: 1.5ex;}
   .description label[for=indicator],
   .description label[for=icd10] { display: block; width: 100%;}
index 57f35fefa224af7e5f924956a7a8d34b6a258e11..2f491477a137a900ddff51aaad88e4b6c468d480 100755 (executable)
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 cat <<EOF
 #!/bin/sh
 
 cat <<EOF
+
+.trailbtn:checked + fieldset.trailbox { display: block;}
+
 * { box-sizing: border-box; }
 body {
   overflow: scroll;
 * { box-sizing: border-box; }
 body {
   overflow: scroll;
@@ -10,6 +13,20 @@ body {
   padding-top: 2em;
 }
 
   padding-top: 2em;
 }
 
+form > 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;}
 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 > .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;
   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 {
 
 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;
 }
 
   display: none;
 }
 
-
 div.tab {
   border: 2px solid #333;
   border-top-width: 1px;
   margin-top: -1px;
 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;
 }
 div.tab > fieldset.note {
   border: none;
@@ -296,7 +310,7 @@ div.tab > fieldset.note {
 }
 div.tab > fieldset.note > textarea {
   display: block;
 }
 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;
 }
   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 > 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:
 EOF
 
 # vi:set filetype=css:
index 05c50fd157f8338afa524c325cfbc568048703d2..ce97dfb0ea959f6ae1ddef33dd5e2eea34e92b17 100755 (executable)
@@ -33,8 +33,13 @@ t_session_note(){
     *)    c7=checked;;
   esac
 
     *)    c7=checked;;
   esac
 
+if [ "$note_n" -eq 1 -o -n "${tpy[session${session_n}_note${note_n}]}" ]; then
+  printf '<input class="trailbtn" type="checkbox" checked="checked">'
+else
+  printf '<input class="trailbtn" type="checkbox">'
+fi
 cat <<EOF
 cat <<EOF
-  <fieldset class=note>
+  <fieldset class="note trailbox">
     <input class=color type=radio name="$color" value="#888" id=${color}_000 $c0><label for=${color}_000></label>
     <input class=color type=radio name="$color" value="#00A" id=${color}_001 $c1><label for=${color}_001></label>
     <input class=color type=radio name="$color" value="#0A0" id=${color}_010 $c2><label for=${color}_010></label>
     <input class=color type=radio name="$color" value="#888" id=${color}_000 $c0><label for=${color}_000></label>
     <input class=color type=radio name="$color" value="#00A" id=${color}_001 $c1><label for=${color}_001></label>
     <input class=color type=radio name="$color" value="#0A0" id=${color}_010 $c2><label for=${color}_010></label>
@@ -54,16 +59,8 @@ t_session(){
   sid=session${session_n}
 
   if [ "$tpy[${sid}_sigset]" = pos ]; then
   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
     sigcheck=checked
   else
-    sig=pos
     unset sigcheck
   fi
 
     unset sigcheck
   fi
 
@@ -76,19 +73,13 @@ cat <<EOF
  --><input class="date" name="${sid}_date" value="${tpy[${sid}_date]}" placeholder="$(l10n date)"><!--
  --><span class=therapist>${tpy[${sid}_therapist]}</span><!--
  --><input class="therapist" name="${sid}_therapist" value="${tpy[${sid}_therapist]}" placeholder="$(l10n therapist)"><!--
  --><input class="date" name="${sid}_date" value="${tpy[${sid}_date]}" placeholder="$(l10n date)"><!--
  --><span class=therapist>${tpy[${sid}_therapist]}</span><!--
  --><input class="therapist" name="${sid}_therapist" value="${tpy[${sid}_therapist]}" placeholder="$(l10n therapist)"><!--
- --><span class=signature><input type=checkbox name="${sid}_signature" value=pos $sigcheck><button type=submit name=${sid}_sigset value=$sig></button></span>
+ --><span class=signature><input type="checkbox" name="${sid}_sigset" value="pos" $sigcheck></span>
   </label>
   <div class=tab>
     <img class="dotmark ov" src="/therapies/${id%.tpy}_${sid}.png" alt="">
   </label>
   <div class=tab>
     <img class="dotmark ov" src="/therapies/${id%.tpy}_${sid}.png" alt="">
-    $(n=1; while [ -n "${tpy[${sid}_note${n}]+x}" ]; do
-      t_session_note $session_n $n
-      n=$(($n+1))
-    done
-    printf '<button type=submit name=%s_note%s value="">+</button>' "$sid" "$n"
-    )
+    $( for n in {1..50}; do t_session_note $session_n $n; done )
 
     <button class=delete type=submit name=delete_session value=${session_n}>$(l10n delete_session)</button>
 
     <button class=delete type=submit name=delete_session value=${session_n}>$(l10n delete_session)</button>
-    <button type=submit>$(l10n save)</button>
   </div>
 EOF
 }
   </div>
 EOF
 }
@@ -202,67 +193,67 @@ cat <<EOF
   <input type=hidden id=image_serialize name=imagedata value="">
   <span id="jsdebug" style="display: none; position: fixed; right:0; bottom:0">Debug</span>
 
   <input type=hidden id=image_serialize name=imagedata value="">
   <span id="jsdebug" style="display: none; position: fixed; right:0; bottom:0">Debug</span>
 
-  <script><!--
-  body = document.body
-  canvas = document.getElementById("canvas")
-  dbg = document.getElementById("jsdebug")
-  image = canvas.getContext("2d")
-  mouse = 0
-  image_serialize=""
-  data=document.getElementById("image_serialize")
-
-  function setcol(c) {
-    image.strokeStyle = c
-    if ( c == "#FFF" ) image.lineWidth = 32
-    else image.lineWidth = 4
-    image_serialize += " stroke " + c + " stroke-width " + image.lineWidth
-  }
+  <button type="submit">$(l10n save)</button>
+</form>
 
 
-  setcol("$tpy[color]")
-
-  function draw(x, y) {
-    if ( mouse == 1){
-      if ( body.clientWidth >= 800 ){
-        sx=Math.floor(cscaleW * (x - canvas.offsetLeft))
-        sy=Math.floor(cscaleH * (y - canvas.offsetTop))
-      } else { 
-        sx=Math.floor(cscaleW * (x - canvas.offsetLeft + window.pageXOffset))
-        sy=Math.floor(cscaleH * (y - canvas.offsetTop + window.pageYOffset))
-      }
-      image.lineTo( sx, sy )
-      image.stroke()
-
-      image_serialize += " " + sx + "," + sy
-    }
-  }
+<script><!--
+body = document.body
+canvas = document.getElementById("canvas")
+dbg = document.getElementById("jsdebug")
+image = canvas.getContext("2d")
+mouse = 0
+image_serialize=""
+data=document.getElementById("image_serialize")
+
+function setcol(c) {
+  image.strokeStyle = c
+  if ( c == "#FFF" ) image.lineWidth = 32
+  else image.lineWidth = 4
+  image_serialize += " stroke " + c + " stroke-width " + image.lineWidth
+}
 
 
-  function drawstart(x, y) {
-    mouse = 1
+setcol("$tpy[color]")
 
 
-    cscaleW = canvas.width / canvas.clientWidth
-    cscaleH = canvas.height / canvas.clientHeight
+function draw(x, y) {
+  if ( mouse == 1){
+    if ( body.clientWidth >= 800 ){
+      sx=Math.floor(cscaleW * (x - canvas.offsetLeft))
+      sy=Math.floor(cscaleH * (y - canvas.offsetTop))
+    } else { 
+      sx=Math.floor(cscaleW * (x - canvas.offsetLeft + window.pageXOffset))
+      sy=Math.floor(cscaleH * (y - canvas.offsetTop + window.pageYOffset))
+    }
+    image.lineTo( sx, sy )
+    image.stroke()
 
 
-    image_serialize += " polyline"
-    image.beginPath()
-    draw(x, y)
-  }
-  function drawstop() {
-   mouse = 0
-   image.closePath()
-   dbg.innerHTML = image_serialize
-   data.value = image_serialize
+    image_serialize += " " + sx + "," + sy
   }
   }
+}
 
 
-  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) } )
+function drawstart(x, y) {
+  mouse = 1
 
 
-  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) } )
+  cscaleW = canvas.width / canvas.clientWidth
+  cscaleH = canvas.height / canvas.clientHeight
 
 
-  --></script>
-</form>
+  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) } )
+--></script>
 EOF
 # vi:set filetype=html:
 EOF
 # vi:set filetype=html: