November 7, 2008 at 3:51 PM by Dr. Drang
Way back in the iPhone 1.x days, I made a Metra train schedule optimized for the iPhone and made it available here. Because the schedule was just a small set of static files, I thought it would be more appropriate to save them locally on the iPhone. But the iPhone 1.x had no mechanism for doing that, so the files sat on the server. Earlier this week, I used Files, one of the many transfer-and-view apps for the iPhone, to move the schedule onto my iPhone itself. In doing so, I learned that the iPhone is much more open to scripting than I’d thought.
Let’s start with the train schedule. It comprises 5 files: an HTML file for weekdays, an HTML file for Saturday, an HTML file for Sunday, a CSS file to style the tables, and a PNG for the iPhone icon. On the server, these all sit in the same directory, called
metra, and are linked to one another through relative addresses. For example, each of the HTML files has a line like this in its
<link rel="stylesheet" type="text/css" media="all" href="metra.css" />
which loads the external CSS stylesheet. After making a copy on my iMac’s hard drive, I used Files to copy the
metra directory and its contents to my iPhone.
I then opened the
metra directory and tapped the
mf.html file to view the weekday schedule.
I confess I was somewhat surprised to see the schedule displayed just as it was when accessed from the server through Mobile Safari. I thought the viewer in Files wouldn’t be able to “find” the external stylesheet. The links to the Saturday and Sunday schedule pages worked, too.
Basically, everything worked the way it would if the local files were on my iMac’s hard disk.
The HTML is in a file called
So jQuery and Prototype and other JS libraries used to make complicated web apps could also be used to make complicated local apps.
One downside is that the user interface that Olive Tree has chosen for Files gets in the way of interactive HTML pages. The semi-transparent navigation controls at the top and bottom of the screen fade away, like the controls in the DVD Player application. A tap on the screen brings them back.
The no-controls look great for viewing PDFs and other non-interactive documents, because it gives you the whole screen for content. Unfortunately, interactive documents rely on screen taps, so the controls keep appearing and disappearing, blocking not only your view but your ability to tap on links and other page elements near the top and bottom.
So, although I love Files for viewing PDFs, I’m in the market for another transfer-and-view utility for working with HTML files. If you know of one that has permanent controls, shoot me an email and tell me about it.
In summary, I see two uses for this desktop-like behavior:
- Long, complicated hypertext document collections stored locally on the iPhone. I can imagine students who put their class notes in, say, VoodooPad, exporting the notes as HTML and putting them on their iPhone for studying on the go.