# along with Confetti. If not, see <http://www.gnu.org/licenses/>.
*/
+.filter, .newcard, .card { box-shadow: 0 0 1ex; }
+
.filter {
display: block;
border: solid 1px;
.card .control .item {
display: inline-block;
width: 100%;
- min-height: 2.5em;
+ height: 2.5em;
+ line-height: 2.5em;
+ margin: .25em 0;
+ padding: 0 .5em;
+ font-size: .75em;
color: #008;
- margin: .25em 0 .5em 0;
- border: 1px solid black;
background: #FFF;
- padding: .25em .75ex 0 .75ex;
text-decoration: none;
- font-size: .75em;
+ border: 1px solid #888;
+ box-shadow: 0 0 .5ex #888;
}
-.card .control .item:hover{ border-color: #888; }
-.card .control input.item { font-size: normal; }
.card .control button.item { text-align: right;}
-.card .control button.item:hover{ border-color: #888;}
+.card .control .item:hover{ border-color: #008; box-shadow: 0 0 .5ex #008; }
.card .control .item[name=newfield] {
width: calc(100% - 2.5em);
.card .section.prescriptions { width: 40ex;}
+form.card input.delete { display: none; }
+form.card input.delete + label {
+ display: inline-block;
+ position: relative;
+ font-size: .875em;
+ left: calc(100% - 1.5em);
+ width: 1.5em;
+ margin-bottom: -1.5em;
+ overflow: hidden;
+ white-space: nowrap;
+ vertical-align: bottom;
+}
+form.card input.delete + label:before {
+ display: inline-block;
+ content: 'x';
+ width: calc(1.5em - 2px); height: calc(1.5em - 2px);
+ vertical-align: bottom;
+ text-align: center;
+ color: #444;
+ background-color: #FBB;
+ border: 1px solid #BBB;
+}
+form.card input.delete + label + input[type=text],
+form.card input.delete + label + input:not([type]),
+form.card input.delete + label + select + input.TEL {
+ width: calc(100% - 1.5em);
+}
+form.card input.delete[name^=TEL_] + label { top: 1.5em; }
+form.card input.delete[name^=TEL_] + label:before { border-top: none; }
+form.card input.delete[name^=NOTE_] + label,
+form.card input.delete[name^=ADR_] + label { margin-bottom: 0; }
+form.card input.delete[name^=NOTE_] + label:before,
+form.card input.delete[name^=ADR_] + label:before { border-bottom: none; }
+
+form.card input.delete:checked + label,
+form.card input.delete:checked + label + input,
+form.card input.delete:checked + label + select,
+form.card input.delete:checked + label + select + input,
+form.card input.delete:checked + label + textarea {
+ display: none
+}
+
form.card .section input[type=text],
form.card .section input:not([type]),
form.card .section textarea,
"$(pdi_value "$card" "$item" |HTML)"
fi
;;
- BDAY) if [ $cnt -gt 0 ]; then
- printf '[span .item .BDAY [b *:] %s]' \
- "$(pdi_value "$card" BDAY |grep -xE '[0-9-]+')"
- fi
+ BDAY)
+ [ $cnt -gt 0 ] && printf '[span .item .BDAY [b *:] %s]' \
+ "$(pdi_value "$card" BDAY |grep -xE '[0-9-]+')"
;;
- SOUND) if [ $cnt -gt 0 ]; then
- printf '[audio .item .SOUND controls="controls"
- [source type="audio/ogg" src="data:audio/ogg;base64,%s"]
- ]' \
- "$(pdi_value "$card" SOUND |grep -xE '[a-zA-Z0-9/+=]+')"
- fi
+ SOUND)
+ [ $cnt -gt 0 ] && printf '[audio .item .SOUND controls="controls"
+ [source type="audio/ogg" src="data:audio/ogg;base64,%s"]
+ ]' \
+ "$(pdi_value "$card" SOUND |grep -xE '[a-zA-Z0-9/+=]+')"
;;
- PHOTO|LOGO) if [ $cnt -gt 0 ]; then
- printf '[img .item .%s src="data:image/%s;base64,%s"]' "$item" \
- "$(pdi_attrib "$card" "$item" |sed -E 's;^(.*;)?TYPE="?(.+)"?(;.*)?$;\2;')" \
- "$(pdi_value "$card" "$item" |grep -xE '[a-zA-Z0-9/+=]+')"
- fi
+ PHOTO|LOGO)
+ [ $cnt -gt 0 ] && printf '[img .item .%s src="data:image/%s;base64,%s"]' "$item" \
+ "$(pdi_attrib "$card" "$item" |sed -E 's;^(.*;)?TYPE="?(.+)"?(;.*)?$;\2;')" \
+ "$(pdi_value "$card" "$item" |grep -xE '[a-zA-Z0-9/+=]+')"
;;
- EMAIL) if [ $cnt -gt 0 ]; then
- printf '[h3 %s]' "$(l10n EMAIL)"
- seq 1 $cnt |while read c; do
- printf '[a .item .EMAIL href="mailto:%s" ­%s]' \
- "$(pdi_value "$card" EMAIL $c |unescape |HTML)" \
- "$(pdi_value "$card" EMAIL $c |unescape |HTML)"
- done
- fi
+ EMAIL)
+ [ $cnt -gt 0 ] && printf '[h3 %s]' "$(l10n EMAIL)"
+ seq 1 $cnt |while read c; do
+ printf '[a .item .EMAIL href="mailto:%s" ­%s]' \
+ "$(pdi_value "$card" EMAIL $c |unescape |HTML)" \
+ "$(pdi_value "$card" EMAIL $c |unescape |HTML)"
+ done
;;
- TEL) if [ $cnt -gt 0 ]; then
- printf '[h3 %s]' "$(l10n TEL)"
- seq 1 $cnt |while read c; do
- teltype="$(pdi_attrib "$card" TEL $c TYPE)"
- [ "$teltype" ] \
- && printf '[span .item .TEL [span .type ­%s:] %s]' \
- "$(l10n "TYPE=$teltype" |HTML)" \
- "$(pdi_value "$card" TEL $c |unescape |HTML)" \
- || printf '[span .item .TEL ­%s]' \
- "$(pdi_value "$card" TEL $c |unescape |HTML)"
- done
- fi
+ TEL)
+ [ $cnt -gt 0 ] && printf '[h3 %s]' "$(l10n TEL)"
+ seq 1 $cnt |while read c; do
+ teltype="$(pdi_attrib "$card" TEL $c TYPE)"
+ [ "$teltype" ] \
+ && printf '[span .item .TEL [span .type ­%s:] %s]' \
+ "$(l10n "TYPE=$teltype" |HTML)" \
+ "$(pdi_value "$card" TEL $c |unescape |HTML)" \
+ || printf '[span .item .TEL ­%s]' \
+ "$(pdi_value "$card" TEL $c |unescape |HTML)"
+ done
;;
- *) if [ $cnt -gt 0 ]; then
- printf '[h3 %s]' "$(l10n "$item")"
- seq 1 $cnt |while read c; do
- printf '[span .item .%s ­%s]' "$item" \
- "$(pdi_value "$card" "$item" $c |unescape |HTML)"
- done
- fi
+ *)[ $cnt -gt 0 ] && printf '[h3 %s]' "$(l10n "$item")"
+ seq 1 $cnt |while read c; do
+ printf '[span .item .%s ­%s]' "$item" \
+ "$(pdi_value "$card" "$item" $c |unescape |HTML)"
+ done
;;
esac
done
;;
BDAY|X-ZACK-JOINDATE|X-ZACK-LEAVEDATE)
printf '[h3 %s]
- [input .item .%s name="%s" value="%s" placeholder="YYYY-MM-DD"]
- ' \
+ [input .item .%s name="%s" value="%s" placeholder="YYYY-MM-DD"]' \
"$(l10n "$item")" "$item" "$item" "$(pdi_value "$card" "$item" |grep -xE '[0-9-]+')"
;;
ADR|NOTE)
printf '[h3 %s]' "$(l10n "$item")"
seq 1 $cnt |while read c; do
+ printf '[checkbox "%s_delete" "%i" .delete #%s_delete_%i][label for="%s_delete_%i" %s]' \
+ "$item" $c "$item" $c "$item" $c "$(l10n delete)"
printf '<textarea class="item %s" name="%s">%s</textarea>' \
- "$item" "$item" "$(pdi_value "$card" "$item" $c |unescape |HTML)"
+ "$item" "$item" "$(pdi_value "$card" "$item" $c |unescape |HTML)"
done
;;
TEL) printf '[h3 %s]' "$(l10n "$item")"
seq 1 $cnt |while read c; do
+ printf '[checkbox "%s_delete" "%i" .delete #%s_delete_%i][label for="%s_delete_%i" %s]' \
+ "$item" $c "$item" $c "$item" $c "$(l10n delete)"
teltype="$(pdi_attrib "$card" TEL $c TYPE)"
printf '[select .item .teltype name="teltype"
[option value="" disabled="disabled" %s %s]
"$([ "$teltype" = 'FAX' ] && printf 'selected="selected"')" "$(l10n TYPE=FAX)"
printf '[input .item .%s name="%s" value="%s" placeholder="%s"]' \
- "$item" "$item" "$(pdi_value "$card" "$item" $c |unescape |HTML)" "$(l10n "$item")"
+ "$item" "$item" "$(pdi_value "$card" "$item" $c |unescape |HTML)" "$(l10n "$item")"
done
;;
- *) printf '[h3 %s]' "$(l10n "$item")"
+ *)printf '[h3 %s]' "$(l10n "$item")"
seq 1 $cnt |while read c; do
+ printf '[checkbox "%s_delete" "%i" .delete #%s_delete_%i][label for="%s_delete_%i" %s]' \
+ "$item" $c "$item" $c "$item" $c "$(l10n delete)"
printf '[input .item .%s name="%s" value="%s" placeholder="%s"]' \
- "$item" "$item" "$(pdi_value "$card" "$item" $c |unescape |HTML)" "$(l10n "$item")"
+ "$item" "$item" "$(pdi_value "$card" "$item" $c |unescape |HTML)" "$(l10n "$item")"
done
;;
esac
while read cardfile; do
cachefile="${_DATA}/cache/${cardfile##*/}.cache"
- if [ -s "$cachefile" -a "$cachefile" -nt "$cardfile" \
- -a "$cachefile" -nt "${_EXEC}/cards" ]; then
+ # if [ -s "$cachefile" -a "$cachefile" -nt "$cardfile" \
+ # -a "$cachefile" -nt "${_EXEC}/cards" ]; then
+ if [ -s "$cachefile" -a "$cachefile" -nt "$cardfile" ]; then
cat "$cachefile"
else
print_card "$cardfile" |tee "$cachefile"