Saturday, 23 June 2007
Feature: “Printer friendly” and “Monochrome” options in monthly log and historical chart pages
Added ``Printer friendly'' and ``Monochrome'' checkboxes to the monthly
log page. These set ``{\tt print}'' and ``{\tt mono}'' CGI arguments
which are propagated to navigation links and the embedded chart. These
choose CSS classes which re-format the monthly log for a printer and, if set,
monochrome output. In printer friendly mode, the monthly log table is
a non-editable static table with collapsed borders.
Added ``Printer friendly'' and ``Monochrome'' checkboxes to the Chart
Workshop and passed them on to {\tt history::drawChart} to apply those
modes to the historical chart.
Bug: Flag and comment fields lost in update of read-only monthly log
The monthlog::updateFromCGI method would clear existing flag and comment items when processing a log in which the edit fields were not defined (for example, one with protected days or a printer-friendly table). I modified the code to skip all updates if the day's rung or comment field was not defined in the CGI arguments.
Feature/admin: Sorting of administrative forms
Modified sorting of items in the administrator account, session, and persistent
login manager forms to be case-insensitive (or at least follow the order which
the Perl {\tt lc()} function produces).
Accessibility: Label links on various check boxes and radio buttons
Wrapped the ``Custom'' radio button in the Chart Workshop and Trend
Analysis pages in a <label> tag with its label. This allows
clicking the label as well as the button and assists non-visual
browsers in identifying the control.
Added <label> tags to the radio buttons in the Export Log Database
form.
Added <label> wrappers to the administrator object dump checkboxes
at the bottom of the Monthly Log form.
Feature: Build number and date in non-beta builds
Made display of the build number not conditional upon beta test mode.
The item is sufficiently unobtrusive at the bottom of the utilities
menu page and useful to knowledgeable folks checking for changes
that it's worth leaving on in production.
Bug: Undefined variable reference updating rung fields
The {\tt monthlog::updateFromCGI} method referenced undefined rung
CGI variables when called from a form in which some or all of the rung
fields were non-edit fields (as in a read-only or printer-friendly
log page)---fixed.
Tuesday, 19 June 2007
Documentation: Online documentation updated
An update to the documentation for The Hacker's Diet Online has been posted. This update documents the features added since the start of the beta test program, and a few items omitted from the original document. Screen shots have been updated to reflect the current version of the application.
Feature: “Remember me” persistent login
The initial implementation of ``Remember me'' is now in place. The sign in form now includes a checkbox which selects ``Remember me'' mode, which (unless the user is logging into a read-only account), drops a cookie in the user's browser and stores a corresponding token in the ``{\tt RememberMe}'' directory which records the user name, time of creation, and time of expiry. When about to display the sign in form, we check whether the browser sent a persistent login cookie. If so, and a token is stored with its code, we automatically sign in the user and proceed to the monthly log page without the need to enter a user name or password. When a sign in via cookie is performed, the cookie used is revoked and a new cookie is assigned. Thus, only the most recently cookie is valid; a previously intercepted and stored cookie is useless.
A sign out takes the user to a sign in page via a special ``{\tt newlogin}''
transaction which bypasses the automatic cookie login. This allows the
user to uncheck ``Remember me'' and revoke the cookie (for this browser).
When logged in via a cookie, the ``Settings'' page is inaccessible. This
keeps a user who somehow manages to hijack a cookie from changing the user's
password or disclosing identity information. A user who has logged in with a
cookie can log out, log back in with their user name and password, and then
access the settings page.
A new ``Forget persistent logins'' item in the Utilities page permits
a user to delete all stored ``Remember me'' tokens. This will invalidate
all cookies stored in browsers for this user.
A new administrator ``Manage persistent logins'' page shows all
persistent login tokens. The administrator can delete any persistent
login token by checking it and pressing the ``Delete'' button,
specifying the administrator's password.
Added fields to the login history record to indicate whether the session
is on a handheld device and if the login was done via a cookie.
Feature/admin: Dump CGI arguments and environment variables
Added an option to the Monthly Log form when viewed with administrative
privilege to dump the CGI arguments and environment string used to invoke
the form.
Thursday, 14 June 2007
Feature: Handheld device support
The Sign In page now includes a check box titled “Handheld device” which, if checked, formats output for display on the small screen of devices such as personal digital assistants and mobile telephones. Image icons are suppressed, the large style sheet used for desktop presentation is skipped, and the charts in the monthly and historical charts default to 320×240 pixels in size. Handheld formatting is a property of the session and persists until the user signs out. A new column in the administrator session manager shows whether a session is in handheld mode.
Users of handheld devices can preset this mode and select a sign in form which is itself formatted for a small screen by bookmarking the URL:
https://www.fourmilab.ch/cgi-bin/HackDiet?handheld=y
which will also preset the handheld device check box. The present implementation is really just the beginning of an ongoing project of adapting the formatting for a small screen. While the result is certainly better than displaying the full desktop forms, a great deal more could be done to better optimise for small screens and slow connections, and suggestions for improvement are welcome.
https://www.fourmilab.ch/cgi-bin/HackDiet?handheld=y
which will also preset the handheld device check box. The present implementation is really just the beginning of an ongoing project of adapting the formatting for a small screen. While the result is certainly better than displaying the full desktop forms, a great deal more could be done to better optimise for small screens and slow connections, and suggestions for improvement are welcome.
Bug: Incorrect height in small historical charts
If the historical chart size was set to $320\times 200$ the actual chart
would be $320\times 320$ due to an incorrect test in the chart size
sanity check---fixed.
Changed the smallest historical chart size to $320\times 240$. With the
caption at the bottom, this leaves more room for the actual chart.
Bug: Caption in small historical charts
When the width of an historical chart was set to less than 480 pixels,
the first line of the caption was truncated. I added an abbreviated
caption which is generated in this case. The body mass index caption
barely fits, but there's no reason to abbreviate further unless we allow
charts less than 320 pixels wide.
Sunday, 10 June 2007
Bug: Excel CSV records with four-digit year specifications
Importing Excel CSV records with four-digit year fields failed because
the test for two-digit years greater than 88 failed to also verify
that the year was less than 100. Consequently a year of, say, 2006
would be deemed a specification of year 3906, which would be rejected
by the sanity check. I rewrote the test for two-digit years and, in
the process, simplified the code. I also made the Excel CSV
diagnostic code, which previously had to be commented on or off,
conditional on a new \verb+$excelCSVdebug+ variable, so simply
changing this variable enables or disables all of the diagnostic
output. (Reported by Jennie Koffman.)
Saturday, 2 June 2007
Bug: E-mail validation for domains with no MX record
Added a test to {\tt validMailDomain} to handle domains with no {\tt MX} record but which have a valid {\tt A} record. This copes with ill-configured sites which run a mail exchanger but do not have an {\tt MX} record pointing to itself.
Bug: Multiple abbreviated changes in Monthly Log form with JavaScript disabled
If more than one copied or abbreviated entry was made in a column of the Monthly Log form before the “Update” button was pressed when JavaScript was disabled, only the first abbreviated item would be expanded. This has now been fixed for all fields which permit abbreviation: Weight, Rung, and Comment. In addition, the plus and minus sign shortcuts in the Rung field, which increment or decrement the previous rung entry, did not work when JavaScript was disabled; this is also now corrected.
When JavaScript was disabled, using more than one exercise rung abbreviation
in a row caused all but the first to be set to 1 because the abbreviation
was not stored back into the CGI arguments hash---fixed.
The exercise rung increment and decrement shortcuts (entering a plus or minus
sign in the rung field to specify a rung one greater or less than the
most recent entry) did not work when JavaScript was disabled---fixed.
Copying more than one previous comment in a monthly log when JavaScript was
disabled failed for all but the first copied item---fixed.
Feature: Comma as optional decimal separator character
As recommended by Jens Peter Bork, all fields which accept numbers with decimal places may now use a comma as well as a period for the decimal separator character. For example, the entry “79,3” in a monthly log weight field is identical to an entry of “79.3”. A new “Decimal character” item in the Modify Account Settings form allows you to select whether a comma or period is used for the decimal separator in numbers displayed in logs, charts, trend analyses, etc. Numbers exported in CSV and XML files will, however, always use a period as the decimal separator, and files imported must use a period as decimal separator.
Subscribe to:
Posts (Atom)