todo.txt web interface
A simple, iPhone-friendly web interface for todo.sh written in PHP and spiced up with a wee bit of jQuery.
Designed to work well in Mobile Safari on an iPhone/iPod Touch. Also tested on a Palm Centro, though the jQuery stuff doesn't work in crappy Blazer. If you try it out on other devices, let me know how it works, ok?
screenshot.png is included.
First, you need a working installation of todo.sh. (Presumably variants like todo.py will work, though I haven't tested them.)
Your todo.txt files and your todo.cfg need to be writable by your webserver. There are a variety of ways to make this happen:
chmod 666on your todo files, set some ACLs, let your web server run todo.sh as sudo... They're all a bit scary, so take your pick.
Install the todo.txt-web files where you want them on your web server.
Copy or rename the file
includes/config.phpand fill in all the variables. It's well-commented.
That should be it. If you have problems, a few things to check:
.htaccessfile in the
includesdirectory preventing web access to that directory. If your web server isn't configured to allow this, that can cause problems.
I'm using Google's copy of jQuery instead of a local copy. If this is a problem, just download jQuery and change the link in the
If you're keeping your todo.txt files in your home area (such as
/Users/you/Documents/todoin OS X), then your web server needs to be able to read the directory path to your todo files. So either move your todo folder elsewhere, or do a
chmod o+xon your Documents folder if you're comfortable with that..
By default, it will display whatever command you have set as
TODOTXT_DEFAULT_ACTIONin your todo config file.
Treat the input box as your command line, only you don't have to type
todo.shfirst. So you can type
lsto list all your items, but you can also type things like
-hto get help info.
The task numbers and tags (words starting with "@" or "+") are links that send numbers or tags to the input box, respectively. After using this for awhile, I found this was the most handy way for this to work:
When you click on the task number, it sends that number to the input field for you and then positions the cursor in front of the number. This makes it easy to just type
When you click on a tag, it sends that tag to the input field, prepends
lsto the front of it and leaves the cursor at the end of the input field so you can either hit submit or add further
Any regular URLs in your task are also made into links.
Because I got sick of automatically doing an
lsagain right after any non-listing command: whenever you do any command that isn't an
ls, the last
lscommand you ran is ran again and displayed right after your command's output.
Since I added
escapeshellcmd()to filter input, parentheses now get escaped when you type in a task with the priority inline (i.e.
add "(A) do this now!").
<script>tags? (Short of making a big list of acceptable user agents, which sucks.) No point in downloading jQuery every pageload if it doesn't work. Question: why can't
Any commands that require user confirmation (like a
mv) won't work. One option is to add
-fto the command arguments, but it'd be nice if there was a way to actually allow for confirmations through the web UI in some way.
I borrowed the idea and some code to get me started from this thread on the todotxt mailing list.
The "move the cursor to the start of the input field" trick found on Stack Overflow.